use of com.tevinjeffrey.rutgersct.ui.utils.CircleSharedElementCallback in project Rutgers-Course-Tracker by tevjef.
the class CourseInfoFragment method startSectionInfoFragment.
private void startSectionInfoFragment(Bundle b, View clickedView) {
SectionInfoFragment sectionInfoFragment = new SectionInfoFragment();
FragmentTransaction ft = this.getFragmentManager().beginTransaction();
CircleView circleView = ButterKnife.findById(clickedView, R.id.section_number_background);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
circleView.setTransitionName(getString(R.string.transition_name_circle_view));
ft.addSharedElement(circleView, getString(R.string.transition_name_circle_view));
mAppBarLayout.setTransitionName(null);
Transition cifSectionEnter = TransitionInflater.from(getParentActivity()).inflateTransition(R.transition.cif_section_enter);
Transition cifSectionReturn = TransitionInflater.from(getParentActivity()).inflateTransition(R.transition.cif_section_return);
sectionInfoFragment.setEnterTransition(cifSectionEnter);
sectionInfoFragment.setReturnTransition(cifSectionReturn);
setReenterTransition(new Fade(Fade.IN).setDuration(200));
Transition cifExit = TransitionInflater.from(getParentActivity()).inflateTransition(R.transition.cif_exit);
setExitTransition(cifExit);
sectionInfoFragment.setAllowReturnTransitionOverlap(false);
sectionInfoFragment.setAllowEnterTransitionOverlap(false);
Transition sharedElementsEnter = TransitionInflater.from(getParentActivity()).inflateTransition(R.transition.cif_shared_element_enter);
Transition sharedElementsReturn = TransitionInflater.from(getParentActivity()).inflateTransition(R.transition.cif_shared_element_return);
sectionInfoFragment.setSharedElementEnterTransition(sharedElementsEnter);
sectionInfoFragment.setSharedElementReturnTransition(sharedElementsReturn);
CircleSharedElementCallback sharedelementCallback = new CircleSharedElementCallback();
sectionInfoFragment.setEnterSharedElementCallback(sharedelementCallback);
sharedElementsEnter.addListener(sharedelementCallback.getTransitionCallback());
} else {
ft.setCustomAnimations(R.anim.enter, R.anim.exit, R.anim.pop_enter, R.anim.pop_exit);
}
sectionInfoFragment.setArguments(b);
startFragment(this, sectionInfoFragment, ft);
}
use of com.tevinjeffrey.rutgersct.ui.utils.CircleSharedElementCallback in project Rutgers-Course-Tracker by tevjef.
the class TrackedSectionsFragment method startSectionInfoFragment.
private void startSectionInfoFragment(SectionInfoFragment sectionInfoFragment, View view) {
FragmentTransaction ft = this.getFragmentManager().beginTransaction();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
CircleView circleView = ButterKnife.findById(view, R.id.section_number_background);
mFab.setTransitionName(getString(R.string.transition_name_fab));
ft.addSharedElement(mFab, getString(R.string.transition_name_fab));
circleView.setTransitionName(getString(R.string.transition_name_circle_view));
ft.addSharedElement(circleView, getString(R.string.transition_name_circle_view));
Transition tsfSectionEnter = TransitionInflater.from(getParentActivity()).inflateTransition(R.transition.tsf_section_enter);
Transition tsfSectionReturn = TransitionInflater.from(getParentActivity()).inflateTransition(R.transition.tsf_section_return);
sectionInfoFragment.setEnterTransition(tsfSectionEnter);
sectionInfoFragment.setReturnTransition(tsfSectionReturn);
setReenterTransition(new Fade(Fade.IN).addTarget(RecyclerView.class));
setExitTransition(new Fade(Fade.OUT).addTarget(RecyclerView.class));
sectionInfoFragment.setAllowReturnTransitionOverlap(false);
sectionInfoFragment.setAllowEnterTransitionOverlap(false);
Transition sharedElementsEnter = TransitionInflater.from(getParentActivity()).inflateTransition(R.transition.tsf_shared_element_enter);
Transition sharedElementsReturn = TransitionInflater.from(getParentActivity()).inflateTransition(R.transition.tsf_shared_element_return);
sectionInfoFragment.setSharedElementEnterTransition(sharedElementsEnter);
sectionInfoFragment.setSharedElementReturnTransition(sharedElementsReturn);
CircleSharedElementCallback sharedelementCallback = new CircleSharedElementCallback();
sectionInfoFragment.setEnterSharedElementCallback(sharedelementCallback);
sharedElementsEnter.addListener(sharedelementCallback.getTransitionCallback());
} else {
ft.setCustomAnimations(R.anim.enter, R.anim.exit, R.anim.pop_enter, R.anim.pop_exit);
}
startFragment(this, sectionInfoFragment, ft);
}
Aggregations