From 8185dedf5647bad922efde145f2cd6e2200ca6cc Mon Sep 17 00:00:00 2001 From: kumarashishg Date: Mon, 26 Jul 2021 02:47:44 +0000 Subject: [PATCH] NIU Tooltip : tooltip overlap issue fix Overlay is getting updated multiple times, So If a tooltip is getting shown then next overlay update call will trigger new tooltip regardless of current tooltip behavior. If a tooltip is getting shown then other tooltips should not be triggered. Added a check for this. Bug: 194458724 Test: Local build and run on Pixel 4a Change-Id: I5266ddd7cfa84258b46dc14846d77872752ac442 (cherry picked from commit ced47f4ae652987f746daeec2367d184b1d63937) --- .../com/android/quickstep/TaskOverlayFactoryGo.java | 9 +++++++-- .../quickstep/views/GoOverviewActionsView.java | 11 ++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java index 91cab3cbd6..c91137e0f7 100644 --- a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java +++ b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java @@ -53,6 +53,7 @@ import com.android.launcher3.BaseActivity; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.R; import com.android.launcher3.Utilities; +import com.android.launcher3.views.ArrowTipView; import com.android.quickstep.util.AssistContentRequester; import com.android.quickstep.util.RecentsOrientedState; import com.android.quickstep.views.GoOverviewActionsView; @@ -117,6 +118,7 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { private AssistContentRequester mFactoryContentRequester; private SharedPreferences mSharedPreferences; private OverlayDialogGo mDialog; + private ArrowTipView mArrowTipView; private TaskOverlayGo(TaskThumbnailView taskThumbnailView, AssistContentRequester assistContentRequester) { @@ -382,11 +384,14 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { * Order of tooltips are translate and then listen */ private void showTooltipsIfUnseen() { + if (mArrowTipView != null && mArrowTipView.isOpen()) { + return; + } if (!mSharedPreferences.getBoolean(TRANSLATE_TOOL_TIP_SEEN, false)) { - ((GoOverviewActionsView) getActionsView()).showTranslateToolTip(); + mArrowTipView = ((GoOverviewActionsView) getActionsView()).showTranslateToolTip(); mSharedPreferences.edit().putBoolean(TRANSLATE_TOOL_TIP_SEEN, true).apply(); } else if (!mSharedPreferences.getBoolean(LISTEN_TOOL_TIP_SEEN, false)) { - ((GoOverviewActionsView) getActionsView()).showListenToolTip(); + mArrowTipView = ((GoOverviewActionsView) getActionsView()).showListenToolTip(); mSharedPreferences.edit().putBoolean(LISTEN_TOOL_TIP_SEEN, true).apply(); } } diff --git a/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java b/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java index 97ba5905e0..6e2e6cb5ab 100644 --- a/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java +++ b/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java @@ -84,7 +84,7 @@ public class GoOverviewActionsView extends OverviewActionsView