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

Commit 318f567a authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Prevent recursive draw-invalidate cycle when drawing folder

Change-Id: I4d3e680ee0cd1af9da997ac92c505ca38ee4e810
parent a2fde430
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -510,6 +510,10 @@ public class FolderIcon extends FrameLayout implements FolderListener {
        Drawable d = params.drawable;

        if (d != null) {
            // Remove the callback to prevent invalidate as a result of property changes
            Drawable.Callback cb = d.getCallback();
            d.setCallback(null);

            mTempBounds.set(d.getBounds());
            d.setBounds(0, 0, mIntrinsicIconSize, mIntrinsicIconSize);
            boolean isPreloadIcon = d instanceof PreloadIconDrawable;
@@ -523,6 +527,7 @@ public class FolderIcon extends FrameLayout implements FolderListener {
                d.clearColorFilter();
            }
            d.setBounds(mTempBounds);
            d.setCallback(cb);
        }
        canvas.restore();
    }