summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/photoeditor/FilterStack.java
diff options
context:
space:
mode:
authorYuli Huang <yuli@google.com>2011-10-01 02:05:06 +0800
committerYuli Huang <yuli@google.com>2011-10-04 00:26:14 +0800
commitae70ae473dcd674d61c9e6a79afcf57f825f7302 (patch)
treef6c985f06fd78e194246324251f404f4221fb895 /src/com/android/gallery3d/photoeditor/FilterStack.java
parent7777ff571ecc799de390ea0d9fe51d85bba38aa8 (diff)
downloadandroid_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.java13
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) {