diff options
author | Erin Dahlgren <edahlgren@google.com> | 2013-10-09 10:59:47 -0700 |
---|---|---|
committer | Erin Dahlgren <edahlgren@google.com> | 2013-10-09 11:46:33 -0700 |
commit | 26862c304a8163016b1f8196c715769750ba1720 (patch) | |
tree | a54bf7b0f5c0032851cc13af8df69ac207a02921 /src/com/android/camera/ui/FilmStripView.java | |
parent | 52beb04d45ff906dfaffb1799a6d93859f1d83bd (diff) | |
download | android_packages_apps_Snap-26862c304a8163016b1f8196c715769750ba1720.tar.gz android_packages_apps_Snap-26862c304a8163016b1f8196c715769750ba1720.tar.bz2 android_packages_apps_Snap-26862c304a8163016b1f8196c715769750ba1720.zip |
Update bottom controls and action bar with a tighter bounds on data change.
Bug: 11087361
Change-Id: Ie319d1767eb671ca7ed4a129aa9b75c77d63b20d
Diffstat (limited to 'src/com/android/camera/ui/FilmStripView.java')
-rw-r--r-- | src/com/android/camera/ui/FilmStripView.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java index 56f5dfac8..7c9a5bab0 100644 --- a/src/com/android/camera/ui/FilmStripView.java +++ b/src/com/android/camera/ui/FilmStripView.java @@ -100,6 +100,8 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener { private ValueAnimator.AnimatorUpdateListener mViewItemUpdateListener; private float mOverScaleFactor = 1f; + private int mLastTotalNumber = 0; + /** * Common interface for all images in the filmstrip. */ @@ -1022,12 +1024,15 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener { return; } - // If not a forced update, check if the item has changed since the last - // time we updated the visibility status. Only then check if the current - // image is a photo sphere. - if (!force && requestId == mLastItemId) { + // We cannot rely on the requestIds to check for data changes, + // because an item hands its id to its rightmost neighbor on + // deletion. To avoid loading the ImageData, we check if the DataAdapter + // has fewer total items. + int total = mDataAdapter.getTotalNumber(); + if (!force && mLastTotalNumber == total) { return; } + mLastTotalNumber = total; ImageData data = mDataAdapter.getImageData(requestId); |