• Colton Idle

    Colton Idle

    1 year ago
    Any tips on how to get height and width of a composable at runtime after it's been drawn to the screen? My backend accepts a height and width param for an image url, but I won't know the exact size to request the image until it's laid out and so I'm looking to write a composable that knows how to do this using glide + accompanist. Just need a hint in terms of how I can get width and height after it's laid out I think. The fact that I'm using glide + accompanist is a detail (i think 😄 ) In classic android view-land we did this by making use of the ktx method called doOnLayout
    fun ImageView.loadImageToSize(url: String) {
        this.doOnLayout { <--- ktx method that replaced OnGlobalLayoutListener
             // it.width and it.height are accessible here
    ...
    }
    Colton Idle
    Albert Chang
    +1
    13 replies
    Copy to Clipboard
  • s

    Shivam Sethi

    1 year ago
    How can I enable typing with hardware keyboard in a TextField composable ? One of the app user is unable to type in because they have a blackberry device with hardware keyboard ?
    s
    Colton Idle
    +1
    7 replies
    Copy to Clipboard
  • j

    jacksparling

    1 year ago
    Why the android studio preview arctic fox 3.1 canary 8 keep telling me 'Invalid Gradle JDK configuration found.'? I've check the path it uses JDK 11 which is added in the directory of android studio preview.
    j
    itnoles
    12 replies
    Copy to Clipboard
  • t

    Tlaster

    1 year ago
    Has anyone getting error
    java.lang.IllegalArgumentException: 0 was already used with subcompose during this measuring pass
    after beta01 when setting
    initialFirstVisibleItemIndex
    for LazyColumn? Full stacktrace in thread.
    t
    Albert Chang
    +2
    7 replies
    Copy to Clipboard
  • v

    Vinay Gaba

    1 year ago
    I’m seeing some weirdness on beta-01 as I’m trying to upgrade my library. I’ve zeroed down the issue to the use of a
    TextField
    as the
    title
    slot of a
    TopAppBar
    . I’m actually using a
    TextField
    or a
    Text
    depending on some state (search being active vs not). The thread has more details. Has anyone noticed something similar?
    v
    e
    +1
    17 replies
    Copy to Clipboard
  • w

    wiktorl4z

    1 year ago
    Anyone had problem with spotless? I have uber newbie code:https://github.com/Wiktorl4z/dev-challenge/blob/week1_bark/app/src/main/java/com/example/androiddevchallenge/MainActivity.kt and I have an error.
    > Task :app:spotlessKotlin FAILED
    Can't parse copyright year '', defaulting to 2021
    Step 'ktlint' found problem in 'app\src\main\java\com\example\androiddevchallenge\MainActivity.kt':
    Error on line: 26, column: 1
    Wildcard import
    java.lang.AssertionError: Error on line: 26, column: 1
    I assume that he has problems with reading the copyright but It's default one..
    w
    Albert Chang
    +1
    6 replies
    Copy to Clipboard
  • Orhan Tozan

    Orhan Tozan

    1 year ago
    I have the following code
    OutlinedButton(shape = RoundedCornerShape(28.dp))
    It looks like it only applies it to the top corners? Is this a bug?
    Orhan Tozan
    Andrey Kulikov
    +2
    8 replies
    Copy to Clipboard
  • n

    note8g2018

    1 year ago
    Please tell Google to update the code lab for jetpack composehttps://developer.android.com/courses/pathways/compose It is not working now Because the code is old and there are many huge changes in the framework jetpack compose Google should update the code
    n
    Gabriel Melo
    +2
    5 replies
    Copy to Clipboard
  • d

    Daniel

    1 year ago
    I was accidentally also running the layout inspect, seems like that was the issue
    d
    Zach Klippenstein (he/him) [MOD]
    5 replies
    Copy to Clipboard
  • s

    Slackbot

    1 year ago
    This message was deleted.
    s
    1 replies
    Copy to Clipboard