Skip to content

Using start

JingYeoh edited this page Dec 18, 2017 · 3 revisions

How to use?

FragmentRigger does not need extend any class,all operation is depend on the proxy class Rigger to manage fragments.

Add Fragment/Activity support

Add @Puppet annotation on your Fragment/Activity,but your fragment must is the child class of android.support.v4.app.Fragment and your activity must is the child class of android.support.v4.app.FragmentActivity.

@Puppet
public class ExampleFragment extends Fragment
@Puppet(containerViewId = R.id.atyContent)
public class ExampleActivity extends AppCompatActivity

You can use this library on the class that is added @Puppet annotation

If you wanna to use this library,@puppet is necessary condition.
But this annotation has some params you need to know.

containerViewId

Optional identifier of the container this fragment is to be placed in. If 0, it will not be placed in a container. default value is 0.

This params will be used in method Rigger#startFragment

bondContainerView

bondContainerView is a boolean object.

  • if the value is true: the puppet will be closed as the top fragment in puppet's stack is closing. the top fragment in stack will not perform transition animation.
  • if the valye is false: the puppet will do nothing as the top fragment in puppet's stack is closing. the top fragment in stack will perform transition animation and closing.

This params will be used as the host Activity#onBackPressed is called.