Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Popup and PopupPresenter aren't necessary, drop'em #102

Open
rjrjr opened this issue Sep 24, 2014 · 1 comment
Open

Popup and PopupPresenter aren't necessary, drop'em #102

rjrjr opened this issue Sep 24, 2014 · 1 comment

Comments

@rjrjr
Copy link
Collaborator

rjrjr commented Sep 24, 2014

There's really nothing you can do with them that you can't do more cleanly through the back stack. Generalized something like the following, make the sample app use it, and deprecate the Popups.

class BlenderScreen {
  transient boolean blendingConfirmed;
}

class ReallyBlendScreen {
  final BlenderScreen caller;
}

class BlenderScreenView {  
  BlenderScreen args = ...

  @OnClick(R.id.cancel) void cancel() {
     args.cancelConfirmed = false;
     flow.goTo(new ConfirmationScreen(args));
  }
}

class ReallyBlendScreenView {
  BlenderScreen args = ...

  @OnClick(R.id.confirm) void confirm() {
    args.caller.cancelConfirmed = true;
    flow.goBack();
  }
}
@pforhan
Copy link

pforhan commented Sep 24, 2014

To clarify, I believe the cancel() method actually should be named showConfirmation() or such. It's the action that causes the confirmation to show, not any cancelation of the confirmation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants