1.概述
在12.0定制化开发中,如果专门适配老年机的时候,这时客户提出要求,如果最后一屏未满时,不让拖拽到后面一屏的空屏中,等当前屏填满了以后,才能拖到下一屏的功能,所以要从workspace的拖拽类开始着手分析
2.长按拖拽时最后一屏未满时不让拖拽到后一屏(二)核心类
packages/apps/Launcher3/src/com/android/launcher3/DropTarget.java
packages/apps/Launcher3/src/com/android/launcher3/Workspace.java
3.长按拖拽时最后一屏未满时不让拖拽到后一屏(二)核心功能分析
分析:
想了解当前是哪一屏和当前屏item个数
请进接下来当知道了当前是哪一屏和当前屏Item个数后
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;boolean isDropEnabled();void onDrop(DragObject dra