0

I have list of outlined button: enter image description here

I set a selector as a background of button. How can I change the color of stroke programmatically? For example: Now: enter image description here

And after click on Button it has to became next:

enter image description here

I don't think I need to create a selectors for every color. I think, I could get a color of stroke programmatically. Please give me a hint!

Jekis Osipov
  • 133
  • 10

1 Answers1

1

The simple way is create a drawable by programmatically, you can check it here: How to create android shape background programmatically?

dinhlam
  • 708
  • 3
  • 14