Search in sources :

Example 16 with WidgetUtils.createAppWidgetProviderInfo

use of com.android.launcher3.util.WidgetUtils.createAppWidgetProviderInfo in project android_packages_apps_Launcher3 by AOSPA.

the class WidgetsListSearchHeaderViewHolderBinderTest method generateWidgetItems.

private List<WidgetItem> generateWidgetItems(String packageName, int numOfWidgets) {
    ArrayList<WidgetItem> widgetItems = new ArrayList<>();
    for (int i = 0; i < numOfWidgets; i++) {
        ComponentName cn = ComponentName.createRelative(packageName, ".SampleWidget" + i);
        AppWidgetProviderInfo widgetInfo = WidgetUtils.createAppWidgetProviderInfo(cn);
        widgetItems.add(new WidgetItem(LauncherAppWidgetProviderInfo.fromProviderInfo(mContext, widgetInfo), mTestProfile, mIconCache));
    }
    return widgetItems;
}
Also used : ArrayList(java.util.ArrayList) AppWidgetProviderInfo(android.appwidget.AppWidgetProviderInfo) LauncherAppWidgetProviderInfo(com.android.launcher3.widget.LauncherAppWidgetProviderInfo) WidgetItem(com.android.launcher3.model.WidgetItem) ComponentName(android.content.ComponentName)

Aggregations

AppWidgetProviderInfo (android.appwidget.AppWidgetProviderInfo)16 ComponentName (android.content.ComponentName)16 WidgetItem (com.android.launcher3.model.WidgetItem)16 LauncherAppWidgetProviderInfo (com.android.launcher3.widget.LauncherAppWidgetProviderInfo)16 ArrayList (java.util.ArrayList)16