-
Notifications
You must be signed in to change notification settings - Fork 216
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
Add fragments instead of replacing them #64
Comments
Hi! Thanks for proposal) What do you think? |
Thanks for your response. The navigator API is indeed easy to extend (like I would be happy to issue a PR which will tackle this feature, but I understand that you don't want to bloat the simplicity of Cicerone. Do you have an advice on how to persist the fragment UI and data, in a way that the Fragment instance would't be cleared (and the data wouldn't be downloaded again) — when going back, while still using |
When you replaced fragment, it didn't destroyed , only views were cleared . FragmentManager saved fragment instance |
fragmentTransaction.add() example: show progress as transparent fragment |
Progress is not screen for navigation chain! 😱 |
I need to use library which requires |
I'm wondering if there is a way to alter the
FragmentTransaction
instance, which is being used in theforward(Forward command)
method, as seen in theSupportFragmentNavigator
class. I need tofragmentTransaction.add()
fragments instead offragmentTransaction.replace()
-ing them.I'm using the
navigateTo
method to show the next Fragment, like so:App.get().getRouter().navigateTo(Screens.CUSTOMER_DETAIL, customer);
I have a Fragment which basically hosts a
RecyclerView
with a lots of data (customers), returned by remote API.Clicking an item from that list will open a new screen which will host detailed data for that customer.
A common scenario you might guess.
When I go back from the detail screen, the API is invoked again, the list reloaded, scrolling position gone, search filters invalidated etc.
That's because the library uses
fragmentTransaction.replace()
, butfragmentTransaction.add()
is what I need, to avoid the reload.I've copied locally these two classes:
SupportFragmentNavigator
andSupportAppNavigator
and changed what I need, and it works.But it's a dirty solution.
Is there an API in Cicerone which will provide customization options for this manner?
The text was updated successfully, but these errors were encountered: