YoKeyword /Fragmentation
[DEPRECATED] A powerful library that manage Fragment for Android
★ 9,655⑂ 2,081👁 302⑃ 44● 1,223▤ 30
+0
Daily
9,655
stars
2,081
forks
302
watchers
44
prs
1,223
issues
30
releases
README

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED
中文版 README.md
FragmentationX
!
Fragmentation is a powerful library managing Fragment for Android.
It is designed for "Single Activity + Multi-Fragments" and "Multi-FragmentActivities + Multi-Fragments" architecture to simplify development process.
Demo
The first demo shows the basic usage of the library. The second one shows the way to implement an app which is similar to Instagram. Complicated nested fragments' usage demo are also showed.
Download APK
Feature
1. Develop complicated nested fragment app rapidly
2. Use fragment's stack view dialog to debug easily
3. Add launch mode, startForResult etc. to provide similar behavior of Activity
4. Add onBackPressedSupport() method to support back button press monitoring in Fragment
5. Add onSupportVisible(), onLazyInitView() to simplify dev
6. Easily manage Fragment transition animations
7. To simplify the communication between Fragment(EventBusActivityScope module)
8. Support SwipeBack to pop(Fragmentation_SwipeBack module README)
How do I use Fragmentation?
Note: This is the use of androidx, if you are using the android.support, click here branch:master
1、build.gradle
gradle
// This is the use of androidx, if you are using the android.support: fragmentationx - fragmentation
implementation 'me.yokeyword:fragmentationx:1.0.2'
// If you don't want to extends SupportActivity/Fragment and would like to customize your own support, just rely on fragmentation-core
// implementation 'me.yokeyword:fragmentationx-core:1.0.2'
// To get SwipeBack feature, rely on both fragmentation & fragmentation-swipeback
implementation 'me.yokeyword:fragmentationx:1.0.2'
// Swipeback is based on fragmentation. Refer to SwipeBackActivity/Fragment for your Customized SupportActivity/Fragment
implementation 'me.yokeyword:fragmentationx-swipeback:1.0.2'
// To simplify the communication between Fragments.
implementation 'me.yokeyword:eventbus-activity-scope:1.1.0'
// Your EventBus's version
implementation 'org.greenrobot:eventbus:{version}'
2. Activity extends SupportActivity or implements ISupportActivity:(refer to MySupportActivity)
java
// since v1.0.0, forced extends of SupportActivity is not required, you can use interface + delegate to implement your own SupportActivity
public class MainActivity extends SupportActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(...);
// Fragmentation is recommended to initialize in the Application
Fragmentation.builder()
// show stack view. Mode: BUBBLE, SHAKE, NONE
.stackViewMode(Fragmentation.BUBBLE)
.debug(BuildConfig.DEBUG)
...
.install();
if (findFragment(HomeFragment.class) == null) {
loadRootFragment(R.id.fl_coTop issues
#1237让Fragmentation 继续走下去24 comments · 2020-01-17#1223不再维护之后,会开发新的fragment管理框架吗?15 comments · 2019-11-15#838我使用懒加载 我fragment嵌套fragment的那个 偶尔会出现onLazyInitView没有执行 这让我很苦恼 会造成空白问题14 comments · 2018-04-13#1011单Activity+多Fragment的架构,偶尔出现白屏问题12 comments · 2018-10-10#1139fragment已经弹栈,但是视图依然残留在页面上11 comments · 2019-06-17#911fragment返回之后,页面为空,使用的是onLazyInitView加载数据,如果放到onCreateView中没有问题9 comments · 2018-06-22#769SupportFragment.java中的onSupportVisible();//偶尔无法收到回调9 comments · 2018-02-05#1255google 官方fragment 导航框架 navigation-fragment+navigation-ui7 comments · 2020-09-21
Latest release
1.3.7 1.3.7 2019-06-07- fix BadParcelableException && NullPointerException(FragmentAnimator.getEnter()) 1079 1122 1014 1004 - Compatible with 1031 (v27.1.0+) Can not perform this action after onSaveInstanceState - Fix 1112, SwipeBackFragment does not completely pop - Optimize DebugStackBubble