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

08. Modify Composables

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: 07. Build the Game UI Next episode: 09. Add String Resources

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: 08. Modify Composables

SOLID Principles

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

In the last episode you got started with working with composables and adding the base components for the Bullseye app. You were introduced to composable function parameters which lets you modify or affect your composables in some way.

Column(
  horizontalAlignment = Alignment.CenterHorizontally,
  modifier = Modifier.fillMaxSize() // New Code
)
modifier = Modifier
  .fillMaxSize()
  .padding(16.dp),
verticalArrangement = Arrangement.Center,
verticalArrangement = Arrangement.SpaceEvenly,
// Inner Column
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.SpaceEvenly,
Spacer(modifier = Modifier.weight(.5f)) // New Code
Column(
  // ...
  modifier = Modifier.weight(9f) // New Code
) {
  //...
Spacer(modifier = Modifier.weight(.5f)) // New Code
Row(
  verticalAlignment = Alignment.CenterVertically,
) {
  Text(
    "1",
    textAlign = TextAlign.Center, // New Code
    modifier = Modifier.padding(start = 16.dp) // New Code
  )
  Slider(
    // ...
    modifier = Modifier.weight(1f) // New Code
  )
  Text(
    "100",
    textAlign = TextAlign.Center, // New Code
    modifier = Modifier.padding(end = 16.dp) // New Code
  )
}