Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening new screens from presenters with a delay is problematic. #25

Open
vicidroiddev opened this issue Oct 10, 2019 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@vicidroiddev
Copy link
Owner

We need a way to handle the following:

  1. presenter is notified of a view event triggered by a button click.
  2. presenter does some long running sync operation.
  3. a new activity must be opened after this long running operation.
  4. the presenter should not hold onto an activity context that may be a member variable in the view event which was originally received.

Possible ways to handle this:

  1. Use the application context and add the new task flag.
    • This is bad if you have some central logic for navigating in your app which is in a BaseActivity. We should not hold on to the activity in the view.

  2. Send a state to the view delegate Navigation(uri)
    • This is problematic because it's a one time state, it should not really be persisted. What if you rotate or do something that would cause this state to be restored? It's almost like we need some form of SingleUseAction

  3. Propagate states from your presenter. Intercept those states in a fragment or activity. This solves the concern with (1), however it brings about another annoyance. What if you have a presenter that manages several other child presenters. Say you have a dashboard with lots of presenters. Do you really want to clutter your fragment or activity with propagateStatesTo calls just to handle navigation?

@vicidroiddev vicidroiddev added the enhancement New feature or request label Oct 10, 2019
@vicidroiddev vicidroiddev added this to Todo in Amalia Board May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Amalia Board
  
Todo
Development

No branches or pull requests

1 participant