From b79bbd85bc1ce26a18a2be1100b95dfacbbce5e6 Mon Sep 17 00:00:00 2001 From: Chih-Chung Chang Date: Thu, 19 Apr 2012 20:14:11 +0800 Subject: In filmstrip, show placeholders for pictures not loaded yet. Change-Id: I037f1f054da4a3800045d5b89724341ac22272a5 --- src/com/android/gallery3d/ui/PositionController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/com/android/gallery3d/ui/PositionController.java') 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); -- cgit v1.2.3