Search in sources :

Example 1 with InstantAppResolver

use of com.android.launcher3.util.InstantAppResolver in project android_packages_apps_Trebuchet by LineageOS.

the class LoggerUtils method newItemTarget.

public static Target newItemTarget(ItemInfo info, InstantAppResolver instantAppResolver) {
    Target t = newTarget(Target.Type.ITEM);
    switch(info.itemType) {
        case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
            t.itemType = (instantAppResolver != null && info instanceof AppInfo && instantAppResolver.isInstantApp(((AppInfo) info))) ? ItemType.WEB_APP : ItemType.APP_ICON;
            t.predictedRank = DEFAULT_PREDICTED_RANK;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
            t.itemType = ItemType.SHORTCUT;
            t.predictedRank = DEFAULT_PREDICTED_RANK;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
            t.itemType = ItemType.FOLDER_ICON;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
            t.itemType = ItemType.WIDGET;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT:
            t.itemType = ItemType.DEEPSHORTCUT;
            t.predictedRank = DEFAULT_PREDICTED_RANK;
            break;
    }
    return t;
}
Also used : Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) ButtonDropTarget(com.android.launcher3.ButtonDropTarget) AppInfo(com.android.launcher3.model.data.AppInfo)

Example 2 with InstantAppResolver

use of com.android.launcher3.util.InstantAppResolver in project Neo-Launcher by NeoApplications.

the class LoggerUtils method newItemTarget.

public static Target newItemTarget(ItemInfo info, InstantAppResolver instantAppResolver) {
    Target t = newTarget(Target.Type.ITEM);
    switch(info.itemType) {
        case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
            t.itemType = (instantAppResolver != null && info instanceof AppInfo && instantAppResolver.isInstantApp(((AppInfo) info))) ? ItemType.WEB_APP : ItemType.APP_ICON;
            t.predictedRank = DEFAULT_PREDICTED_RANK;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
            t.itemType = ItemType.SHORTCUT;
            t.predictedRank = DEFAULT_PREDICTED_RANK;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
            t.itemType = ItemType.FOLDER_ICON;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
            t.itemType = ItemType.WIDGET;
            break;
        case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT:
            t.itemType = ItemType.DEEPSHORTCUT;
            t.predictedRank = DEFAULT_PREDICTED_RANK;
            break;
    }
    return t;
}
Also used : Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) ButtonDropTarget(com.android.launcher3.ButtonDropTarget) AppInfo(com.android.launcher3.AppInfo)

Aggregations

ButtonDropTarget (com.android.launcher3.ButtonDropTarget)2 Target (com.android.launcher3.userevent.nano.LauncherLogProto.Target)2 AppInfo (com.android.launcher3.AppInfo)1 AppInfo (com.android.launcher3.model.data.AppInfo)1