Question

I would like to change the default orange color that appears when someone press an Android button. I have done many searches but all I found was the use of selectors. I understand the principle, but I don't want to modify the grey aspect of the normal button (not pressed). But using selectors force to define all characteristics of all aspects (pressed or not).

I don't know how to obtain the default aspect of buttons in the light theme, so can anyone tell me where I can find the original parameters of the light theme or at least give me another means to simply change the color of the button when clicked?

Was it helpful?

Solution

You can copy the Android's selector into your project, the one that Android sets it by default to buttons, and modify only the state when the button is pressed by just changing one single drawable.

You could find the file in \android-sdk\platforms\android-10\data\res\drawable\btn_default.xml

OTHER TIPS

Sorry bro........... i guess only selector will help you...... You must go with selector..... and selector are reusable xmls you can use in all buttons.....:) You can refer below link. :) http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top