Search in sources :

Example 6 with WidgetUtils.createAppWidgetProviderInfo

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

the class WidgetsListTableViewHolderBinderTest 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)

Example 7 with WidgetUtils.createAppWidgetProviderInfo

use of com.android.launcher3.util.WidgetUtils.createAppWidgetProviderInfo in project android_packages_apps_404Launcher by P-404.

the class WidgetsListAdapterTest 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)

Example 8 with WidgetUtils.createAppWidgetProviderInfo

use of com.android.launcher3.util.WidgetUtils.createAppWidgetProviderInfo in project android_packages_apps_404Launcher by P-404.

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)

Example 9 with WidgetUtils.createAppWidgetProviderInfo

use of com.android.launcher3.util.WidgetUtils.createAppWidgetProviderInfo in project android_packages_apps_404Launcher by P-404.

the class WidgetsListHeaderViewHolderBinderTest 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)

Example 10 with WidgetUtils.createAppWidgetProviderInfo

use of com.android.launcher3.util.WidgetUtils.createAppWidgetProviderInfo in project android_packages_apps_404Launcher by P-404.

the class WidgetsListTableViewHolderBinderTest 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