Blankj/AndroidUtilCode

FragmentUtils 增加 fragmentTransaction.setMaxLifecycle 支持

Open

#1,540 opened on Sep 6, 2021

View on GitHub
 (0 comments) (0 reactions) (1 assignee)Java (10,654 forks)batch import
help wanted

Repository metrics

Stars
 (33,679 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Androidx Fragment 通过Add() Hide() 方式实现懒加载

在调用 add 或 show 方法后,setMaxLifecycle(showFragment, Lifecycle.State.RESUMED)

在调用 hide 方法后,setMaxLifecycle(fragment, Lifecycle.State.STARTED)

建议 增加fragmentTransaction.setMaxLifecycle 支持

Contributor guide