android 12.0Launcher3禁止拖动图标到Hotseat

1.概述

在12.0系统Launcher3进行定制化开发中,对于hotseat的开发中,由功能需求要求禁止拖动图标到Hotseat的功能,而拖拽也是在workspace.java中处理的
接下来就从workspace.java 开始找解决的办法

2.Launcher3禁止拖动图标到Hotseat相关代码分析

packages/apps/Launcher3/src/com/android/launcher3/DropTarget.java
packages/apps/Launcher3/src/com/android/launcher3/Workspace.java

3.Launcher3禁止拖动图标到Hotseat功能分析和实现
3.1DropTarget.java相关拖拽的接口

public interface DropTarget {
 
     class DragObject {        
	  void onDrop(DragObject dragObject, DragOptions options);
  
      void onDragEnter(DragObject dragObject);
  
      void onDragOver(DragObject dragObject);
  
      void onDragExit(DragObject dragObject);
  
      /**
       * Check if a drop action can occur at, or near, the requested location.
       * This will be called just before onDrop.
       * @return True if the drop will be accepted, false otherwise.
       */
      boolean acceptDrop(D

你可能感兴趣的:(android,12.0,Rom定制化系统讲解,android,framewrok,Launcher禁止拖拽,禁止拖拽hotseat,拖拽hotseat)