Design + Code an Android App from Scratch
This video shows how to make a selector in Android. A selector is basically a collection of drawables where each drawable is displayed when the widget using the selector is in a particular state and as a developer you have to specify which states of the selector correspond to which drawables. When the button is pressed, it selects the first colour in our case and when the button is not pressed, it selects the second colour from the selector for our Button when we apply a selector to the text colour of our Button. Instead of using images as selector items, we can also use shapes like rectangle where we specify the solid colour and the stroke colour that must be applied at each state of the selector.