Make your buttons look pretty

We colored our buttons and defined states for them. We colored each state differently. We have colors for disabled state, for enabled, and pressed states. Now we will go one step further. We will make our buttons rounded and color them with a gradient instead of a solid color. We will prepare a layout for a new button style. Open the activity_todo layout and modify the buttons container:

    <LinearLayout 
      android:background="@color/grey_text_light" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:weightSum="1"> 
           
      ... 
 
     </LinearLayout> 

We set the background the same as the one we used for the edit text field. Buttons will be rounded so we want them on ...

Get Mastering Android Development with Kotlin now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.