summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-08-05 17:35:36 -0700
committerJason Sams <rjsams@android.com>2009-08-05 17:35:36 -0700
commit8c709dcc418681e8e2226e1e564ce1e0b3f1319c (patch)
tree3990fc4f6604169895f2a0e000c27c2e547f9818
parent9bee51c42eb8c3daffe7d6fa483edbb1689b94d2 (diff)
downloadframeworks_base-8c709dcc418681e8e2226e1e564ce1e0b3f1319c.zip
frameworks_base-8c709dcc418681e8e2226e1e564ce1e0b3f1319c.tar.gz
frameworks_base-8c709dcc418681e8e2226e1e564ce1e0b3f1319c.tar.bz2
Implement basic snapping.
-rw-r--r--libs/rs/java/Rollo/res/raw/rollo.c1
-rw-r--r--libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java14
-rw-r--r--libs/rs/java/Rollo/src/com/android/rollo/RolloView.java2
3 files changed, 3 insertions, 14 deletions
diff --git a/libs/rs/java/Rollo/res/raw/rollo.c b/libs/rs/java/Rollo/res/raw/rollo.c
index a527588..6376715 100644
--- a/libs/rs/java/Rollo/res/raw/rollo.c
+++ b/libs/rs/java/Rollo/res/raw/rollo.c
@@ -61,6 +61,7 @@ int main(void* con, int ft, int launchID)
storeF(2, SCRATCH_ZOOM, zoom);
float targetRot = loadI32(0, STATE_FIRST_VISIBLE) / 180.0f * 3.14f;
+ targetRot = targetRot * 0.80f - .12f;
float drawRot = filter(loadF(2, SCRATCH_ROT), targetRot, 0.1f * touchCut);
storeF(2, SCRATCH_ROT, drawRot);
diff --git a/libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java b/libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java
index 32a8f3c..ba74b58 100644
--- a/libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java
+++ b/libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java
@@ -264,20 +264,6 @@ public class RolloRS {
mLabels[27] = mLabels[8];
mLabels[28] = mLabels[9];
-/*
- mIcons[19] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.solitaire, ie8888, true);
- mIcons[20] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.sudoku, ie8888, true);
- mIcons[21] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.taptaprevenge, ie8888, true);
- mIcons[22] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.tetris, ie8888, true);
- mIcons[23] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.tictactoe, ie8888, true);
- mIcons[24] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.tweetie, ie8888, true);
- mIcons[25] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.urbanspoon, ie8888, true);
- mIcons[26] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.waterslide_extreme, ie8888, true);
- mIcons[27] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.weather_channel, ie8888, true);
- mIcons[28] = Allocation.createFromBitmapResource(mRS, mRes, R.raw.zippo, ie8888, true);
-*/
-
-
for(int ct=0; ct < mIcons.length; ct++) {
mIcons[ct].uploadToTexture(0);
mLabels[ct].uploadToTexture(0);
diff --git a/libs/rs/java/Rollo/src/com/android/rollo/RolloView.java b/libs/rs/java/Rollo/src/com/android/rollo/RolloView.java
index 71d6c7e..3e1c54d 100644
--- a/libs/rs/java/Rollo/src/com/android/rollo/RolloView.java
+++ b/libs/rs/java/Rollo/src/com/android/rollo/RolloView.java
@@ -187,6 +187,8 @@ public class RolloView extends RSSurfaceView {
mFlingY = ny;
} else {
mFlingMode = false;
+ mColumn = (float)(java.lang.Math.floor(mColumn * 0.25f + 0.3f) * 4.f) + 1.f;
+ setColumn(true);
}
}