Android 13.0 Launcher3 prohibits dragging app icons to the first screen

1 Overview

In the customized development of Launcher3 for 13.0 system rom, there will be some requirements for Launcher3. For example, the current requirement is to fix the icons on the first screen of Launcher3 and prevent icons from other screens from being dragged to them< a i=1> First screen So this requirement is similar to disabling dragging icons to Hotseat. We also look for solutions from WorkSpace.java and then implement related functions

2.Launcher3 prohibits dragging app icons to the first screen related code

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

3.Launcher3 prohibits dragging app icons to the first screen and analysis of related functions

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 analysis

 

Guess you like

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