From 323b1e4f43c06a0a6eb175ef13be4f4e91f912d7 Mon Sep 17 00:00:00 2001 From: Zak Cohen Date: Tue, 28 Sep 2021 16:09:45 -0700 Subject: [PATCH] Remove RecentsExtraCard plugin hook. This plugin hook never really worked properly. The touch handling was always a bit off and it complicates the code. Bug: 201460301 Test: Local Change-Id: I19401be18f859b3bdf408a2e4aacd95ca95d35cc --- .../OverscrollInputConsumer.java | 3 - .../quickstep/views/LauncherRecentsView.java | 90 ------------------ .../views/RecentsExtraViewContainer.java | 54 ----------- .../android/quickstep/views/RecentsView.java | 92 ++++++------------- .../systemui/plugins/RecentsExtraCard.java | 42 --------- 5 files changed, 27 insertions(+), 254 deletions(-) delete mode 100644 quickstep/src/com/android/quickstep/views/RecentsExtraViewContainer.java delete mode 100644 src_plugins/com/android/systemui/plugins/RecentsExtraCard.java diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OverscrollInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OverscrollInputConsumer.java index fb420a272a..e984b4fe94 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/OverscrollInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/OverscrollInputConsumer.java @@ -230,9 +230,6 @@ public class OverscrollInputConsumer extends DelegateInputConsumer { // Make sure there isn't an app to quick switch to on our right int maxIndex = 0; - if (mRecentsView != null && mRecentsView.hasRecentsExtraCard()) { - maxIndex = 1; - } boolean atRightMostApp = mRecentsView == null || (mRecentsView.getRunningTaskIndex() <= maxIndex); diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java index ddb1fca4b5..5ca5c94e59 100644 --- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java +++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java @@ -29,18 +29,14 @@ import android.os.Build; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.Surface; -import android.widget.FrameLayout; import com.android.launcher3.BaseQuickstepLauncher; import com.android.launcher3.LauncherState; import com.android.launcher3.statehandlers.DepthController; import com.android.launcher3.statemanager.StateManager.StateListener; -import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper; import com.android.launcher3.util.SplitConfigurationOptions; import com.android.quickstep.LauncherActivityInterface; import com.android.quickstep.util.SplitSelectStateController; -import com.android.systemui.plugins.PluginListener; -import com.android.systemui.plugins.RecentsExtraCard; /** * {@link RecentsView} used in Launcher activity @@ -49,25 +45,6 @@ import com.android.systemui.plugins.RecentsExtraCard; public class LauncherRecentsView extends RecentsView implements StateListener { - private RecentsExtraCard mRecentsExtraCardPlugin; - private RecentsExtraViewContainer mRecentsExtraViewContainer; - private PluginListener mRecentsExtraCardPluginListener = - new PluginListener() { - @Override - public void onPluginConnected(RecentsExtraCard recentsExtraCard, Context context) { - createRecentsExtraCard(); - mRecentsExtraCardPlugin = recentsExtraCard; - mRecentsExtraCardPlugin.setupView(context, mRecentsExtraViewContainer, mActivity); - } - - @Override - public void onPluginDisconnected(RecentsExtraCard plugin) { - removeView(mRecentsExtraViewContainer); - mRecentsExtraCardPlugin = null; - mRecentsExtraViewContainer = null; - } - }; - public LauncherRecentsView(Context context) { this(context, null); } @@ -147,73 +124,6 @@ public class LauncherRecentsView extends RecentsView 0 - && !mDisallowScrollToClearAll; - } - - private int computeScrollX() { - int scrollIndex = getTaskViewStartIndex() - 1; - while (scrollIndex >= 0 && getChildAt(scrollIndex) instanceof RecentsExtraViewContainer - && ((RecentsExtraViewContainer) getChildAt(scrollIndex)).isScrollable()) { - scrollIndex--; - } - return getScrollForPage(scrollIndex + 1); - } - - private void createRecentsExtraCard() { - mRecentsExtraViewContainer = new RecentsExtraViewContainer(getContext()); - FrameLayout.LayoutParams helpCardParams = - new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, - FrameLayout.LayoutParams.MATCH_PARENT); - mRecentsExtraViewContainer.setLayoutParams(helpCardParams); - mRecentsExtraViewContainer.setScrollable(true); - addView(mRecentsExtraViewContainer, 0); - } - - @Override - public boolean hasRecentsExtraCard() { - return mRecentsExtraViewContainer != null; - } - - @Override - public void setContentAlpha(float alpha) { - super.setContentAlpha(alpha); - if (mRecentsExtraViewContainer != null) { - mRecentsExtraViewContainer.setAlpha(alpha); - } - } - @Override protected DepthController getDepthController() { return mActivity.getDepthController(); diff --git a/quickstep/src/com/android/quickstep/views/RecentsExtraViewContainer.java b/quickstep/src/com/android/quickstep/views/RecentsExtraViewContainer.java deleted file mode 100644 index 16bc3bc533..0000000000 --- a/quickstep/src/com/android/quickstep/views/RecentsExtraViewContainer.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.quickstep.views; - -import android.content.Context; -import android.util.AttributeSet; -import android.widget.FrameLayout; - -/** - * Empty view to house recents overview extra card - */ -public class RecentsExtraViewContainer extends FrameLayout { - - private boolean mScrollable = false; - - public RecentsExtraViewContainer(Context context) { - super(context); - } - - public RecentsExtraViewContainer(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public RecentsExtraViewContainer(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - - /** - * Determine whether the view should be scrolled to in the recents overview, similar to the - * taskviews. - * @return true if viewed should be scrolled to, false if not - */ - public boolean isScrollable() { - return mScrollable; - } - - public void setScrollable(boolean scrollable) { - this.mScrollable = scrollable; - } -} diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 88f82a4f87..ef18519ee4 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -116,7 +116,6 @@ import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.PagedView; import com.android.launcher3.R; import com.android.launcher3.Utilities; -import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorListeners; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PendingAnimation; @@ -609,8 +608,6 @@ public abstract class RecentsView= 0; taskViewIndex--, taskDataIndex--) { - final int pageIndex = requiredTaskViewCount - taskViewIndex - 1 + mTaskViewStartIndex; + final int pageIndex = requiredTaskViewCount - taskViewIndex - 1; final Task task = tasks.get(taskDataIndex); final TaskView taskView = (TaskView) getChildAt(pageIndex); if (taskView instanceof GroupedTaskView) { @@ -1415,7 +1397,7 @@ public abstract class RecentsView= 0; i--) { - final int pageIndex = requiredTaskViewCount - i - 1 + mTaskViewStartIndex; + final int pageIndex = requiredTaskViewCount - i - 1; final TaskView taskView = (TaskView) getChildAt(pageIndex); int taskViewId = taskView.getTaskViewId(); sb.append(" taskViewId: " + taskViewId @@ -1478,7 +1460,7 @@ public abstract class RecentsView= 0) { - View child = getChildAt(index); - return child instanceof TaskView ? (TaskView) child : null; - } - return null; + View child = getChildAt(index); + return child instanceof TaskView ? (TaskView) child : null; } public void setOnEmptyMessageUpdatedListener(OnEmptyMessageUpdatedListener listener) { @@ -4385,7 +4347,7 @@ public abstract class RecentsView clearAllScroll - clearAllWidth)) { pageScroll = clearAllScroll + (mIsRtl ? clearAllWidth : -clearAllWidth); @@ -4478,7 +4440,7 @@ public abstract class RecentsView