summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-07-30 23:26:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-07-30 23:26:21 +0000
commita0a51343063d9d689771112b9af668f01d8cf87c (patch)
tree2e17da18179909883759a343e63a3d9e0ecb393d
parent430d25bfc7d78f03f3f7007edfddc8d15fb8c5c9 (diff)
parent7dd44d877efb2682c538fdf6d1cb06237ec00308 (diff)
downloadandroid_packages_apps_Snap-a0a51343063d9d689771112b9af668f01d8cf87c.tar.gz
android_packages_apps_Snap-a0a51343063d9d689771112b9af668f01d8cf87c.tar.bz2
android_packages_apps_Snap-a0a51343063d9d689771112b9af668f01d8cf87c.zip
Merge "clean up some bugs and update the icons" into gb-ub-photos-carlsbad
-rw-r--r--res/drawable-hdpi/filtershow_button_grad.pngbin1984 -> 1408 bytes
-rw-r--r--res/drawable-mdpi/filtershow_button_grad.pngbin1442 -> 990 bytes
-rw-r--r--res/drawable-xhdpi/filtershow_button_grad.pngbin2720 -> 1920 bytes
-rw-r--r--res/values/filtershow_values.xml2
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterGradRepresentation.java62
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
index 01a565d1d..7903ac7cf 100644
--- a/res/drawable-hdpi/filtershow_button_grad.png
+++ b/res/drawable-hdpi/filtershow_button_grad.png
Binary files differ
diff --git a/res/drawable-mdpi/filtershow_button_grad.png b/res/drawable-mdpi/filtershow_button_grad.png
index f04af799e..284da5c34 100644
--- a/res/drawable-mdpi/filtershow_button_grad.png
+++ b/res/drawable-mdpi/filtershow_button_grad.png
Binary files differ
diff --git a/res/drawable-xhdpi/filtershow_button_grad.png b/res/drawable-xhdpi/filtershow_button_grad.png
index 3feeef69e..c5f7035d7 100644
--- a/res/drawable-xhdpi/filtershow_button_grad.png
+++ b/res/drawable-xhdpi/filtershow_button_grad.png
Binary files differ
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: