I know that you can make a selector and set different press modes there. But after all, standard libraries are now working very nicely pressing. My question is that when I create just a button in an empty activation and click on it, it makes a beautiful wave from the touch point and further along the entire button, but when I add my button
android:background="@drawable/stylecapturebutton" android:src="@drawable/photocamera" then she stops doing that ...
Here is the code of my ImageButton :
<ImageButton android:id="@+id/bPicture" android:onClick="bPicture" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/stylecapturebutton" android:src="@drawable/photocamera" android:padding = "10dp" /> Is it possible to somehow set the background and resource in the button, while at the same time maintaining the standard touch processing?
Such a button turned out
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <!--<solid android:color="@color/myColor" />--> <stroke android:width="1dp" android:color="@color/color_white" /> <size android:width="18dp" android:height="18dp" /> </shape> </item> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/button" android:state_focused="true" android:state_pressed="false" /> <item android:drawable="@drawable/button" android:state_focused="true" android:state_pressed="true" /> <item android:drawable="@drawable/button_pressed" android:state_focused="false" android:state_pressed="true" /> <item android:drawable="@drawable/button" /> </selector> </layer-list>
selector-ami to work? or is there something else? - Aleksey Timoshchenko