diff options
author | Matt Garnes <matt@cyngn.com> | 2014-06-27 16:56:22 -0700 |
---|---|---|
committer | Matt Garnes <matt@cyngn.com> | 2014-06-28 01:07:07 +0000 |
commit | 26372e7875f3128672d9a74632942848ab7ab43d (patch) | |
tree | f46e711cb6baac9a33c5caee8725991fd04c1ff7 /src/com/android | |
parent | 0b0c09f1aabdafe8e134174e74b739754d64ccce (diff) | |
download | android_packages_apps_Trebuchet-26372e7875f3128672d9a74632942848ab7ab43d.tar.gz android_packages_apps_Trebuchet-26372e7875f3128672d9a74632942848ab7ab43d.tar.bz2 android_packages_apps_Trebuchet-26372e7875f3128672d9a74632942848ab7ab43d.zip |
Fix GEL integration for RTL mode.
In RTL mode, the Google Now activity starts to the right,
so to return to Trebuchet, the left edge must be swiped.
Change-Id: Ib8869570307b6186e7e9ea19520ed21418a175fb
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher3/GelIntegrationHelper.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/GelIntegrationHelper.java b/src/com/android/launcher3/GelIntegrationHelper.java index 6dd9c0e32..f43e7e6a0 100644 --- a/src/com/android/launcher3/GelIntegrationHelper.java +++ b/src/com/android/launcher3/GelIntegrationHelper.java @@ -22,6 +22,7 @@ public class GelIntegrationHelper { private static final String GEL_PACKAGE_NAME = "com.google.android.googlequicksearchbox"; private static final int EDGE_GESTURE_SERVICE_RIGHT_EDGE = 4; + private static final int EDGE_GESTURE_SERVICE_LEFT_EDGE = 1; private static final int EDGE_GESTURE_SERVICE_NO_EDGE = -1; private EdgeGestureManager.EdgeGestureActivationListener mEdgeGestureActivationListener = null; @@ -42,7 +43,7 @@ public class GelIntegrationHelper { * 2. Starts the Google Now Activity with an exit_out_right transition animation so that * the new Activity appears to slide in as another screen (similar to GEL). */ - public void registerSwipeBackGestureListenerAndStartGel(final Activity launcherActivity) { + public void registerSwipeBackGestureListenerAndStartGel(final Activity launcherActivity, boolean isLayoutRtl) { EdgeGestureManager edgeGestureManager = EdgeGestureManager.getInstance(); if(mEdgeGestureActivationListener == null) { mEdgeGestureActivationListener = new EdgeGestureManager.EdgeGestureActivationListener() { @@ -74,8 +75,9 @@ public class GelIntegrationHelper { edgeGestureManager.setEdgeGestureActivationListener(mEdgeGestureActivationListener); } mEdgeGestureActivationListener.restoreListenerState(); + int edge = isLayoutRtl ? EDGE_GESTURE_SERVICE_LEFT_EDGE : EDGE_GESTURE_SERVICE_RIGHT_EDGE; edgeGestureManager.updateEdgeGestureActivationListener(mEdgeGestureActivationListener, - EDGE_GESTURE_SERVICE_RIGHT_EDGE); + edge); // Start the Google Now Activity Intent i = new Intent(INTENT_ACTION_ASSIST); diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 0f8ce9a20..ab3f1daa0 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -608,7 +608,7 @@ public class Launcher extends Activity public void onCustomContentLaunch() { if(isGelIntegrationEnabled() && isGelIntegrationSupported()) { - GelIntegrationHelper.getInstance().registerSwipeBackGestureListenerAndStartGel(this); + GelIntegrationHelper.getInstance().registerSwipeBackGestureListenerAndStartGel(this, mWorkspace.isLayoutRtl()); } } |