Skip to content

Use function types and lambda expressions in Kotlin: Android Basics with Compose #225

Description

@2390183798

URL of codelab
https://developer.android.google.cn/codelabs/basic-android-kotlin-compose-function-types-and-lambda?hl=zh-cn&continue=https%3A%2F%2Fdeveloper.android.google.cn%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%3Fhl%3Dzh-cn%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-function-types-and-lambda#4

In which task and step of the codelab can this issue be found?
【省略参数名称】

Describe the problem
更新 coins() 函数以使用参数的简写语法:

在 coins() 函数中,移除 quantity 参数名称和 -> 符号。
val coins: (Int) -> String = { "$quantity quarters" }
这段代码, 没有变量,应该是

val coins: (Int) -> String = { quantity -> "$quantity quarters" }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions