summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2013-05-31 16:53:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-31 16:53:45 +0000
commit344b4fa24ffad7b53218e7f02c3b233e3d79bb28 (patch)
treebb774c7df784b06d4828d01bcff7a0217109c8e0 /src
parent8029edefa4d78b5b0e4bc23380590450fe525b79 (diff)
parent9fee35628aeaa923305d433b7b79a2065835bbee (diff)
downloadandroid_packages_apps_Gallery2-344b4fa24ffad7b53218e7f02c3b233e3d79bb28.tar.gz
android_packages_apps_Gallery2-344b4fa24ffad7b53218e7f02c3b233e3d79bb28.tar.bz2
android_packages_apps_Gallery2-344b4fa24ffad7b53218e7f02c3b233e3d79bb28.zip
Merge "Translate the first/last view too." into gb-ub-photos-carlsbad
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/ui/FilmStripView.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java
index f9a4ec038..286d6e3b8 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -562,8 +562,8 @@ public class FilmStripView extends ViewGroup {
mViewInfo[curr] = buildInfoFromData(mViewInfo[prev].getID() + 1);
}
-
- for (int i = removedInfo; i < BUFFER_SIZE - 1; i++) {
+ // Translate the views to their original places.
+ for (int i = removedInfo; i < BUFFER_SIZE; i++) {
if (mViewInfo[i] != null) {
mViewInfo[i].setTranslationX(offsetX, mScale);
}
@@ -588,9 +588,6 @@ public class FilmStripView extends ViewGroup {
for (int i = removedInfo; i > 0; i--) {
mViewInfo[i] = mViewInfo[i - 1];
- if (mViewInfo[i] != null) {
- mViewInfo[i].setTranslationX(-offsetX, mScale);
- }
}
// pull data out from the DataAdapter for the first one.
@@ -599,6 +596,13 @@ public class FilmStripView extends ViewGroup {
if (mViewInfo[next] != null) {
mViewInfo[curr] = buildInfoFromData(mViewInfo[next].getID() - 1);
}
+
+ // Translate the views to their original places.
+ for (int i = removedInfo; i >= 0; i--) {
+ if (mViewInfo[i] != null) {
+ mViewInfo[i].setTranslationX(-offsetX, mScale);
+ }
+ }
}
// Now, slide every one back.