Step 3

Add a background color to your activity and a CardView.

To add the CardView you will first need to add the dependency. You can find the latest version in the documentation.

Another way to add your dependencies without having to look for the documentation is from the File>Project Structure menu in Android Studio. Check the images below

At the project structure dialog, click on the plus item and then select "Library dependency"
Search by the name of the dependency, click on the search button and then click ok to add it to your project

After this step, your view should look like this:

The bottom of the screen is a View with background color set to it.

The colors I've used are :

  • Light background: #CDDC39

  • Dark background: #43A047

Paddings are at 16dp and the corner radius 8dp.

Last updated