diff options
author | Yuli Huang <yuli@google.com> | 2011-10-01 02:05:06 +0800 |
---|---|---|
committer | Yuli Huang <yuli@google.com> | 2011-10-04 00:26:14 +0800 |
commit | ae70ae473dcd674d61c9e6a79afcf57f825f7302 (patch) | |
tree | f6c985f06fd78e194246324251f404f4221fb895 /src/com/android/gallery3d/photoeditor/FilterStack.java | |
parent | 7777ff571ecc799de390ea0d9fe51d85bba38aa8 (diff) | |
download | android_packages_apps_Gallery2-ae70ae473dcd674d61c9e6a79afcf57f825f7302.tar.gz android_packages_apps_Gallery2-ae70ae473dcd674d61c9e6a79afcf57f825f7302.tar.bz2 android_packages_apps_Gallery2-ae70ae473dcd674d61c9e6a79afcf57f825f7302.zip |
Fix b/5317371 to make action-bar consistent with framework CAB.
1. Refactor to decouple ActionBar from FilterStackListener and
ActionBarListener to avoid FilterStack/Toolbar depending on ActionBar.
2. Recreate the action-bar on configuration changes and restore button
status and behaviors from the old action-bar.
3. Use framework CAB styles/dimensions to have consistent look and feel.
Change-Id: Ib7be0e0b8135f5f86af65b320f09b3d691464f54
Diffstat (limited to 'src/com/android/gallery3d/photoeditor/FilterStack.java')
-rw-r--r-- | src/com/android/gallery3d/photoeditor/FilterStack.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/photoeditor/FilterStack.java b/src/com/android/gallery3d/photoeditor/FilterStack.java index 3b35aa3e1..5b8d0d743 100644 --- a/src/com/android/gallery3d/photoeditor/FilterStack.java +++ b/src/com/android/gallery3d/photoeditor/FilterStack.java @@ -113,7 +113,7 @@ public class FilterStack { } private void callbackDone(final OnDoneCallback callback) { - // Call back in UI thread to report done. + // GL thread calls back to report UI thread the task is done. photoView.post(new Runnable() { @Override @@ -124,7 +124,16 @@ public class FilterStack { } private void stackChanged() { - stackListener.onStackChanged(!appliedStack.empty(), !redoStack.empty()); + // GL thread calls back to report UI thread the stack is changed. + final boolean canUndo = !appliedStack.empty(); + final boolean canRedo = !redoStack.empty(); + photoView.post(new Runnable() { + + @Override + public void run() { + stackListener.onStackChanged(canUndo, canRedo); + } + }); } public void saveBitmap(final OnDoneBitmapCallback callback) { |