當前位置: 首頁>>代碼示例>>Java>>正文


Java DeleteDropTarget類代碼示例

本文整理匯總了Java中com.android.launcher3.DeleteDropTarget的典型用法代碼示例。如果您正苦於以下問題:Java DeleteDropTarget類的具體用法?Java DeleteDropTarget怎麽用?Java DeleteDropTarget使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DeleteDropTarget類屬於com.android.launcher3包,在下文中一共展示了DeleteDropTarget類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initDropTarget

import com.android.launcher3.DeleteDropTarget; //導入依賴的package包/類
private static Target initDropTarget(View v) {
    Target t = new LauncherLogProto.Target();
    t.type = (v instanceof ButtonDropTarget)? Target.CONTROL : Target.CONTAINER;
    if (t.type == Target.CONTAINER) {
        return t;
    }

    if (v instanceof InfoDropTarget) {
        t.controlType = LauncherLogProto.APPINFO_TARGET;
    } else if (v instanceof UninstallDropTarget) {
        t.controlType = LauncherLogProto.UNINSTALL_TARGET;
    } else if (v instanceof DeleteDropTarget) {
        t.controlType = LauncherLogProto.REMOVE_TARGET;
    }
    return t;
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:17,代碼來源:LoggerUtils.java

示例2: onDropCompleted

import com.android.launcher3.DeleteDropTarget; //導入依賴的package包/類
@Override
public void onDropCompleted(View target, DropTarget.DragObject d, boolean isFlingToDelete,
        boolean success) {
    if (isFlingToDelete || !success || (target != mLauncher.getWorkspace() &&
            !(target instanceof DeleteDropTarget) && !(target instanceof Folder))) {
        // Exit spring loaded mode if we have not successfully dropped or have not handled the
        // drop in Workspace
        mLauncher.exitSpringLoadedDragModeDelayed(true,
                Launcher.EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT, null);
    }
    mLauncher.unlockScreenOrientation(false);

    // Display an error message if the drag failed due to there not being enough space on the
    // target layout we were dropping on.
    if (!success) {
        boolean showOutOfSpaceMessage = false;
        if (target instanceof Workspace && !mLauncher.getDragController().isDeferringDrag()) {
            int currentScreen = mLauncher.getCurrentWorkspaceScreen();
            Workspace workspace = (Workspace) target;
            CellLayout layout = (CellLayout) workspace.getChildAt(currentScreen);
            ItemInfo itemInfo = d.dragInfo;
            if (layout != null) {
                showOutOfSpaceMessage =
                        !layout.findCellForSpan(null, itemInfo.spanX, itemInfo.spanY);
            }
        }
        if (showOutOfSpaceMessage) {
            mLauncher.showOutOfSpaceMessage(false);
        }

        d.deferDragViewCleanupPostAnimation = false;
    }
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:34,代碼來源:AllAppsContainerView.java

示例3: addActions

import com.android.launcher3.DeleteDropTarget; //導入依賴的package包/類
protected void addActions(View host, AccessibilityNodeInfo info) {
    if (!(host.getTag() instanceof ItemInfo)) return;
    ItemInfo item = (ItemInfo) host.getTag();

    if (host instanceof BubbleTextView && ((BubbleTextView) host).hasDeepShortcuts()) {
        info.addAction(mActions.get(DEEP_SHORTCUTS));
    }

    if (DeleteDropTarget.supportsAccessibleDrop(item)) {
        info.addAction(mActions.get(REMOVE));
    }
    if (UninstallDropTarget.supportsDrop(host.getContext(), item)) {
        info.addAction(mActions.get(UNINSTALL));
    }
    if (InfoDropTarget.supportsDrop(item)) {
        info.addAction(mActions.get(INFO));
    }

    if ((item instanceof ShortcutInfo)
            || (item instanceof LauncherAppWidgetInfo)
            || (item instanceof FolderInfo)) {
        info.addAction(mActions.get(MOVE));

        if (item.container >= 0) {
            info.addAction(mActions.get(MOVE_TO_WORKSPACE));
        } else if (item instanceof LauncherAppWidgetInfo) {
            if (!getSupportedResizeActions(host, (LauncherAppWidgetInfo) item).isEmpty()) {
                info.addAction(mActions.get(RESIZE));
            }
        }
    }

    if ((item instanceof AppInfo) || (item instanceof PendingAddItemInfo)) {
        info.addAction(mActions.get(ADD_TO_WORKSPACE));
    }
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:37,代碼來源:LauncherAccessibilityDelegate.java

示例4: onDropCompleted

import com.android.launcher3.DeleteDropTarget; //導入依賴的package包/類
@Override
public void onDropCompleted(View target, DragObject d, boolean isFlingToDelete,
        boolean success) {
    if (LOGD) {
        Log.d(TAG, "onDropCompleted");
    }
    if (isFlingToDelete || !success || (target != mLauncher.getWorkspace() &&
            !(target instanceof DeleteDropTarget) && !(target instanceof Folder))) {
        // Exit spring loaded mode if we have not successfully dropped or have not handled the
        // drop in Workspace
        mLauncher.exitSpringLoadedDragModeDelayed(true,
                Launcher.EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT, null);
    }
    mLauncher.unlockScreenOrientation(false);

    // Display an error message if the drag failed due to there not being enough space on the
    // target layout we were dropping on.
    if (!success) {
        boolean showOutOfSpaceMessage = false;
        if (target instanceof Workspace) {
            int currentScreen = mLauncher.getCurrentWorkspaceScreen();
            Workspace workspace = (Workspace) target;
            CellLayout layout = (CellLayout) workspace.getChildAt(currentScreen);
            ItemInfo itemInfo = d.dragInfo;
            if (layout != null) {
                showOutOfSpaceMessage =
                        !layout.findCellForSpan(null, itemInfo.spanX, itemInfo.spanY);
            }
        }
        if (showOutOfSpaceMessage) {
            mLauncher.showOutOfSpaceMessage(false);
        }
        d.deferDragViewCleanupPostAnimation = false;
    }
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:36,代碼來源:WidgetsContainerView.java

示例5: onDropCompleted

import com.android.launcher3.DeleteDropTarget; //導入依賴的package包/類
@Override
public void onDropCompleted(View target, DropTarget.DragObject d, boolean isFlingToDelete,
        boolean success) {
    if (isFlingToDelete || !success || (target != mLauncher.getWorkspace() &&
            !(target instanceof DeleteDropTarget) && !(target instanceof Folder))) {
        // Exit spring loaded mode if we have not successfully dropped or have not handled the
        // drop in Workspace
        mLauncher.exitSpringLoadedDragModeDelayed(true,
                Launcher.EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT, null);
    }
    mLauncher.unlockScreenOrientation(false);

    // Display an error message if the drag failed due to there not being enough space on the
    // target layout we were dropping on.
    if (!success) {
        boolean showOutOfSpaceMessage = false;
        if (target instanceof Workspace) {
            int currentScreen = mLauncher.getCurrentWorkspaceScreen();
            Workspace workspace = (Workspace) target;
            CellLayout layout = (CellLayout) workspace.getChildAt(currentScreen);
            ItemInfo itemInfo = (ItemInfo) d.dragInfo;
            if (layout != null) {
                showOutOfSpaceMessage =
                        !layout.findCellForSpan(null, itemInfo.spanX, itemInfo.spanY);
            }
        }
        if (showOutOfSpaceMessage) {
            mLauncher.showOutOfSpaceMessage(false);
        }

        d.deferDragViewCleanupPostAnimation = false;
    }
}
 
開發者ID:talentlo,項目名稱:Trebuchet,代碼行數:34,代碼來源:AllAppsContainerView.java

示例6: onInitializeAccessibilityNodeInfo

import com.android.launcher3.DeleteDropTarget; //導入依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    if (!(host.getTag() instanceof ItemInfo)) return;
    ItemInfo item = (ItemInfo) host.getTag();

    if (DeleteDropTarget.supportsDrop(item)) {
        info.addAction(mActions.get(REMOVE));
    }
    if (UninstallDropTarget.supportsDrop(host.getContext(), item)) {
        info.addAction(mActions.get(UNINSTALL));
    }
    if (InfoDropTarget.supportsDrop(host.getContext(), item)) {
        info.addAction(mActions.get(INFO));
    }

    if ((item instanceof ShortcutInfo)
            || (item instanceof LauncherAppWidgetInfo)
            || (item instanceof FolderInfo)) {
        info.addAction(mActions.get(MOVE));

        if (item.container >= 0) {
            info.addAction(mActions.get(MOVE_TO_WORKSPACE));
        } else if (item instanceof LauncherAppWidgetInfo) {
            if (!getSupportedResizeActions(host, (LauncherAppWidgetInfo) item).isEmpty()) {
                info.addAction(mActions.get(RESIZE));
            }
        }
    } if ((item instanceof AppInfo) || (item instanceof PendingAddItemInfo)) {
        info.addAction(mActions.get(ADD_TO_WORKSPACE));
    }
}
 
開發者ID:talentlo,項目名稱:Trebuchet,代碼行數:33,代碼來源:LauncherAccessibilityDelegate.java

示例7: onDropCompleted

import com.android.launcher3.DeleteDropTarget; //導入依賴的package包/類
@Override
public void onDropCompleted(View target, DragObject d, boolean isFlingToDelete,
        boolean success) {
    if (isFlingToDelete || !success || (target != mLauncher.getWorkspace() &&
            !(target instanceof DeleteDropTarget) && !(target instanceof Folder))) {
        // Exit spring loaded mode if we have not successfully dropped or have not handled the
        // drop in Workspace
        mLauncher.exitSpringLoadedDragModeDelayed(true,
                Launcher.EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT, null);
    }
    mLauncher.unlockScreenOrientation(false);

    // Display an error message if the drag failed due to there not being enough space on the
    // target layout we were dropping on.
    if (!success) {
        boolean showOutOfSpaceMessage = false;
        if (target instanceof Workspace) {
            int currentScreen = mLauncher.getCurrentWorkspaceScreen();
            Workspace workspace = (Workspace) target;
            CellLayout layout = (CellLayout) workspace.getChildAt(currentScreen);
            ItemInfo itemInfo = (ItemInfo) d.dragInfo;
            if (layout != null) {
                showOutOfSpaceMessage =
                        !layout.findCellForSpan(null, itemInfo.spanX, itemInfo.spanY);
            }
        }
        if (showOutOfSpaceMessage) {
            mLauncher.showOutOfSpaceMessage(false);
        }
        d.deferDragViewCleanupPostAnimation = false;
    }
}
 
開發者ID:talentlo,項目名稱:Trebuchet,代碼行數:33,代碼來源:WidgetsContainerView.java


注:本文中的com.android.launcher3.DeleteDropTarget類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。