For the default android button, when I click on it, its color is changed to orange for a few seconds (for notifying the user the button is clicked). Anyway, I don\'t want th
Have a look on how button is styled by Android:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/btn_default_normal" />
<item android:state_window_focused="false" android:state_enabled="false"
android:drawable="@drawable/btn_default_normal_disable" />
<item android:state_pressed="true"
android:drawable="@drawable/btn_default_pressed" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/btn_default_selected" />
<item android:state_enabled="true"
android:drawable="@drawable/btn_default_normal" />
<item android:state_focused="true"
android:drawable="@drawable/btn_default_normal_disable_focused" />
<item
android:drawable="@drawable/btn_default_normal_disable" />
</selector>
To style your button with Android's themes images resources, just create your own selector by copying the Android's one and replace all @drawable/btn_default_*
by @android:drawable/btn_default_normal
in item
s tag (and just remove item
s you don't want). For example :
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true"
android:drawable="@android:drawable/btn_default_normal" />
</selector>
Then, apply this drawable selector as a android:background
of your button.
Hope it helps.
(If you want, I can also provide an example of applying this background easily to all your buttons, just ask.)