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

Commit 9c9befae authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Use nearest region for all the nav buttons in 3-button folded mode

Bug: 230395757
Test: In 3-button folded mode, make sure that the touches that happen between nav buttons go to the nearest button. No regression in other modes.

Change-Id: Icb776a9a4ed4fc31d33dc3267c7053f2b0da0bfc
parent 5f3b7614
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <FrameLayout
    <com.android.launcher3.taskbar.navbutton.NearestTouchFrame
        android:id="@+id/navbuttons_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
@@ -62,7 +62,7 @@
            android:layout_height="match_parent"
            android:gravity="center_vertical"
            android:layout_gravity="end"/>
    </FrameLayout>
    </com.android.launcher3.taskbar.navbutton.NearestTouchFrame>

    <com.android.launcher3.taskbar.StashedHandleView
        android:id="@+id/stashed_handle"
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@
        android:elevation="@dimen/bubblebar_elevation"
        />

    <FrameLayout
    <com.android.launcher3.taskbar.navbutton.NearestTouchFrame
        android:id="@+id/navbuttons_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
@@ -83,7 +83,7 @@
            android:paddingTop="@dimen/taskbar_contextual_padding_top"
            android:gravity="center_vertical"
            android:layout_gravity="end"/>
    </FrameLayout>
    </com.android.launcher3.taskbar.navbutton.NearestTouchFrame>

    <com.android.launcher3.taskbar.StashedHandleView
        android:id="@+id/stashed_handle"
+2 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.widget.FrameLayout;
import androidx.annotation.Nullable;

import com.android.launcher3.R;
import com.android.launcher3.taskbar.navbutton.NearestTouchFrame;

/**
 * Controller for managing buttons and status icons in taskbar in a desktop environment.
@@ -43,7 +44,7 @@ public class DesktopNavbarButtonsViewController extends NavbarButtonsViewControl
    private TaskbarControllers mControllers;

    public DesktopNavbarButtonsViewController(TaskbarActivityContext context,
            @Nullable Context navigationBarPanelContext, FrameLayout navButtonsView) {
            @Nullable Context navigationBarPanelContext, NearestTouchFrame navButtonsView) {
        super(context, navigationBarPanelContext, navButtonsView);
        mContext = context;
        mNavButtonsView = navButtonsView;
+9 −2
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.taskbar.TaskbarNavButtonController.TaskbarButton;
import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory;
import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter;
import com.android.launcher3.taskbar.navbutton.NearestTouchFrame;
import com.android.launcher3.util.DimensionUtils;
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
import com.android.launcher3.util.MultiValueAlpha;
@@ -151,7 +152,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
    private final TaskbarActivityContext mContext;
    private final @Nullable Context mNavigationBarPanelContext;
    private final WindowManagerProxy mWindowManagerProxy;
    private final FrameLayout mNavButtonsView;
    private final NearestTouchFrame mNavButtonsView;
    private final LinearLayout mNavButtonContainer;
    // Used for IME+A11Y buttons
    private final ViewGroup mEndContextualContainer;
@@ -208,7 +209,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
    private ImageView mRecentsButton;

    public NavbarButtonsViewController(TaskbarActivityContext context,
            @Nullable Context navigationBarPanelContext, FrameLayout navButtonsView) {
            @Nullable Context navigationBarPanelContext, NearestTouchFrame navButtonsView) {
        mContext = context;
        mNavigationBarPanelContext = navigationBarPanelContext;
        mWindowManagerProxy = WindowManagerProxy.INSTANCE.get(mContext);
@@ -517,6 +518,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
        return (mState & FLAG_IME_VISIBLE) != 0;
    }

    public boolean isImeRenderingNavButtons() {
        return mIsImeRenderingNavButtons;
    }

    /**
     * Returns true if the home button is disabled
     */
@@ -1003,6 +1008,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
                + mOnTaskbarBackgroundNavButtonColorOverride.value);
        pw.println(prefix + "\t\tmOnBackgroundNavButtonColorOverrideMultiplier="
                + mOnBackgroundNavButtonColorOverrideMultiplier.value);

        mNavButtonsView.dumpLogs(prefix + "\t", pw);
    }

    private static String getStateString(int flags) {
+2 −1
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ import com.android.launcher3.taskbar.bubbles.BubbleDismissController;
import com.android.launcher3.taskbar.bubbles.BubbleDragController;
import com.android.launcher3.taskbar.bubbles.BubbleStashController;
import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController;
import com.android.launcher3.taskbar.navbutton.NearestTouchFrame;
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
@@ -236,7 +237,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        mDragLayer = (TaskbarDragLayer) mLayoutInflater.inflate(taskbarLayout, null, false);
        TaskbarView taskbarView = mDragLayer.findViewById(R.id.taskbar_view);
        TaskbarScrimView taskbarScrimView = mDragLayer.findViewById(R.id.taskbar_scrim);
        FrameLayout navButtonsView = mDragLayer.findViewById(R.id.navbuttons_view);
        NearestTouchFrame navButtonsView = mDragLayer.findViewById(R.id.navbuttons_view);
        StashedHandleView stashedHandleView = mDragLayer.findViewById(R.id.stashed_handle);
        BubbleBarView bubbleBarView = mDragLayer.findViewById(R.id.taskbar_bubbles);
        StashedHandleView bubbleHandleView = mDragLayer.findViewById(R.id.stashed_bubble_handle);
Loading