summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-12-15 15:07:35 -0800
committerMichael Kolb <kolby@google.com>2011-12-15 15:53:58 -0800
commitf5261da39d50e722587772e5c230c4cc19f8decc (patch)
tree4451dbb1ee67ce3f8d40bd6aef4f48bfaeb7bc69
parent08952b047801ed0f00f7433ad238d539b2c22c13 (diff)
downloadpackages_apps_Browser-f5261da39d50e722587772e5c230c4cc19f8decc.zip
packages_apps_Browser-f5261da39d50e722587772e5c230c4cc19f8decc.tar.gz
packages_apps_Browser-f5261da39d50e722587772e5c230c4cc19f8decc.tar.bz2
Make Ctl-Tab and Shift-Ctl-Tab cycle tabs
Bug: 5731975 Change-Id: I1dd44b25f718a2270d5965a8f3f5dab096398856
-rw-r--r--src/com/android/browser/Controller.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 9683a47..c395935 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -2569,8 +2569,11 @@ public class Controller
* returns the current tab if it can't advance
*/
private Tab getNextTab() {
- return mTabControl.getTab(Math.min(mTabControl.getTabCount() - 1,
- mTabControl.getCurrentPosition() + 1));
+ int pos = mTabControl.getCurrentPosition() + 1;
+ if (pos >= mTabControl.getTabCount()) {
+ pos = 0;
+ }
+ return mTabControl.getTab(pos);
}
/**
@@ -2578,8 +2581,11 @@ public class Controller
* returns the current tab if it can't advance
*/
private Tab getPrevTab() {
- return mTabControl.getTab(Math.max(0,
- mTabControl.getCurrentPosition() - 1));
+ int pos = mTabControl.getCurrentPosition() - 1;
+ if ( pos < 0) {
+ pos = mTabControl.getTabCount() - 1;
+ }
+ return mTabControl.getTab(pos);
}
/**