Search in sources :

Example 1 with SubjectFragment

use of com.tevinjeffrey.rutgersct.ui.subject.SubjectFragment in project Rutgers-Course-Tracker by tevjef.

the class ChooserFragment method startSubjectFragment.

private void startSubjectFragment(Bundle b) {
    SubjectFragment sf = new SubjectFragment();
    sf.setArguments(b);
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        sf.setExitTransition(new Fade(Fade.OUT).excludeTarget(ImageView.class, true).setDuration(100));
        sf.setReturnTransition(new Fade(Fade.OUT).excludeTarget(ImageView.class, true).setDuration(100));
        sf.setAllowReturnTransitionOverlap(false);
        sf.setAllowEnterTransitionOverlap(false);
        sf.setSharedElementEnterTransition(new ChangeBounds().setInterpolator(new DecelerateInterpolator()));
        sf.setSharedElementReturnTransition(new ChangeBounds().setInterpolator(new DecelerateInterpolator()));
        ft.addSharedElement(mToolbar, getString(R.string.transition_name_tool_background));
    } else {
        ft.setCustomAnimations(R.anim.enter, R.anim.exit, R.anim.pop_enter, R.anim.pop_exit);
    }
    startFragment(this, sf, ft);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) FragmentTransaction(android.app.FragmentTransaction) SubjectFragment(com.tevinjeffrey.rutgersct.ui.subject.SubjectFragment) ChangeBounds(android.transition.ChangeBounds) Fade(android.transition.Fade)

Aggregations

FragmentTransaction (android.app.FragmentTransaction)1 ChangeBounds (android.transition.ChangeBounds)1 Fade (android.transition.Fade)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 SubjectFragment (com.tevinjeffrey.rutgersct.ui.subject.SubjectFragment)1