diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/RecentsActivity.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/RecentsActivity.java index f2e8f9663d..3ab0f19069 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/RecentsActivity.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/RecentsActivity.java @@ -70,7 +70,7 @@ public final class RecentsActivity extends BaseRecentsActivity { setContentView(R.layout.fallback_recents_activity); mRecentsRootView = findViewById(R.id.drag_layer); mFallbackRecentsView = findViewById(R.id.overview_panel); - mRecentsRootView.setup(); + mRecentsRootView.recreateControllers(); } @Override @@ -108,7 +108,7 @@ public final class RecentsActivity extends BaseRecentsActivity { @Override protected void onHandleConfigChanged() { super.onHandleConfigChanged(); - mRecentsRootView.setup(); + mRecentsRootView.recreateControllers(); } @Override diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index beb2857b13..0269e4a138 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -50,8 +50,6 @@ import androidx.annotation.UiThread; import androidx.annotation.WorkerThread; import com.android.launcher3.BaseDraggingActivity; -import com.android.launcher3.Launcher; -import com.android.launcher3.PagedView; import com.android.launcher3.Utilities; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.config.FeatureFlags; @@ -351,17 +349,6 @@ public class TouchInteractionService extends Service implements PluginListener { - mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */); - }); - } else { - mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */); - } - } - private void resetHomeBounceSeenOnQuickstepEnabledFirstTime() { if (!mDeviceState.isUserUnlocked() || mDeviceState.isButtonNavMode()) { // Skip if not yet unlocked (can't read user shared prefs) or if the current navigation @@ -554,15 +541,15 @@ public class TouchInteractionService extends Service implements PluginListener { private static final int MIN_SIZE = 10; - private final RecentsActivity mActivity; private final Point mLastKnownSize = new Point(MIN_SIZE, MIN_SIZE); public RecentsRootView(Context context, AttributeSet attrs) { super(context, attrs, 1 /* alphaChannelCount */); - mActivity = BaseActivity.fromContext(context); setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | SYSTEM_UI_FLAG_LAYOUT_STABLE); @@ -47,7 +44,8 @@ public class RecentsRootView extends BaseDragLayer { return mLastKnownSize; } - public void setup() { + @Override + public void recreateControllers() { mControllers = new TouchController[] { new RecentsTaskController(mActivity), new FallbackNavBarTouchController(mActivity), diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 92f35e2b19..369bf283b1 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -119,6 +119,7 @@ public class DragLayer extends BaseDragLayer { recreateControllers(); } + @Override public void recreateControllers() { mControllers = mActivity.createTouchControllers(); } diff --git a/src/com/android/launcher3/secondarydisplay/SecondaryDragLayer.java b/src/com/android/launcher3/secondarydisplay/SecondaryDragLayer.java index 8fffee8c8d..936d377fde 100644 --- a/src/com/android/launcher3/secondarydisplay/SecondaryDragLayer.java +++ b/src/com/android/launcher3/secondarydisplay/SecondaryDragLayer.java @@ -54,6 +54,11 @@ public class SecondaryDragLayer extends BaseDragLayer public SecondaryDragLayer(Context context, AttributeSet attrs) { super(context, attrs, 1 /* alphaChannelCount */); + recreateControllers(); + } + + @Override + public void recreateControllers() { mControllers = new TouchController[] {new CloseAllAppsTouchController()}; } diff --git a/src/com/android/launcher3/views/BaseDragLayer.java b/src/com/android/launcher3/views/BaseDragLayer.java index 254655cd7f..25748ae538 100644 --- a/src/com/android/launcher3/views/BaseDragLayer.java +++ b/src/com/android/launcher3/views/BaseDragLayer.java @@ -40,7 +40,6 @@ import android.widget.FrameLayout; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.InsettableFrameLayout; -import com.android.launcher3.Launcher; import com.android.launcher3.Utilities; import com.android.launcher3.util.MultiValueAlpha; import com.android.launcher3.util.MultiValueAlpha.AlphaProperty; @@ -115,6 +114,11 @@ public abstract class BaseDragLayer mMultiValueAlpha = new MultiValueAlpha(this, alphaChannelCount); } + /** + * Called to reinitialize touch controllers. + */ + public abstract void recreateControllers(); + /** * Same as {@link #isEventOverView(View, MotionEvent, View)} where evView == this drag layer. */