summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/photoeditor
diff options
context:
space:
mode:
authorYuli Huang <yuli@google.com>2011-11-09 15:10:45 +0800
committerYuli Huang <yuli@google.com>2011-11-09 18:13:38 +0800
commitb69298a00f20f2a3b7ac8f5d3c350c3152d428c3 (patch)
tree152ab5e61a8fb0e12d2a5c40e18e1f4d13f27adf /src/com/android/gallery3d/photoeditor
parent16ac4446300bdc6b23a9436328a667996a70c278 (diff)
downloadandroid_packages_apps_Snap-b69298a00f20f2a3b7ac8f5d3c350c3152d428c3.tar.gz
android_packages_apps_Snap-b69298a00f20f2a3b7ac8f5d3c350c3152d428c3.tar.bz2
android_packages_apps_Snap-b69298a00f20f2a3b7ac8f5d3c350c3152d428c3.zip
Fix b/5510870 by persisting states of save/share buttons.
Change-Id: Ida5c2868199b75a1a710ee5b92e0e3dffd71cec6
Diffstat (limited to 'src/com/android/gallery3d/photoeditor')
-rw-r--r--src/com/android/gallery3d/photoeditor/FilterStack.java2
-rw-r--r--src/com/android/gallery3d/photoeditor/PhotoEditor.java9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/photoeditor/FilterStack.java b/src/com/android/gallery3d/photoeditor/FilterStack.java
index 7194575a3..fe6fb104d 100644
--- a/src/com/android/gallery3d/photoeditor/FilterStack.java
+++ b/src/com/android/gallery3d/photoeditor/FilterStack.java
@@ -60,7 +60,7 @@ public class FilterStack {
appliedStack.addAll(getFilters(savedState, APPLIED_STACK_KEY));
redoStack.addAll(getFilters(savedState, REDO_STACK_KEY));
outputTopFilter = true;
- stackChanged();
+ stackListener.onStackChanged(!appliedStack.empty(), !redoStack.empty());
}
}
diff --git a/src/com/android/gallery3d/photoeditor/PhotoEditor.java b/src/com/android/gallery3d/photoeditor/PhotoEditor.java
index 78d414d9f..7b53041ad 100644
--- a/src/com/android/gallery3d/photoeditor/PhotoEditor.java
+++ b/src/com/android/gallery3d/photoeditor/PhotoEditor.java
@@ -30,6 +30,8 @@ import com.android.gallery3d.R;
*/
public class PhotoEditor extends Activity {
+ private static final String SAVE_URI_KEY = "save_uri";
+
private Uri sourceUri;
private Uri saveUri;
private FilterStack filterStack;
@@ -54,6 +56,10 @@ public class PhotoEditor extends Activity {
actionBar.updateButtons(canUndo, canRedo);
}
}, savedInstanceState);
+ if (savedInstanceState != null) {
+ saveUri = savedInstanceState.getParcelable(SAVE_URI_KEY);
+ actionBar.updateSave(saveUri == null);
+ }
EffectsBar effectsBar = (EffectsBar) findViewById(R.id.effects_bar);
effectsBar.initialize(filterStack);
@@ -134,8 +140,8 @@ public class PhotoEditor extends Activity {
@Override
public void onComplete(Uri result) {
progressDialog.dismiss();
- actionBar.updateSave(result == null);
saveUri = result;
+ actionBar.updateSave(saveUri == null);
}
};
new SaveCopyTask(PhotoEditor.this, sourceUri, callback).execute(
@@ -203,6 +209,7 @@ public class PhotoEditor extends Activity {
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
filterStack.saveStacks(outState);
+ outState.putParcelable(SAVE_URI_KEY, saveUri);
}
@Override