Search in sources :

Example 1 with BaseItemDragListener

use of com.android.launcher3.dragndrop.BaseItemDragListener in project Neo-Launcher by NeoApplications.

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.dragView, null, 1.0f, itemReturnedOnFailedDrop ? item.rank : mInfo.contents.size(), itemReturnedOnFailedDrop);
}
Also used : BaseItemDragListener(com.android.launcher3.dragndrop.BaseItemDragListener) WorkspaceItemInfo(com.android.launcher3.WorkspaceItemInfo) AppInfo(com.android.launcher3.AppInfo)

Example 2 with BaseItemDragListener

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

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 3 with BaseItemDragListener

use of com.android.launcher3.dragndrop.BaseItemDragListener in project android_packages_apps_404Launcher by P-404.

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 4 with BaseItemDragListener

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

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 5 with BaseItemDragListener

use of com.android.launcher3.dragndrop.BaseItemDragListener in project android_packages_apps_Trebuchet by LineageOS.

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