Your First Kotlin Android App: An App From Scratch

Aug 15 2023 · Kotlin 1.8.20, Android 13, Android Studio Flamingo | 2022.2.1

Part 1: Get Started with Android Development

07. Build the Game UI

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 06. Get Started with Jetpack Compose Next episode: 08. Modify Composables

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

When you make an Android app, you build the layout using Composable functions or Composables for short. Composables in Android are a collection of layout components which you use to build the app’s UI. You can also call them components or widgets.

@Composable
fun GameScreen() {

}
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
  GameScreen() // New Code
}
...
fun GameScreenPreview() { // Updated Code
  ...
    GameScreen() // New Code
  ...
}
Text("PUT THE BULLSEYE AS CLOSE AS YOU CAN TO")
Text("89")
...
Column {
  Text("PUT THE BULLSEYE AS CLOSE AS YOU CAN TO")
  Text("89")
}
...
Column(
  horizontalAlignment = Alignment.CenterHorizontally,
)
...
Text("89", fontSize = 32.sp, fontWeight = FontWeight.Bold)
Slider(
  value = 0.5f,
  valueRange = 0.01f..1f,
  onValueChange = { }
)
Text("1")
Slider(
  ...
)
Text("100")
Row(
  verticalAlignment = Alignment.CenterVertically,
)
Button(onClick = { }) {
  Text("HIT ME")
}