本文整理匯總了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;
}
示例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));
}
}
示例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));
}
}