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
  • c

    Chachako

    04/30/2021, 6:45 AM
    How to display multiple dialog boxes in sequence with the most elegant code? dialog1 -> dialog2 -> dialog3 (The messy code in the thread 😅 and maybe this is the flaw of declarative...
    p
    f
    +2
    • 5
    • 9
  • s

    Smorg

    04/30/2021, 7:29 AM
    Hi, anyone knows if the RC releases of AS works with compose?
    j
    c
    • 3
    • 2
  • m

    MaxUt

    04/30/2021, 9:34 AM
    Hi there, I'm trying to maintain the navigation and scrollstate of a WebView but haven't manage to make it work so far. I decided to hoist the webView and webViewClient to the parent composable but when switching tab, the webview doesn't seem to come back to its previous state. Any idea what would cause such problem ?
    f
    j
    z
    • 4
    • 7
  • p

    Paul Woitaschek

    04/30/2021, 11:06 AM
    I'm running into issues between ComposeView interop:
    ViewTreeLifecycleOwner not set for this ComposeView
    This is because the transition manager detaches the view for transitions:
    at android.view.ViewGroupOverlay.add(ViewGroupOverlay.java:72)
            at androidx.transition.ViewGroupOverlayApi18.add(ViewGroupOverlayApi18.java:48)
            at androidx.transition.Visibility.onDisappear(Visibility.java:431)
            at androidx.transition.Visibility.createAnimator(Visibility.java:257)
            at androidx.transition.Transition.createAnimators(Transition.java:744)
            at androidx.transition.Transition.playTransition(Transition.java:1808)
            at androidx.transition.TransitionManager$MultiListener.onPreDraw(TransitionManager.java:300)
    Is this a known thing?
    e
    • 2
    • 3
  • d

    Daniele B

    04/30/2021, 12:33 PM
    If we are using JetpackCompose Navigation, is there a suggested path to support dual-pane for tablets? In other words, if we define a master screen and a detail screen as separate
    NavHost
    composables, is there a way to tell Navigation to show them next to each other on a bigger screen in landscape?
    b
    i
    a
    • 4
    • 14
  • s

    Semyon Zadorozhnyi

    04/30/2021, 2:26 PM
    Hi! I’m practicing Compose for desktop and I’m stuck with the problem: I have “screenState: StateFlow” value with state for my UI (sealed class) From UI I use default approach “screenState.collectAsFlow()” to trigger recomposition if state changes and I have method “subscribe(chatRoom: ChatRoom)” in my ApplicationController (aka view model for desktop) which calls to a useCase and returns Flow<Message>. Emitter takes my state and makes a copy with a new message but from time to time Compose ignores (or misses) new state value. Screenshots in thread.
    n
    f
    • 3
    • 14
  • r

    robnik

    04/30/2021, 4:43 PM
    What's the latest way to hook into the "back" button? I see some older posts but they seem outdated. I'm experimenting with writing a custom nav controller, since the official NavController does not do what I want. It seems relatively easy thanks to Compose, but the back button is a question mark... maybe more difficultly is hiding there.
    z
    i
    • 3
    • 5
  • v

    Vince Rickey

    04/30/2021, 5:18 PM
    Layout Intrinsics example from Layouts in Compose documentation and CodeLab doesn't seem to be working. Screenshots and code in the thread.
    🙂 1
    y
    • 2
    • 5
  • m

    Michal Klimczak

    04/30/2021, 6:09 PM
    I think there might be a bug in the error message for compose compiler or I don't understand something. I get:
    This version (1.0.0-alpha13) of the Compose Compiler requires Kotlin version 1.4.31 but you appear to be using Kotlin version 1.4.32 which is not known to be compatible. Please fix your configuration (or
    suppressKotlinVersionCompatibilityCheck
    but don't say I didn't warn you!).
    But the version I'm using is
    1.0.0-beta03
    . Also, when I had
    1.0.0-beta01
    it complained
    This version (1.0.0-alpha13) of the Compose Compiler requires Kotlin version 1.4.30 but you appear to be using Kotlin version 1.4.32 which is not known to be compatible. Please fix your configuration (or
    suppressKotlinVersionCompatibilityCheck
    but don't say I didn't warn you!).
    So it's still saying
    (1.0.0-alpha13)
    even though reports that it requires a different kotlin version. Where do I even report that?
    j
    j
    • 3
    • 2
  • c

    Cicero

    04/30/2021, 7:01 PM
    I have a question. I’ve been punishing myself here trying to achieve what’s in the linked image, I kind of got it with drawing an arc bit I can get the arch to be aligned or anchored to the bottom of the image. Please, if you know how to improve my snippet or do this in a simpler way, code snippet of what I currently have is in the thread…
    n
    r
    o
    • 4
    • 31
  • r

    Ravi

    04/30/2021, 8:18 PM
    Hi, our app min sdk is 16 & we are planning to migrate to api 21 for compose but don't want to loose <21 user base. They should be able download at least older version (of course no updates) instead of seeing
    This app is not compatible with your device
    in playstore. I've seen multiple-apk approach but it might increase our release cycle complexity. Is there a way to retain older
    aab
    to cater <21 api level? Also if we want to provide
    liteversion
    to <21 is it possible ? Any help/suggestions would be appreciated.
    :stackoverflow: 1
    i
    • 2
    • 1
  • n

    Nat Strangerweather

    04/30/2021, 8:38 PM
    Collision Detection Question: I am dragging some boxes around my screen and I want to create an animation when one box touches another. Is this possible or would I be better off transferring everything to a Canvas? If it is possible, could someone please point me in the right direction. I can deal with the doc; I just don't know where to start to detect collision between boxes in Compose. Thanks!
    👀 1
    o
    s
    • 3
    • 10
  • j

    John O'Reilly

    05/01/2021, 11:47 AM
    Has anyone used any particular approach for adding coach marks when using Compose?
    k
    c
    +2
    • 5
    • 5
  • r

    rsktash

    05/01/2021, 1:01 PM
    Is there a plan to support native ads in jetpack compose?
    k
    j
    +2
    • 5
    • 7
  • s

    Slackbot

    05/01/2021, 1:29 PM
    This message was deleted.
    o
    m
    • 3
    • 3
  • c

    Colton Idle

    05/01/2021, 2:28 PM
    Possibly dumb question, but Icon has a tint param, while Image does not. If my image just displays a black vector and I want to set it to white, is this enough or am I breaking some kind of rule I don't know about? I might write my own VectorImage composable that just takes a tint like Icon. 😅
    colorFilter = ColorFilter.tint(MyTheme.colors.onSurfaceWhiteColor)
    s
    • 2
    • 1
  • r

    Rudolf Tammekivi

    05/01/2021, 2:32 PM
    Is there a way to color an SVG with different colors in Compose? Previously I used ContextThemeWrapper with a custom theme and in the SVG I set the fillColor to my custom attribute ( for example:
    android:fillColor="?attr/ferryOutside"
    ) . This allowed me to reuse the same SVG for different colored images. I am wondering if there is a way to do this in Compose and maybe there is a better way? I need to use multiple colors in the SVG, it seems like LocalContentColor is not suitable for this use.
    c
    • 2
    • 3
  • d

    dewildte

    05/01/2021, 5:58 PM
    Anybody know how to fix this:
    e: This version (1.0.0-alpha13) of the Compose Compiler requires Kotlin version 1.4.30 but you appear to be using Kotlin version 1.4.31 which is not known to be compatible.  Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
    All my dependencies are
    1.0.0-beta05
    so this error seems impossible. EDIT: Fixed
    c
    g
    • 3
    • 3
  • l

    Lilly

    05/01/2021, 7:08 PM
    Having this sample, when checking the first item and scrolling the list, the item is unchecked again, so the state is reset on scrolling, but why? I'm blind
    @Preview(device = Devices.PIXEL)
    @Composable
    private fun TestPreview() {
        LazyColumn {
            repeat(20) {
                item {
                    val checkedState = remember { mutableStateOf(true) }
                    Checkbox(
                        checked = checkedState.value,
                        onCheckedChange = { checkedState.value = it }
                    )
                    Spacer(modifier = Modifier.height(24.dp))
                    Divider()
                }
            }
        }
    }
    f
    z
    • 3
    • 4
  • a

    Adrian Landborn

    05/02/2021, 9:15 AM
    We have stated to build a Design System Library which will be consumed by multiple apps. Are there any good articles, tutorials or such to get inspiration from? I am opting for Compose but the POs (and teams to consume this lib) thinks its too early to to use Compose. Anyone built a proper DSL with Compose yet?
    d
    z
    • 3
    • 9
  • s

    Shakil Karim

    05/02/2021, 12:14 PM
    Finally, Prefetch API's are added to the LazyColumn/Row, Hopefully, it increases performance. https://android-review.googlesource.com/c/platform/frameworks/support/+/1673249
    👍 6
    g
    g
    • 3
    • 2
  • s

    ste

    05/02/2021, 1:21 PM
    Hi guys, is combining
    width(IntrinsicSize.Max)
    and
    animateContentSize
    intended to throw an exception (
    Can't represent a size of 2147483647 in Constraints
    )? Code in thread
    z
    w
    s
    • 4
    • 12
  • n

    Nat Strangerweather

    05/02/2021, 2:46 PM
    I'm using
    Modifier
        .onGloballyPositioned {
            position.value = it.positionInParent()
        }
    which is incredibly useful but I would need the value as DpOffset rather than Offset. Is that conversion at all possible?
    a
    • 2
    • 7
  • j

    Justin Tullgren

    05/03/2021, 12:47 AM
    Whats the recommended way to have screens without scaffold views when they are being loaded in a
    NavHost
    composable which is the
    content
    of a scaffold? Ex. The main screens should all have consistent bottomnav and topappbar but some screens need to go without and these screens are accessed from the main screen. Is this a nav subgraph situation, push the scaffold down into the screens, or something else I am missing? Thanks !
    i
    • 2
    • 2
  • s

    Shivam Sethi

    05/03/2021, 4:27 AM
    Please help, I am not able to instantiate viewModel which has dependencies injected to it through hilt. The app. crashes when I start that activity
    s
    i
    • 3
    • 3
  • s

    Shivam Sethi

    05/03/2021, 6:47 AM
    this activity was running fine 2 days ago, now it is crashing. I did not change anything in this file.😩
    s
    j
    • 3
    • 3
  • s

    Shakil Karim

    05/03/2021, 9:05 AM
    Is there any examples for loading new data when reaching last item on Lazycolumn?
    j
    s
    • 3
    • 3
  • m

    Mjahangiry75

    05/03/2021, 10:58 AM
    Is it possible to create Squircle shape in jetpack compose?
    n
    • 2
    • 13
  • n

    Nat Strangerweather

    05/03/2021, 2:11 PM
    This is quite basic but in the case of a custom layout, if I wanted to pass a measured value to another composable, is the best solution to use a View Model or is there a more straightforward way? Please see my code. I need to pass the
    boardWidth
    value elsewhere.
    k
    a
    • 3
    • 18
  • c

    clhols

    05/03/2021, 2:40 PM
    I have an issue where a ComposeView just freezes (animations stop and no input is registered) when navigating to its fragment. The profiler shows that the UI thread is just sleeping and doing nothing. It also shows the touches/clicks but the composables inside the ComposeView doesn't receive the clicks and animations do not run. The app (main thread) is not frozen as I can use a bottom nav view to switch to another fragment and back. If I do that then everything works as expected. It is triggered by a deep link which navigates to the startDestination of the nav graph just with a new Bundle containing the data from the deep link. Maybe there is a conflict between the nav component navigating to the startDestination and the deep link triggering another navigate() immediately afterwards. Any pointer on how to debug this?
    👀 1
    m
    • 2
    • 2
Powered by Linen
Title
c

clhols

05/03/2021, 2:40 PM
I have an issue where a ComposeView just freezes (animations stop and no input is registered) when navigating to its fragment. The profiler shows that the UI thread is just sleeping and doing nothing. It also shows the touches/clicks but the composables inside the ComposeView doesn't receive the clicks and animations do not run. The app (main thread) is not frozen as I can use a bottom nav view to switch to another fragment and back. If I do that then everything works as expected. It is triggered by a deep link which navigates to the startDestination of the nav graph just with a new Bundle containing the data from the deep link. Maybe there is a conflict between the nav component navigating to the startDestination and the deep link triggering another navigate() immediately afterwards. Any pointer on how to debug this?
👀 1
The same thing happens if you use "Apply Changes and Restart Activity" in Android Studio.
m

Michal

11/29/2021, 12:22 PM
@clhols have you find a way around this or how to get some logs? I see the issue in current beta03. I will see if it happens due to some dependencies...
View count: 5