summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2015-01-04 10:18:20 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-01-14 08:21:59 -0800
commit63581873a606fdaad3c9667c4d07908b9d7954c3 (patch)
treec3250105133693a5bc73e0ce8ea4b213b2295426 /src
parentc300a39b471a09670f4e3c738b5a7eb7a37c3ac1 (diff)
downloadandroid_packages_apps_Gallery2-63581873a606fdaad3c9667c4d07908b9d7954c3.tar.gz
android_packages_apps_Gallery2-63581873a606fdaad3c9667c4d07908b9d7954c3.tar.bz2
android_packages_apps_Gallery2-63581873a606fdaad3c9667c4d07908b9d7954c3.zip
Gallery2: Fix color chooser
There is another problem for this issue: the border of color is not set well for the flag of mSelectedButton. Set mSelectedButton when set up. CRs-Fixed: 764078 Change-Id: Ibaddb66abe425bdc95a1f78a58522a3b4449ae80
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/controller/ColorChooser.java9
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java5
2 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/controller/ColorChooser.java b/src/com/android/gallery3d/filtershow/controller/ColorChooser.java
index f9f29bccc..82ce80bbf 100644
--- a/src/com/android/gallery3d/filtershow/controller/ColorChooser.java
+++ b/src/com/android/gallery3d/filtershow/controller/ColorChooser.java
@@ -68,9 +68,16 @@ public class ColorChooser implements Control {
Color.colorToHSV(palette[i], hsvo);
hsvo[OPACITY_OFFSET] = (0xFF & (palette[i] >> 24)) / (float) 255;
button.setTag(hsvo);
+
+ String colorString = "(" + Integer.toHexString(palette[i]) + ")";
+ boolean colorSelect = false;
+ if (parameter.getValueString().equals(colorString)) {
+ mSelectedButton = i;
+ colorSelect = true;
+ }
GradientDrawable sd = ((GradientDrawable) button.getBackground());
sd.setColor(palette[i]);
- sd.setStroke(3, (mSelectedButton == i) ? mSelected : mTransparent);
+ sd.setStroke(3, colorSelect? mSelected : mTransparent);
final int buttonNo = i;
button.setOnClickListener(new View.OnClickListener() {
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java
index 48d3d9077..275a40409 100644
--- a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java
+++ b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java
@@ -166,6 +166,11 @@ public class FilterDrawRepresentation extends FilterRepresentation {
setEditorId(EditorDraw.ID);
setOverlayId(R.drawable.filtershow_drawing);
setOverlayOnly(true);
+ setDefaultColor();
+ }
+
+ private void setDefaultColor() {
+ mParamColor.setValue(DEFAULT_MENU_COLOR1);
}
@Override