In this unproblematic tip, I’m going to demo how to modify android push clit on click or press color. If y’all desire to modify the click or press color of TextView or whatsoever android Layout y’all tin exercise same way. Android Button onClick Event teaches y’all to grip push clit click as well as y’all tin detect dissimilar android push clit agency at Android Button Examples.
Define Color Value
To define color value, y’all convey to exercise colors.xml file inwards your projection values directory as well as add together following.
Create a XML File inwards Drawable Directory
Create a button_background.xml file inwards your drawable folder as well as add together push clit pressed/clicked, focused as well as default color. Final code of button_background.xml file looks similar this.
Now, run your application as well as click whatsoever of 2 buttons. You volition encounter dissimilar color at the fourth dimension of click. In next screenshot, start push clit is at the fourth dimension of push clit click/press as well as merely about other is default.