Search in sources :

Example 1 with CourseInfoFragment

use of com.tevinjeffrey.rutgersct.ui.courseinfo.CourseInfoFragment in project Rutgers-Course-Tracker by tevjef.

the class CourseFragment method startCourseInfoFragment.

private void startCourseInfoFragment(Bundle b) {
    CourseInfoFragment courseInfoFragment = new CourseInfoFragment();
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ChangeBounds changeBoundsTransition = new ChangeBounds();
        changeBoundsTransition.setInterpolator(new DecelerateInterpolator());
        courseInfoFragment.setEnterTransition(new Fade(Fade.IN).setStartDelay(250));
        courseInfoFragment.setReturnTransition(new Fade(Fade.OUT).setDuration(50));
        courseInfoFragment.setAllowReturnTransitionOverlap(false);
        courseInfoFragment.setAllowEnterTransitionOverlap(false);
        courseInfoFragment.setSharedElementEnterTransition(changeBoundsTransition);
        courseInfoFragment.setSharedElementReturnTransition(changeBoundsTransition);
        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);
    }
    courseInfoFragment.setArguments(b);
    startFragment(this, courseInfoFragment, ft);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) FragmentTransaction(android.app.FragmentTransaction) ChangeBounds(android.transition.ChangeBounds) CourseInfoFragment(com.tevinjeffrey.rutgersct.ui.courseinfo.CourseInfoFragment) 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 CourseInfoFragment (com.tevinjeffrey.rutgersct.ui.courseinfo.CourseInfoFragment)1