Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 349f1014 authored by Pat Manning's avatar Pat Manning Committed by Android (Google) Code Review
Browse files

Merge "Migrate ENABLE_CURSOR_HOVER_STATES to aconfig" into main

parents 4fc16ab2 c49d60b9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -20,3 +20,10 @@ flag {
    description: "Enable a grid-only overview without a focused task."
    bug: "257950105"
}

flag {
    name: "enable_cursor_hover_states"
    namespace: "launcher"
    description: "Enables cursor hover states for certain elements."
    bug: "243191650"
}
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ import static android.content.pm.PackageManager.FEATURE_PC;
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_CURSOR_HOVER_STATES;
import static com.android.launcher3.config.FeatureFlags.enableCursorHoverStates;
import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR;

import android.content.Context;
@@ -347,7 +347,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
                }
            }
            setClickAndLongClickListenersForIcon(hotseatView);
            if (ENABLE_CURSOR_HOVER_STATES.get()) {
            if (enableCursorHoverStates()) {
                setHoverListenerForIcon(hotseatView);
            }
            nextViewIndex++;
+3 −3
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ import static android.view.MotionEvent.INVALID_POINTER_ID;

import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent;
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 android.content.Context;
@@ -276,7 +276,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
     */
    @Override
    public void onHoverEvent(MotionEvent ev) {
        if (!ENABLE_CURSOR_HOVER_STATES.get() || mTaskbarActivityContext == null
        if (!enableCursorHoverStates() || mTaskbarActivityContext == null
                || !mTaskbarActivityContext.isTaskbarStashed()) {
            return;
        }
@@ -331,7 +331,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
    private boolean isStashedTaskbarHovered(int x, int y) {
        if (!mTaskbarActivityContext.isTaskbarStashed()
                || mTaskbarActivityContext.isTaskbarAllAppsOpen()
                || !ENABLE_CURSOR_HOVER_STATES.get()) {
                || !enableCursorHoverStates()) {
            return false;
        }
        DeviceProfile dp = mTaskbarActivityContext.getDeviceProfile();
+4 −4
Original line number Diff line number Diff line
@@ -443,7 +443,7 @@ public class TaskView extends FrameLayout implements Reusable {
                || DesktopTaskView.DESKTOP_MODE_SUPPORTED;

        boolean willDrawBorder =
                keyboardFocusHighlightEnabled || FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get();
                keyboardFocusHighlightEnabled || FeatureFlags.enableCursorHoverStates();
        setWillNotDraw(!willDrawBorder);

        if (willDrawBorder) {
@@ -461,7 +461,7 @@ public class TaskView extends FrameLayout implements Reusable {
                            /* targetView= */ this)) : null;

            mHoverBorderAnimator =
                    FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get() ? new BorderAnimator(
                    FeatureFlags.enableCursorHoverStates() ? new BorderAnimator(
                            /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius,
                            /* borderColor= */ styledAttrs.getColor(
                                    R.styleable.TaskView_hoverBorderColor, DEFAULT_BORDER_COLOR),
@@ -536,7 +536,7 @@ public class TaskView extends FrameLayout implements Reusable {

    @Override
    public boolean onHoverEvent(MotionEvent event) {
        if (FeatureFlags.ENABLE_CURSOR_HOVER_STATES.get()) {
        if (FeatureFlags.enableCursorHoverStates()) {
            switch (event.getAction()) {
                case MotionEvent.ACTION_HOVER_ENTER:
                    mHoverBorderAnimator.buildAnimator(/* isAppearing= */ true).start();
@@ -553,7 +553,7 @@ public class TaskView extends FrameLayout implements Reusable {

    @Override
    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
            // task view
            return true;
+2 −2
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@

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_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.icons.BitmapInfo.FLAG_NO_BADGE;
import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED;
@@ -198,7 +198,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
    public BubbleTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        mActivity = ActivityContext.lookupContext(context);
        FastBitmapDrawable.setFlagHoverEnabled(ENABLE_CURSOR_HOVER_STATES.get());
        FastBitmapDrawable.setFlagHoverEnabled(enableCursorHoverStates());

        TypedArray a = context.obtainStyledAttributes(attrs,
                R.styleable.BubbleTextView, defStyle, 0);
Loading