Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b9665df authored by Andrey Kulikov's avatar Andrey Kulikov Committed by Android (Google) Code Review
Browse files

Merge "Improve platform TransitionSet behavior"

parents f969016b c5dede2b
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -163,8 +163,7 @@ public class TransitionSet extends Transition {
     */
    public TransitionSet addTransition(Transition transition) {
        if (transition != null) {
            mTransitions.add(transition);
            transition.mParent = this;
            addTransitionInternal(transition);
            if (mDuration >= 0) {
                transition.setDuration(mDuration);
            }
@@ -184,6 +183,11 @@ public class TransitionSet extends Transition {
        return this;
    }

    private void addTransitionInternal(Transition transition) {
        mTransitions.add(transition);
        transition.mParent = this;
    }

    /**
     * Returns the number of child transitions in the TransitionSet.
     *
@@ -355,10 +359,12 @@ public class TransitionSet extends Transition {
    public void setPathMotion(PathMotion pathMotion) {
        super.setPathMotion(pathMotion);
        mChangeFlags |= FLAG_CHANGE_PATH_MOTION;
        if (mTransitions != null) {
            for (int i = 0; i < mTransitions.size(); i++) {
                mTransitions.get(i).setPathMotion(pathMotion);
            }
        }
    }

    /**
     * Removes the specified child transition from this set.
@@ -604,7 +610,7 @@ public class TransitionSet extends Transition {
        clone.mTransitions = new ArrayList<Transition>();
        int numTransitions = mTransitions.size();
        for (int i = 0; i < numTransitions; ++i) {
            clone.addTransition((Transition) mTransitions.get(i).clone());
            clone.addTransitionInternal((Transition) mTransitions.get(i).clone());
        }
        return clone;
    }