google-developer-training / basic-android-kotlin-compose-training-tip-calculator

Apache License 2.0
60 stars 88 forks source link

Intro to state in Compose: Android Basics with Compose #125

Open rdhpn opened 1 year ago

rdhpn commented 1 year ago

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

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

9

Describe the problem Here says "Note: The ?: Elvis operator returns the expression that precedes it if the value isn't null and the expression that proceeds it when the value is null. It lets you write this code more idiomatically. For more information, see Elvis operator." But when you click on the link, you see that: If the expression to the left of ?: is not null, the Elvis operator returns it, otherwise it returns the expression to the right. Note that the expression on the right-hand side is evaluated only if the left-hand side is null.

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.

android-dev-lxl commented 1 year ago

@rdhpn Thank you for reaching out to us. The codelab seems to explaining the same Kotlin definition differently. Could you please explain us the issue further?