Giter Club home page Giter Club logo

fragmentrigger's Introduction

FragmentRigger

R i g g e r

💥A powerful library to manage Fragments. 一个强大的Fragment管理框架。(中文版入口

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 this FragmentRigger with 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 post Issues or Email 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 as onBackPressed()
  • Print tree for the fragment stack
  • Fragment lazy load
  • Fragment transition animations
  • Add onBackPressed method support for fragment which is not contained in stack
  • Fragment shared elements transition animations
  • Slide left side to exit fragment

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 @Puppet annotation for your Activity/Fragment that need to use this library.

//MainActivity.java
@Puppet(containerViewId = R.id.atyContent)//containerViewId is the fragment to be placed in.
public class MainActivity extends AppCompatActivity
//TestFragment.java
@Puppet
public class TestFragment extends Fragment

2、Fragment usage

After add @Puppet annotation, use the proxy class Rigger to manage fragments.

@Puppet(containerViewId = R.id.atyContent)
public class MainActivity extends AppCompatActivity{
  ...
  //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());
}

License

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

fragmentrigger's People

Contributors

anotherjack avatar henryhaoson avatar jingyeoh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.