diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index ada16f5737..6b731f4f55 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -724,11 +724,30 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, } } + @Override + public void onWindowFocusChanged(boolean hasWindowFocus) { + super.onWindowFocusChanged(hasWindowFocus); + // Resume callbacks can run before the window is focused again (e.g. back / predictive + // back). Clearing when focus returns covers that ordering gap. + if (hasWindowFocus) { + clearPressedIconState(); + } + } + public void clearPressedBackground() { setPressed(false); setStayPressed(false); } + /** + * Clears framework pressed state, synthetic stay-pressed, and {@link FastBitmapDrawable} tap + * scale. Use when a launch transition ends so the icon matches neighbors again. + */ + public void clearPressedIconState() { + clearPressedBackground(); + resetIconScale(); + } + @Override public boolean onKeyUp(int keyCode, KeyEvent event) { // Unlike touch events, keypress event propagate pressed state change immediately, diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 6ecbcf766f..a1b5c6b978 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2120,7 +2120,7 @@ public class Launcher extends StatefulActivity // state when we return to launcher. BubbleTextView btv = (BubbleTextView) v; btv.setStayPressed(true); - result.add(() -> btv.setStayPressed(false)); + result.add(btv::clearPressedIconState); } return result; }