summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/PositionController.java
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-04-19 20:14:11 +0800
committerChih-Chung Chang <chihchung@google.com>2012-04-19 20:25:50 +0800
commitb79bbd85bc1ce26a18a2be1100b95dfacbbce5e6 (patch)
tree73a1b17a5bf7955286ab89be104ac7e38dad56b0 /src/com/android/gallery3d/ui/PositionController.java
parent4831a8fbd146ed627b8f6be4f4d1fed4cd4e3fe5 (diff)
downloadandroid_packages_apps_Snap-b79bbd85bc1ce26a18a2be1100b95dfacbbce5e6.tar.gz
android_packages_apps_Snap-b79bbd85bc1ce26a18a2be1100b95dfacbbce5e6.tar.bz2
android_packages_apps_Snap-b79bbd85bc1ce26a18a2be1100b95dfacbbce5e6.zip
In filmstrip, show placeholders for pictures not loaded yet.
Change-Id: I037f1f054da4a3800045d5b89724341ac22272a5
Diffstat (limited to 'src/com/android/gallery3d/ui/PositionController.java')
-rw-r--r--src/com/android/gallery3d/ui/PositionController.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java
index f087c6b70..46f01217f 100644
--- a/src/com/android/gallery3d/ui/PositionController.java
+++ b/src/com/android/gallery3d/ui/PositionController.java
@@ -533,7 +533,10 @@ class PositionController {
mFilmScroller.fling(p.mCurrentX, 0, velocityX, 0,
Integer.MIN_VALUE, Integer.MAX_VALUE, 0, 0);
int targetX = mFilmScroller.getFinalX();
- ANIM_TIME[ANIM_KIND_FLING] = mFilmScroller.getDuration();
+ // This value doesn't matter because we use mFilmScroller.isFinished()
+ // to decide when to stop. We set this to 0 so it's faster for
+ // Animatable.advanceAnimation() to calculate the progress (always 1).
+ ANIM_TIME[ANIM_KIND_FLING] = 0;
startAnimation(targetX, b.mCurrentY, b.mCurrentScale, ANIM_KIND_FLING);
return true;
}
@@ -1123,8 +1126,8 @@ class PositionController {
float scale = Utils.clamp(b.mCurrentScale, scaleMin, scaleMax);
int x = mCurrentX;
if (mFilmMode) {
- if (mHasNext) x = Math.max(x, mViewW / 2);
- if (mHasPrev) x = Math.min(x, mViewW / 2);
+ if (!mHasNext) x = Math.max(x, mViewW / 2);
+ if (!mHasPrev) x = Math.min(x, mViewW / 2);
} else {
calculateStableBound(scale, HORIZONTAL_SLACK);
x = Utils.clamp(x, mBoundLeft, mBoundRight);