diff options
author | Nebojsa Cvetkovic <nebkat@gmail.com> | 2013-04-18 20:26:01 +0100 |
---|---|---|
committer | Nebojsa Cvetkovic <nebkat@gmail.com> | 2013-04-18 20:29:48 +0100 |
commit | c788c40e64d42f22d76ab70199d3d29fd88e4366 (patch) | |
tree | a8d3f3cd62aca8032dbae5cf4652903f012278e3 /src | |
parent | 16689a8e1b9d86bd15ee0692a60a1b631e0d9874 (diff) | |
download | packages_apps_trebuchet-c788c40e64d42f22d76ab70199d3d29fd88e4366.zip packages_apps_trebuchet-c788c40e64d42f22d76ab70199d3d29fd88e4366.tar.gz packages_apps_trebuchet-c788c40e64d42f22d76ab70199d3d29fd88e4366.tar.bz2 |
Hotseat: Go to default page on home button
Change-Id: I95a85fafa34a7a58c98b9aed5547434f9c4610c7
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Hotseat.java | 13 | ||||
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Launcher.java | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java index 9795c71..9f6441a 100644 --- a/src/com/cyanogenmod/trebuchet/Hotseat.java +++ b/src/com/cyanogenmod/trebuchet/Hotseat.java @@ -32,6 +32,8 @@ import java.util.Arrays; public class Hotseat extends PagedView { private int mCellCount; + private int mDefaultPage; + private boolean mTransposeLayoutWithOrientation; private boolean mIsLandscape; @@ -60,7 +62,7 @@ public class Hotseat extends PagedView { defaultPage = hotseatPages / 2; } - mCurrentPage = defaultPage; + mCurrentPage = mDefaultPage = defaultPage; TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Hotseat, defStyle, 0); @@ -247,6 +249,15 @@ public class Hotseat extends PagedView { } } + void moveToDefaultScreen(boolean animate) { + if (animate) { + snapToPage(mDefaultPage); + } else { + setCurrentPage(mDefaultPage); + } + getChildAt(mDefaultPage).requestFocus(); + } + @Override public void syncPages() { } diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java index db4888e..f90a1eb 100644 --- a/src/com/cyanogenmod/trebuchet/Launcher.java +++ b/src/com/cyanogenmod/trebuchet/Launcher.java @@ -1544,6 +1544,7 @@ public final class Launcher extends Activity if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isTouchActive() && openFolder == null) { mWorkspace.moveToDefaultScreen(true); + mHotseat.moveToDefaultScreen(true); } closeFolder(); |