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

Commit 634a20ac authored by Chet Haase's avatar Chet Haase
Browse files

Fix bug with LayoutTransition when layouts are just coming on line

Change-Id: Ia7061d8ec138f8f7aea822596f46b3549a996700
parent 414e7f76
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -520,6 +520,10 @@ public class LayoutTransition {
        staggerDelay = 0;

        final ViewTreeObserver observer = parent.getViewTreeObserver(); // used for later cleanup
        if (!observer.isAlive()) {
            // If the observer's not in a good state, skip the transition
            return;
        }
        int numChildren = parent.getChildCount();

        for (int i = 0; i < numChildren; ++i) {
@@ -607,7 +611,7 @@ public class LayoutTransition {
        // layout listeners.
        observer.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
            public boolean onPreDraw() {
                observer.removeOnPreDrawListener(this);
                parent.getViewTreeObserver().removeOnPreDrawListener(this);
                int numChildren = parent.getChildCount();
                for (int i = 0; i < numChildren; ++i) {
                    final View child = parent.getChildAt(i);