summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/trebuchet/Hotseat.java
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-06-22 01:27:05 +0200
committerJorge Ruesga <jorge@ruesga.com>2013-06-22 01:27:05 +0200
commit39060740ee6679a4c6e1757ea78b1b34233eb24e (patch)
treeba0b7b071e7dab9b9b8bf14102908364e0d13e54 /src/com/cyanogenmod/trebuchet/Hotseat.java
parent73c303e92d43cb74824f25b8158c65765b1a421b (diff)
downloadpackages_apps_trebuchet-39060740ee6679a4c6e1757ea78b1b34233eb24e.tar.gz
packages_apps_trebuchet-39060740ee6679a4c6e1757ea78b1b34233eb24e.tar.bz2
packages_apps_trebuchet-39060740ee6679a4c6e1757ea78b1b34233eb24e.zip
Trebuchet: Fix Landscape/TransposeLayoutWithOrientation move to default page
Change-Id: I5906ee6af855d9ed17f51e9ee94d53058c67812e JIRA: CYAN-1246 Issue: https://jira.cyanogenmod.org/browse/CYAN-1246 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/Hotseat.java')
-rw-r--r--src/com/cyanogenmod/trebuchet/Hotseat.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java
index 5dcbcb1f..d5fd0ecc 100644
--- a/src/com/cyanogenmod/trebuchet/Hotseat.java
+++ b/src/com/cyanogenmod/trebuchet/Hotseat.java
@@ -30,6 +30,7 @@ import com.cyanogenmod.trebuchet.preference.PreferencesProvider;
public class Hotseat extends PagedView {
private int mCellCount;
+ private int mHotseatPages;
private int mDefaultPage;
private boolean mTransposeLayoutWithOrientation;
@@ -58,10 +59,10 @@ public class Hotseat extends PagedView {
mFadeInAdjacentScreens = false;
mHandleScrollIndicator = true;
- int hotseatPages = PreferencesProvider.Interface.Dock.getNumberPages();
+ mHotseatPages = PreferencesProvider.Interface.Dock.getNumberPages();
int defaultPage = PreferencesProvider.Interface.Dock.getDefaultPage(DEFAULT_PAGE);
- if (defaultPage >= hotseatPages) {
- defaultPage = hotseatPages / 2;
+ if (defaultPage >= mHotseatPages) {
+ defaultPage = mHotseatPages / 2;
}
mCurrentPage = mDefaultPage = defaultPage;
@@ -91,7 +92,7 @@ public class Hotseat extends PagedView {
LayoutInflater inflater =
(LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- for (int i = 0; i < hotseatPages; i++) {
+ for (int i = 0; i < mHotseatPages; i++) {
CellLayout cl = (CellLayout) inflater.inflate(R.layout.hotseat_page, null);
cl.setChildrenScale(childrenScale);
cl.setGridSize((!hasVerticalHotseat() ? mCellCount : 1), (hasVerticalHotseat() ? mCellCount : 1));
@@ -263,12 +264,13 @@ public class Hotseat extends PagedView {
}
void moveToDefaultScreen(boolean animate) {
+ int page = hasVerticalHotseat() ? (mHotseatPages - mDefaultPage - 1) : mDefaultPage;
if (animate) {
- snapToPage(mDefaultPage);
+ snapToPage(page);
} else {
- setCurrentPage(mDefaultPage);
+ setCurrentPage(page);
}
- getChildAt(mDefaultPage).requestFocus();
+ getChildAt(page).requestFocus();
}
@Override