diff options
author | John Hoford <hoford@google.com> | 2013-04-15 22:10:43 -0700 |
---|---|---|
committer | John Hoford <hoford@google.com> | 2013-04-17 09:39:13 -0700 |
commit | 0c53bbc7da61556d5af8e7f8c6be6cf96432012e (patch) | |
tree | 75fd593a2368045f282d80db8b7aeb18694a5669 /src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java | |
parent | 70c1e959b8eaf7bd1bda12ae24e4b9164bab5bdf (diff) | |
download | android_packages_apps_Snap-0c53bbc7da61556d5af8e7f8c6be6cf96432012e.tar.gz android_packages_apps_Snap-0c53bbc7da61556d5af8e7f8c6be6cf96432012e.tar.bz2 android_packages_apps_Snap-0c53bbc7da61556d5af8e7f8c6be6cf96432012e.zip |
Support for save state in images
bug:8626775
Change-Id: I2a34a6027b23dab9c1802f672bfbf399cac0c4f7
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java index 3ef1e09ed..e0525e367 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java @@ -29,6 +29,8 @@ public class FilterBasicRepresentation extends FilterRepresentation implements P private int mMaximum; private int mDefaultValue; private int mPreviewValue; + public static final String SERIAL_NAME = "Name"; + public static final String SERIAL_VALUE = "Value"; public FilterBasicRepresentation(String name, int minimum, int value, int maximum) { super(name); @@ -165,4 +167,23 @@ public class FilterBasicRepresentation extends FilterRepresentation implements P public void copyFrom(Parameter src) { useParametersFrom((FilterBasicRepresentation) src); } + + @Override + public String[][] serializeRepresentation() { + String[][] ret = { + {SERIAL_NAME , getName() }, + {SERIAL_VALUE , Integer.toString(mValue)}}; + return ret; + } + + @Override + public void deSerializeRepresentation(String[][] rep) { + super.deSerializeRepresentation(rep); + for (int i = 0; i < rep.length; i++) { + if (SERIAL_VALUE.equals(rep[i][0])) { + mValue = Integer.parseInt(rep[i][1]); + break; + } + } + } } |