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


Java UninstallDropTarget類代碼示例

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


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

示例1: initDropTarget

import com.android.launcher3.UninstallDropTarget; //導入依賴的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: addActions

import com.android.launcher3.UninstallDropTarget; //導入依賴的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

示例3: onInitializeAccessibilityNodeInfo

import com.android.launcher3.UninstallDropTarget; //導入依賴的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


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