Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Yeah, it is our API issue. It is very unclear to developer that this will happen. Should we pass lifecycle as parameter?
il...@google.com <il...@google.com> #3
IMO it is complicated issue/feature.
I see three possible use case scenarios:
1. Single actionBar/toolbar per activity. NavigationUI.setupWithNavController works fine.
2. Every fragment has its own toolbar. NavigationUI.setupWithNavController leaks views. And managing back arrow inside Toolbar is not necessary since it it not going to change.
3. Same toolbar used only for some fragments. Such case can occur when parent fragment has back stack with childFragmenManager.
I am not sure how to solve this best. If SDK user will pass fragmentLifecycle instead of viewLifeCycle then view is still be leaked for some time.
I decided not to use these methods at all because in my case (2nd) it is needed to update Toolbar only once - after Toolbar view create.
I see three possible use case scenarios:
1. Single actionBar/toolbar per activity. NavigationUI.setupWithNavController works fine.
2. Every fragment has its own toolbar. NavigationUI.setupWithNavController leaks views. And managing back arrow inside Toolbar is not necessary since it it not going to change.
3. Same toolbar used only for some fragments. Such case can occur when parent fragment has back stack with childFragmenManager.
I am not sure how to solve this best. If SDK user will pass fragmentLifecycle instead of viewLifeCycle then view is still be leaked for some time.
I decided not to use these methods at all because in my case (2nd) it is needed to update Toolbar only once - after Toolbar view create.
Description
Currently, the `Navigation` class has 2 signatures for `createNavigateOnClickListener`:
`createNavigateOnClickListener(final int resId)`
`createNavigateOnClickListener(final int resId, finalBundle args)`
I propose a third overload:
`createNavigateOnClickListener(NavDirections)`
This overload could trampoline to the other two, as necessary, but it would allow for users to avoid having to manually extract the ActionID and Bundle from the NavDirections. It would be a nicety on top of an already nice library :)