diff options
author | John Hoford <hoford@google.com> | 2013-07-30 16:02:10 -0700 |
---|---|---|
committer | John Hoford <hoford@google.com> | 2013-07-30 16:15:16 -0700 |
commit | 7dd44d877efb2682c538fdf6d1cb06237ec00308 (patch) | |
tree | 09be12f4c555912c43c2841bba960a1a9c839f50 | |
parent | 2e5fe3fc3b6381456ab8e009f4270b1f4c42e53d (diff) | |
download | android_packages_apps_Snap-7dd44d877efb2682c538fdf6d1cb06237ec00308.tar.gz android_packages_apps_Snap-7dd44d877efb2682c538fdf6d1cb06237ec00308.tar.bz2 android_packages_apps_Snap-7dd44d877efb2682c538fdf6d1cb06237ec00308.zip |
clean up some bugs and update the icons
Change-Id: I6952bae8cfea2ec64064f3126eece93687c02eae
-rw-r--r-- | res/drawable-hdpi/filtershow_button_grad.png | bin | 1984 -> 1408 bytes | |||
-rw-r--r-- | res/drawable-mdpi/filtershow_button_grad.png | bin | 1442 -> 990 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/filtershow_button_grad.png | bin | 2720 -> 1920 bytes | |||
-rw-r--r-- | res/values/filtershow_values.xml | 2 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/FilterGradRepresentation.java | 62 |
5 files changed, 24 insertions, 40 deletions
diff --git a/res/drawable-hdpi/filtershow_button_grad.png b/res/drawable-hdpi/filtershow_button_grad.png Binary files differindex 01a565d1d..7903ac7cf 100644 --- a/res/drawable-hdpi/filtershow_button_grad.png +++ b/res/drawable-hdpi/filtershow_button_grad.png diff --git a/res/drawable-mdpi/filtershow_button_grad.png b/res/drawable-mdpi/filtershow_button_grad.png Binary files differindex f04af799e..284da5c34 100644 --- a/res/drawable-mdpi/filtershow_button_grad.png +++ b/res/drawable-mdpi/filtershow_button_grad.png diff --git a/res/drawable-xhdpi/filtershow_button_grad.png b/res/drawable-xhdpi/filtershow_button_grad.png Binary files differindex 3feeef69e..c5f7035d7 100644 --- a/res/drawable-xhdpi/filtershow_button_grad.png +++ b/res/drawable-xhdpi/filtershow_button_grad.png diff --git a/res/values/filtershow_values.xml b/res/values/filtershow_values.xml index bd1f8904e..0bb59c06a 100644 --- a/res/values/filtershow_values.xml +++ b/res/values/filtershow_values.xml @@ -37,7 +37,7 @@ <dimen name="gradcontrol_dot_size">20dip</dimen> <!-- Grad filter minimum touch distance --> - <dimen name="gradcontrol_min_touch_dist">40dip</dimen> + <dimen name="gradcontrol_min_touch_dist">80dip</dimen> </resources>
\ No newline at end of file diff --git a/src/com/android/gallery3d/filtershow/filters/FilterGradRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterGradRepresentation.java index 1bfce6f05..64e7fb0c9 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterGradRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterGradRepresentation.java @@ -42,7 +42,7 @@ public class FilterGradRepresentation extends FilterRepresentation super("Grad"); setSerializationName(SERIALIZATION_NAME); creatExample(); - setOverlayId(R.drawable.filtershow_button_colors_vignette); + setOverlayId(R.drawable.filtershow_button_grad); setFilterClass(ImageFilterGrad.class); setTextId(R.string.grad); setEditorId(EditorGrad.ID); @@ -63,7 +63,7 @@ public class FilterGradRepresentation extends FilterRepresentation static class Band { private boolean mask = true; - private boolean active = true; + private int xPos1 = -1; private int yPos1 = 100; private int xPos2 = -1; @@ -71,7 +71,7 @@ public class FilterGradRepresentation extends FilterRepresentation private int brightness = 40; private int contrast = 0; private int saturation = 0; - private boolean inking; + public Band() { } @@ -85,7 +85,6 @@ public class FilterGradRepresentation extends FilterRepresentation public Band(Band copy) { mask = copy.mask; - active = copy.active; xPos1 = copy.xPos1; yPos1 = copy.yPos1; xPos2 = copy.xPos2; @@ -93,7 +92,6 @@ public class FilterGradRepresentation extends FilterRepresentation brightness = copy.brightness; contrast = copy.contrast; saturation = copy.saturation; - inking = copy.inking; } } @@ -112,7 +110,6 @@ public class FilterGradRepresentation extends FilterRepresentation private void creatExample() { Band p = new Band(); p.mask = false; - p.active = true; p.xPos1 = -1; p.yPos1 = 100; p.xPos2 = -1; @@ -120,7 +117,6 @@ public class FilterGradRepresentation extends FilterRepresentation p.brightness = 40; p.contrast = 0; p.saturation = 0; - p.inking = false; mBands.add(0, p); mCurrentBand = p; trimVector(); @@ -155,7 +151,26 @@ public class FilterGradRepresentation extends FilterRepresentation @Override public boolean equals(FilterRepresentation representation) { if (representation instanceof FilterGradRepresentation) { - return true; // TODO much more extensive equals needed + FilterGradRepresentation rep = (FilterGradRepresentation) representation; + int n = getNumberOfBands(); + if (rep.getNumberOfBands() != n) { + return false; + } + for (int i = 0; i < mBands.size(); i++) { + Band b1 = mBands.get(i); + Band b2 = rep.mBands.get(i); + if (b1.mask != b2.mask + || b1.brightness != b2.brightness + || b1.contrast != b2.contrast + || b1.saturation != b2.saturation + || b1.xPos1 != b2.xPos1 + || b1.xPos2 != b2.xPos2 + || b1.yPos1 != b2.yPos1 + || b1.yPos2 != b2.yPos2) { + return false; + } + } + return true; } return false; } @@ -170,17 +185,6 @@ public class FilterGradRepresentation extends FilterRepresentation return count; } - public void toggleInking() { - mCurrentBand.inking = !mCurrentBand.inking; - } - - public void setInking(boolean on) { - for (Band point : mBands) { - point.inking = false; - } - mCurrentBand.inking = on; - } - public int addBand(Rect rect) { mBands.add(0, mCurrentBand = new Band(rect.centerX(), rect.centerY())); mCurrentBand.mask = false; @@ -278,17 +282,6 @@ public class FilterGradRepresentation extends FilterRepresentation return ret; } - public boolean[] getActive() { - boolean[] ret = new boolean[mBands.size()]; - int i = 0; - String s = ""; - for (Band point : mBands) { - ret[i++] = point.active; - s += (point.active) ? "1" : "0"; - } - return ret; - } - public int[] getXPos1() { int[] ret = new int[mBands.size()]; int i = 0; @@ -352,15 +345,6 @@ public class FilterGradRepresentation extends FilterRepresentation return ret; } - public boolean[] getInking() { - boolean[] ret = new boolean[mBands.size()]; - int i = 0; - for (Band point : mBands) { - ret[i++] = point.inking; - } - return ret; - } - public int getParameter(int type) { switch (type){ case PARAM_BRIGHTNESS: |