AndroidFillableLoaders icon indicating copy to clipboard operation
AndroidFillableLoaders copied to clipboard

want to change fillColor

Open PratikSonawane10 opened this issue 7 years ago • 3 comments

hi, i want to change fillcolor according to my if condition, how can i do this?

if (somevalue = 20){ fillableLoader.setFillColor(Color.parseColor("#4CAF50")); } else { fillableLoader.setFillColor(Color.parseColor("#CDDC39")); } i done something like this but its not working, color is not changing. please help me out. thank you

PratikSonawane10 avatar Jun 06 '17 10:06 PratikSonawane10

Maybe it's not supported set the color dinamically, and u can "init" the color when change another state u want it showing the other color~

cervy avatar Jul 11 '17 11:07 cervy

i got what ids the problem . in your library you forgot to call initDashPaint(); & initFillPaint();

    public void setStrokeColor(int strokeColor) {
            this.strokeColor = strokeColor;
           **initDashPaint();  // you didnt call this**
     }

     public void setFillColor(int fillColor) {
           this.fillColor = fillColor;
           **initFillPaint();  // you didnt call this**
    }

update it.

PratikSonawane10 avatar Jul 19 '17 06:07 PratikSonawane10

@JorgeCastilloPrz I want to change fill and stroke colours programmatically also. It would be really nice to have this feature

mustafaozhan avatar Apr 27 '19 13:04 mustafaozhan