google-developer-training / basic-android-kotlin-compose-training-inventory-app

Apache License 2.0
77 stars 84 forks source link

Read and update data using Room #76

Open FretlessT opened 10 months ago

FretlessT commented 10 months ago

URL of codelab:

https://github.com/google-developer-training/basic-android-kotlin-compose-training-inventory-app/issues/new?assignees=&labels=&template=read-and-update-data-using-room-issue-template-.md&title=Read+and+update+data+using+Room

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

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

12 through 13

Describe the problem

Step twelve sets "outOfStock" to quantity <= 0. Step thirteen asserts that the "Sell" Button is disabled when item quantity reaches 0, but button is not disabled because the Button function call has not been updated. Following change to ItemDetailsScreen.kt is needed to fully implement this change:

Button( onClick = onSellItem, modifier = Modifier.fillMaxWidth(), shape = MaterialTheme.shapes.small, enabled = !itemDetailsUiState.outOfStock

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.