-
Notifications
You must be signed in to change notification settings - Fork 343
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
Help with child controller custom back handling #536
Comments
For me the default I have a Now I handle
|
@PaulWoitaschek so this is what I tried, it works; thanks However this controller is retainViewMode = Controller.RetainViewMode.RETAIN_DETACH, and after I move away to another controller, then back, then push something onto leftDrawerRouter (so the backstack size is 2), however I can see the 1st controller view, wth? If I remove the retain mode, it works as should
Any ideas? |
Hi, I have a drawer layout, (whole screen is a controller), where drawer has its own backstack, and content (the view under drawer when it is opened) has also its own backstack; so two child routers
When drawer is opened, I want to handle the drawer router back clicks; if not, then the content's
Mind you the first controller placed in the drawer router has handleBack overriden with
override fun handleBack() = false
. Which in my mind reads I dont wanna handle back at all, just pass it throughWhat I want is:
When I press back when the drawer is opened, that means I should pop that drawer router; and when there is only one controller left on drawer router, just close the drawer
So the the back implementation in the root controller is like this:
However this has a bug, where if there is only 1 controller in the drawer router, because of this Conductor code
tldr;
When there is only one, the expected would be to have its handleBack called; which in my case always returns false, and therefore it should pass through to the root controller, which would return hardcoded true in this case, thuss stopping the back press handling; with nothing actually happening (besides the drawer closing)
However the THIS line shows it gets popped, thuss calling its onDestroy, which is not what I want. I would not expect it to get popped if I return false from its handleBack. Another interesting fact is that the controller's view stays in layout, and then when another controller is placed onto drawer router, I can see 2 overlapping controllers (bug)
The text was updated successfully, but these errors were encountered: