https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
compose
  • j

    Jonas

    06/20/2022, 8:20 PM
    ContentAlreadySetError cc.: @Jelle Fresen [G] Can you elaborate a little bit on that? Why is that always bad? We have a test that perfectly worked pre 1.2.0-rc01 and now breaks with this exception. (more details in the thread) Whats the alternative?
    • 1
    • 1
  • z

    Zoltan Demant

    06/21/2022, 4:06 AM
    Is it possible to change the background color of a
    DropdownMenu
    ? It seems to inherit it from the theme internally. Using
    Modifier.background
    doesnt work in the sense that Im able to see parts of the inherited background as well.
    d
    s
    • 3
    • 4
  • g

    galex

    06/21/2022, 7:50 AM
    What's the best option to run a modifier only if a value is not null? We've created this:
    inline fun Modifier.optional(
        block: Modifier.() -> Modifier?
    ) = block() ?: this
    And we use it this way:
    .optional {
        frameColor?.let {
            border(4.dp, it, CircleShape)
        }
    }
    It there a better way to do this? 🤔
    z
    y
    a
    • 4
    • 7
  • s

    Satyam G

    06/21/2022, 10:46 AM
    Hello, Do any one have any idea on How to Make BackHandler {....} work when dialog is already displayed on Screen. I want to exit app when back button is pressed when Dialog is displayed . But right now that Back event is catch by system and dismiss the Dialog. how to resolve this ?
    c
    n
    • 3
    • 2
  • j

    Javier

    06/21/2022, 11:03 AM
    Is live edit working with multimodule with KMP?
    c
    • 2
    • 8
  • m

    Matti MK

    06/21/2022, 11:49 AM
    I have an app with three distinct graphs, each with separate needs for a
    Scaffold
    . • Graph1 has no scaffold • Graph2 has typical bottom scaffold • Graph3 has top and bottom scaffolds, but only with
    Graph3
    routes I am wondering how to build this. Should I have multiple
    Scaffold
    and
    NavHost
    or instead use just one
    NavHost
    and one
    Scaffold
    , switching out the
    Scaffold
    content based on current Graph? Thank you 🙂
    k
    c
    • 3
    • 8
  • a

    Andrei Kovalev

    06/21/2022, 1:04 PM
    Hi folks, LazyVerticalGrid in
    1.2.0-beta02
    crashes (only on OPPO and Realme devices) when calculating child constraints.
    crossAxisSize
    has a negative value. Does anyone experience the same crash?
    a
    • 2
    • 6
  • c

    Christian Meese

    06/21/2022, 1:24 PM
    We have some problems with the statusbarpadding appearing to be 0 only on some devices… so far only observed on Android 10 (Pixel XL Emulator and Xiaomi real device) but not on higher APIs … has anybody come across this / is this a known issue?
    👀 2
    a
    a
    • 3
    • 9
  • d

    Dan Peluso

    06/21/2022, 2:32 PM
    I'm looking for a component that could work for a 'popup' effect on my screen. Something where it could appear to be 'on top of' other screen components (raised z axis) but having some trouble implementing. At first I thought a Box would be good, but when that is embedded in a row and column it will resize and move other components around. I want it to appear above these components instead - is there a way to do that with a box or should I be using a different component?
    l
    j
    o
    • 4
    • 7
  • d

    dorche

    06/21/2022, 3:34 PM
    Has anyone done a PDF Viewer type of component in Compose? Would people generally just wrap existing libraries that were build for the old view system? Looking for the correct/good way of doing this, in a full compose app (don’t mind wrapping an android view tho if that’s what we have to do).
    j
    • 2
    • 9
  • t

    theapache64

    06/21/2022, 8:31 PM
    Does compose
    1.2.0-*
    needs
    Android32
    as targetSdk? Happening when am using latest accompanist version 🤔
    i
    • 2
    • 2
  • t

    theapache64

    06/21/2022, 8:44 PM
    😬 could be a stupid question: If a library is transitively using a latest alpha version of compose, (eg,
    1.2.0-alpha01
    ) and the app using latest stable version (eg.
    1.1.1
    ), which version will gradle pick? (i hope its the former -
    1.2.0-alpha01
    ) In that case, if there’s a breaking API change in the latest version, how that’s managed by gradle? Would that fail the build? or does compose compiler will do some magic? 👀 Would this version conflict can cause an error like this?
    e
    n
    • 3
    • 4
  • j

    james

    06/21/2022, 10:21 PM
    question for those who are using one
    NavHost
    , one
    Scaffold
    and
    BottomNavigation
    at the root level, with many nested screens & Composables under that: is there a recommended way to show and hide the
    BottomNavigation
    ? I have a nested
    LazyColumn
    which I’d like to use to trigger showing/hiding of that
    BottomNavigation
    when I scroll up/down. this is fairly simple when the
    BottomNavigation
    is “closer” to the Composable triggering it, but when it’s deeply nested I wonder what the best solution is? do I simply pass a lambda like
    toggleBottomNavigationVisibility
    all the way from the top level where the
    Scaffold
    is, through many Composables, down into my deeply nested one? this would work but I would like to know if there’s a better way and my brain isn’t seeing it 😄
    a
    c
    • 3
    • 9
  • d

    David Corrado

    06/21/2022, 10:51 PM
    I am trying to get some content align with in a specific way and wanted some thoughts on how you would build this. Weight of 1 seems to fill the full width so I am nesting that and assumed I could put something to the right of it but its off the screen 🧵
    d
    c
    +2
    • 5
    • 14
  • a

    allan.conda

    06/22/2022, 5:48 AM
    Hello, how are you guys saving and restoring the text states for your
    TextFields
    ?
    l
    g
    +6
    • 9
    • 27
  • r

    raghunandan

    06/22/2022, 7:33 AM
    I drew a rectangle where i wanted only top left and bottom left rounded. But when you zoom in the corners look bad. Is it something to do with anti-aliasing. I draw rect with path. https://gist.github.com/raghunandankavi2010/aecb872b021dc42a9568d76c023629ca. How can i make this rounded corner smooth?. Emulator screen shot added.
    a
    f
    • 3
    • 5
  • j

    jasu

    06/22/2022, 9:49 AM
    How do I call methods of view in androidView?
    AndroidView(
                    factory = {
                        CropImageView(it).apply {
                            setCenterMoveEnabled(true)
                            setSnapRadius(16f)
                            setBackgroundColor(Color.Black.toArgb())
                            with(density) {
                                layoutParams = ViewGroup.LayoutParams(maxWidth.roundToPx(), maxHeight.roundToPx())
                            }
                        }
                    },
                    update = { cropView ->
                        // how to call cropView.rotateImage(90)                                    }
                )
    m
    a
    • 3
    • 28
  • b

    Billy Newman

    06/22/2022, 1:23 PM
    I am having some issues with LazyListState and the initial scroll position. In some cases I am trying to set the position to the last item in the list. This works for smaller lists, say 20 items. But when I get to larger lists I seem to end up in the middle of the list. Code in reply
    n
    • 2
    • 11
  • z

    Zoltan Demant

    06/22/2022, 2:32 PM
    Wouldnt it be beneficial to have navigation logic outside of compose? Ive seen quite a few navigation libraries where a navigator sits at the root, and the different screen composables of the app delegate onViewDetails, etc, to the navigator which manipulates the backstack to show the appropiate screen. 🧵
    💡 1
    👍 1
    c
    c
    +7
    • 10
    • 21
  • m

    Marco Pierucci

    06/22/2022, 3:25 PM
    Is there a chance Pager loads pages without being attached ? I have a very simple layout with custom measurements/placements. That layout is used on every Pager page. I had no problem for months, but the moment I updated Compose (1.05 -> 1.2.0-rc1) and accompanis (0.18 -> 0.24.11-rc) I started seeing :
    Fatal Exception: java.lang.IllegalStateException: LayoutCoordinates androidx.compose.ui.node.InnerPlaceable@50d1d48 is not attached!
    On firebase, without code changes. Worst of all is that It cant even bee reproduced reliable
    a
    • 2
    • 4
  • s

    spierce7

    06/22/2022, 4:07 PM
    If I have the below code, Is there a way to clip B to only where A has content (not clip to bounds, but actually clip B to where A has drawn)?
    Box {
      A()
      B()
    }
    It’s fine if the API here changes. The only way I can think to do this would be to somehow render A and B to `ImageBitmap`s and then draw them in a
    Canvas
    with a
    BlendMode
    . However the only way that I can think to get A or B to
    ImageBitmap
    would be with
    ImageComposeScene
    which seems like a really bad idea.
    r
    • 2
    • 2
  • z

    zsperske

    06/22/2022, 5:23 PM
    Hello, I am implementing smooth scroll to top functionality, but the call to scroll to the top comes from outside compose land. Is this a proper way to use a LaunchedEffect?
    if (viewModel.state.scrollToTop) {
        LaunchedEffect(viewModel.state.scrollToTop) {
            scrollState.animateScrollTo(0)
            viewModel.updateScrollToTop(false)
        }
      }
    s
    • 2
    • 29
  • r

    rkeazor

    06/22/2022, 6:35 PM
    When Compose 1.2.0 reaches stable , will it target 1.6.21 or 1.7.0 of the Kotlin Compiler
    f
    e
    +5
    • 8
    • 16
  • c

    Colton Idle

    06/22/2022, 6:53 PM
    Maybe I need more sleep... but how do I make sure that I use the default capitalization EXCEPT when I declare the type to be a NAME?
    KeyboardOptions.Default.copy(
        capitalization = when (textFieldType) {
            MyCustomInputFieldType.EMAIL -> "How do I use the default here?"
            MyCustomInputFieldType.NAME -> KeyboardCapitalization.Sentences
            MyCustomInputFieldType.NUMBER -> "and here?"
        }
    j
    l
    • 3
    • 4
  • c

    Colton Idle

    06/22/2022, 7:13 PM
    😛arty-parrot: Compose Version 1.2.0-rc02 out today! • Nothing substantial! Hooray getting close to stable material3 Version 1.0.0-alpha13 out today! • Supports maintaining the top app bar position on configuration change • Fix Material outline text field label measurement (although I think this was in the previous release)
    👍🏻 1
    :party-parrot: 3
    :thank-you: 2
    n
    r
    • 3
    • 4
  • k

    Kunal Raghav

    06/22/2022, 7:41 PM
    Hi everyone, I was currently working on my apps with colors and themes using compose, does anyone have an idea how to change the cursor color from this very bright pink to something else
    a
    • 2
    • 2
  • c

    Colton Idle

    06/22/2022, 8:18 PM
    I have an ExposedDropDownMenu that is extremely laggy delayed when opening. It takes like a good 4 seconds (and yes this happens in release builds too). I have a bunch of items (it's a country picker actually). My idea was "I know lets make it Lazy" but that leads to a crash. Any ideas from anyone?
    r
    f
    +2
    • 5
    • 15
  • m

    Manojna Chintapalli

    06/23/2022, 12:16 AM
    Hi! I am trying to implement swipeable buttons like below...like you can swipe that blue highlighted box to select a different setting. However, I am not yet fully successful in doing so.. please share if you have any helpful ideas or links. Thanks!
    a
    c
    • 3
    • 2
  • t

    theapache64

    06/23/2022, 5:57 AM
    In which compose version, foundation introduced the
    WindowInsets
    class ? 🤔
    c
    • 2
    • 5
  • h

    Honey Sandy

    06/23/2022, 9:33 AM
    Hi guy is there any best practise of compose and jetpack? Thanks!
    l
    • 2
    • 2
Powered by Linen
Title
h

Honey Sandy

06/23/2022, 9:33 AM
Hi guy is there any best practise of compose and jetpack? Thanks!
l

lilypuchi

06/23/2022, 9:36 AM
Don’t know if you’re looking for anything specific. But nowinandroid is a good place to start I guess. Even the Compose documentations are well written. https://github.com/android/nowinandroid
h

Honey Sandy

06/23/2022, 9:56 AM
Thanks a lot! Lily
View count: 13