use of com.android.launcher3.Launcher in project android_packages_apps_Launcher3 by crdroidandroid.
the class Launcher method dump.
/**
* $ adb shell dumpsys activity com.android.launcher3.Launcher [--all]
*/
@Override
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
super.dump(prefix, fd, writer, args);
if (args.length > 0 && TextUtils.equals(args[0], "--all")) {
writer.println(prefix + "Workspace Items");
for (int i = 0; i < mWorkspace.getPageCount(); i++) {
writer.println(prefix + " Homescreen " + i);
ViewGroup layout = ((CellLayout) mWorkspace.getPageAt(i)).getShortcutsAndWidgets();
for (int j = 0; j < layout.getChildCount(); j++) {
Object tag = layout.getChildAt(j).getTag();
if (tag != null) {
writer.println(prefix + " " + tag.toString());
}
}
}
writer.println(prefix + " Hotseat");
ViewGroup layout = mHotseat.getShortcutsAndWidgets();
for (int j = 0; j < layout.getChildCount(); j++) {
Object tag = layout.getChildAt(j).getTag();
if (tag != null) {
writer.println(prefix + " " + tag.toString());
}
}
}
writer.println(prefix + "Misc:");
dumpMisc(prefix + "\t", writer);
writer.println(prefix + "\tmWorkspaceLoading=" + mWorkspaceLoading);
writer.println(prefix + "\tmPendingRequestArgs=" + mPendingRequestArgs + " mPendingActivityResult=" + mPendingActivityResult);
writer.println(prefix + "\tmRotationHelper: " + mRotationHelper);
writer.println(prefix + "\tmAppWidgetHost.isListening: " + mAppWidgetHost.isListening());
// Extra logging for general debugging
mDragLayer.dump(prefix, writer);
mStateManager.dump(prefix, writer);
mPopupDataProvider.dump(prefix, writer);
mDeviceProfile.dump(prefix, writer);
try {
FileLog.flushAll(writer);
} catch (Exception e) {
// Ignore
}
mModel.dumpState(prefix, fd, writer, args);
if (mLauncherCallbacks != null) {
mLauncherCallbacks.dump(prefix, fd, writer, args);
}
mOverlayManager.dump(prefix, writer);
}
use of com.android.launcher3.Launcher in project android_packages_apps_Launcher3 by crdroidandroid.
the class LauncherUIScrollTest method testWidgetsListScroll.
@Test
public void testWidgetsListScroll() throws Exception {
// Install 100 widgets
for (int i = 0; i < 100; i++) {
mModelHelper.installCustomShortcut(TEST_PACKAGE + i, "shortcutProvider");
}
// Bind and open widgets
Launcher launcher = loadLauncher();
WidgetsFullSheet widgets = WidgetsFullSheet.show(launcher, false);
doLayout(launcher);
int currentScroll = widgets.getRecyclerView().getCurrentScrollY();
launcher.dispatchGenericMotionEvent(createScrollEvent(-1));
int newScroll = widgets.getRecyclerView().getCurrentScrollY();
assertNotEquals("Widgets was not scrolled", currentScroll, newScroll);
assertEquals("Workspace was scrolled", 0, launcher.getWorkspace().getNextPage());
}
use of com.android.launcher3.Launcher 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.Launcher in project android_packages_apps_Launcher3 by crdroidandroid.
the class AppWidgetResizeFrame method showForWidget.
public static void showForWidget(LauncherAppWidgetHostView widget, CellLayout cellLayout) {
Launcher launcher = Launcher.getLauncher(cellLayout.getContext());
AbstractFloatingView.closeAllOpenViews(launcher);
DragLayer dl = launcher.getDragLayer();
AppWidgetResizeFrame frame = (AppWidgetResizeFrame) launcher.getLayoutInflater().inflate(R.layout.app_widget_resize_frame, dl, false);
if (widget.hasEnforcedCornerRadius()) {
float enforcedCornerRadius = widget.getEnforcedCornerRadius();
ImageView imageView = frame.findViewById(R.id.widget_resize_frame);
Drawable d = imageView.getDrawable();
if (d instanceof GradientDrawable) {
GradientDrawable gd = (GradientDrawable) d.mutate();
gd.setCornerRadius(enforcedCornerRadius);
}
}
frame.setupForWidget(widget, cellLayout, dl);
((DragLayer.LayoutParams) frame.getLayoutParams()).customPosition = true;
dl.addView(frame);
frame.mIsOpen = true;
frame.snapToWidget(false);
}
use of com.android.launcher3.Launcher in project android_packages_apps_Launcher3 by crdroidandroid.
the class TaplTestsLauncher3 method testAppIconLaunchFromAllAppsFromHome.
@Test
@PortraitLandscape
public void testAppIconLaunchFromAllAppsFromHome() throws Exception {
final AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
assertTrue("Launcher internal state is not All Apps", isInState(() -> LauncherState.ALL_APPS));
runIconLaunchFromAllAppsTest(this, allApps);
}
Aggregations