Skip to content

Android Compose Add a Scrollable List #244

Description

@zarub2k

Name of the Codelab or Codelab URL
https://developer.android.com/codelabs/basic-android-kotlin-compose-training-add-scrollable-list?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-3-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-training-add-scrollable-list#2
Add a scrollable list

Describe the problem
Under "Add a list to your app" section, the example code has a small typo. Under the Surface element, the variable name for the 'modifier' should be in small case. But here in the example it is mentioned with upper case. Due to that the program is NOT compiled.

@composable
fun AffirmationsApp() {
val layoutDirection = LocalLayoutDirection.current
Surface(
Modifier = Modifier
.fillMaxSize()
.statusBarsPadding()
.padding(
start = WindowInsets.safeDrawing.asPaddingValues()
.calculateStartPadding(layoutDirection),
end = WindowInsets.safeDrawing.asPaddingValues()
.calculateEndPadding(layoutDirection),
),
) {
}
}

In which lesson and step of the codelab can this issue be found?
Lesson step 3

How to reproduce?
I simply changed the Modifier variable name to small case and it started working.

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: basic-android-compose-training-add-scrollable-list

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions