Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Compose Add a Scrollable List #137

Open
DigKleppe opened this issue Oct 14, 2024 · 0 comments
Open

Android Compose Add a Scrollable List #137

DigKleppe opened this issue Oct 14, 2024 · 0 comments

Comments

@DigKleppe
Copy link

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

Describe the problem
The code on the website for the final AffirmationsApp is different from the code in github. Errors om Modifier and AffirmationsList

// from website
fun AffirmationsAppWebsite() {
    val layoutDirection = LocalLayoutDirection.current
    Surface(
        Modifier = Modifier
            .fillMaxSize()
            .statusBarsPadding()
            .padding(
                start = WindowInsets.safeDrawing.asPaddingValues()
                    .calculateStartPadding(layoutDirection),
                end = WindowInsets.safeDrawing.asPaddingValues()
                    .calculateEndPadding(layoutDirection),
            ),
    ) {
        AffirmationsList(
            affirmationList = Datasource().loadAffirmations(),
        )
    }
}

// from github, OK
@Composable
fun AffirmationsApp() {
    AffirmationList(
        affirmationList = Datasource().loadAffirmations(),
    )
}

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

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
    Android Studio Ladybug | 2024.2.1
    Build #AI-242.21829.142.2421.12409432, built on September 24, 2024
    Runtime version: 21.0.3+-12282718-b509.11 amd64
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
    Toolkit: sun.awt.X11.XToolkit
    Linux 6.8.0-45-generic
    Kotlin plugin: K2 mode (Beta)
    GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
    Memory: 2048M
    Cores: 16
    Registry:
    ide.experimental.ui=true
    i18n.locale=
    Current Desktop: ubuntu:GNOME

  2. What API level are you targeting?
    33

Additional information

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant