Building the Scene

The first step is to build the scene that will be animated. Create a new project called Sunset. Make sure that your minimum API level is set to 21, and use the empty activity template and AndroidX artifacts.

A sunset by the sea should be colorful, so it will help to start by naming a few colors. Open the colors.xml file in your res/values folder and add the following values to it.

Listing 31.1  Adding sunset colors (res/values/colors.xml)

    <color name="colorPrimary">#008577</color>
    <color name="colorPrimaryDark">#00574B</color>
    <color name="colorAccent">#D81B60</color>

    <color name="bright_sun">#fcfcb7</color>
    <color name="blue_sky">#1e7ac7</color>
    <color name="sunset_sky">#ec8100</color>
    <color name="night_sky">#05192e</color> ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

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