Android 9.0 Launcher3桌面禁止左右滑动

1.前言

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

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.1AllAppsPagedView.java的相关源码分析

     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 context) 

猜你喜欢

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