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

Implement Bottom navigation tab with own back stack in each tab #474

Closed
wants to merge 1 commit into from
Closed

Implement Bottom navigation tab with own back stack in each tab #474

wants to merge 1 commit into from

Conversation

MkhytarMkhoian
Copy link

@EricKuck I'll try to implement Bottom navigation tab with own back stack. It works, but it would be great if you review this code because I can miss some edge cases.

In #316 when you switch tab, the previous router destroyed all controllers in a stack, so if you try using MVP pattern it does not work because all presenters destroyed with controllers. In my implementation, it's alive and has the same lifecycle as a standard controller.

@MkhytarMkhoian MkhytarMkhoian changed the title Implement Bottom navigation tab with own backstack Implement Bottom navigation tab with own back stack in each tab Sep 3, 2018
@mateherber
Copy link

Hi! What is the status of this PR? Is there a possibility that it will be merged soon?

@MkhytarMkhoian
Copy link
Author

MkhytarMkhoian commented Nov 7, 2018

I think it's better to extract this feature to separated library, before that the code and idea need to be reviewed

@mateherber
Copy link

Make sense. In the meantime I've tried it and wanted to use my own ChangeHandler for tab switchs (animation like in the guidelines) but the router detach executed earlier than changehandler perfomchange so the fromView it got was already null so views didn't get removed from container when switching tabs :(

@sdelaysam
Copy link

sdelaysam commented Sep 9, 2019

@MkhytarMkhoian another option is to use RouterPagerAdapter with custom view pager implementation (which, unlike androidx.viewpager.widget.ViewPager will disallow scrolling and keep only one view created).
That way you will get required behavior for free without library modifications.

Please refer to #565

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

Successfully merging this pull request may close these issues.

3 participants