android 12.0Launcher3禁止拖拽app图标到第一屏
1.概述
在12.0进行定制化开发Launcher3中,会对Launcher3 做些要求,比如现在的需求就是Launcher3第一屏的图标固定,不让其他屏的图标拖动到
第一屏所以说这个需求和 禁止拖拽图标到Hotseat类似,也是从WorkSpace.java里面寻找解决方案
2.Launcher3禁止拖拽app图标到第一屏相关代码
packages/apps/Launcher3/src/com/android/launcher3/DropTarget.java
packages/apps/Launcher3/src/com/android/launcher3/Workspace.java
3.Launcher3禁止拖拽app图标到第一屏相关功能分析
3.1DropTarget.java相关拖拽的接口分析
public interface DropTarget {class DragObject {public int x = -1;public int y = -1;/** X offset from the upper-left corner of the cell to where we touched. */public int xOffset = -1;/** Y offset from the upper-left corner of the cell to where we touched. */public int yOffset = -1;/** This indicates whether a drag is in final stages, either drop or cancel. It* differentiate