summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2011-04-22 13:18:53 -0700
committerMarco Nelissen <marcone@google.com>2011-04-22 13:38:17 -0700
commit876668c132e87fb3dfe6b25eb9e07fd7ae896e33 (patch)
tree21ec1cef5b37241b9b2d1cb6d123e3cf627a56fe /src
parent785d2eb2b8d7072c8124300dd9168ff51a91cf38 (diff)
downloadandroid_packages_apps_Trebuchet-876668c132e87fb3dfe6b25eb9e07fd7ae896e33.tar.gz
android_packages_apps_Trebuchet-876668c132e87fb3dfe6b25eb9e07fd7ae896e33.tar.bz2
android_packages_apps_Trebuchet-876668c132e87fb3dfe6b25eb9e07fd7ae896e33.zip
Fixes for landscape AllApps3D
Change-Id: Ib4cbe475d81a0b857d5560592c3db4ba09ec9319
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AllApps3D.java32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java
index 499025443..0e512c6d9 100644
--- a/src/com/android/launcher2/AllApps3D.java
+++ b/src/com/android/launcher2/AllApps3D.java
@@ -155,13 +155,6 @@ public class AllApps3D extends RSSurfaceView
setRenderScriptGL(sRS);
}
- final DisplayMetrics metrics = getResources().getDisplayMetrics();
- final boolean isPortrait = metrics.widthPixels < metrics.heightPixels;
- mColumnsPerPage = isPortrait ? Defines.COLUMNS_PER_PAGE_PORTRAIT :
- Defines.COLUMNS_PER_PAGE_LANDSCAPE;
- mRowsPerPage = isPortrait ? Defines.ROWS_PER_PAGE_PORTRAIT :
- Defines.ROWS_PER_PAGE_LANDSCAPE;
-
if (sRollo != null) {
sRollo.mAllApps = this;
sRollo.mRes = getResources();
@@ -233,6 +226,12 @@ public class AllApps3D extends RSSurfaceView
super.surfaceChanged(holder, format, w, h);
+ final boolean isPortrait = w < h;
+ mColumnsPerPage = isPortrait ? Defines.COLUMNS_PER_PAGE_PORTRAIT :
+ Defines.COLUMNS_PER_PAGE_LANDSCAPE;
+ mRowsPerPage = isPortrait ? Defines.ROWS_PER_PAGE_PORTRAIT :
+ Defines.ROWS_PER_PAGE_LANDSCAPE;
+
if (mSurrendered) return;
mHaveSurface = true;
@@ -1046,13 +1045,16 @@ public class AllApps3D extends RSSurfaceView
i.ScaleOffset.x = (2.f / 480.f);
i.ScaleOffset.y = 0;
i.ScaleOffset.z = -((float)w / 2) - 0.25f;
- i.ScaleOffset.w = -380.25f;
- i.BendPos.x = 120.f;
- i.BendPos.y = 680.f;
- if (w > h) {
- i.ScaleOffset.z = 40.f;
- i.ScaleOffset.w = h - 40.f;
- i.BendPos.y = 1.f;
+ if (w < h) {
+ // portrait
+ i.ScaleOffset.w = -380.25f;
+ i.BendPos.x = 120.f; // bottom of screen
+ i.BendPos.y = h - 82.f; // top of screen
+ } else {
+ // landscape
+ i.ScaleOffset.w = -206.25f;
+ i.BendPos.x = 50.f;
+ i.BendPos.y = h - 30.f;
}
mUniformAlloc.set(i, 0, true);
}
@@ -1092,7 +1094,7 @@ public class AllApps3D extends RSSurfaceView
" float aDy = cos(bendAngle);\n" +
" float aDz = sin(bendAngle);\n" +
- " float scale = (2.0 / 480.0);\n" +
+ " float scale = (2.0 / " + mWidth + ".0);\n" +
" float x = UNI_Position.x + UNI_ImgSize.x * (1.0 - ani) * (ATTRIB_position.x - 0.5);\n" +
" float ys= UNI_Position.y + UNI_ImgSize.y * (1.0 - ani) * ATTRIB_position.y;\n" +
" float y = 0.0;\n" +