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

    David Edwards

    07/02/2021, 9:01 PM
    I thought I would make a small project based around Mosaic specifically. To better get to grips with it. I made a small project that others can copy from to get a working project up and running faster. https://github.com/DavidEdwards/MosaicFileBrowser
    :kotlin-intensifies: 6
    💯 4
    🎉 6
    ➕ 1
    j
    • 2
    • 2
  • y

    YASAN

    07/03/2021, 12:03 AM
    On 1.0.0-RC1
    Dialog
    just fill out the whole screen size unlike the previous versions where they just had the proper dialog size by default. I am not sure if its a bug or a feature but I am not sure what is the best way of making the Dialogs have the proper size again? I can add padding around my inside my dialog to make it look better but a static dp padding would not do the same thing since the dialog will still look super large on Tablets.
    a
    m
    • 3
    • 3
  • m

    mattinger

    07/03/2021, 1:19 AM
    Has anyone else noticed their @Preview not working in Arctic Fox Beta 5? This is all i see for any preview function i create.
    c
    a
    • 3
    • 7
  • b

    Berkeli Alashov

    07/03/2021, 3:11 AM
    Is there a way to detect user stopping the gestures when using
    detectTransformGestures
    ? Like
    onDragEnd
    of
    detectDragGesture
    . I need to reset transformations after user stops the gestures.
    a
    • 2
    • 2
  • s

    Slackbot

    07/03/2021, 9:00 AM
    This message was deleted.
    c
    f
    c
    • 4
    • 4
  • g

    georgiy.shur

    07/03/2021, 9:09 AM
    It seems that
    Surface
    doesn’t allow click events to come through even if
    clickable
    is not set. Is it possible to propagate its clicks to parent composable?
    e
    l
    • 3
    • 3
  • m

    MBegemot

    07/03/2021, 10:27 AM
    Confused about dark mode 🧵
    a
    c
    b
    • 4
    • 9
  • r

    Ravi

    07/03/2021, 1:01 PM
    Hi, our project got
    compileSDkVersion 29
    , after upgrading compose to
    rc01
    we are facing this issue 🧵
    a
    • 2
    • 2
  • s

    Se7eN

    07/03/2021, 4:18 PM
    Has anyone used the in-app review API with compose? I'm not sure how to launch the review flow since it needs an activity. Do I need to cast my context to an activity? Or maybe use lambdas to communicate to the activity when I need to launch the flow? https://developer.android.com/guide/playcore/in-app-review/kotlin-java#launch-review-flow
    c
    • 2
    • 2
  • f

    Fudge

    07/03/2021, 5:08 PM
    rememberSaveable
    is supposed to persist a value across process death. However, I've tried killing the app and restarting it in multiple ways (even cases as simple as 'Live Edit of Literals'!), and every time the state is not persisted. Am I not understanding what
    rememberSaveable
    is actually supposed to do? A simple example:
    var enabled by state { false }
                    Button(onClick = { enabled = !enabled }) {
                        Text(text = if (enabled) "enabled" else "disabled")
                    }
    When the app is started,
    enabled
    should have the value it had when the app last closed, but that is not the case. It is not 'remembered' or 'saved', it is forgotten and lost.
    l
    f
    a
    • 4
    • 12
  • c

    Chuck Stein

    07/03/2021, 6:59 PM
    Are there plans to bring Material's Chip and ChipGroup components to Compose?
    👍 3
    b
    • 2
    • 2
  • c

    Colton Idle

    07/03/2021, 7:58 PM
    Was there any blog post for compose rc01 release?
    ➕ 3
    a
    • 2
    • 1
  • r

    Rob

    07/03/2021, 10:14 PM
    Has anyone here seen differences in performance between build debug and release build variants. I've seen it where debug builds perform navigation with nav component instantly but release builds (R8 enabled) take a very noticeable second. I don't know if this is Compose or NavComponent related.
    j
    • 2
    • 4
  • a

    Andre Classen

    07/04/2021, 12:33 AM
    Is there any chance to keep the scroll position when swapping the first visible item in an item keyed
    LazyColumn
    ?
    b
    j
    • 3
    • 4
  • g

    Gaurav

    07/04/2021, 11:24 AM
    Hey..I just started learning compose...how can we set color in spacer.....I want to have a 30 dp space with white color....by default it is coming black color....it tried setting spacer.background(white) but not working....suggest any way to do so...thanx
    f
    f
    • 3
    • 4
  • s

    Sololo

    07/05/2021, 6:34 AM
    Can someone invite me to the AV channel?
    g
    • 2
    • 1
  • n

    ninadmg

    07/05/2021, 9:30 AM
    Is there a compose support for leanback library planned? Did anyone try compose for android TV?
    w
    • 2
    • 1
  • z

    Zun

    07/05/2021, 11:44 AM
    I am currently experiencing an issue where my Column loses its vertical scroll state (even with a rememberScrollState) after a simple A>B, back to A screen navigation. The lists inside that Column do retain their horizontal scroll position though. What's the correct way of troubleshooting this problem? I don't necessarily need an answer but I'd like to know how to approach an issue like this for future reference
    a
    • 2
    • 1
  • i

    iamthevoid

    07/05/2021, 12:29 PM
    Is there some kind
    onDestroyView
    for composable? For example here listed example when viewModel value assigning as default parameter in composable function by
    viewModel()
    call. If i understand correct this factory creates (or returns) view model from activity or fragment scope. But what if i develop single activity app with huge number of features on billions screens? Should i use activity view model scope or i must include fragments to my code or there is better way to handle memory in compose?
    d
    • 2
    • 5
  • j

    julioromano

    07/05/2021, 12:34 PM
    Software keyboard closes on configuration change I just noticed that when typing in a
    BasicTextField
    the software keyboard closes whenever there’s a configuration change (rotation, dark mode switch, etc.). I tried fiddling with the
    windowSoftInputMode
    activity manifest attribute but to no avail. Is this the intended behavior? Is there any way to change it (apart from disallowing any configuration change which is not possible in my case)? PS: The text field also happens to loose focus during the config change.
    c
    g
    • 3
    • 3
  • w

    Wojciech Rozwadowski

    07/05/2021, 12:48 PM
    shrinkResources = true
    set my resources as unused when I use it in that way:
    @Composable
    private fun SomeIcon() = `Icon(painter = painterResource(id = R.drawable.ic_some_awesome_icon), …)`
    I don't want to use
    keep
    for many of randomly shrinked resources and I prefer to keep shrinkResources on. Any suggestions?
    ➕ 1
    a
    • 2
    • 1
  • v

    Vitaliy Zarubin

    07/05/2021, 3:00 PM
    Tell me how to correctly place the cursor at the end of the line when focusing
    d
    • 2
    • 1
  • n

    nglauber

    07/05/2021, 3:06 PM
    I have a
    ScreenA
    which is using
    MyViewModel
    instantiated using
    hiltViewModel()
    function.
    ScreenA
    calls
    ScreenB
    . I want to share
    MyViewModel
    between both screens. However, I’m popping
    ScreenA
    when I’m calling
    ScreenB
    . Is there a way to do this without create a custom
    ViewModelStoreOwner
    ? 🤔 cc: @Ian Lake
    j
    • 2
    • 4
  • s

    Sparsh Dutta

    07/05/2021, 4:17 PM
    Hi, when is the release of Jetpack compose stable version expected?
    j
    a
    c
    • 4
    • 4
  • a

    Alex

    07/05/2021, 5:31 PM
    Is there a way to get the height of a composable? Not the min and max height but the measured height? Code in thread.
    d
    b
    c
    • 4
    • 5
  • d

    dimsuz

    07/05/2021, 5:32 PM
    I have a
    LazyColumn
    and I need to do certain actions based if user has scrolled up or down for a certain threshold. What are my best options here? • Use
    snapshotFlow
    to watch
    LazyColumnState
    changes, collect delta, act accordingly? • I've also found
    pointerInput
    +
    detectDragGesture
    , will it work with
    LazyColumn
    , should I use it? • Something else?
    c
    • 2
    • 3
  • n

    Neil

    07/05/2021, 5:36 PM
    Hi, I’m using Android Studio Arctic Fox Beta 5. I’m looking at the latest version of the Jetsnack app but none of the previews display properly. When I try to deploy a preview I get an error. The app itself runs fine. Does anyone know what the problem might be with the preview?
    s
    • 2
    • 4
  • a

    andrew

    07/05/2021, 8:13 PM
    Had to flex my trig and circle skills a bit lol
    c
    j
    +2
    • 5
    • 8
  • c

    Cicero

    07/05/2021, 8:48 PM
    I’m trying to do something a little different and I’m having a very weird “Composition requires an active composition context” 🧵
    j
    • 2
    • 13
  • t

    Tash

    07/05/2021, 10:12 PM
    Seeing some weird behavior with 
    graphicsLayer
     + 
    shadowElevation
     🧵 (using rc01)
    a
    • 2
    • 10
Powered by Linen
Title
t

Tash

07/05/2021, 10:12 PM
Seeing some weird behavior with 
graphicsLayer
 + 
shadowElevation
 🧵 (using rc01)
there seem to be some artifacts visible near the shadow (see bottom-left/top-left/right:
card-rotation-shadowelevation-rc01.mp4
Relevant code
Untitled.kt
Not sure if this is a bug, known or otherwise, or if its incorrect usage of the api
a

Andrey Kulikov

07/06/2021, 10:19 AM
why do you set a shadow twice? Once with graphicsLayer() and another one with shadow(). Which one of those two gives this effect?
t

Tash

07/06/2021, 5:33 PM
Sorry, that was a copy paste error. The
.shadow()
modifier just creates a feathered shadow around the
Box
. The
shadowElevation
in
graphicsLayer
is what produces the skewed shadow + artifacts, regardless of the
.shadow()
modifier
a

Andrey Kulikov

07/06/2021, 6:04 PM
what if you try to split one graphicsLayer into two separate once, where one defines the rotation and another one the shadow?
t

Tash

07/06/2021, 6:15 PM
that seems to work:
Box(
            modifier = Modifier
                .wrapContentSize()
                .graphicsLayer {
                    rotationX = /** **/
                    rotationY = /** **/
                    cameraDistance = /** **/
                }
                .graphicsLayer {
                    shadowElevation = elevation
                    shape = RoundedCornerShape(6.dp)
                },
        )
wondering why/how this separation works... 🤔 is this how the API is supposed to be used for this use case?
a

Andrey Kulikov

07/06/2021, 6:50 PM
feel free to file a bug, we would explore is something can be improved on our side
👍🏼 1
t

Tash

07/06/2021, 6:59 PM
thank you, will do!
https://issuetracker.google.com/issues/192895696
View count: 2