google-developer-training / basic-android-kotlin-compose-training-woof

Apache License 2.0
55 stars 87 forks source link

Material Theming: Android Basics with Compose #58

Open MinusMallard opened 1 year ago

MinusMallard commented 1 year ago

URL of codelab https://developer.android.com/codelabs/basic-android-kotlin-compose-material-theming?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-3-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-material-theming#3

In which task and step of the codelab can this issue be found? Card composable of function DogItem should contain modifier parameter in Material Theming of JetPack Compose step no 4 (Add color)

Describe the problem the problem is that in DogItem function there is no usage of modifier it should be passed to card composable

Steps to reproduce?

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

Versions Android Studio version: giraffe API version of the emulator: 34

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

BEFORE

@Composable fun DogItem( dog: Dog, modifier: Modifier ) { Card() { Row( modifier = modifier .fillMaxWidth() .padding(dimensionResource(R.dimen.padding_small)) ) { DogIcon(dog.imageResourceId) DogInformation(dog.name, dog.age) } }

}

**AFTER

@Composable fun DogItem( dog: Dog, modifier: Modifier ) { Card(modifier) { Row( modifier = modifier .fillMaxWidth() .padding(dimensionResource(R.dimen.padding_small)) ) { DogIcon(dog.imageResourceId) DogInformation(dog.name, dog.age) } }

}