use of com.android.launcher3.testcomponent.ListViewService.SimpleViewsFactory in project android_packages_apps_Launcher3 by AOSPA.
the class ViewInflationDuringSwipeUp method testSwipeUp_with_list_widgets.
@Test
@NavigationModeSwitch(mode = ZERO_BUTTON)
// until b/190729479 is fixed
@Suppress
public void testSwipeUp_with_list_widgets() {
SimpleViewsFactory viewFactory = new SimpleViewsFactory();
viewFactory.viewCount = 1;
Bundle args = new Bundle();
args.putBinder(EXTRA_VALUE, viewFactory.toBinder());
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, args);
try {
executeSwipeUpTestWithWidget(widgetId -> {
// Initialize widget
RemoteViews views = createMainWidgetViews("List widget title");
views.setRemoteAdapter(android.R.id.list, new Intent(getContext(), ListViewService.class));
AppWidgetManager.getInstance(getContext()).updateAppWidget(widgetId, views);
verifyWidget(viewFactory.getLabel(0));
}, widgetId -> {
// Update widget
viewFactory.viewCount = 2;
AppWidgetManager.getInstance(getContext()).notifyAppWidgetViewDataChanged(widgetId, android.R.id.list);
}, viewFactory.getLabel(1));
} finally {
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, new Bundle());
}
}
use of com.android.launcher3.testcomponent.ListViewService.SimpleViewsFactory in project android_packages_apps_Trebuchet by LineageOS.
the class ViewInflationDuringSwipeUp method testSwipeUp_with_list_widgets.
@Test
@NavigationModeSwitch(mode = ZERO_BUTTON)
public void testSwipeUp_with_list_widgets() {
SimpleViewsFactory viewFactory = new SimpleViewsFactory();
viewFactory.viewCount = 1;
Bundle args = new Bundle();
args.putBinder(EXTRA_VALUE, viewFactory.toBinder());
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, args);
try {
executeSwipeUpTestWithWidget(widgetId -> {
// Initialize widget
RemoteViews views = createMainWidgetViews("List widget title");
views.setRemoteAdapter(android.R.id.list, new Intent(getContext(), ListViewService.class));
AppWidgetManager.getInstance(getContext()).updateAppWidget(widgetId, views);
verifyWidget(viewFactory.getLabel(0));
}, widgetId -> {
// Update widget
viewFactory.viewCount = 2;
AppWidgetManager.getInstance(getContext()).notifyAppWidgetViewDataChanged(widgetId, android.R.id.list);
}, viewFactory.getLabel(1));
} finally {
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, new Bundle());
}
}
use of com.android.launcher3.testcomponent.ListViewService.SimpleViewsFactory in project android_packages_apps_404Launcher by P-404.
the class ViewInflationDuringSwipeUp method testSwipeUp_with_list_widgets.
@Test
@NavigationModeSwitch(mode = ZERO_BUTTON)
// until b/190729479 is fixed
@Suppress
public void testSwipeUp_with_list_widgets() {
SimpleViewsFactory viewFactory = new SimpleViewsFactory();
viewFactory.viewCount = 1;
Bundle args = new Bundle();
args.putBinder(EXTRA_VALUE, viewFactory.toBinder());
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, args);
try {
executeSwipeUpTestWithWidget(widgetId -> {
// Initialize widget
RemoteViews views = createMainWidgetViews("List widget title");
views.setRemoteAdapter(android.R.id.list, new Intent(getContext(), ListViewService.class));
AppWidgetManager.getInstance(getContext()).updateAppWidget(widgetId, views);
verifyWidget(viewFactory.getLabel(0));
}, widgetId -> {
// Update widget
viewFactory.viewCount = 2;
AppWidgetManager.getInstance(getContext()).notifyAppWidgetViewDataChanged(widgetId, android.R.id.list);
}, viewFactory.getLabel(1));
} finally {
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, new Bundle());
}
}
use of com.android.launcher3.testcomponent.ListViewService.SimpleViewsFactory in project android_packages_apps_Launcher3 by crdroidandroid.
the class ViewInflationDuringSwipeUp method testSwipeUp_with_list_widgets.
@Test
@NavigationModeSwitch(mode = ZERO_BUTTON)
// until b/190729479 is fixed
@Suppress
public void testSwipeUp_with_list_widgets() {
SimpleViewsFactory viewFactory = new SimpleViewsFactory();
viewFactory.viewCount = 1;
Bundle args = new Bundle();
args.putBinder(EXTRA_VALUE, viewFactory.toBinder());
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, args);
try {
executeSwipeUpTestWithWidget(widgetId -> {
// Initialize widget
RemoteViews views = createMainWidgetViews("List widget title");
views.setRemoteAdapter(android.R.id.list, new Intent(getContext(), ListViewService.class));
AppWidgetManager.getInstance(getContext()).updateAppWidget(widgetId, views);
verifyWidget(viewFactory.getLabel(0));
}, widgetId -> {
// Update widget
viewFactory.viewCount = 2;
AppWidgetManager.getInstance(getContext()).notifyAppWidgetViewDataChanged(widgetId, android.R.id.list);
}, viewFactory.getLabel(1));
} finally {
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, new Bundle());
}
}
use of com.android.launcher3.testcomponent.ListViewService.SimpleViewsFactory in project android_packages_apps_Launcher3 by ArrowOS.
the class ViewInflationDuringSwipeUp method testSwipeUp_with_list_widgets.
@Test
@NavigationModeSwitch(mode = ZERO_BUTTON)
// until b/190729479 is fixed
@Suppress
public void testSwipeUp_with_list_widgets() {
SimpleViewsFactory viewFactory = new SimpleViewsFactory();
viewFactory.viewCount = 1;
Bundle args = new Bundle();
args.putBinder(EXTRA_VALUE, viewFactory.toBinder());
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, args);
try {
executeSwipeUpTestWithWidget(widgetId -> {
// Initialize widget
RemoteViews views = createMainWidgetViews("List widget title");
views.setRemoteAdapter(android.R.id.list, new Intent(getContext(), ListViewService.class));
AppWidgetManager.getInstance(getContext()).updateAppWidget(widgetId, views);
verifyWidget(viewFactory.getLabel(0));
}, widgetId -> {
// Update widget
viewFactory.viewCount = 2;
AppWidgetManager.getInstance(getContext()).notifyAppWidgetViewDataChanged(widgetId, android.R.id.list);
}, viewFactory.getLabel(1));
} finally {
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, new Bundle());
}
}
Aggregations