FragNav
FragNav copied to clipboard
Be able to setMaxLifecycle during the fragment transaction
Story
There's a known issue that if you use the hiding strategy on the fragment switch, the fragment's lifecycle won't be changed.
However, there's a new setMaxLifecycle function been added in the FragmentTransaction
which can set the maximum lifecycle state during the transaction, and ViewPager2.FragmentStateAdapter
actually has such implementation.
Bringing this function call to the library for the hiding strategy, so the fragment lifecycle will be triggered properly during switching.
What have been changed in this PR:
- Offered a
setMaxLifecycleOnSwitch
flag inFragNavController
, and set max lifecycle to "Started" for those fragments that are going to be hidden in the transaction. - Updated quite a lot of dependencies and gradle plugins
- Adjusted the gradle settings for publishing