You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem
The description of the sortedBy function says "lets you specify a lambda that returns the property you'd like to sort by". This is incorrect.
In fact the specified lamba should return an expression, which will control the sort order.
This expression typically will be based on properties of the collection being sorted, but is not required to be.
The current description (and subsequent example) leads one to imagine reflection where the lambda returns the name of the property to sort by, which is of course not the case.
In which lesson and step of the codelab can this issue be found?
Step 7, paragraph 2.
How to reproduce?
Add a property "factor" to the class Cookie of type Double
Change sortedBy expression in main() to { it.price*it.factor }
Versions
N/A this is purely a Kotlin lesson
Additional information
Add any other context about the problem here.
Name of the Codelab or Codelab URL
https://developer.android.com/codelabs/basic-android-kotlin-compose-higher-order-functions#6
Describe the problem
The description of the sortedBy function says "lets you specify a lambda that returns the property you'd like to sort by". This is incorrect.
In fact the specified lamba should return an expression, which will control the sort order.
This expression typically will be based on properties of the collection being sorted, but is not required to be.
The current description (and subsequent example) leads one to imagine reflection where the lambda returns the name of the property to sort by, which is of course not the case.
In which lesson and step of the codelab can this issue be found?
Step 7, paragraph 2.
How to reproduce?
Versions
N/A this is purely a Kotlin lesson
Additional information
Add any other context about the problem here.
codelab: basic-android-compose-training-add-scrollable-list
The text was updated successfully, but these errors were encountered: