Android Programming: The Big Nerd Ranch Guide, 5th Edition
by Bryan Sills, Brian Gardner, Kristin Marsicano, Chris Stewart
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 24.
Before setting up anything else, open the app/build.gradle file. As in other apps, you are going to use View Binding to help you out in Sunset.
Listing 25.1 Setting up View Binding (app/build.gradle)
...
android {
...
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}
Do not forget to sync your changes with Gradle.
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 25.2 Adding sunset colors (res/values/colors.xml ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access