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

Commit dfaaa4a2 authored by Liam Lee Pong Lam's avatar Liam Lee Pong Lam Committed by Android (Google) Code Review
Browse files

Merge "[Launcher3] Hides AllApps education view for trackpad" into main

parents 126be562 a457b0e0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -256,6 +256,8 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer

    private boolean mIsPredictiveBackToHomeInProgress;

    private boolean mCanShowAllAppsEducationView;

    public static QuickstepLauncher getLauncher(Context context) {
        return fromContext(context);
    }
@@ -1494,4 +1496,12 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer
    public boolean isRecentsViewVisible() {
        return getStateManager().getState().isRecentsViewVisible;
    }

    public boolean isCanShowAllAppsEducationView() {
        return mCanShowAllAppsEducationView;
    }

    public void setCanShowAllAppsEducationView(boolean canShowAllAppsEducationView) {
        mCanShowAllAppsEducationView = canShowAllAppsEducationView;
    }
}
+7 −3
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import android.view.MotionEvent;
import android.view.ViewConfiguration;

import com.android.internal.jank.Cuj;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorPlaybackController;
@@ -88,13 +87,16 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch
    // Normal to Hint animation has flag SKIP_OVERVIEW, so we update this scrim with this animator.
    private ObjectAnimator mNormalToHintOverviewScrimAnimator;

    private final QuickstepLauncher mLauncher;

    /**
     * @param cancelSplitRunnable Called when split placeholder view needs to be cancelled.
     *                            Animation should be added to the provided AnimatorSet
     */
    public NoButtonNavbarToOverviewTouchController(Launcher l,
    public NoButtonNavbarToOverviewTouchController(QuickstepLauncher l,
            BiConsumer<AnimatorSet, Long> cancelSplitRunnable) {
        super(l);
        mLauncher = l;
        mRecentsView = l.getOverviewPanel();
        mMotionPauseDetector = new MotionPauseDetector(l);
        mMotionPauseMinDisplacement = ViewConfiguration.get(l).getScaledTouchSlop();
@@ -104,7 +106,9 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch

    @Override
    protected boolean canInterceptTouch(MotionEvent ev) {
        if (!isTrackpadMotionEvent(ev) && DisplayController.getNavigationMode(mLauncher)
        boolean isTrackpadEvent = isTrackpadMotionEvent(ev);
        mLauncher.setCanShowAllAppsEducationView(!isTrackpadEvent);
        if (!isTrackpadEvent && DisplayController.getNavigationMode(mLauncher)
                == THREE_BUTTONS) {
            return false;
        }
+2 −1
Original line number Diff line number Diff line
@@ -106,7 +106,8 @@ public class QuickstepOnboardingPrefs {
                        return;
                    }
                    mShouldIncreaseCount = toState == HINT_STATE
                            && launcher.getWorkspace().getNextPage() == Workspace.DEFAULT_PAGE;
                            && launcher.getWorkspace().getNextPage() == Workspace.DEFAULT_PAGE
                            && launcher.isCanShowAllAppsEducationView();
                }

                @Override