Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63581873 authored by kaiyiz's avatar kaiyiz Committed by Gerrit - the friendly Code Review server
Browse files

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
parent c300a39b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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() {
+5 −0
Original line number Diff line number Diff line
@@ -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