Skip to content

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

Closed
MkhytarMkhoian wants to merge 1 commit into
bluelinelabs:developfrom
MkhytarMkhoian:feature/bottom_navigation
Closed

Implement Bottom navigation tab with own back stack in each tab#474
MkhytarMkhoian wants to merge 1 commit into
bluelinelabs:developfrom
MkhytarMkhoian:feature/bottom_navigation

Conversation

@MkhytarMkhoian

Copy link
Copy Markdown

@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
Copy Markdown

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

@MkhytarMkhoian

MkhytarMkhoian commented Nov 7, 2018

Copy link
Copy Markdown
Author

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
Copy Markdown

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

sdelaysam commented Sep 9, 2019

Copy link
Copy Markdown

@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