MCPcopy Index your code
hub / github.com/YoKeyword/Fragmentation

github.com/YoKeyword/Fragmentation @1.3.7 sqlite

repository ↗ · DeepWiki ↗ · release 1.3.7 ↗
1,233 symbols 2,825 edges 125 files 324 documented · 26%
README

Android Arsenal Build Status Download Hex.pm

中文版 README.md

Fragmentation

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?

1、build.gradle

// appcompat-v7 is required
compile 'me.yokeyword:fragmentation:1.3.7'

// If you don't want to extends SupportActivity/Fragment and would like to customize your own support, just rely on fragmentation-core
// compile 'me.yokeyword:fragmentation-core:1.3.7'

// To get SwipeBack feature, rely on both fragmentation & fragmentation-swipeback
compile 'me.yokeyword:fragmentation:1.3.7'
// Swipeback is based on fragmentation. Refer to SwipeBackActivity/Fragment for your Customized SupportActivity/Fragment
compile 'me.yokeyword:fragmentation-swipeback:1.3.7'

// To simplify the communication between Fragments.
compile 'me.yokeyword:eventbus-activity-scope:1.1.0'
// Your EventBus's version
compile 'org.greenrobot:eventbus:{version}'

2. Activity extends SupportActivity or implements ISupportActivity:(refer to MySupportActivity)

// 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_container, HomeFragment.newInstance());  //load root Fragment
        }
    }

3. Fragment extends SupportFragment or implements ISupportFragment:(refer to MySupportFragment):

// since v1.0.0, forced extends of SupportActivity is not required, you can use interface + delegate to implement your own SupportActivity
public class HomeFragment extends SupportFragment {

    private void xxx() {
        // launch a new Fragment, other methods: start(fragment,SINGTASK)、startForResult、startWithPop etc.
        start(DetailFragment.newInstance(HomeBean));
        // check wiki for other pop, find and animation setting related API
    }
}

WIKI , CHANGELOG

LICENSE

Copyright 2016 YoKey

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extension points exported contracts — how you extend this code

ISupportFragment (Interface)
Created by YoKey on 17/6/23. [4 implementers]
fragmentation_core/src/main/java/me/yokeyword/fragmentation/ISupportFragment.java
OnItemClickListener (Interface)
(no doc) [10 implementers]
demo/src/main/java/me/yokeyword/sample/demo_zhihu/listener/OnItemClickListener.java
ISwipeBackActivity (Interface)
Created by YoKey on 17/6/29. [3 implementers]
fragmentation_swipeback/src/main/java/me/yokeyword/fragmentation_swipeback/core/ISwipeBackActivity.java
ISupportActivity (Interface)
Created by YoKey on 17/6/13. [4 implementers]
fragmentation_core/src/main/java/me/yokeyword/fragmentation/ISupportActivity.java
OnItemClickListener (Interface)
(no doc) [10 implementers]
demo/src/main/java/me/yokeyword/sample/demo_wechat/listener/OnItemClickListener.java
ISwipeBackFragment (Interface)
Created by YoKey on 17/6/29. [3 implementers]
fragmentation_swipeback/src/main/java/me/yokeyword/fragmentation_swipeback/core/ISwipeBackFragment.java
ExceptionHandler (Interface)
Created by YoKey on 17/2/5. [1 implementers]
fragmentation_core/src/main/java/me/yokeyword/fragmentation/helper/ExceptionHandler.java
OnItemClickListener (Interface)
(no doc) [10 implementers]
demo/src/main/java/me/yokeyword/sample/demo_flow/listener/OnItemClickListener.java

Core symbols most depended-on inside this repo

getSupportDelegate
called by 52
fragmentation_core/src/main/java/me/yokeyword/fragmentation/ISupportFragment.java
getFragmentManager
called by 30
fragmentation_core/src/main/java/me/yokeyword/fragmentation/ExtraTransaction.java
getArguments
called by 30
fragmentation_core/src/main/java/me/yokeyword/fragmentation/TransactionDelegate.java
start
called by 29
fragmentation_core/src/main/java/me/yokeyword/fragmentation/ExtraTransaction.java
show
called by 24
demo/src/main/java/me/yokeyword/sample/demo_zhihu/ui/view/BottomBar.java
getSupportFragmentManager
called by 23
fragmentation_core/src/main/java/me/yokeyword/fragmentation/SupportActivityDelegate.java
getChildFragmentManager
called by 22
fragmentation_core/src/main/java/me/yokeyword/fragmentation/SupportFragmentDelegate.java
post
called by 20
fragmentation_core/src/main/java/me/yokeyword/fragmentation/ISupportFragment.java

Shape

Method 1,081
Class 135
Interface 16
Enum 1

Languages

Java100%

Modules by API surface

fragmentation_core/src/main/java/me/yokeyword/fragmentation/SupportFragmentDelegate.java70 symbols
fragmentation/src/main/java/me/yokeyword/fragmentation/SupportFragment.java48 symbols
fragmentation_swipeback/src/main/java/me/yokeyword/fragmentation/SwipeBackLayout.java42 symbols
demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportFragment.java40 symbols
fragmentation_core/src/main/java/me/yokeyword/fragmentation/ExtraTransaction.java39 symbols
fragmentation_core/src/main/java/me/yokeyword/fragmentation/TransactionDelegate.java38 symbols
fragmentation_core/src/main/java/me/yokeyword/fragmentation/SupportActivityDelegate.java31 symbols
fragmentation/src/main/java/me/yokeyword/fragmentation/SupportActivity.java26 symbols
demo/src/main/java/me/yokeyword/sample/demo_wechat/ui/view/BottomBar.java26 symbols
demo/src/main/java/me/yokeyword/sample/demo_zhihu/ui/view/BottomBar.java25 symbols
fragmentation_core/src/main/java/me/yokeyword/fragmentation/helper/internal/VisibleDelegate.java20 symbols
demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportActivity.java20 symbols

For agents

$ claude mcp add Fragmentation \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact