https://kotlinlang.org logo
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
  • f

    Florian

    12/10/2021, 11:33 AM
    How can I separate items in a LazyVerticalGrid with Dividers? Adding a horizontal line between each row is easy but I don't know how to separate the columns with vertical lines. Using a Box with a border doesn't work well because the start/end borders add up.
    ➕ 1
    a
    c
    +2
    • 5
    • 11
  • z

    Zoltan Demant

    12/10/2021, 11:52 AM
    If an item inside a LazyList has several sub-items, does it make any difference if I use a key(stableKey){} when rendering them in terms of it recomposing less if only other sub-items are changed?
    a
    • 2
    • 3
  • a

    Ankit Shah

    12/10/2021, 12:00 PM
    In compose, can we get width dynamically? For example I do have a Row with fillMaxWidth and in the elements I have two Box inside row to which I want to provide 50%-50% width of parent Row. If yes, how can I achieve it?
    j
    c
    • 3
    • 3
  • a

    Andreas Haglund

    12/10/2021, 12:14 PM
    I get this error when navigating to a subscreen in the app after updating to compose 1.1.0-beta04:
    java.lang.IllegalStateException: Place was called on a node which was placed already
    What does that mean and how can I fix this?
    j
    • 2
    • 1
  • m

    mattinger

    12/10/2021, 1:52 PM
    So i’m trying to use the “dialog” feature on the navigation component. I’ve got things working mostly as i want, except for the handling of the back button. The back button should basically dismiss the dialog, which it does. However, i also want to run some code to insert a log statement when that happens. You can do this with the normal “Dialog” composable, via the
    onDismissRequest
    parameter. However, that seems to be missing from the navComponent.
    i
    • 2
    • 3
  • l

    Lilly

    12/10/2021, 1:55 PM
    Is it possible to have a screen that is floating over other screens, kinda like a Full Screen Dialog? I'm not looking for a modification of a
    Dialog
    but something more low level, simply a screen that overlays another screen
    m
    a
    z
    • 4
    • 10
  • t

    Tijs Gobbens

    12/10/2021, 2:50 PM
    i'm using the
    HorizontalPager
    from the accompanist library with a content padding , but when swiping to the last item/page and do a "fast" swipe the previous items seems to disappear, this only seems to happen with a fast swipe move (maybe some overshoot swing animation?) ``````
    device-2021-12-10-154029.mp4
    a
    c
    a
    • 4
    • 4
  • n

    Nthily

    12/10/2021, 5:38 PM
    How can i set the drawerContent width in
    Scaffold
    ?
    a
    • 2
    • 1
  • c

    Chris Fillmore

    12/10/2021, 6:04 PM
    What is the right way to build a Row of children, where all children, except the last one, are left-aligned, and the last one is right-aligned?
    s
    c
    c
    • 4
    • 31
  • s

    spierce7

    12/10/2021, 7:21 PM
    What does r8 do to Compose Lambdas that allow such large optimizations for compose?
    e
    • 2
    • 2
  • c

    colintheshots

    12/10/2021, 8:06 PM
    Is there any known issue in Jetpack Compose Navigation where the back gesture or certain screen taps can cause the entire Compose hierarchy to become non-interactable? We’re seeing, especially with the back gesture enabled instead of 3 button mode, that making the back gesture causes the whole Compose view we return to to be disconnected from all listeners and not interactive. If we back out again then everything works. What’s especially strange is that pressing the Close button to call navController.popBackStack() in a clickable callback doesn’t cause this issue, but that overriding the back behavior with a BackHandler to do the exact same thing does cause the issue. I do wonder if the cause is in any way related to the fact that we’re using Jetpack Navigation on some top-level screens and Jetpack Compose Navigation locally within certain sections of the app. Any thoughts? We’re pretty stumped right now. Compose version is 1.1.0-alpha03 with Accompanist 0.21.3-beta. We’re also using bottom sheets from Navigation-Material on some screens.
    j
    a
    +3
    • 6
    • 16
  • c

    Colton Idle

    12/10/2021, 8:37 PM
    Do we have to do anything to enable auto-fill on text fields? I have my types setup as email and password, but my password manager doesn't prompt me with auto-fill at all, while my view based version of this screen does indeed prompt me.
    c
    b
    z
    • 4
    • 6
  • b

    brabo-hi

    12/11/2021, 1:54 AM
    Hi all, when using
    akka persistence durable state query
    what is the best way to store offset and to always start reading states from the latest
    offset
    stored
    z
    • 2
    • 2
  • n

    nilTheDev

    12/11/2021, 7:16 AM
    Is there any other way to have a
    viewModel
    scoped to a navigation destination than using
    hiltViewModel
    ?
    y
    s
    +2
    • 5
    • 7
  • i

    iamthevoid

    12/11/2021, 7:26 AM
    I got strange behavior (it doesn't snap pages) on accompanist view pager interact. On the video at first i try swipe pages, then i use control to change pages, then swipe with fingers again. In case when I use pager control then pages snaps correctly, but when i use finger pager works like recycler view. Pager control is not the problem source, because i commented it and behavior haven't changed. Do you have any ideas what can lead that behavor? Or maybe somewho met same behavior?
    video.mp4
    y
    c
    • 3
    • 17
  • a

    Arpan Sarkar

    12/11/2021, 6:56 PM
    i am using accompanist view pager is there any way to set offscreenPageLimit like normal viewpager?
    c
    • 2
    • 2
  • d

    d.medina

    12/11/2021, 7:20 PM
    So im trying to save a canvis as as a png on desk top
    k
    • 2
    • 1
  • t

    trevjones

    12/12/2021, 3:44 AM
    Compose doc's explaining dependency tree scope to those that already can't explain scoping. #thermoSiphon
    • 1
    • 2
  • y

    YASAN

    12/12/2021, 9:19 AM
    I am setting up a few pages using the
    pager
    +
    pager-indicator
    accompanist libraries. The issue is that each page has a different size and it is making the interactions a bit weird. I have a short (in height) page first but the height matches the largest one which makes the content look out of place. If I put the same page AFTER the largest tab, the size is ok. Video in 🧵
    z
    c
    • 3
    • 8
  • t

    Tgo1014

    12/12/2021, 12:21 PM
    Is there a guide for adding material 3 to a material 2 compose project?
    c
    • 2
    • 6
  • n

    Nthily

    12/12/2021, 2:21 PM
    I'm trying to set up the startDestination page based on whether the room database has the specified value, but it keeps getting this error
    k
    i
    • 3
    • 6
  • m

    Marcin Wisniowski

    12/12/2021, 2:56 PM
    Are material colors defined somewhere in Compose? For example I want to get "Red500". Or do I need to define them myself?
    c
    c
    • 3
    • 14
  • n

    Nikola Drljaca

    12/12/2021, 6:33 PM
    Anyone have an idea why
    MaterialTransition
    breaks when a
    ComposeView
    gets integrated into a Fragments XML layout? I have a few fragments using transitions and if I change a piece of the XML layout to use a ComposeView the transitions no longer run.
    i
    • 2
    • 5
  • l

    Libor Bicanovsky

    12/13/2021, 12:00 AM
    I've just updated from 1.0.5 to 1.1.0-beta04 and it looks like the elvis operator is no longer working within composables, does anyone know why that is? The second
    Text
    should be displayed but it isn't - as soon as I replace the elvis operator with an
    if
    statement then the second text is rendered correctly
    z
    • 2
    • 3
  • j

    jannis

    12/13/2021, 9:22 AM
    Is it possible with the Accompanist Navigation Animation library to perform a Crossfade animation? Currently it fades out the old view and fades in the new one, which is not 100% the same, e.g. you might see the background behind both views while the animation is performed.
    a
    • 2
    • 5
  • z

    Zoltan Demant

    12/13/2021, 9:43 AM
    How can I measure a composable and update the PaddingValues of another composable without using
    Modifier.onSizeChanged
    (in other words, without causing an additional recomposition for the entire screen)? Is this even possible? 🤷‍♂️🏽
    f
    c
    • 3
    • 9
  • b

    Bhavna Thacker

    12/13/2021, 11:56 AM
    Hi, We have created a native Kotlin Bridge to communicate with Webview. Calling a Native Kotlin function from a Button click on Webview works well via Javascript Interface like calling a showToast() (Non-Composable) function. However calling a Composable function from Button click on Webview doesn’t work - Like calling AlertComponentDialog() (Composable Function). Any Idea how to call a Composable function from Android Webview?
    s
    • 2
    • 2
  • f

    Filip Wiesner

    12/13/2021, 12:02 PM
    When using Popup, the content is clipped by system UI even though the activity draws behind it. Am I missing something? Code in 🧵
    s
    • 2
    • 6
  • r

    rsktash

    12/13/2021, 2:51 PM
    Hi I’m trying to implement zoomable image. When user interaction(touch down) ends I should run animation which fixes over-zooms and over-scrolls. What code I should run after end of this block?
    a
    • 2
    • 5
  • z

    Zoltan Demant

    12/13/2021, 5:50 PM
    Are there any known issues with compose on Android 12? Ive received a few super-strange reports where ui actions have ~1 second delay; e.g. typing text in an input field has a 1 second delay between letters, etc. In all other cases, all of this happens instantaneously.
    c
    r
    d
    • 4
    • 20
Powered by Linen
Title
z

Zoltan Demant

12/13/2021, 5:50 PM
Are there any known issues with compose on Android 12? Ive received a few super-strange reports where ui actions have ~1 second delay; e.g. typing text in an input field has a 1 second delay between letters, etc. In all other cases, all of this happens instantaneously.
c

Casey Brooks

12/13/2021, 5:52 PM
Are you launching any coroutines in your composable's
rememberCoroutineScope()
? That scope by default runs on
Dispatchers.Main.immediate
, so any long-running work on it would block UI rendering and event dispatching, and it should be moved to another dispatcher
z

Zoltan Demant

12/13/2021, 6:21 PM
I do use it as the overall scope so that operations stop whenever the compose-scope is cancelled, but I make sure that all background work runs on
Dispatchers.Default/IO
(and I just verified thats the case).
r

Rick Regan

12/14/2021, 1:59 AM
I have performance issues with
Crossfade
on Android 12, though that doesn't sound like it's related to your problem: https://issuetracker.google.com/u/1/issues/207107680
z

Zoltan Demant

12/14/2021, 5:35 AM
@Rick Regan Thank you, its hard to tell if its the same underlying issue - but your screen recordings look exactly like what Im seeing, and I do use
Crossfade
a lot. Is this local to
Crossfade
only, or does a similar thing happen with
AnimatedContent
for you as well?
r

Rick Regan

12/14/2021, 12:04 PM
I don't use `AnimatedContent`; in fact,
Crossfade
is the only animation I (explicitly) use.
z

Zoltan Demant

12/14/2021, 12:15 PM
@Rick Regan Got it. I just got a response about the delay being fixed after having switched to
AnimatedContent
, so thats a good sign! Thank you so much for bringing this to my attention. Im still seeing some lag on Android 12, but I think thats internal components using the broken animations, likely the same thing that
Crossfade
uses.
r

Rick Regan

12/14/2021, 12:31 PM
Can you share more detail on the "delay being fixed after having switched to 
AnimatedContent
?
z

Zoltan Demant

12/14/2021, 12:34 PM
Delay/Lag 🙂 Same thing that you showed in your screen-recordings.
r

Rick Regan

12/14/2021, 12:35 PM
Oh...I thought you meant you had a side channel with someone else 🙂
(@Doris Liu I wanted to make you aware of the issue cited above. Thank you.)
z

Zoltan Demant

12/14/2021, 12:43 PM
Oh snap, the response I was referring to is from a user of my app - I cant recreate these issues locally, so thankfully there are people out there who are happy to help :)
r

Rick Regan

12/14/2021, 1:12 PM
I never really looked into`AnimatedContent` so it's interesting to learn that it's a "drop-in replacement" for
Crossfade
. (Although the doc page I am looking at calls it "experimental".) I will try it out.
z

Zoltan Demant

12/14/2021, 1:23 PM
Ridiculously simplified probably, but I think of
Crossfade
like an
AnimatedContent
that just uses
fadeIn
and
fadeOut
.
r

Rick Regan

12/14/2021, 1:49 PM
Funny,
AnimatedContent
made the example in my issue much slower (both API 31 and 30). Although, I'm not 100% sure I'm comparing them correctly (for
Crossfade
I used 
animationSpec = tween(10)
and for 
AnimatedContent
 I used
transitionSpec = {
  fadeIn(animationSpec = tween(5)) with
      fadeOut(animationSpec = tween(5))
},
(the low
tween
times was just to factor that out of the issue.)
z

Zoltan Demant

12/14/2021, 2:25 PM
Do you see the same behavior if you use something like a
Text
? Ive noticed that buttons do something when animating their enabled/disabled state, Im curious if something in there is related to this as well.
r

Rick Regan

12/14/2021, 2:44 PM
Still slow with `Text`s instead of `Button`s (both
Crossfade
and
AnimatedContent
, with
AnimatedContent
still slower).
z

Zoltan Demant

12/14/2021, 3:18 PM
Hopefully well find the answers soon enough! Have you tried running this on a real device too?
r

Rick Regan

12/14/2021, 3:54 PM
The
Crossfade
version I had, yes, and I saw it there too.
👍🏽 1
d

Doris Liu

12/14/2021, 10:12 PM
@Rick Regan Do you see any difference in performance between 30 & 31 when using
AnimatedContent
with
slideIntoContainer(AnimatedContentScope.SlideDirection.Left) with slideOutOfContainer(AnimatedContentScope.SlideDirection.Left)
instead of fade? That might help narrow down the issue here.
r

Rick Regan

12/14/2021, 11:44 PM
I posted an update (with videos) to the issue (31 is much slower).
👍🏽 1
View count: 1