summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorErin Dahlgren <edahlgren@google.com>2013-10-09 10:59:47 -0700
committerErin Dahlgren <edahlgren@google.com>2013-10-09 11:46:33 -0700
commit26862c304a8163016b1f8196c715769750ba1720 (patch)
treea54bf7b0f5c0032851cc13af8df69ac207a02921 /src/com/android
parent52beb04d45ff906dfaffb1799a6d93859f1d83bd (diff)
downloadandroid_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')
-rw-r--r--src/com/android/camera/CameraActivity.java2
-rw-r--r--src/com/android/camera/ui/FilmStripView.java13
2 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 3e5a7c044..35fcf42b3 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -733,7 +733,6 @@ public class CameraActivity extends Activity
private void removeData(int dataID) {
mDataAdapter.removeData(CameraActivity.this, dataID);
- updateActionBarMenu(mFilmStripView.getCurrentId());
if (mDataAdapter.getTotalNumber() > 1) {
showUndoDeletionBar();
} else {
@@ -1339,6 +1338,7 @@ public class CameraActivity extends Activity
}
hideUndoDeletionBar(false);
mDataAdapter.executeDeletion(CameraActivity.this);
+ updateActionBarMenu(mFilmStripView.getCurrentId());
}
public void showUndoDeletionBar() {
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);