Skip to content

💥A powerful library powered by AOP to manage Fragments. ( một cái căn cứ vào AOP thiết kế Fragment quản lý dàn giáo )

License

Notifications You must be signed in to change notification settings

JingYeoh/FragmentRigger

Repository files navigation

FragmentRigger

R i g g e r

💥A powerful library to manage Fragments. Một cái cường đại Fragment quản lý dàn giáo. (Tiếng Trung bản nhập khẩu)

Platform Download SDK Build AsPectJ JingYeoh

This might is the library that at the least cost of use to manage fragments.
No need to extend any class!!! No need to extend any class!!! No need to extend any class!!!the most important thing must be said for three times!!!
You can use thisFragmentRiggerwith one line annotation.
Principle:define the pointcuts for Fragment/Activity lifecycle methods and bind to the proxy class to execute.

Demo

This library support usual fragment using scenes,if you found the scene that this library does not supported,you can postIssuesorEmail me

Stack manager Show Lazy loading Replace

Goal

  • Make Fragment use easier.
  • At the least cost of use to manage fragments.

Wiki

Getting Started

Information

Feature

  • Powerful api
  • Enough English notes
  • Strictest exceptions
  • Resolve usual exceptions and bugs in fragments
  • Never lost any fragment transaction commit
  • Extend the android native fragment methods,add some usual methods such asonBackPressed()
  • Print tree for the fragment stack
  • Fragment lazy load
  • Fragment transition animations
  • Option to configure fragment tag
  • AddonBackPressedmethod support for the fragment that is not added into stack
  • Swipe edge to exit Fragment/Activity
  • Option to configure fragment launch mode
  • Fragment shared elements transition animations
  • Support DialogFragment

Problem solved

  • Fragment view overlapping
  • Fragment Multi-level showing
  • Fragment stack manager
  • Fragment transaction commit failed
  • Commit the transaction when the host activity is not resumed
  • Multiple commits are interconnected but the fragment transaction commit does not happen immediately
  • A series of exceptions when memory restarting
  • Data saved and restored when the screen is flipped
  • Can not perform this action after onSaveInstanceState
  • Lazy loading in ViewPager and other scenarios
  • The animation does not perform in different scenarios

Usage example

This library provides powerful api.

1, Add support for your classes

Add@Puppetannotation for yourActivity/Fragmentthat need to use this library.

//MainActivity.java
@Puppet(containerViewId=R.id.atyContent)//containerViewId is the fragment to be placed in.
publicclassMainActivityextendsAppCompatActivity
//TestFragment.java
@Puppet
publicclassTestFragmentextendsFragment

2, Fragment usage

After add@Puppetannotation, use the proxy classRiggerto manage fragments.

@Puppet(containerViewId=R.id.atyContent)
publicclassMainActivityextendsAppCompatActivity{
...
//add and show a fragment and add it to the stack,this fragment is placed in the container view.
Rigger.getRigger(this).startFragment(TestFragment.newInstance());
}

3, Activity/Fragment swipe back to exit

AddSwiperannotation for yourActivity/Fragment.

@Swiper
@Puppet
publicclassMainActivityextendsAppCompatActivity{
// swiper can only used with puppet.
}
@Swiper
@Puppet
publicclassTestFragmentextendsFragment{
// swiper can only used with puppet.
}

License

This library is available under the MIT license. See theLICENSEfile for more info.

About

💥A powerful library powered by AOP to manage Fragments. ( một cái căn cứ vào AOP thiết kế Fragment quản lý dàn giáo )

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages