2/ Notify adjust touch slop when one handed mode activated
When one handed mode activated, user swipe-up to exit usually
cross over the NavBar region, and then invoke TouchController
intercept touch event to trigger All Apps drawer on Home.
To enhanced the UX of gesture conflict of exit OHM & All Apps,
notify TouchController throught LauncherActivityInterface,
and Launcher dispatch onOneHandedModeStateChanged() event to
all mTouchControllers in DragLayer that touchController can
adjust the touch slop by it's SingleAxisSwipeDetector.
Test: manual trigger One handed mode and swipe-up to exit
Test: monitor minDisplacement of SingleAxisSwipeDetector
OHM activated : touchSlop x multiplier
OHM deactivated : touchSlop x 1
Test: check All Apps doesn't mis-trigger when exit one handed mode
Bug: 186235522
Change-Id: I7b9e6e7fa898231697d1866186a5f9b1717a9aa3
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 8889e60..299c68f 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -576,6 +576,14 @@
mHotseat.getQsb().setAlpha(1f - visibility);
}
+ /**
+ * Called when one handed mode activated and deactivated.
+ * @param activated true if one handed mode activated, false otherwise.
+ */
+ public void onOneHandedStateChanged(boolean activated) {
+ mDragLayer.onOneHandedModeStateChanged(activated);
+ }
+
private void initDeviceProfile(InvariantDeviceProfile idp) {
// Load configuration-specific DeviceProfile
mDeviceProfile = idp.getDeviceProfile(this);