Loading aconfig/launcher.aconfig +7 −0 Original line number Original line Diff line number Diff line Loading @@ -20,3 +20,10 @@ flag { description: "Enable a grid-only overview without a focused task." description: "Enable a grid-only overview without a focused task." bug: "257950105" bug: "257950105" } } flag { name: "enable_cursor_hover_states" namespace: "launcher" description: "Enables cursor hover states for certain elements." bug: "243191650" } quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ import static android.content.pm.PackageManager.FEATURE_PC; import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED; import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED; import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES; import static com.android.launcher3.config.FeatureFlags.enableCursorHoverStates; import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR; import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR; import android.content.Context; import android.content.Context; Loading Loading @@ -347,7 +347,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar } } } } setClickAndLongClickListenersForIcon(hotseatView); setClickAndLongClickListenersForIcon(hotseatView); if (ENABLE_CURSOR_HOVER_STATES.get()) { if (enableCursorHoverStates()) { setHoverListenerForIcon(hotseatView); setHoverListenerForIcon(hotseatView); } } nextViewIndex++; nextViewIndex++; Loading quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ import static android.view.MotionEvent.INVALID_POINTER_ID; import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES; import static com.android.launcher3.config.FeatureFlags.enableCursorHoverStates; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TOUCHING; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TOUCHING; import android.content.Context; import android.content.Context; Loading Loading @@ -276,7 +276,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { */ */ @Override @Override public void onHoverEvent(MotionEvent ev) { public void onHoverEvent(MotionEvent ev) { if (!ENABLE_CURSOR_HOVER_STATES.get() || mTaskbarActivityContext == null if (!enableCursorHoverStates() || mTaskbarActivityContext == null || !mTaskbarActivityContext.isTaskbarStashed()) { || !mTaskbarActivityContext.isTaskbarStashed()) { return; return; } } Loading Loading @@ -331,7 +331,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { private boolean isStashedTaskbarHovered(int x, int y) { private boolean isStashedTaskbarHovered(int x, int y) { if (!mTaskbarActivityContext.isTaskbarStashed() if (!mTaskbarActivityContext.isTaskbarStashed() || mTaskbarActivityContext.isTaskbarAllAppsOpen() || mTaskbarActivityContext.isTaskbarAllAppsOpen() || !ENABLE_CURSOR_HOVER_STATES.get()) { || !enableCursorHoverStates()) { return false; return false; } } DeviceProfile dp = mTaskbarActivityContext.getDeviceProfile(); DeviceProfile dp = mTaskbarActivityContext.getDeviceProfile(); Loading quickstep/src/com/android/quickstep/views/TaskView.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -443,7 +443,7 @@ public class TaskView extends FrameLayout implements Reusable { || DesktopTaskView.DESKTOP_MODE_SUPPORTED; || DesktopTaskView.DESKTOP_MODE_SUPPORTED; boolean willDrawBorder = boolean willDrawBorder = keyboardFocusHighlightEnabled || FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get(); keyboardFocusHighlightEnabled || FeatureFlags.enableCursorHoverStates(); setWillNotDraw(!willDrawBorder); setWillNotDraw(!willDrawBorder); if (willDrawBorder) { if (willDrawBorder) { Loading @@ -461,7 +461,7 @@ public class TaskView extends FrameLayout implements Reusable { /* targetView= */ this)) : null; /* targetView= */ this)) : null; mHoverBorderAnimator = mHoverBorderAnimator = FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get() ? new BorderAnimator( FeatureFlags.enableCursorHoverStates() ? new BorderAnimator( /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius, /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius, /* borderColor= */ styledAttrs.getColor( /* borderColor= */ styledAttrs.getColor( R.styleable.TaskView_hoverBorderColor, DEFAULT_BORDER_COLOR), R.styleable.TaskView_hoverBorderColor, DEFAULT_BORDER_COLOR), Loading Loading @@ -536,7 +536,7 @@ public class TaskView extends FrameLayout implements Reusable { @Override @Override public boolean onHoverEvent(MotionEvent event) { public boolean onHoverEvent(MotionEvent event) { if (FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get()) { if (FeatureFlags.enableCursorHoverStates()) { switch (event.getAction()) { switch (event.getAction()) { case MotionEvent.ACTION_HOVER_ENTER: case MotionEvent.ACTION_HOVER_ENTER: mHoverBorderAnimator.buildAnimator(/* isAppearing= */ true).start(); mHoverBorderAnimator.buildAnimator(/* isAppearing= */ true).start(); Loading @@ -553,7 +553,7 @@ public class TaskView extends FrameLayout implements Reusable { @Override @Override public boolean onInterceptHoverEvent(MotionEvent event) { public boolean onInterceptHoverEvent(MotionEvent event) { if (FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get()) { if (FeatureFlags.enableCursorHoverStates()) { // avoid triggering hover event on child elements which would cause HOVER_EXIT for this // avoid triggering hover event on child elements which would cause HOVER_EXIT for this // task view // task view return true; return true; Loading src/com/android/launcher3/BubbleTextView.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -16,9 +16,9 @@ package com.android.launcher3; package com.android.launcher3; import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES; import static com.android.launcher3.config.FeatureFlags.ENABLE_DOWNLOAD_APP_UX_V2; import static com.android.launcher3.config.FeatureFlags.ENABLE_DOWNLOAD_APP_UX_V2; import static com.android.launcher3.config.FeatureFlags.ENABLE_ICON_LABEL_AUTO_SCALING; import static com.android.launcher3.config.FeatureFlags.ENABLE_ICON_LABEL_AUTO_SCALING; import static com.android.launcher3.config.FeatureFlags.enableCursorHoverStates; import static com.android.launcher3.graphics.PreloadIconDrawable.newPendingIcon; import static com.android.launcher3.graphics.PreloadIconDrawable.newPendingIcon; import static com.android.launcher3.icons.BitmapInfo.FLAG_NO_BADGE; import static com.android.launcher3.icons.BitmapInfo.FLAG_NO_BADGE; import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED; import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED; Loading Loading @@ -198,7 +198,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, public BubbleTextView(Context context, AttributeSet attrs, int defStyle) { public BubbleTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); super(context, attrs, defStyle); mActivity = ActivityContext.lookupContext(context); mActivity = ActivityContext.lookupContext(context); FastBitmapDrawable.setFlagHoverEnabled(ENABLE_CURSOR_HOVER_STATES.get()); FastBitmapDrawable.setFlagHoverEnabled(enableCursorHoverStates()); TypedArray a = context.obtainStyledAttributes(attrs, TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BubbleTextView, defStyle, 0); R.styleable.BubbleTextView, defStyle, 0); Loading Loading
aconfig/launcher.aconfig +7 −0 Original line number Original line Diff line number Diff line Loading @@ -20,3 +20,10 @@ flag { description: "Enable a grid-only overview without a focused task." description: "Enable a grid-only overview without a focused task." bug: "257950105" bug: "257950105" } } flag { name: "enable_cursor_hover_states" namespace: "launcher" description: "Enables cursor hover states for certain elements." bug: "243191650" }
quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ import static android.content.pm.PackageManager.FEATURE_PC; import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED; import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED; import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES; import static com.android.launcher3.config.FeatureFlags.enableCursorHoverStates; import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR; import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR; import android.content.Context; import android.content.Context; Loading Loading @@ -347,7 +347,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar } } } } setClickAndLongClickListenersForIcon(hotseatView); setClickAndLongClickListenersForIcon(hotseatView); if (ENABLE_CURSOR_HOVER_STATES.get()) { if (enableCursorHoverStates()) { setHoverListenerForIcon(hotseatView); setHoverListenerForIcon(hotseatView); } } nextViewIndex++; nextViewIndex++; Loading
quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ import static android.view.MotionEvent.INVALID_POINTER_ID; import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES; import static com.android.launcher3.config.FeatureFlags.enableCursorHoverStates; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TOUCHING; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TOUCHING; import android.content.Context; import android.content.Context; Loading Loading @@ -276,7 +276,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { */ */ @Override @Override public void onHoverEvent(MotionEvent ev) { public void onHoverEvent(MotionEvent ev) { if (!ENABLE_CURSOR_HOVER_STATES.get() || mTaskbarActivityContext == null if (!enableCursorHoverStates() || mTaskbarActivityContext == null || !mTaskbarActivityContext.isTaskbarStashed()) { || !mTaskbarActivityContext.isTaskbarStashed()) { return; return; } } Loading Loading @@ -331,7 +331,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { private boolean isStashedTaskbarHovered(int x, int y) { private boolean isStashedTaskbarHovered(int x, int y) { if (!mTaskbarActivityContext.isTaskbarStashed() if (!mTaskbarActivityContext.isTaskbarStashed() || mTaskbarActivityContext.isTaskbarAllAppsOpen() || mTaskbarActivityContext.isTaskbarAllAppsOpen() || !ENABLE_CURSOR_HOVER_STATES.get()) { || !enableCursorHoverStates()) { return false; return false; } } DeviceProfile dp = mTaskbarActivityContext.getDeviceProfile(); DeviceProfile dp = mTaskbarActivityContext.getDeviceProfile(); Loading
quickstep/src/com/android/quickstep/views/TaskView.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -443,7 +443,7 @@ public class TaskView extends FrameLayout implements Reusable { || DesktopTaskView.DESKTOP_MODE_SUPPORTED; || DesktopTaskView.DESKTOP_MODE_SUPPORTED; boolean willDrawBorder = boolean willDrawBorder = keyboardFocusHighlightEnabled || FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get(); keyboardFocusHighlightEnabled || FeatureFlags.enableCursorHoverStates(); setWillNotDraw(!willDrawBorder); setWillNotDraw(!willDrawBorder); if (willDrawBorder) { if (willDrawBorder) { Loading @@ -461,7 +461,7 @@ public class TaskView extends FrameLayout implements Reusable { /* targetView= */ this)) : null; /* targetView= */ this)) : null; mHoverBorderAnimator = mHoverBorderAnimator = FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get() ? new BorderAnimator( FeatureFlags.enableCursorHoverStates() ? new BorderAnimator( /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius, /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius, /* borderColor= */ styledAttrs.getColor( /* borderColor= */ styledAttrs.getColor( R.styleable.TaskView_hoverBorderColor, DEFAULT_BORDER_COLOR), R.styleable.TaskView_hoverBorderColor, DEFAULT_BORDER_COLOR), Loading Loading @@ -536,7 +536,7 @@ public class TaskView extends FrameLayout implements Reusable { @Override @Override public boolean onHoverEvent(MotionEvent event) { public boolean onHoverEvent(MotionEvent event) { if (FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get()) { if (FeatureFlags.enableCursorHoverStates()) { switch (event.getAction()) { switch (event.getAction()) { case MotionEvent.ACTION_HOVER_ENTER: case MotionEvent.ACTION_HOVER_ENTER: mHoverBorderAnimator.buildAnimator(/* isAppearing= */ true).start(); mHoverBorderAnimator.buildAnimator(/* isAppearing= */ true).start(); Loading @@ -553,7 +553,7 @@ public class TaskView extends FrameLayout implements Reusable { @Override @Override public boolean onInterceptHoverEvent(MotionEvent event) { public boolean onInterceptHoverEvent(MotionEvent event) { if (FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get()) { if (FeatureFlags.enableCursorHoverStates()) { // avoid triggering hover event on child elements which would cause HOVER_EXIT for this // avoid triggering hover event on child elements which would cause HOVER_EXIT for this // task view // task view return true; return true; Loading
src/com/android/launcher3/BubbleTextView.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -16,9 +16,9 @@ package com.android.launcher3; package com.android.launcher3; import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES; import static com.android.launcher3.config.FeatureFlags.ENABLE_DOWNLOAD_APP_UX_V2; import static com.android.launcher3.config.FeatureFlags.ENABLE_DOWNLOAD_APP_UX_V2; import static com.android.launcher3.config.FeatureFlags.ENABLE_ICON_LABEL_AUTO_SCALING; import static com.android.launcher3.config.FeatureFlags.ENABLE_ICON_LABEL_AUTO_SCALING; import static com.android.launcher3.config.FeatureFlags.enableCursorHoverStates; import static com.android.launcher3.graphics.PreloadIconDrawable.newPendingIcon; import static com.android.launcher3.graphics.PreloadIconDrawable.newPendingIcon; import static com.android.launcher3.icons.BitmapInfo.FLAG_NO_BADGE; import static com.android.launcher3.icons.BitmapInfo.FLAG_NO_BADGE; import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED; import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED; Loading Loading @@ -198,7 +198,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, public BubbleTextView(Context context, AttributeSet attrs, int defStyle) { public BubbleTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); super(context, attrs, defStyle); mActivity = ActivityContext.lookupContext(context); mActivity = ActivityContext.lookupContext(context); FastBitmapDrawable.setFlagHoverEnabled(ENABLE_CURSOR_HOVER_STATES.get()); FastBitmapDrawable.setFlagHoverEnabled(enableCursorHoverStates()); TypedArray a = context.obtainStyledAttributes(attrs, TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BubbleTextView, defStyle, 0); R.styleable.BubbleTextView, defStyle, 0); Loading