diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2013-06-22 01:27:05 +0200 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2013-06-22 01:27:05 +0200 |
commit | 39060740ee6679a4c6e1757ea78b1b34233eb24e (patch) | |
tree | ba0b7b071e7dab9b9b8bf14102908364e0d13e54 /src | |
parent | 73c303e92d43cb74824f25b8158c65765b1a421b (diff) | |
download | packages_apps_trebuchet-39060740ee6679a4c6e1757ea78b1b34233eb24e.zip packages_apps_trebuchet-39060740ee6679a4c6e1757ea78b1b34233eb24e.tar.gz packages_apps_trebuchet-39060740ee6679a4c6e1757ea78b1b34233eb24e.tar.bz2 |
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')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Hotseat.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java index 5dcbcb1..d5fd0ec 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 |