I do not understand how to make such a trace at the button, which is filled when you click on it. Maybe someone knows how?

enter image description here Total:

enter image description here

  • Try adding this here for the necessary elements in the markup: android:background="?selectableItemBackgroundBorderless" - Yuriy SPb
  • First, what does the question mark mean? Secondly, if I change the background, then the picture will fly off, respectively. - Michael Shcherbakov
  • ? - this is an indication that it is necessary to take a value from the current topic, i.e. the value may be different for the light / dark theme and will be different in these cases. The picture should not be installed as a background. If you have an ImageView , use android:src for the image. - Yuriy SPb
  • In general, I decided to use FloatingActionButton. But there were 2 problems. Photo in question. If the button is pressed, then a shadow appears in it, although elevation stands at 0. And the second is how to adjust the position of the picture, otherwise it is somehow crooked. - Michael Shcherbakov
  • FAB is very poorly configured. Use ImageView with background and image - it will definitely work and you can customize anything. FAB is not good here, it is for another. - Yuriy SPb

1 answer 1

New-> Android XML File (Drawable, selector) with a name like "icon_phone" that’s this:

  <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/button_pressed" android:state_pressed="true" /> <item android:drawable="@drawable/button_normal" /> </selector> 

you create two files in drawable resources: drawable / button_normal - vessels image not pressed, drawable / button_pressed - vessels image pressed (with a trace)

in the properties of the button:

 android:drawable="@drawable/icon_phone" 
  • So it's not about changing the pictures of a button that is pressed and not pressed. Open VC and there it is implemented in the player. There, when pressed, it fills itself in the form of a circle. - Michael Shcherbakov
  • it is necessary to formulate the question correctly, with reference to VK, for example. I do not use it, I'm sorry I did not recognize it by appearance. - avp
  • Sorry, not used to asking trivial questions) - Michael Shcherbakov