Android 12.0 Launcher3 desktop prohibits sliding left and right

1 Overview

In the 12.0 rom customization development, since Launcher3 has some functions that need to be customized, there are many such requirements.
Now the functional requirements require that the desktop is fixed on the app list page of Launcher3, and the left and right movement is not allowed, which means that the function of prohibiting left and right movement is realized. Therefore, it is necessary to disable the function of sliding the sliding part of the analysis page, and then disable the left and right sliding function of the desktop

2. The core code that prohibits left and right sliding on the Launcher3 desktop

      packages\apps\Launcher3\src\com\android\launcher3\PagedView.java
      packages\apps\Launcher3\src\com\android\launcher3\allapps\AllAppsPagedView.java
      packages/apps/Launcher3/src/com/android/launcher3/allapps/AllAppsContainerView.java

3. Function analysis and function realization of Launcher3 desktop prohibiting left and right sliding
3.1 AllAppsPagedView.java about app list page app binding function analysis

        public class AllAppsPagedView extends PagedView<PersonalWorkSlidingTabStrip> {
     
      final static float START_DAMPING_TOUCH_SLOP_ANGLE = (float) Math.PI / 6;
      final static float MAX_SWIPE_ANGLE = (float) Math.PI / 3;
      final static float TOUCH_SLOP_DAMPING_FACTOR = 4;
     
      public AllAppsPagedView(Context co

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/130513264