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

Be able to setMaxLifecycle during the fragment transaction #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevinguitar
Copy link

@kevinguitar kevinguitar commented Apr 5, 2022

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 in FragNavController, 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

Related issue: #244

Original pull request: bandlab#2 coauthored by @gildor

…es (#2)

* Apply setMaxLifecycle during fragment transaction & update dependencies

* Updated travis config

* Deprecated few properties + adjust publishing config

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Add an option to set max lifecycle

* Fix some lint warning

* Fix missing dependency in test

* Address review comments

* Update jacoco report path

* Workaround for coveralls SSLException

Co-authored-by: Andrey Mischenko <gildor@users.noreply.github.com>
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.

1 participant