Search in sources :

Example 1 with CONTAINER_ALL_APPS

use of com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS in project android_packages_apps_Trebuchet by LineageOS.

the class SecondaryDisplayLauncher method onIconClicked.

private void onIconClicked(View v) {
    // view has detached (it's possible for this to happen if the view is removed mid touch).
    if (v.getWindowToken() == null)
        return;
    Object tag = v.getTag();
    if (tag instanceof ItemInfo) {
        ItemInfo item = (ItemInfo) tag;
        Intent intent;
        if (item instanceof PromiseAppInfo) {
            PromiseAppInfo promiseAppInfo = (PromiseAppInfo) item;
            intent = promiseAppInfo.getMarketIntent(this);
        } else {
            intent = item.getIntent();
        }
        if (intent == null) {
            throw new IllegalArgumentException("Input must have a valid intent");
        }
        startActivitySafely(v, intent, item, CONTAINER_ALL_APPS);
    }
}
Also used : ItemInfo(com.android.launcher3.model.data.ItemInfo) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) PromiseAppInfo(com.android.launcher3.model.data.PromiseAppInfo) Intent(android.content.Intent)

Example 2 with CONTAINER_ALL_APPS

use of com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS in project Neo-Launcher by NeoApplications.

the class ItemClickHandler method onClick.

private static void onClick(View v, String sourceContainer) {
    // view has detached (it's possible for this to happen if the view is removed mid touch).
    if (v.getWindowToken() == null)
        return;
    Launcher launcher = Launcher.getLauncher(v.getContext());
    if (!launcher.getWorkspace().isFinishedSwitchingState())
        return;
    Object tag = v.getTag();
    if (tag instanceof WorkspaceItemInfo) {
        onClickAppShortcut(v, (WorkspaceItemInfo) tag, launcher, sourceContainer);
    } else if (tag instanceof FolderInfo) {
        if (v instanceof FolderIcon) {
            onClickFolderIcon(v);
        }
    } else if (tag instanceof AppInfo) {
        startAppShortcutOrInfoActivity(v, (AppInfo) tag, launcher, sourceContainer == null ? CONTAINER_ALL_APPS : sourceContainer);
        if (Utilities.getOmegaPrefs(launcher).getSortMode() == Config.SORT_MOST_USED) {
            Utilities.getOmegaPrefs(launcher).updateSortApps();
            Log.d(TAG, "Sort Mode Most Used");
        }
    } else if (tag instanceof LauncherAppWidgetInfo) {
        if (v instanceof PendingAppWidgetHostView) {
            onClickPendingWidget((PendingAppWidgetHostView) v, launcher);
        }
    }
}
Also used : FolderIcon(com.android.launcher3.folder.FolderIcon) Launcher(com.android.launcher3.Launcher) LauncherAppWidgetInfo(com.android.launcher3.LauncherAppWidgetInfo) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) FolderInfo(com.android.launcher3.FolderInfo) WorkspaceItemInfo(com.android.launcher3.WorkspaceItemInfo) AppInfo(com.android.launcher3.AppInfo) PromiseAppInfo(com.android.launcher3.PromiseAppInfo)

Example 3 with CONTAINER_ALL_APPS

use of com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS in project android_packages_apps_Trebuchet by LineageOS.

the class ItemClickHandler method onClick.

private static void onClick(View v, String sourceContainer) {
    // view has detached (it's possible for this to happen if the view is removed mid touch).
    if (v.getWindowToken() == null)
        return;
    Launcher launcher = Launcher.getLauncher(v.getContext());
    if (!launcher.getWorkspace().isFinishedSwitchingState())
        return;
    Object tag = v.getTag();
    if (tag instanceof WorkspaceItemInfo) {
        onClickAppShortcut(v, (WorkspaceItemInfo) tag, launcher, sourceContainer);
    } else if (tag instanceof FolderInfo) {
        if (v instanceof FolderIcon) {
            onClickFolderIcon(v);
        }
    } else if (tag instanceof AppInfo) {
        startAppShortcutOrInfoActivity(v, (AppInfo) tag, launcher, sourceContainer == null ? CONTAINER_ALL_APPS : sourceContainer);
    } else if (tag instanceof LauncherAppWidgetInfo) {
        if (v instanceof PendingAppWidgetHostView) {
            onClickPendingWidget((PendingAppWidgetHostView) v, launcher);
        }
    }
}
Also used : FolderIcon(com.android.launcher3.folder.FolderIcon) Launcher(com.android.launcher3.Launcher) LauncherAppWidgetInfo(com.android.launcher3.model.data.LauncherAppWidgetInfo) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) FolderInfo(com.android.launcher3.model.data.FolderInfo) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) AppInfo(com.android.launcher3.model.data.AppInfo) PromiseAppInfo(com.android.launcher3.model.data.PromiseAppInfo)

Aggregations

Launcher (com.android.launcher3.Launcher)2 FolderIcon (com.android.launcher3.folder.FolderIcon)2 PromiseAppInfo (com.android.launcher3.model.data.PromiseAppInfo)2 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)2 PendingAppWidgetHostView (com.android.launcher3.widget.PendingAppWidgetHostView)2 Intent (android.content.Intent)1 AppInfo (com.android.launcher3.AppInfo)1 FolderInfo (com.android.launcher3.FolderInfo)1 LauncherAppWidgetInfo (com.android.launcher3.LauncherAppWidgetInfo)1 PromiseAppInfo (com.android.launcher3.PromiseAppInfo)1 WorkspaceItemInfo (com.android.launcher3.WorkspaceItemInfo)1 AppInfo (com.android.launcher3.model.data.AppInfo)1 FolderInfo (com.android.launcher3.model.data.FolderInfo)1 ItemInfo (com.android.launcher3.model.data.ItemInfo)1 LauncherAppWidgetInfo (com.android.launcher3.model.data.LauncherAppWidgetInfo)1