summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2013-06-28 09:25:23 -0700
committerztenghui <ztenghui@google.com>2013-07-01 15:45:12 -0700
commit1ffd4a20e4b93ff7b54e4c8c8e6d977062ca40bd (patch)
tree825e0a404d3a67c7d8eb0791f127e0a596ebd0b4 /src
parentd9347c858cfb20256dababe51806a38e71651103 (diff)
downloadandroid_packages_apps_Snap-1ffd4a20e4b93ff7b54e4c8c8e6d977062ca40bd.tar.gz
android_packages_apps_Snap-1ffd4a20e4b93ff7b54e4c8c8e6d977062ca40bd.tar.bz2
android_packages_apps_Snap-1ffd4a20e4b93ff7b54e4c8c8e6d977062ca40bd.zip
Fix the save button issue.
When dealing with non Fx filters, the hasModification() really need to go deep to figure out whether things has changed. bug:9468909 Change-Id: I89495f147f7af7c35490def84805aae98e3f917f
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java3
-rw-r--r--src/com/android/gallery3d/filtershow/presets/ImagePreset.java14
2 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java
index c046a6e7f..a60410d2b 100644
--- a/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java
+++ b/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java
@@ -174,6 +174,9 @@ public class FilterRepresentation implements Cloneable {
mFilterClass = filterClass;
}
+ // This same() function is different from equals(), basically it checks
+ // whether 2 FilterRepresentations are the same type. It doesn't care about
+ // the values.
public boolean same(FilterRepresentation b) {
if (b == null) {
return false;
diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
index 2276ee71c..5a0100df4 100644
--- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
@@ -186,6 +186,20 @@ public class ImagePreset {
return geo;
}
+ public boolean hasModifications() {
+ for (int i = 0; i < mFilters.size(); i++) {
+ FilterRepresentation filter = mFilters.elementAt(i);
+ if (filter instanceof GeometryMetadata) {
+ if (((GeometryMetadata) filter).hasModifications()) {
+ return true;
+ }
+ } else if (!filter.isNil()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public boolean isPanoramaSafe() {
for (FilterRepresentation representation : mFilters) {
if (representation instanceof GeometryMetadata) {