Android 12.0 Launcher3桌面禁止左右滑动

1.概述

在12.0的rom定制化开发中,由于Launcher3有一些功能需要定制,这样的需求也好多的,
现在功能需求要求桌面固定在Launcher3的app列表页,不让左右移动,就是禁止左右移动的功能实现,所以需要禁止滑动分析页面滑动部分的功能,然后禁用桌面左右滑动功能

2.Launcher3桌面禁止左右滑动的核心代码

      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.Launcher3桌面禁止左右滑动的功能分析以及功能实现
3.1 AllAppsPagedView.java关于app列表页app绑定功能分析

        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

猜你喜欢

转载自blog.csdn.net/baidu_41666295/article/details/130513264