summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2013-09-30 21:04:57 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-30 21:04:57 -0700
commit85be0ac807789a8d02ab900de179adbef5c865cb (patch)
treee55b1d32cac7b3fdbb863df6d6aa7f2b250bb680
parent7334597fcc93679d49d15e3922887496b17cb3cd (diff)
parenta1cb57beb56e17f8d64b82cb1465dcb63cce74b1 (diff)
downloadandroid_packages_apps_Snap-85be0ac807789a8d02ab900de179adbef5c865cb.tar.gz
android_packages_apps_Snap-85be0ac807789a8d02ab900de179adbef5c865cb.tar.bz2
android_packages_apps_Snap-85be0ac807789a8d02ab900de179adbef5c865cb.zip
am a1cb57be: Merge "Don\'t adjust the position while scrolling." into gb-ub-photos-carlsbad
* commit 'a1cb57beb56e17f8d64b82cb1465dcb63cce74b1': Don't adjust the position while scrolling.
-rw-r--r--src/com/android/camera/ui/FilmStripView.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java
index 955b904bf..fc1970441 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -1700,10 +1700,14 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
if (reporter.isDataUpdated(dataId)) {
updateViewItem(mCurrentItem);
final ImageData data = mDataAdapter.getImageData(dataId);
- int[] dim = calculateChildDimension(
- data.getWidth(), data.getHeight(),
- getMeasuredWidth(), getMeasuredHeight());
- mCenterX = curr.getLeftPosition() + dim[0] / 2;
+ if (!mIsUserScrolling && !mController.isScrolling()) {
+ // If there is no scrolling at all, adjust mCenterX to place
+ // the current item at the center.
+ int[] dim = calculateChildDimension(
+ data.getWidth(), data.getHeight(),
+ getMeasuredWidth(), getMeasuredHeight());
+ mCenterX = curr.getLeftPosition() + dim[0] / 2;
+ }
}
// Check left