I have a button.xml and I need to round the button in it and at the same time change colors when pressed. Here is the code:
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/button_pressed_color" android:state_pressed="true" /> <item android:drawable="@color/menu_color" android:state_focused="true" /> <item android:drawable="@color/button_color" /> <item> <shape> <corners android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" android:topLeftRadius="10dp" android:topRightRadius="10dp" /> </shape> </item> </selector> However, it does not work. If you remove the rounding or processing of pressing, then everything is fine, but not together. How to implement this feature?