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

Commit 4b2e12cc authored by Adam Powell's avatar Adam Powell
Browse files

Revert "Only call Drawable.setVisible(false) for visible outgoing drawables"

This reverts commit 35e2ea02.

This patch was based on two different wrong assumptions.

Bug 27822069

Change-Id: I20b1017f91f3fce3c23dd8446459d6f3e3150a48
parent 33b30609
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -18072,13 +18072,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
         * to clear the previous drawable. setVisible first while we still have the callback set.
         */
        if (mBackground != null) {
            // It's possible for this method to be invoked from the View constructor before
            // subclass constructors have run. Drawables can and should trigger invalidations
            // and other activity with their callback on visibility changes, which shouldn't
            // happen before subclass constructors finish. However, we won't have set the
            // drawable as visible until the view becomes attached. This guard below keeps
            // multiple calls to this method from constructors from causing issues.
            if (mBackground.isVisible()) {
            if (isAttachedToWindow()) {
                mBackground.setVisible(false, false);
            }
            mBackground.setCallback(null);
@@ -18313,13 +18307,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
        if (mForegroundInfo.mDrawable != null) {
            // It's possible for this method to be invoked from the View constructor before
            // subclass constructors have run. Drawables can and should trigger invalidations
            // and other activity with their callback on visibility changes, which shouldn't
            // happen before subclass constructors finish. However, we won't have set the
            // drawable as visible until the view becomes attached. This guard below keeps
            // multiple calls to this method from constructors from causing issues.
            if (mForegroundInfo.mDrawable.isVisible()) {
            if (isAttachedToWindow()) {
                mForegroundInfo.mDrawable.setVisible(false, false);
            }
            mForegroundInfo.mDrawable.setCallback(null);
+3 −9
Original line number Diff line number Diff line
@@ -911,17 +911,11 @@ public class ImageView extends View {
        }

        if (mDrawable != null) {
            // It's possible for this method to be invoked from the constructor before
            // subclass constructors have run. Drawables can and should trigger invalidations
            // and other activity with their callback on visibility changes, which shouldn't
            // happen before subclass constructors finish. However, we won't have set the
            // drawable as visible until the view becomes attached. This guard below keeps
            // multiple calls to this method from constructors from causing issues.
            if (mDrawable.isVisible()) {
                mDrawable.setVisible(false, false);
            }
            mDrawable.setCallback(null);
            unscheduleDrawable(mDrawable);
            if (isAttachedToWindow()) {
                mDrawable.setVisible(false, false);
            }
        }

        mDrawable = d;