summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2013-07-01 23:42:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-07-01 23:42:04 +0000
commit59552e6424a93bf8ba55fa770b7d7a230ea10db9 (patch)
treed01e93b5c106fadd4e24599146e226029a9ae01c /src
parent54d97996e53871b01a49b177960c6c2132da94e2 (diff)
parent1ffd4a20e4b93ff7b54e4c8c8e6d977062ca40bd (diff)
downloadandroid_packages_apps_Snap-59552e6424a93bf8ba55fa770b7d7a230ea10db9.tar.gz
android_packages_apps_Snap-59552e6424a93bf8ba55fa770b7d7a230ea10db9.tar.bz2
android_packages_apps_Snap-59552e6424a93bf8ba55fa770b7d7a230ea10db9.zip
Merge "Fix the save button issue." into gb-ub-photos-carlsbad
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 6f752d963..4ec39f765 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) {