From 503f04f86d363363a6fcfe0685834379d6e27eca Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Wed, 6 Sep 2023 20:40:54 +0000 Subject: [PATCH] Register OnAttachStateChangeListener before attaching to container. If we do the reverse, there is a change onAttach will occur before the callback is registered and invokable (e.g. overlay window already exists for EDU). Test: Manual Fix: 299335210 Flag: None Change-Id: Ic4befe900c9582e1b01c2bc4699b431f95efa617 --- .../allapps/TaskbarAllAppsSlideInView.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java index 537d2c66ab..001c3bcfc0 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java @@ -21,12 +21,16 @@ import android.animation.Animator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; +import android.os.Handler; +import android.os.Looper; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.animation.Interpolator; import android.window.OnBackInvokedDispatcher; +import androidx.annotation.Nullable; + import com.android.launcher3.DeviceProfile; import com.android.launcher3.Insettable; import com.android.launcher3.R; @@ -40,8 +44,11 @@ import com.android.launcher3.views.AbstractSlideInView; /** Wrapper for taskbar all apps with slide-in behavior. */ public class TaskbarAllAppsSlideInView extends AbstractSlideInView implements Insettable, DeviceProfile.OnDeviceProfileChangeListener { + private final Handler mHandler; + private TaskbarAllAppsContainerView mAppsView; private float mShiftRange; + private @Nullable Runnable mShowOnFullyAttachedToWindowRunnable; // Initialized in init. private TaskbarAllAppsCallbacks mAllAppsCallbacks; @@ -53,6 +60,7 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView showOnFullyAttachedToWindow(animate)); + mShowOnFullyAttachedToWindowRunnable = () -> showOnFullyAttachedToWindow(animate); + mHandler.post(mShowOnFullyAttachedToWindowRunnable); } @Override @@ -80,6 +88,7 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView