How do I implement the \"raised button\" and the \"flat button\" as described in google\'s material design guidelines?
Raised buttons add dimension
This requires Android 5.0
Raised Button
Inherit your button style from Widget.Material.Button, and the standard elevation and raising action will automatically be applied.
Then you need to create a raised_button_background.xml
file with your button's background color inside a ripple tag:
Flat Button
Edit: Instead of my previous advice for flat buttons, you should instead use follow the advice given by Stephen Kaiser below:
Edit: If you are using Support Library, you can achieve the same result on Pre-Lollipop devices by using style="?attr/borderlessButtonStyle"
. (notice the absence of android:
) The above example then becomes