summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2013-10-01 04:03:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-01 04:03:53 +0000
commita1cb57beb56e17f8d64b82cb1465dcb63cce74b1 (patch)
treec4c85f7e6f96ce6443ed92f98016a1a39303b1ba /src/com/android/camera/ui
parent4d21fc2e3f7e7e64e5910b9ee4f6b7662a441427 (diff)
parenta5d6b243d3d742cf9dd2ffdac88d386abacd123a (diff)
downloadandroid_packages_apps_Snap-a1cb57beb56e17f8d64b82cb1465dcb63cce74b1.tar.gz
android_packages_apps_Snap-a1cb57beb56e17f8d64b82cb1465dcb63cce74b1.tar.bz2
android_packages_apps_Snap-a1cb57beb56e17f8d64b82cb1465dcb63cce74b1.zip
Merge "Don't adjust the position while scrolling." into gb-ub-photos-carlsbad
Diffstat (limited to 'src/com/android/camera/ui')
-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