Search in sources :

Example 76 with Transition

use of android.transition.Transition in project android_frameworks_base by DirtyUnicorns.

the class ExitTransitionCoordinator method startExitTransition.

private void startExitTransition() {
    Transition transition = getExitTransition();
    ViewGroup decorView = getDecor();
    if (transition != null && decorView != null && mTransitioningViews != null) {
        setTransitioningViewsVisiblity(View.VISIBLE, false);
        TransitionManager.beginDelayedTransition(decorView, transition);
        setTransitioningViewsVisiblity(View.INVISIBLE, false);
        decorView.invalidate();
    } else {
        transitionStarted();
    }
}
Also used : ViewGroup(android.view.ViewGroup) Transition(android.transition.Transition)

Example 77 with Transition

use of android.transition.Transition in project android_frameworks_base by AOSPA.

the class BackStackRecord method setEpicenter.

private static void setEpicenter(Transition transition, View view) {
    final Rect epicenter = new Rect();
    view.getBoundsOnScreen(epicenter);
    transition.setEpicenterCallback(new Transition.EpicenterCallback() {

        @Override
        public Rect onGetEpicenter(Transition transition) {
            return epicenter;
        }
    });
}
Also used : Rect(android.graphics.Rect) Transition(android.transition.Transition)

Example 78 with Transition

use of android.transition.Transition in project android_frameworks_base by AOSPA.

the class BackStackRecord method removeTargets.

/**
     * This method removes the views from transitions that target ONLY those views.
     * The views list should match those added in addTargets and should contain
     * one view that is not in the view hierarchy (state.nonExistentView).
     */
public static void removeTargets(Transition transition, ArrayList<View> views) {
    if (transition instanceof TransitionSet) {
        TransitionSet set = (TransitionSet) transition;
        int numTransitions = set.getTransitionCount();
        for (int i = 0; i < numTransitions; i++) {
            Transition child = set.getTransitionAt(i);
            removeTargets(child, views);
        }
    } else if (!hasSimpleTarget(transition)) {
        List<View> targets = transition.getTargets();
        if (targets != null && targets.size() == views.size() && targets.containsAll(views)) {
            // We have an exact match. We must have added these earlier in addTargets
            for (int i = views.size() - 1; i >= 0; i--) {
                transition.removeTarget(views.get(i));
            }
        }
    }
}
Also used : TransitionSet(android.transition.TransitionSet) Transition(android.transition.Transition) ArrayList(java.util.ArrayList) List(java.util.List)

Example 79 with Transition

use of android.transition.Transition in project Shuttle by timusus.

the class LibraryController method pushDetailFragment.

void pushDetailFragment(BaseDetailFragment detailFragment, @Nullable View transitionView) {
    List<Pair<View, String>> transitions = new ArrayList<>();
    if (transitionView != null) {
        String transitionName = ViewCompat.getTransitionName(transitionView);
        transitions.add(new Pair<>(transitionView, transitionName));
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
            Transition moveTransition = TransitionInflater.from(getContext()).inflateTransition(R.transition.image_transition);
            detailFragment.setSharedElementEnterTransition(moveTransition);
            detailFragment.setSharedElementReturnTransition(moveTransition);
        }
    }
    getNavigationController().pushViewController(detailFragment, "DetailFragment", transitions);
}
Also used : ArrayList(java.util.ArrayList) Transition(android.transition.Transition) Pair(android.support.v4.util.Pair)

Example 80 with Transition

use of android.transition.Transition in project Shuttle by timusus.

the class SearchFragment method pushDetailFragment.

void pushDetailFragment(BaseDetailFragment detailFragment, @Nullable View transitionView) {
    List<Pair<View, String>> transitions = new ArrayList<>();
    if (transitionView != null) {
        String transitionName = ViewCompat.getTransitionName(transitionView);
        transitions.add(new Pair<>(transitionView, transitionName));
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
            Transition moveTransition = TransitionInflater.from(getContext()).inflateTransition(R.transition.image_transition);
            detailFragment.setSharedElementEnterTransition(moveTransition);
            detailFragment.setSharedElementReturnTransition(moveTransition);
        }
    }
    getNavigationController().pushViewController(detailFragment, "DetailFragment", transitions);
}
Also used : ArrayList(java.util.ArrayList) Transition(android.transition.Transition) Pair(android.support.v4.util.Pair)

Aggregations

Transition (android.transition.Transition)176 TransitionSet (android.transition.TransitionSet)62 View (android.view.View)54 ViewGroup (android.view.ViewGroup)37 ArrayList (java.util.ArrayList)23 TransitionInflater (android.transition.TransitionInflater)19 Fade (android.transition.Fade)18 ViewTreeObserver (android.view.ViewTreeObserver)18 ChangeBounds (android.transition.ChangeBounds)17 Rect (android.graphics.Rect)12 List (java.util.List)12 TargetApi (android.annotation.TargetApi)11 TextView (android.widget.TextView)11 AutoTransition (android.transition.AutoTransition)10 Scene (android.transition.Scene)8 ObjectAnimator (android.animation.ObjectAnimator)7 Fragment (android.support.v4.app.Fragment)6 FragmentTransaction (android.support.v4.app.FragmentTransaction)6 AdapterView (android.widget.AdapterView)6 ImageView (android.widget.ImageView)6