diff options
author | Angus Kong <shkong@google.com> | 2013-05-28 17:48:04 -0700 |
---|---|---|
committer | Angus Kong <shkong@google.com> | 2013-05-30 14:52:11 -0700 |
commit | 0980fe89b2c0d2d8f75cb43a5fe06c00b8c8901e (patch) | |
tree | c74243b0d234ddff7e10fb222680972ce91c2c08 /src | |
parent | 9d6561494d28e8e8c6f1add50ab7724df722525b (diff) | |
download | android_packages_apps_Snap-0980fe89b2c0d2d8f75cb43a5fe06c00b8c8901e.tar.gz android_packages_apps_Snap-0980fe89b2c0d2d8f75cb43a5fe06c00b8c8901e.tar.bz2 android_packages_apps_Snap-0980fe89b2c0d2d8f75cb43a5fe06c00b8c8901e.zip |
Translate the first/last view too.
Change-Id: Iea6dfa8acc632596fdf05001b6b11d11d014a8a0
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/ui/FilmStripView.java | 14 |
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. |