Search in sources :

Example 6 with BaseItemDragListener

use of com.android.launcher3.dragndrop.BaseItemDragListener in project android_packages_apps_Launcher3 by ArrowOS.

the class FolderIcon method onDrop.

public void onDrop(DragObject d, boolean itemReturnedOnFailedDrop) {
    WorkspaceItemInfo item;
    if (d.dragInfo instanceof AppInfo) {
        // Came from all apps -- make a copy
        item = ((AppInfo) d.dragInfo).makeWorkspaceItem();
    } else if (d.dragSource instanceof BaseItemDragListener) {
        // Came from a different window -- make a copy
        item = new WorkspaceItemInfo((WorkspaceItemInfo) d.dragInfo);
    } else {
        item = (WorkspaceItemInfo) d.dragInfo;
    }
    mFolder.notifyDrop();
    onDrop(item, d, null, 1.0f, itemReturnedOnFailedDrop ? item.rank : mInfo.contents.size(), itemReturnedOnFailedDrop);
}
Also used : BaseItemDragListener(com.android.launcher3.dragndrop.BaseItemDragListener) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) AppInfo(com.android.launcher3.model.data.AppInfo)

Example 7 with BaseItemDragListener

use of com.android.launcher3.dragndrop.BaseItemDragListener in project android_packages_apps_Launcher3 by AOSPA.

the class FolderIcon method onDrop.

public void onDrop(DragObject d, boolean itemReturnedOnFailedDrop) {
    WorkspaceItemInfo item;
    if (d.dragInfo instanceof AppInfo) {
        // Came from all apps -- make a copy
        item = ((AppInfo) d.dragInfo).makeWorkspaceItem();
    } else if (d.dragSource instanceof BaseItemDragListener) {
        // Came from a different window -- make a copy
        item = new WorkspaceItemInfo((WorkspaceItemInfo) d.dragInfo);
    } else {
        item = (WorkspaceItemInfo) d.dragInfo;
    }
    mFolder.notifyDrop();
    onDrop(item, d, null, 1.0f, itemReturnedOnFailedDrop ? item.rank : mInfo.contents.size(), itemReturnedOnFailedDrop);
}
Also used : BaseItemDragListener(com.android.launcher3.dragndrop.BaseItemDragListener) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) AppInfo(com.android.launcher3.model.data.AppInfo)

Aggregations

BaseItemDragListener (com.android.launcher3.dragndrop.BaseItemDragListener)7 AppInfo (com.android.launcher3.model.data.AppInfo)6 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)6 AppInfo (com.android.launcher3.AppInfo)1 WorkspaceItemInfo (com.android.launcher3.WorkspaceItemInfo)1