1.前言
在9.0的系统rom产品定制化开发中,在launcher3中,对于系统hotseat 文件夹 和app图标的拖拽功能也是比较重要的,由于在hotseat中的几个图标都是固定的,所以
产品要求不能拖拽hotseat的图标去其他屏,其他屏的图标也不能拖拽到hotseat区域,所以需要了解hotseat的拖拽流程,然后实现这个功能
如图:
2.禁止拖拽hotseat到其他屏功能实现的核心类
packages\apps\Launcher3\src\com\android\launcher3\Workspace.java
packages\apps\Launcher3\src\com\android\launcher3\DropTarget.java
3.禁止拖拽hotseat到其他屏功能实现的核心功能分析和实现
3.1 DropTarget.java中关于拖拽的相关方法分析
/**
* Interface defining an object that can receive a drag.
*
*/
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 i