Search in sources :

Example 26 with AppInfo

use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by AOSPA.

the class AllAppsContainerView method onAppsUpdated.

private void onAppsUpdated() {
    boolean hasWorkApps = false;
    for (AppInfo app : mAllAppsStore.getApps()) {
        if (mWorkManager.getMatcher().matches(app, null)) {
            hasWorkApps = true;
            break;
        }
    }
    mHasWorkApps = hasWorkApps;
    if (!mAH[AdapterHolder.MAIN].appsList.hasFilter()) {
        rebindAdapters();
        if (hasWorkApps) {
            mWorkManager.reset();
        }
    }
}
Also used : AppInfo(com.android.launcher3.model.data.AppInfo)

Example 27 with AppInfo

use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by AOSPA.

the class WidgetsListHeaderViewHolderBinderTest method generateSampleAppHeader.

private WidgetsListHeaderEntry generateSampleAppHeader(String appName, String packageName, int numOfWidgets) {
    PackageItemInfo appInfo = new PackageItemInfo(packageName, UserHandle.CURRENT);
    appInfo.title = appName;
    appInfo.bitmap = BitmapInfo.of(Bitmap.createBitmap(10, 10, Bitmap.Config.ALPHA_8), 0);
    return new WidgetsListHeaderEntry(appInfo, /* titleSectionName= */
    "", generateWidgetItems(packageName, numOfWidgets));
}
Also used : PackageItemInfo(com.android.launcher3.model.data.PackageItemInfo) WidgetsListHeaderEntry(com.android.launcher3.widget.model.WidgetsListHeaderEntry)

Example 28 with AppInfo

use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by AOSPA.

the class WidgetsListSearchHeaderViewHolderBinderTest method generateSampleSearchHeader.

private WidgetsListSearchHeaderEntry generateSampleSearchHeader(String appName, String packageName, int numOfWidgets) {
    PackageItemInfo appInfo = new PackageItemInfo(packageName, UserHandle.CURRENT);
    appInfo.title = appName;
    appInfo.bitmap = BitmapInfo.of(Bitmap.createBitmap(10, 10, Bitmap.Config.ALPHA_8), 0);
    return new WidgetsListSearchHeaderEntry(appInfo, /* titleSectionName= */
    "", generateWidgetItems(packageName, numOfWidgets));
}
Also used : PackageItemInfo(com.android.launcher3.model.data.PackageItemInfo) WidgetsListSearchHeaderEntry(com.android.launcher3.widget.model.WidgetsListSearchHeaderEntry)

Example 29 with AppInfo

use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by AOSPA.

the class LauncherModel method dumpState.

public void dumpState(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    if (args.length > 0 && TextUtils.equals(args[0], "--all")) {
        writer.println(prefix + "All apps list: size=" + mBgAllAppsList.data.size());
        for (AppInfo info : mBgAllAppsList.data) {
            writer.println(prefix + "   title=\"" + info.title + "\" bitmapIcon=" + info.bitmap.icon + " componentName=" + info.componentName.getPackageName());
        }
        writer.println();
    }
    mModelDelegate.dump(prefix, fd, writer, args);
    mBgDataModel.dump(prefix, fd, writer, args);
}
Also used : AppInfo(com.android.launcher3.model.data.AppInfo)

Example 30 with AppInfo

use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by AOSPA.

the class FolderNameProviderTest method setUp.

@Before
public void setUp() {
    mContext = getApplicationContext();
    mItem1 = new WorkspaceItemInfo(new AppInfo(new ComponentName("a.b.c", "a.b.c/a.b.c.d"), "title1", UserHandle.of(10), new Intent().setComponent(new ComponentName("a.b.c", "a.b.c/a.b.c.d"))));
    mItem2 = new WorkspaceItemInfo(new AppInfo(new ComponentName("a.b.c", "a.b.c/a.b.c.d"), "title2", UserHandle.of(10), new Intent().setComponent(new ComponentName("a.b.c", "a.b.c/a.b.c.d"))));
}
Also used : ComponentName(android.content.ComponentName) Intent(android.content.Intent) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) AppInfo(com.android.launcher3.model.data.AppInfo) Before(org.junit.Before)

Aggregations

AppInfo (com.android.launcher3.model.data.AppInfo)181 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)86 ItemInfo (com.android.launcher3.model.data.ItemInfo)46 ArrayList (java.util.ArrayList)46 ComponentName (android.content.ComponentName)36 AppInfo (com.android.launcher3.AppInfo)33 View (android.view.View)32 LauncherActivityInfo (android.content.pm.LauncherActivityInfo)31 Intent (android.content.Intent)30 FolderInfo (com.android.launcher3.model.data.FolderInfo)30 LauncherAppWidgetInfo (com.android.launcher3.model.data.LauncherAppWidgetInfo)30 UserHandle (android.os.UserHandle)21 PackageItemInfo (com.android.launcher3.model.data.PackageItemInfo)21 PendingAddShortcutInfo (com.android.launcher3.widget.PendingAddShortcutInfo)21 Point (android.graphics.Point)19 BubbleTextView (com.android.launcher3.BubbleTextView)19 LauncherApps (android.content.pm.LauncherApps)17 ItemInfoWithIcon (com.android.launcher3.model.data.ItemInfoWithIcon)17 PendingAddItemInfo (com.android.launcher3.PendingAddItemInfo)15 AppWidgetHostView (android.appwidget.AppWidgetHostView)14