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

Apache License 2.0
55 stars 80 forks source link

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

Open JuDCraide opened 2 months ago

JuDCraide commented 2 months 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#3

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

Describe the problem

Error on the text of the codelab. There is no EditNumberField, it is call TipTimeLayout() instead. The 2 solutions I see is to either to change the text of the codelab or function the name in https://github.com/google-developer-training/basic-android-kotlin-compose-training-tip-calculator/blob/starter/app/src/main/java/com/example/tiptime/MainActivity.kt

Steps to reproduce?

  1. Clone the project with the instructions given in step 3
    $ git clone https://github.com/google-developer-training/basic-android-kotlin-compose-training-tip-calculator.git
    $ cd basic-android-kotlin-compose-training-tip-calculator
    $ git checkout starter
  2. Open the MainActivity.kt in Android Studio -> https://github.com/google-developer-training/basic-android-kotlin-compose-training-tip-calculator/blob/starter/app/src/main/java/com/example/tiptime/MainActivity.kt
  3. See there is no function called EditNumberField
  4. The function is called TipTimeLayout instead

Versions Android Studio version: API version of the emulator:

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

JuDCraide commented 2 months ago

Following the rest of the course a function named EditNumberField is created on task 5. The Composition in stage 4. So the previous uses of this function in task 4. Use state in Compose and on task 5.1 are a mistake and should be replaced with TipTimeLayout. Thanks