use of com.android.launcher3.folder.FolderPagedView in project android_packages_apps_Launcher3 by crdroidandroid.
the class LauncherUIScrollTest method testFolderPageScroll.
@Test
public void testFolderPageScroll() throws Exception {
// Add a folder with multiple icons
FolderBuilder fb = mLayoutBuilder.atWorkspace(mIdp.numColumns / 2, mIdp.numRows / 2, 0).putFolder(0);
for (int i = 0; i < 100; i++) {
fb.addApp(TEST_PACKAGE, TEST_PACKAGE);
}
// Bind and open folder
Launcher launcher = loadLauncher();
doLayout(launcher);
launcher.getWorkspace().getFirstMatch((i, v) -> v instanceof FolderIcon).performClick();
ShadowLooper.idleMainLooper();
doLayout(launcher);
FolderPagedView folderPages = Folder.getOpen(launcher).getContent();
assertEquals(0, folderPages.getNextPage());
launcher.dispatchGenericMotionEvent(createScrollEvent(-1));
assertNotEquals("Folder page was not scrolled", 0, folderPages.getNextPage());
assertEquals("Workspace was scrolled", 0, launcher.getWorkspace().getNextPage());
}
use of com.android.launcher3.folder.FolderPagedView in project android_packages_apps_Trebuchet by LineageOS.
the class LauncherUIScrollTest method testFolderPageScroll.
@Test
public void testFolderPageScroll() throws Exception {
// Add a folder with multiple icons
FolderBuilder fb = mLayoutBuilder.atWorkspace(mIdp.numColumns / 2, mIdp.numRows / 2, 0).putFolder(0);
for (int i = 0; i < 100; i++) {
fb.addApp(TEST_PACKAGE, TEST_PACKAGE);
}
// Bind and open folder
Launcher launcher = loadLauncher();
doLayout(launcher);
launcher.getWorkspace().getFirstMatch((i, v) -> v instanceof FolderIcon).performClick();
ShadowLooper.idleMainLooper();
doLayout(launcher);
FolderPagedView folderPages = Folder.getOpen(launcher).getContent();
assertEquals(0, folderPages.getNextPage());
launcher.dispatchGenericMotionEvent(createScrollEvent(-1));
assertNotEquals("Folder page was not scrolled", 0, folderPages.getNextPage());
assertEquals("Workspace was scrolled", 0, launcher.getWorkspace().getNextPage());
}
Aggregations