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

Commit 5a284c42 authored by Chet Haase's avatar Chet Haase Committed by Android (Google) Code Review
Browse files

Merge "Cancel running LayoutTransition before removing it from a container" into klp-dev

parents a052d5a7 ef3cbfd4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3855,12 +3855,17 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * the ViewGroup will be animated according to the animations defined in that LayoutTransition
     * object. By default, the transition object is null (so layout changes are not animated).
     *
     * <p>Replacing a non-null transition will cause that previous transition to be
     * canceled, if it is currently running, to restore this container to
     * its correct post-transition state.</p>
     *
     * @param transition The LayoutTransition object that will animated changes in layout. A value
     * of <code>null</code> means no transition will run on layout changes.
     * @attr ref android.R.styleable#ViewGroup_animateLayoutChanges
     */
    public void setLayoutTransition(LayoutTransition transition) {
        if (mTransition != null) {
            mTransition.cancel();
            mTransition.removeTransitionListener(mLayoutTransitionListener);
        }
        mTransition = transition;