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

Commit 0c934386 authored by Andreas Agvard's avatar Andreas Agvard Committed by Automerger Merge Worker
Browse files

Merge "Fixes search feature invocation issue" into udc-qpr-dev am: 7d793ecd

parents 80dace90 7d793ecd
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.quickstep.inputconsumers;

import android.content.Context;

import androidx.annotation.Nullable;

import com.android.launcher3.R;
import com.android.launcher3.util.ResourceBasedOverride;

@@ -33,12 +35,15 @@ public class NavHandleLongPressHandler implements ResourceBasedOverride {
    }

    /**
     * Called when nav handle is long pressed.
     *
     * @return if the long press was consumed, meaning other input consumers should receive a
     * cancel event
     * Called when nav handle is long pressed to get the Runnable that should be executed by the
     * caller to invoke long press behavior. If null is returned that means long press couldn't be
     * handled.
     * <p>
     * A Runnable is returned here to ensure the InputConsumer can call
     * {@link android.view.InputMonitor#pilferPointers()} before invoking the long press behavior
     * since pilfering can break the long press behavior.
     */
    public boolean onLongPress() {
        return false;
    public @Nullable Runnable getLongPressRunnable() {
        return null;
    }
}
+6 −3
Original line number Diff line number Diff line
@@ -38,8 +38,8 @@ public class NavHandleLongPressInputConsumer extends DelegateInputConsumer {
    public NavHandleLongPressInputConsumer(Context context, InputConsumer delegate,
            InputMonitorCompat inputMonitor) {
        super(delegate, inputMonitor);
        mNavHandleWidth = context.getResources()
                .getDimensionPixelSize(R.dimen.navigation_home_handle_width);
        mNavHandleWidth = context.getResources().getDimensionPixelSize(
                R.dimen.navigation_home_handle_width);
        mScreenWidth = DisplayController.INSTANCE.get(context).getInfo().currentSize.x;

        mNavHandleLongPressHandler = NavHandleLongPressHandler.newInstance(context);
@@ -48,8 +48,11 @@ public class NavHandleLongPressInputConsumer extends DelegateInputConsumer {
            @Override
            public void onLongPress(MotionEvent motionEvent) {
                if (isInArea(motionEvent.getRawX())) {
                    if (mNavHandleLongPressHandler.onLongPress()) {
                    Runnable longPressRunnable = mNavHandleLongPressHandler.getLongPressRunnable();
                    if (longPressRunnable != null) {
                        setActive(motionEvent);

                        longPressRunnable.run();
                    }
                }
            }