Loading quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java +4 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ import android.view.ContextThemeWrapper; import android.view.MotionEvent; import android.view.View; import androidx.annotation.VisibleForTesting; import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BubbleTextView; Loading @@ -49,7 +51,7 @@ import com.android.launcher3.views.ArrowTipView; */ public class TaskbarHoverToolTipController implements View.OnHoverListener { private static final int HOVER_TOOL_TIP_REVEAL_START_DELAY = 400; @VisibleForTesting protected static final int HOVER_TOOL_TIP_REVEAL_START_DELAY = 400; private static final int HOVER_TOOL_TIP_REVEAL_DURATION = 300; private static final int HOVER_TOOL_TIP_EXIT_DURATION = 150; Loading Loading @@ -145,7 +147,6 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { } private void startRevealHoverToolTip() { mActivity.setTaskbarWindowFullscreen(true); mHoverToolTipHandler.postDelayed(mRevealHoverToolTipRunnable, HOVER_TOOL_TIP_REVEAL_START_DELAY); } Loading @@ -157,6 +158,7 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { if (mHoverView instanceof FolderIcon && !((FolderIcon) mHoverView).getIconVisible()) { return; } mActivity.setTaskbarWindowFullscreen(true); Rect iconViewBounds = Utilities.getViewBounds(mHoverView); mHoverToolTipView.showAtLocation(mToolTipText, iconViewBounds.centerX(), mTaskbarView.getTop(), /* shouldAutoClose= */ false); Loading quickstep/tests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.java +10 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.taskbar; import static androidx.test.core.app.ApplicationProvider.getApplicationContext; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS; import static com.android.launcher3.taskbar.TaskbarHoverToolTipController.HOVER_TOOL_TIP_REVEAL_START_DELAY; import static com.google.common.truth.Truth.assertThat; Loading @@ -26,6 +27,7 @@ import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading Loading @@ -56,7 +58,7 @@ import org.mockito.stubbing.Answer; */ @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper @TestableLooper.RunWithLooper(setAsMainLooper = true) public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { private TaskbarHoverToolTipController mTaskbarHoverToolTipController; Loading Loading @@ -126,8 +128,10 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { boolean hoverHandled = mTaskbarHoverToolTipController.onHover(mHoverBubbleTextView, mMotionEvent); waitForIdleSync(); // Verify fullscreen is not set until the delayed runnable to reveal the tooltip has run verify(taskbarActivityContext, never()).setTaskbarWindowFullscreen(true); waitForIdleSync(); assertThat(hoverHandled).isTrue(); verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS, true); Loading Loading @@ -155,8 +159,10 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { boolean hoverHandled = mTaskbarHoverToolTipController.onHover(mHoverFolderIcon, mMotionEvent); waitForIdleSync(); // Verify fullscreen is not set until the delayed runnable to reveal the tooltip has run verify(taskbarActivityContext, never()).setTaskbarWindowFullscreen(true); waitForIdleSync(); assertThat(hoverHandled).isTrue(); verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS, true); Loading Loading @@ -216,6 +222,7 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { } private void waitForIdleSync() { mTestableLooper.moveTimeForward(HOVER_TOOL_TIP_REVEAL_START_DELAY + 1); mTestableLooper.processAllMessages(); } } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarHoverToolTipController.java +4 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ import android.view.ContextThemeWrapper; import android.view.MotionEvent; import android.view.View; import androidx.annotation.VisibleForTesting; import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BubbleTextView; Loading @@ -49,7 +51,7 @@ import com.android.launcher3.views.ArrowTipView; */ public class TaskbarHoverToolTipController implements View.OnHoverListener { private static final int HOVER_TOOL_TIP_REVEAL_START_DELAY = 400; @VisibleForTesting protected static final int HOVER_TOOL_TIP_REVEAL_START_DELAY = 400; private static final int HOVER_TOOL_TIP_REVEAL_DURATION = 300; private static final int HOVER_TOOL_TIP_EXIT_DURATION = 150; Loading Loading @@ -145,7 +147,6 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { } private void startRevealHoverToolTip() { mActivity.setTaskbarWindowFullscreen(true); mHoverToolTipHandler.postDelayed(mRevealHoverToolTipRunnable, HOVER_TOOL_TIP_REVEAL_START_DELAY); } Loading @@ -157,6 +158,7 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener { if (mHoverView instanceof FolderIcon && !((FolderIcon) mHoverView).getIconVisible()) { return; } mActivity.setTaskbarWindowFullscreen(true); Rect iconViewBounds = Utilities.getViewBounds(mHoverView); mHoverToolTipView.showAtLocation(mToolTipText, iconViewBounds.centerX(), mTaskbarView.getTop(), /* shouldAutoClose= */ false); Loading
quickstep/tests/src/com/android/launcher3/taskbar/TaskbarHoverToolTipControllerTest.java +10 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.taskbar; import static androidx.test.core.app.ApplicationProvider.getApplicationContext; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS; import static com.android.launcher3.taskbar.TaskbarHoverToolTipController.HOVER_TOOL_TIP_REVEAL_START_DELAY; import static com.google.common.truth.Truth.assertThat; Loading @@ -26,6 +27,7 @@ import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading Loading @@ -56,7 +58,7 @@ import org.mockito.stubbing.Answer; */ @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper @TestableLooper.RunWithLooper(setAsMainLooper = true) public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { private TaskbarHoverToolTipController mTaskbarHoverToolTipController; Loading Loading @@ -126,8 +128,10 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { boolean hoverHandled = mTaskbarHoverToolTipController.onHover(mHoverBubbleTextView, mMotionEvent); waitForIdleSync(); // Verify fullscreen is not set until the delayed runnable to reveal the tooltip has run verify(taskbarActivityContext, never()).setTaskbarWindowFullscreen(true); waitForIdleSync(); assertThat(hoverHandled).isTrue(); verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS, true); Loading Loading @@ -155,8 +159,10 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { boolean hoverHandled = mTaskbarHoverToolTipController.onHover(mHoverFolderIcon, mMotionEvent); waitForIdleSync(); // Verify fullscreen is not set until the delayed runnable to reveal the tooltip has run verify(taskbarActivityContext, never()).setTaskbarWindowFullscreen(true); waitForIdleSync(); assertThat(hoverHandled).isTrue(); verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS, true); Loading Loading @@ -216,6 +222,7 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase { } private void waitForIdleSync() { mTestableLooper.moveTimeForward(HOVER_TOOL_TIP_REVEAL_START_DELAY + 1); mTestableLooper.processAllMessages(); } }