summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/raw/allapps.rs53
-rw-r--r--src/com/android/launcher2/AllAppsView.java23
2 files changed, 56 insertions, 20 deletions
diff --git a/res/raw/allapps.rs b/res/raw/allapps.rs
index ab79768fa..1d4aed3c7 100644
--- a/res/raw/allapps.rs
+++ b/res/raw/allapps.rs
@@ -257,10 +257,21 @@ draw_home_button()
{
setColor(1.0f, 1.0f, 1.0f, 1.0f);
bindTexture(NAMED_PFTexNearest, 0, state->homeButtonId);
- float x = (SCREEN_WIDTH_PX - params->homeButtonTextureWidth) / 2;
- float y = -g_Animation * params->homeButtonTextureHeight;
- y -= 30; // move the house to the edge of the screen as it doesn't fill the texture.
+ float w = getWidth();
+ float h = getHeight();
+
+ float x;
+ float y;
+ if (getWidth() > getHeight()) {
+ x = w - (params->homeButtonTextureWidth * (1 - g_Animation)) + 20;
+ y = (h - params->homeButtonTextureHeight) * 0.5f;
+ } else {
+ x = (w - params->homeButtonTextureWidth) / 2;
+ y = -g_Animation * params->homeButtonTextureHeight;
+ y -= 30; // move the house to the edge of the screen as it doesn't fill the texture.
+ }
+
drawSpriteScreenspace(x, y, 0, params->homeButtonTextureWidth, params->homeButtonTextureHeight);
}
@@ -271,50 +282,58 @@ void drawFrontGrid(float rowOffset, float p)
int intRowOffset = rowOffset;
float rowFrac = rowOffset - intRowOffset;
- float colWidth = getWidth() / 4;
+ float colWidth = 120.f;//getWidth() / 4;
float rowHeight = colWidth + 25.f;
float yoff = 0.5f * h + 1.5f * rowHeight;
int row, col;
- int iconNum = (intRowOffset - 5) * 4;
+ int colCount = 4;
+ if (w > h) {
+ colCount = 6;
+ rowHeight -= 12.f;
+ yoff = 0.47f * h + 1.0f * rowHeight;
+ }
+
+ int iconNum = (intRowOffset - 5) * colCount;
+
bindProgramVertex(NAMED_PVCurve);
- storeF(ALLOC_VP_CONSTANTS, 4, p);
+ vpConstants->Position.z = p;
setColor(1.0f, 1.0f, 1.0f, 1.0f);
for (row = -5; row < 15; row++) {
float y = yoff - ((-rowFrac + row) * rowHeight);
- for (col=0; col < 4; col++) {
+ for (col=0; col < colCount; col++) {
if (iconNum >= state->iconCount) {
return;
}
if (iconNum >= 0) {
float x = colWidth * col + (colWidth / 2);
- storeF(ALLOC_VP_CONSTANTS, 2, x);
+ vpConstants->Position.x = x;
if (state->selectedIconIndex == iconNum && !p) {
bindProgramFragment(NAMED_PFTexNearest);
bindTexture(NAMED_PFTexNearest, 0, state->selectedIconTexture);
- storeF(ALLOC_VP_CONSTANTS, 0, SELECTION_TEXTURE_WIDTH_PX);
- storeF(ALLOC_VP_CONSTANTS, 1, SELECTION_TEXTURE_HEIGHT_PX);
- storeF(ALLOC_VP_CONSTANTS, 3, y - (SELECTION_TEXTURE_HEIGHT_PX - ICON_TEXTURE_HEIGHT_PX) * 0.5f);
+ vpConstants->ImgSize.x = SELECTION_TEXTURE_WIDTH_PX;
+ vpConstants->ImgSize.y = SELECTION_TEXTURE_HEIGHT_PX;
+ vpConstants->Position.y = y - (SELECTION_TEXTURE_HEIGHT_PX - ICON_TEXTURE_HEIGHT_PX) * 0.5f;
drawSimpleMesh(NAMED_SMCell);
}
bindProgramFragment(NAMED_PFTexMip);
- storeF(ALLOC_VP_CONSTANTS, 0, ICON_TEXTURE_WIDTH_PX);
- storeF(ALLOC_VP_CONSTANTS, 1, ICON_TEXTURE_HEIGHT_PX);
- storeF(ALLOC_VP_CONSTANTS, 3, y);
+ vpConstants->ImgSize.x = ICON_TEXTURE_WIDTH_PX;
+ vpConstants->ImgSize.y = ICON_TEXTURE_HEIGHT_PX;
+ vpConstants->Position.y = y;
bindTexture(NAMED_PFTexMip, 0, loadI32(ALLOC_ICON_IDS, iconNum));
drawSimpleMesh(NAMED_SMCell);
bindProgramFragment(NAMED_PFTexMipAlpha);
- storeF(ALLOC_VP_CONSTANTS, 0, 128.f);
- storeF(ALLOC_VP_CONSTANTS, 1, 64.f);
- storeF(ALLOC_VP_CONSTANTS, 3, y - 64.f);
+ vpConstants->ImgSize.x = 120.f;
+ vpConstants->ImgSize.y = 64.f;
+ vpConstants->Position.y = y - 64.f;
bindTexture(NAMED_PFTexMipAlpha, 0, loadI32(ALLOC_LABEL_IDS, iconNum));
drawSimpleMesh(NAMED_SMCell);
}
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 9b81042b7..a5ad1835d 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -229,6 +229,23 @@ public class AllAppsView extends RSSurfaceView
Resources res = getContext().getResources();
int barHeight = (int)res.getDimension(R.dimen.button_bar_height);
+
+ if (mRollo.mUniformAlloc != null) {
+ float tf[] = new float[] {72.f, 72.f,
+ 120.f, 120.f, 0.f, 0.f,
+ 120.f, 680.f,
+ (2.f / 480.f), 0, -((float)w / 2) - 0.25f, -380.25f};
+ if (w > h) {
+ tf[6] = 40.f;
+ tf[7] = h - 40.f;
+ tf[9] = 1.f;
+ tf[10] = -((float)w / 2) - 0.25f;
+ tf[11] = -((float)h / 2) - 0.25f;
+ }
+
+ mRollo.mUniformAlloc.data(tf);
+ }
+
//long endTime = SystemClock.uptimeMillis();
//Log.d(TAG, "surfaceChanged took " + (endTime-startTime) + "ms");
}
@@ -893,7 +910,7 @@ public class AllAppsView extends RSSurfaceView
SimpleMesh.TriangleMeshBuilder tm = new SimpleMesh.TriangleMeshBuilder(mRS, 2, 0);
for (int ct=0; ct < 16; ct++) {
- float pos = (1.f / 16.f) * ct;
+ float pos = (1.f / (16.f - 1)) * ct;
tm.addVertex(0.0f, pos);
tm.addVertex(1.0f, pos);
}
@@ -936,10 +953,10 @@ public class AllAppsView extends RSSurfaceView
// Animation
" float ani = UNI_Position.z;\n" +
- " float bendAngle = 47.0 * (3.14 / 180.0);\n" +
- " float bendDistance = 50.0;\n" +
" float bendY1 = UNI_BendPos.x;\n" +
" float bendY2 = UNI_BendPos.y;\n" +
+ " float bendAngle = 47.0 * (3.14 / 180.0);\n" +
+ " float bendDistance = bendY1 * 0.4;\n" +
" float distanceDimLevel = 0.6;\n" +
" float bendStep = (bendAngle / bendDistance) * (bendAngle * 0.5);\n" +