Your First Kotlin Android App: Polishing the App

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

Part 1: Build Out the App

03. Add Other Game Controls

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: 02. Set App Orientation Next episode: 04. Display the Score

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.

Notes: 03. Add Other Game Controls

String resource for this episode:

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

Info Start Over Score Round


@Composable
fun GameDetail(modifier: Modifier = Modifier) {

}
@Preview(showBackground = true)
@Composable
fun GameDetailPreview() {
  GameDetail()
}
Row(
  modifier = modifier
) {

}
//...
  Button(onClick = {}) {
    Text(stringResource(R.string.start_over))
  }
  // Score Widget
  // Round Widget
  Button(onClick = {}) {
    Text(stringResource(R.string.info))
  }
//...
@Composable
fun GameInfo(label: String, value: Int = 0) {
  Column(
    horizontalAlignment = Alignment.CenterHorizontally,
    modifier = Modifier.padding(horizontal = 32.dp)
  ) {
    Text(label)
    Text(
      value.toString(),
    )
  }
}
GameInfo(label = stringResource(id = R.string.score_label), value = 0)
GameInfo(label = stringResource(id = R.string.current_round_label), value = 1)
verticalAlignment = Alignment.CenterVertically,
GameDetail()
GameDetail(modifier = Modifier.fillMaxWidth())
horizontalArrangement = Arrangement.SpaceEvenly,