Android 13.0 Launcher3 prohibits dragging icons to Hotseat function implementation

1 Overview

In the customized development of Launcher3 of the 13.0 system, for the development of hotseat, the functional requirements require that the function of dragging icons to Hotseat is prohibited, and dragging is also handled in workspace.java< a i=1> Next, let’s start from workspace.java to find a solution

2.Launcher3 prohibits dragging icons to Hotseat related code analysis

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

3.Launcher3 prohibits dragging icons to Hotseat function analysis and implementation

DropTarget is an abstraction of the drop area, which means that when we let go of the gesture drag, we want to place it somewhere, and this place is
DropTarget is an object, and this object can refer to a folder, workspace, delete area, etc.
The workspace (Workspace) refers to the area on the desktop where applications and widgets are displayed, and when dragging When dragging starts, the listener is notified that dragging has started through the callback
 onDragStart(). In Launcher3, the registered dragging listeners include Folder, Workspace,
ButtonDropTarget.java, SecondDropTarget.java, DeleteDropTarget.java, and WidgetHostViewLoader
all have drag-and-drop monitoring interfaces. OnDrop() in the workspace specifically handles related icons after dragging stops. Placed functions

3.1DropTarget.java related drag and drop interface

public interface DropTarget

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/134967346