I am implementing a switch button that can remotely turn on or off a light.
Whenever the switch button is pressed, a HTTP request will be sent to the server, and a response will be sent back.
The requirement is:
While the app is waiting for the response, the switch button turns yellow.
If the response is 200 OK, the button turns green.
If the response is denied or times out, the button turns red.
I am using the default switch button. It does not allow me to change the color dynamically and I have been looking around and could not find anything that can be used for my app.
How am i able to achieve this multi-state switch button?