summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErin Dahlgren <edahlgren@google.com>2013-10-09 13:09:05 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-09 13:09:05 -0700
commit82223508f8a30bf30577cad5760db8ceff35586a (patch)
tree34c4324be57ffd85cff6e1f4d8e996192bba65be
parent676b89cab6e9db1b784617fc16e97eadac7c4e2d (diff)
parent26862c304a8163016b1f8196c715769750ba1720 (diff)
downloadandroid_packages_apps_Snap-82223508f8a30bf30577cad5760db8ceff35586a.tar.gz
android_packages_apps_Snap-82223508f8a30bf30577cad5760db8ceff35586a.tar.bz2
android_packages_apps_Snap-82223508f8a30bf30577cad5760db8ceff35586a.zip
am 26862c30: Update bottom controls and action bar with a tighter bounds on data change.
* commit '26862c304a8163016b1f8196c715769750ba1720': Update bottom controls and action bar with a tighter bounds on data change.
-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);