diff options
author | nicolasroard <nicolasroard@google.com> | 2013-02-28 12:11:35 -0800 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-03-01 13:56:10 -0800 |
commit | 2a025ee773a4c40b05de6c70a4681abdb4e243bd (patch) | |
tree | cc66d1164919c6a28ffa11eb45bdc7069ff3a497 /src/com/android/gallery3d | |
parent | 5df0d2333fd3ade6a0396124ae4ce85e51ef7f0d (diff) | |
download | android_packages_apps_Snap-2a025ee773a4c40b05de6c70a4681abdb4e243bd.tar.gz android_packages_apps_Snap-2a025ee773a4c40b05de6c70a4681abdb4e243bd.tar.bz2 android_packages_apps_Snap-2a025ee773a4c40b05de6c70a4681abdb4e243bd.zip |
Improves State panel and Refactor FilterShowActivity
- handles multiple xml layout
- add a portrait layout
- improves the state panel (delete, etc.)
Change-Id: I29762c99cdd467db8705174c660304c8ed673ce2
Diffstat (limited to 'src/com/android/gallery3d')
-rw-r--r-- | src/com/android/gallery3d/filtershow/presets/ImagePreset.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java index 14c671e9f..82592a0f7 100644 --- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java +++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java @@ -129,6 +129,9 @@ public class ImagePreset { } public void updateFilterRepresentation(FilterRepresentation representation) { + if (representation == null) { + return; + } synchronized (mFilters) { if (representation instanceof GeometryMetadata) { setGeometry((GeometryMetadata) representation); @@ -331,6 +334,23 @@ public class ImagePreset { Log.v(LOGTAG, "/// showFilters -- " + mFilters.size() + " filters"); } + public FilterRepresentation getLastRepresentation() { + if (mFilters.size() > 0) { + return mFilters.lastElement(); + } + return null; + } + + public void removeFilter(FilterRepresentation filterRepresentation) { + for (int i = 0; i < mFilters.size(); i++) { + if (mFilters.elementAt(i).getFilterClass() == filterRepresentation.getFilterClass()) { + mFilters.remove(i); + setHistoryName("Remove"); + return; + } + } + } + public void addFilter(FilterRepresentation representation) { if (representation instanceof GeometryMetadata) { setGeometry((GeometryMetadata) representation); @@ -501,4 +521,5 @@ public class ImagePreset { public Rect getPartialRenderingBounds() { return mPartialRenderingBounds; } + } |