Loading src/com/android/launcher3/touch/ItemLongClickListener.java +5 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import com.android.launcher3.Launcher; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragOptions; import com.android.launcher3.folder.Folder; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; /** * Class to handle long-clicks on workspace items and start drag as a result. Loading @@ -46,6 +48,7 @@ public class ItemLongClickListener { ItemLongClickListener::onAllAppsItemLongClick; private static boolean onWorkspaceItemLongClick(View v) { TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onWorkspaceItemLongClick"); Launcher launcher = Launcher.getLauncher(v.getContext()); if (!canStartDrag(launcher)) return false; if (!launcher.isInState(NORMAL) && !launcher.isInState(OVERVIEW)) return false; Loading Loading @@ -75,6 +78,8 @@ public class ItemLongClickListener { } private static boolean onAllAppsItemLongClick(View v) { TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onAllAppsItemLongClick"); v.cancelLongPress(); Launcher launcher = Launcher.getLauncher(v.getContext()); if (!canStartDrag(launcher)) return false; // When we have exited all apps or are in transition, disregard long clicks Loading src/com/android/launcher3/touch/WorkspaceTouchListener.java +3 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.Workspace; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.views.OptionsPopupView; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; Loading Loading @@ -165,6 +167,7 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe @Override public void onLongPress(MotionEvent event) { TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Workspace.longPress"); if (mLongPressState == STATE_REQUESTED) { if (canHandleLongPress()) { mLongPressState = STATE_PENDING_PARENT_INFORM; Loading src/com/android/launcher3/widget/BaseWidgetSheet.java +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.dragndrop.DragOptions; import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.ItemLongClickListener; import com.android.launcher3.uioverrides.WallpaperColorInfo; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; Loading Loading @@ -92,6 +94,8 @@ abstract class BaseWidgetSheet extends AbstractSlideInView @Override public boolean onLongClick(View v) { TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick"); v.cancelLongPress(); if (!ItemLongClickListener.canStartDrag(mLauncher)) return false; if (v instanceof WidgetCell) { Loading tests/tapl/com/android/launcher3/tapl/AppIcon.java +7 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import java.util.regex.Pattern; public final class AppIcon extends Launchable { private static final Pattern START_EVENT = Pattern.compile("start:"); private static final Pattern LONG_CLICK_EVENT = Pattern.compile("onAllAppsItemLongClick"); AppIcon(LauncherInstrumentation launcher, UiObject2 icon) { super(launcher, icon); Loading @@ -47,10 +48,15 @@ public final class AppIcon extends Launchable { public AppIconMenu openMenu() { try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) { return new AppIconMenu(mLauncher, mLauncher.clickAndGet( mObject, "deep_shortcuts_container")); mObject, "deep_shortcuts_container", LONG_CLICK_EVENT)); } } @Override protected void addExpectedEventsForLongClick() { mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, LONG_CLICK_EVENT); } @Override protected String getLongPressIndicator() { return "deep_shortcuts_container"; Loading tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java +4 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,10 @@ public class AppIconMenuItem extends Launchable { return mObject.getText(); } @Override protected void addExpectedEventsForLongClick() { } @Override protected String getLongPressIndicator() { return "drop_target_bar"; Loading Loading
src/com/android/launcher3/touch/ItemLongClickListener.java +5 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import com.android.launcher3.Launcher; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragOptions; import com.android.launcher3.folder.Folder; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; /** * Class to handle long-clicks on workspace items and start drag as a result. Loading @@ -46,6 +48,7 @@ public class ItemLongClickListener { ItemLongClickListener::onAllAppsItemLongClick; private static boolean onWorkspaceItemLongClick(View v) { TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onWorkspaceItemLongClick"); Launcher launcher = Launcher.getLauncher(v.getContext()); if (!canStartDrag(launcher)) return false; if (!launcher.isInState(NORMAL) && !launcher.isInState(OVERVIEW)) return false; Loading Loading @@ -75,6 +78,8 @@ public class ItemLongClickListener { } private static boolean onAllAppsItemLongClick(View v) { TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onAllAppsItemLongClick"); v.cancelLongPress(); Launcher launcher = Launcher.getLauncher(v.getContext()); if (!canStartDrag(launcher)) return false; // When we have exited all apps or are in transition, disregard long clicks Loading
src/com/android/launcher3/touch/WorkspaceTouchListener.java +3 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.Workspace; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.views.OptionsPopupView; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; Loading Loading @@ -165,6 +167,7 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe @Override public void onLongPress(MotionEvent event) { TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Workspace.longPress"); if (mLongPressState == STATE_REQUESTED) { if (canHandleLongPress()) { mLongPressState = STATE_PENDING_PARENT_INFORM; Loading
src/com/android/launcher3/widget/BaseWidgetSheet.java +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.dragndrop.DragOptions; import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.ItemLongClickListener; import com.android.launcher3.uioverrides.WallpaperColorInfo; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; Loading Loading @@ -92,6 +94,8 @@ abstract class BaseWidgetSheet extends AbstractSlideInView @Override public boolean onLongClick(View v) { TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick"); v.cancelLongPress(); if (!ItemLongClickListener.canStartDrag(mLauncher)) return false; if (v instanceof WidgetCell) { Loading
tests/tapl/com/android/launcher3/tapl/AppIcon.java +7 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import java.util.regex.Pattern; public final class AppIcon extends Launchable { private static final Pattern START_EVENT = Pattern.compile("start:"); private static final Pattern LONG_CLICK_EVENT = Pattern.compile("onAllAppsItemLongClick"); AppIcon(LauncherInstrumentation launcher, UiObject2 icon) { super(launcher, icon); Loading @@ -47,10 +48,15 @@ public final class AppIcon extends Launchable { public AppIconMenu openMenu() { try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) { return new AppIconMenu(mLauncher, mLauncher.clickAndGet( mObject, "deep_shortcuts_container")); mObject, "deep_shortcuts_container", LONG_CLICK_EVENT)); } } @Override protected void addExpectedEventsForLongClick() { mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, LONG_CLICK_EVENT); } @Override protected String getLongPressIndicator() { return "deep_shortcuts_container"; Loading
tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java +4 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,10 @@ public class AppIconMenuItem extends Launchable { return mObject.getText(); } @Override protected void addExpectedEventsForLongClick() { } @Override protected String getLongPressIndicator() { return "drop_target_bar"; Loading