Search in sources :

Example 31 with TransitionSet

use of android.transition.TransitionSet in project android_frameworks_base by ResurrectionRemix.

the class SequenceTestSimple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fading_test_simple);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mRemovingButton = (Button) findViewById(R.id.removingButton);
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple2, this);
    TransitionSet fader = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    fader.addTransition(new Fade().addTarget(R.id.removingButton));
    fader.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFade = fader;
    sequencedFadeReverse = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    sequencedFadeReverse.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFadeReverse.addTransition(new Fade().addTarget(R.id.removingButton));
    mCurrentScene = mScene1;
}
Also used : TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View) Fade(android.transition.Fade)

Example 32 with TransitionSet

use of android.transition.TransitionSet in project android_frameworks_base by ResurrectionRemix.

the class ActivityTransitionCoordinator method noLayoutSuppressionForVisibilityTransitions.

/**
     * Blocks suppressLayout from Visibility transitions. It is ok to suppress the layout,
     * but we don't want to force the layout when suppressLayout becomes false. This leads
     * to visual glitches.
     */
private static void noLayoutSuppressionForVisibilityTransitions(Transition transition) {
    if (transition instanceof Visibility) {
        final Visibility visibility = (Visibility) transition;
        visibility.setSuppressLayout(false);
    } else if (transition instanceof TransitionSet) {
        final TransitionSet set = (TransitionSet) transition;
        final int count = set.getTransitionCount();
        for (int i = 0; i < count; i++) {
            noLayoutSuppressionForVisibilityTransitions(set.getTransitionAt(i));
        }
    }
}
Also used : TransitionSet(android.transition.TransitionSet) Visibility(android.transition.Visibility)

Example 33 with TransitionSet

use of android.transition.TransitionSet in project android_frameworks_base by ResurrectionRemix.

the class ActivityTransitionCoordinator method setTargets.

protected Transition setTargets(Transition transition, boolean add) {
    if (transition == null || (add && (mTransitioningViews == null || mTransitioningViews.isEmpty()))) {
        return null;
    }
    // Add the targets to a set containing transition so that transition
    // remains unaffected. We don't want to modify the targets of transition itself.
    TransitionSet set = new TransitionSet();
    if (mTransitioningViews != null) {
        for (int i = mTransitioningViews.size() - 1; i >= 0; i--) {
            View view = mTransitioningViews.get(i);
            if (add) {
                set.addTarget(view);
            } else {
                set.excludeTarget(view, true);
            }
        }
    }
    // By adding the transition after addTarget, we prevent addTarget from
    // affecting transition.
    set.addTransition(transition);
    if (!add && mTransitioningViews != null && !mTransitioningViews.isEmpty()) {
        // Allow children of excluded transitioning views, but not the views themselves
        set = new TransitionSet().addTransition(set);
    }
    return set;
}
Also used : TransitionSet(android.transition.TransitionSet) ImageView(android.widget.ImageView) GhostView(android.view.GhostView) View(android.view.View)

Example 34 with TransitionSet

use of android.transition.TransitionSet in project android_frameworks_base by ResurrectionRemix.

the class Fragment method loadTransition.

private static Transition loadTransition(Context context, TypedArray typedArray, Transition currentValue, Transition defaultValue, int id) {
    if (currentValue != defaultValue) {
        return currentValue;
    }
    int transitionId = typedArray.getResourceId(id, 0);
    Transition transition = defaultValue;
    if (transitionId != 0 && transitionId != com.android.internal.R.transition.no_transition) {
        TransitionInflater inflater = TransitionInflater.from(context);
        transition = inflater.inflateTransition(transitionId);
        if (transition instanceof TransitionSet && ((TransitionSet) transition).getTransitionCount() == 0) {
            transition = null;
        }
    }
    return transition;
}
Also used : TransitionSet(android.transition.TransitionSet) Transition(android.transition.Transition) TransitionInflater(android.transition.TransitionInflater)

Example 35 with TransitionSet

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

the class SequenceTestSimple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fading_test_simple);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mRemovingButton = (Button) findViewById(R.id.removingButton);
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple2, this);
    TransitionSet fader = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    fader.addTransition(new Fade().addTarget(R.id.removingButton));
    fader.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFade = fader;
    sequencedFadeReverse = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    sequencedFadeReverse.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFadeReverse.addTransition(new Fade().addTarget(R.id.removingButton));
    mCurrentScene = mScene1;
}
Also used : TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View) Fade(android.transition.Fade)

Aggregations

TransitionSet (android.transition.TransitionSet)127 ChangeBounds (android.transition.ChangeBounds)71 View (android.view.View)66 Transition (android.transition.Transition)57 Fade (android.transition.Fade)47 TransitionManager (android.transition.TransitionManager)32 Recolor (android.transition.Recolor)24 Crossfade (android.transition.Crossfade)20 ViewGroup (android.view.ViewGroup)17 TransitionInflater (android.transition.TransitionInflater)15 ArrayList (java.util.ArrayList)15 ChangeText (android.transition.ChangeText)12 TextView (android.widget.TextView)12 List (java.util.List)10 ImageView (android.widget.ImageView)9 Scene (android.transition.Scene)8 Visibility (android.transition.Visibility)5 GhostView (android.view.GhostView)5 AutoTransition (android.transition.AutoTransition)4 Rotate (android.transition.Rotate)4