Search in sources :

Example 1 with CircleView

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);
}
Also used : ViewGroup(android.view.ViewGroup) CircleView(com.tevinjeffrey.rutgersct.ui.utils.CircleView) TextView(android.widget.TextView)

Example 2 with CircleView

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);
}
Also used : CircleSharedElementCallback(com.tevinjeffrey.rutgersct.ui.utils.CircleSharedElementCallback) FragmentTransaction(android.app.FragmentTransaction) SectionInfoFragment(com.tevinjeffrey.rutgersct.ui.sectioninfo.SectionInfoFragment) Transition(android.transition.Transition) CircleView(com.tevinjeffrey.rutgersct.ui.utils.CircleView) Fade(android.transition.Fade)

Example 3 with CircleView

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;
}
Also used : CircleView(com.tevinjeffrey.rutgersct.ui.utils.CircleView) View(android.view.View) CircleView(com.tevinjeffrey.rutgersct.ui.utils.CircleView)

Example 4 with CircleView

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);
            }
        }
    }
}
Also used : CircleView(com.tevinjeffrey.rutgersct.ui.utils.CircleView) View(android.view.View) CircleView(com.tevinjeffrey.rutgersct.ui.utils.CircleView)

Example 5 with CircleView

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);
}
Also used : CircleSharedElementCallback(com.tevinjeffrey.rutgersct.ui.utils.CircleSharedElementCallback) FragmentTransaction(android.app.FragmentTransaction) Transition(android.transition.Transition) CircleView(com.tevinjeffrey.rutgersct.ui.utils.CircleView) RecyclerView(android.support.v7.widget.RecyclerView) Fade(android.transition.Fade)

Aggregations

CircleView (com.tevinjeffrey.rutgersct.ui.utils.CircleView)7 ViewGroup (android.view.ViewGroup)3 TextView (android.widget.TextView)3 FragmentTransaction (android.app.FragmentTransaction)2 Fade (android.transition.Fade)2 Transition (android.transition.Transition)2 View (android.view.View)2 SectionInfoVH (com.tevinjeffrey.rutgersct.ui.sectioninfo.SectionInfoVH)2 CircleSharedElementCallback (com.tevinjeffrey.rutgersct.ui.utils.CircleSharedElementCallback)2 RecyclerView (android.support.v7.widget.RecyclerView)1 SectionInfoFragment (com.tevinjeffrey.rutgersct.ui.sectioninfo.SectionInfoFragment)1