diff options
-rw-r--r-- | src/com/android/gallery3d/photoeditor/FilterStack.java | 2 | ||||
-rw-r--r-- | src/com/android/gallery3d/photoeditor/PhotoEditor.java | 9 |
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 |