I need a button with no padding with the specified background color and the default ripple effect:

enter image description here

I tried to do this:

<Button style="@style/Button.Default" android:id="@+id/next" android:layout_width="0dp" android:layout_height="wrap_content" android:text="@string/continue_text" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent"/> 

styles.xml:

 <style name="Button.Default" parent="Widget.AppCompat.Button.Borderless.Colored"> <item name="colorButtonNormal">@color/accent</item> <item name="android:textColor">@android:color/white</item> </style> 

Got the following:

enter image description here

Plus, when I click, I see the highlighting with indents:

enter image description here

  • android: background = "? android: attr / selectableItemBackgroundBorderless" - for ripla - Sviat Volkov
  • @ Sviat-volkov, in the end I see a ripple effect on the floor of the screen (that is, beyond the borders of the button), with the background being the same sadness. - Yura Shinkarev
  • remove Borderless and will be on the size of the button - Sviat Volkov
  • And what about the color of the button? - Yura Shinkarev
  • one
    Well, then put your color in the background, and in the foreground? android: attr / selectItemBackground - Sviat Volkov

0