use of com.tevinjeffrey.rutgersct.ui.utils.CircleView in project Rutgers-Course-Tracker by tevjef.
the class SectionInfoVH method newInstance.
public static SectionInfoVH newInstance(View parent) {
TextView instructors = ButterKnife.findById(parent, R.id.prof_text);
CircleView sectionNumberBackground = ButterKnife.findById(parent, R.id.section_number_background);
ViewGroup sectionTimeContainer = ButterKnife.findById(parent, R.id.section_item_time_container);
return new SectionInfoVH(parent, instructors, sectionNumberBackground, sectionTimeContainer);
}
use of com.tevinjeffrey.rutgersct.ui.utils.CircleView 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.CircleView in project Rutgers-Course-Tracker by tevjef.
the class CircleSharedElementCallback method onMapSharedElements.
//set
@Override
public void onMapSharedElements(List<String> names, Map<String, View> sharedElements) {
//It's possible for the fragmment to not be attach to the activity. Calls to getResources will crash.
if (isEnter) {
if (mCircleViewSnapshot != null) {
final View mappedFrameLayout = sharedElements.get(mCircleViewSnapshot.getTransitionName());
CircleView hiddenCircleView = ButterKnife.findById(mappedFrameLayout, R.id.hidden_circle_view);
hiddenCircleView.setVisibility(View.VISIBLE);
hiddenCircleView.setBackgroundColor(mCircleViewSnapshot.getBackgroundColor());
hiddenCircleView.setTitleText(mCircleViewSnapshot.getTitleText());
tempView = new WeakReference<>(mappedFrameLayout);
}
}
isEnter = false;
}
use of com.tevinjeffrey.rutgersct.ui.utils.CircleView in project Rutgers-Course-Tracker by tevjef.
the class CircleSharedElementCallback method onSharedElementStart.
//capture
@Override
public void onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots) {
super.onSharedElementStart(sharedElementNames, sharedElements, sharedElementSnapshots);
if (isEnter) {
for (View v : sharedElements) {
if (v.getTransitionName().equals(v.getResources().getString(R.string.transition_name_circle_view)) && v instanceof CircleView) {
mCircleViewSnapshot = (CircleView) v;
mCircleViewSnapshot.setVisibility(View.INVISIBLE);
}
}
}
}
use of com.tevinjeffrey.rutgersct.ui.utils.CircleView 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