diff options
author | Romain Guy <romainguy@android.com> | 2010-03-04 12:15:37 -0800 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2010-03-04 12:15:37 -0800 |
commit | ce11585bb420b0bd49fa08d6fab5e0f0e210d81c (patch) | |
tree | f6237426b17aa6c030a7bb8365f9b70b355cbf5f /src/com/android/launcher2/AllApps3D.java | |
parent | 4f20947fd6b5c788aa0798a6227b29f662d9d8ea (diff) | |
download | packages_apps_trebuchet-ce11585bb420b0bd49fa08d6fab5e0f0e210d81c.zip packages_apps_trebuchet-ce11585bb420b0bd49fa08d6fab5e0f0e210d81c.tar.gz packages_apps_trebuchet-ce11585bb420b0bd49fa08d6fab5e0f0e210d81c.tar.bz2 |
Make the Home on screen button work in landscape.
Diffstat (limited to 'src/com/android/launcher2/AllApps3D.java')
-rw-r--r-- | src/com/android/launcher2/AllApps3D.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java index 59bda67..ac4b52c 100644 --- a/src/com/android/launcher2/AllApps3D.java +++ b/src/com/android/launcher2/AllApps3D.java @@ -481,10 +481,12 @@ public class AllApps3D extends RSSurfaceView int x = (int)ev.getX(); int y = (int)ev.getY(); + final boolean isPortrait = getWidth() < getHeight(); int action = ev.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: - if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) { + if ((isPortrait && y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) || + (!isPortrait && x > mRollo.mTouchXBorders[mRollo.mTouchXBorders.length-1])) { mTouchTracking = TRACKING_HOME; mRollo.setHomeSelected(SELECTED_PRESSED); mRollo.mState.save(); @@ -518,7 +520,9 @@ public class AllApps3D extends RSSurfaceView case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_OUTSIDE: if (mTouchTracking == TRACKING_HOME) { - mRollo.setHomeSelected(y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1] + mRollo.setHomeSelected((isPortrait && + y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) || (!isPortrait + && x > mRollo.mTouchXBorders[mRollo.mTouchXBorders.length-1]) ? SELECTED_PRESSED : SELECTED_NONE); mRollo.mState.save(); } else if (mTouchTracking == TRACKING_FLING) { @@ -556,7 +560,8 @@ public class AllApps3D extends RSSurfaceView case MotionEvent.ACTION_CANCEL: if (mTouchTracking == TRACKING_HOME) { if (action == MotionEvent.ACTION_UP) { - if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) { + if ((isPortrait && y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length-1]) || + (!isPortrait && x > mRollo.mTouchXBorders[mRollo.mTouchXBorders.length-1])) { reallyPlaySoundEffect(SoundEffectConstants.CLICK); mLauncher.closeAllApps(true); } |