Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +4 −0 Original line number Diff line number Diff line Loading @@ -1649,6 +1649,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext { return mControllers.uiController.canToggleHomeAllApps(); } boolean isIconAlignedWithHotseat() { return mControllers.uiController.isIconAlignedWithHotseat(); } @VisibleForTesting public TaskbarControllers getControllers() { return mControllers; Loading quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java +4 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,10 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { if (mHoverView == null || mToolTipText == null) { return; } // Do not show tooltip if taskbar icons are transitioning to hotseat. if (mActivity.isIconAlignedWithHotseat()) { return; } if (mHoverView instanceof FolderIcon && !((FolderIcon) mHoverView).getIconVisible()) { return; } Loading quickstep/tests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { when(taskbarActivityContext.getDragLayer()).thenReturn(mTaskbarDragLayer); when(taskbarActivityContext.getMainLooper()).thenReturn(context.getMainLooper()); when(taskbarActivityContext.getDisplay()).thenReturn(mDisplay); when(taskbarActivityContext.isIconAlignedWithHotseat()).thenReturn(false); when(mTaskbarDragLayer.getChildCount()).thenReturn(1); mSpyFolderView = spy(new Folder(new ActivityContextWrapper(context), null)); Loading Loading @@ -243,6 +244,21 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { false); } @Test public void onHover_hoverEnterIconAlignedWithHotseat_noReveal() { when(mMotionEvent.getAction()).thenReturn(MotionEvent.ACTION_HOVER_ENTER); when(mMotionEvent.getActionMasked()).thenReturn(MotionEvent.ACTION_HOVER_ENTER); when(taskbarActivityContext.isIconAlignedWithHotseat()).thenReturn(true); boolean hoverHandled = mTaskbarHoverToolTipController.onHover(mHoverBubbleTextView, mMotionEvent); waitForIdleSync(); assertThat(hoverHandled).isTrue(); verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS, true); } private void waitForIdleSync() { mTestableLooper.processAllMessages(); } Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +4 −0 Original line number Diff line number Diff line Loading @@ -1649,6 +1649,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext { return mControllers.uiController.canToggleHomeAllApps(); } boolean isIconAlignedWithHotseat() { return mControllers.uiController.isIconAlignedWithHotseat(); } @VisibleForTesting public TaskbarControllers getControllers() { return mControllers; Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java +4 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,10 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { if (mHoverView == null || mToolTipText == null) { return; } // Do not show tooltip if taskbar icons are transitioning to hotseat. if (mActivity.isIconAlignedWithHotseat()) { return; } if (mHoverView instanceof FolderIcon && !((FolderIcon) mHoverView).getIconVisible()) { return; } Loading
quickstep/tests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { when(taskbarActivityContext.getDragLayer()).thenReturn(mTaskbarDragLayer); when(taskbarActivityContext.getMainLooper()).thenReturn(context.getMainLooper()); when(taskbarActivityContext.getDisplay()).thenReturn(mDisplay); when(taskbarActivityContext.isIconAlignedWithHotseat()).thenReturn(false); when(mTaskbarDragLayer.getChildCount()).thenReturn(1); mSpyFolderView = spy(new Folder(new ActivityContextWrapper(context), null)); Loading Loading @@ -243,6 +244,21 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { false); } @Test public void onHover_hoverEnterIconAlignedWithHotseat_noReveal() { when(mMotionEvent.getAction()).thenReturn(MotionEvent.ACTION_HOVER_ENTER); when(mMotionEvent.getActionMasked()).thenReturn(MotionEvent.ACTION_HOVER_ENTER); when(taskbarActivityContext.isIconAlignedWithHotseat()).thenReturn(true); boolean hoverHandled = mTaskbarHoverToolTipController.onHover(mHoverBubbleTextView, mMotionEvent); waitForIdleSync(); assertThat(hoverHandled).isTrue(); verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS, true); } private void waitForIdleSync() { mTestableLooper.processAllMessages(); } Loading