diff options
author | Angus Kong <shkong@google.com> | 2013-05-31 16:53:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-05-31 16:53:45 +0000 |
commit | f464958e6bc926e0c4a776d11a9f2aa8514a866f (patch) | |
tree | 2fad923018cce8a572ee2eb2057a08d75909beb6 /src | |
parent | d3992d8958aa8067c4803f113bcbab9e7f5a61b0 (diff) | |
parent | 0980fe89b2c0d2d8f75cb43a5fe06c00b8c8901e (diff) | |
download | android_packages_apps_Snap-f464958e6bc926e0c4a776d11a9f2aa8514a866f.tar.gz android_packages_apps_Snap-f464958e6bc926e0c4a776d11a9f2aa8514a866f.tar.bz2 android_packages_apps_Snap-f464958e6bc926e0c4a776d11a9f2aa8514a866f.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.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. |