google-developer-training / basic-android-kotlin-compose-birthday-card-app

Apache License 2.0
125 stars 95 forks source link

Text composables: Android Basics with Compose #885

Open Houda-tdi201 opened 1 month ago

Houda-tdi201 commented 1 month ago

URL of codelab

developer.android.com/codelabs/basic-android-kotlin-compose-text-composables?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-1-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-text-composables#8 In which task and step of the codelab can this issue be found?

Describe the problem ---The problem is in this code:

@Composable fun GreetingText(message: String, from: String, modifier: Modifier = Modifier) { Column( verticalArrangement = Arrangement.Center, modifier = modifier ) { // ... } }

----This code is not enough to make the text (birthday greeting) in the center of the screen. ----Instead, it should be like this:

@Composable fun GreetingText(message: String, from: String, modifier: Modifier = Modifier) { Column( verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, modifier = modifier.fillMaxSize() ) { // ... } }

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions Android Studio version: API version of the emulator:

Additional information Include screenshots if they would be useful in clarifying the problem.