After hours of digging around multiple answers I finally found a solution that doesn't use a different element, manipulate minHeight
or minWidth
, or even wrapping Button
around a RelativeLayout
.
<Button
android:foreground="?attr/selectableItemBackground"
android:background="@color/whatever" />
The main takeaway here is the setting of the foreground instead of background as many of the answers stipulate. Changing the background itself to selectableItemBackground
will just overwrite any changes you made to the button's color/background, if any.
Changing the foreground gives you the best of both worlds: get rid of the "invisible" padding and retain your button's design.