summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/util
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2015-10-20 16:24:53 -0700
committerTony Wickham <twickham@google.com>2015-10-20 16:24:53 -0700
commitc2bc0ef1c313698fd931fc84ec2f11882c38cdba (patch)
tree1846072264f70efabbbeb725933664e3d2825197 /src/com/android/launcher3/util
parent93229c40bc1cf31c9864a6e4948b8479790345bc (diff)
downloadandroid_packages_apps_Trebuchet-c2bc0ef1c313698fd931fc84ec2f11882c38cdba.tar.gz
android_packages_apps_Trebuchet-c2bc0ef1c313698fd931fc84ec2f11882c38cdba.tar.bz2
android_packages_apps_Trebuchet-c2bc0ef1c313698fd931fc84ec2f11882c38cdba.zip
Fix regression where keyboard couldn't switch between workspace pages.
Bug: 25122302 Change-Id: Id1d7628753ce7ef37af50e8594e541dcb6bea13e
Diffstat (limited to 'src/com/android/launcher3/util')
-rw-r--r--src/com/android/launcher3/util/FocusLogic.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/com/android/launcher3/util/FocusLogic.java b/src/com/android/launcher3/util/FocusLogic.java
index 696eabe00..27ce3f127 100644
--- a/src/com/android/launcher3/util/FocusLogic.java
+++ b/src/com/android/launcher3/util/FocusLogic.java
@@ -22,9 +22,6 @@ import android.view.View;
import android.view.ViewGroup;
import com.android.launcher3.CellLayout;
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherAppState;
import com.android.launcher3.ShortcutAndWidgetContainer;
import java.util.Arrays;
@@ -51,7 +48,7 @@ public class FocusLogic {
private static final String TAG = "FocusLogic";
private static final boolean DEBUG = false;
- // Item and page index related constant used by {@link #handleKeyEvent}.
+ /** Item and page index related constant used by {@link #handleKeyEvent}. */
public static final int NOOP = -1;
public static final int PREVIOUS_PAGE_RIGHT_COLUMN = -2;
@@ -94,7 +91,7 @@ public class FocusLogic {
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_LEFT:
newIndex = handleDpadHorizontal(iconIdx, cntX, cntY, map, -1 /*increment*/);
- if (isRtl && newIndex == NOOP && pageIndex > 0) {
+ if (!isRtl && newIndex == NOOP && pageIndex > 0) {
newIndex = PREVIOUS_PAGE_RIGHT_COLUMN;
} else if (isRtl && newIndex == NOOP && pageIndex < pageCount - 1) {
newIndex = NEXT_PAGE_RIGHT_COLUMN;
@@ -102,7 +99,7 @@ public class FocusLogic {
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
newIndex = handleDpadHorizontal(iconIdx, cntX, cntY, map, 1 /*increment*/);
- if (isRtl && newIndex == NOOP && pageIndex < pageCount - 1) {
+ if (!isRtl && newIndex == NOOP && pageIndex < pageCount - 1) {
newIndex = NEXT_PAGE_LEFT_COLUMN;
} else if (isRtl && newIndex == NOOP && pageIndex > 0) {
newIndex = PREVIOUS_PAGE_LEFT_COLUMN;