google-developer-training / basic-android-kotlin-compose-training-mars-photos

Solution code for Android Basics in Kotlin course
https://developer.android.com/courses/android-basics-kotlin/course?gclid=CjwKCAjw4c-ZBhAEEiwAZ105RTyT-iaLHzrhMBUXdMhO230ZDwOwxxI2x4RgK8DwBxK8t1h0wmU_QxoCi4YQAvD_BwE
Apache License 2.0
66 stars 58 forks source link

Add Repository #48

Open gabriel-aquino-jr opened 1 year ago

gabriel-aquino-jr commented 1 year ago

URL of codelab: https://developer.android.com/codelabs/basic-android-kotlin-compose-add-repository#5

Specify the language of the codelab if it is not English:

In which task and step of the codelab can this issue be found? step 8

Describe the problem The code provided in this step is different from the solution.

Steps to reproduce?

  1. Go to... MainActivity.kt
  2. Click on... Type this method: MarsPhotosTheme { val viewModel: MarsViewModel = viewModel(factory = MarsViewModel.Factory) MarsPhotosApp(viewModel) }
  3. See error... See that viewModel is not of type Modifier.

Versions Android Studio version: 2022.1.1 API version of the emulator:

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

image

gabriel-aquino-jr commented 1 year ago

Solved that way, adding viewModel parameter in the MarsPhotosApp:

image

osuleymanova commented 1 year ago

Duplicate of #45, #38, #31, #29, #25, #20