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

    Lilly

    04/16/2022, 11:26 PM
    Any ideas how to get `Cell`s have the same height in
    LazyVerticalGrid
    ?
    j
    a
    • 3
    • 3
  • j

    James Black

    04/17/2022, 4:50 AM
    How do I troubleshoot why Preview annotation isn't working in my project? It does work on very simple UIs, where I show a text box, for example, that is hard-coded. I am using Kotlin 1.6.10 on compose 1.2.0-alpha07
    c
    j
    • 3
    • 5
  • n

    Noop

    04/17/2022, 6:59 AM
    If I use rememberNavController()
    val navController = rememberNavController()
    error then below
    java.lang.IllegalStateException: 2. expected value parameter count to be higher: rememberNavController()
    what’s the problem?
    j
    • 2
    • 2
  • s

    Sanendak

    04/17/2022, 11:00 PM
    Hello everyone! I want to implement floating search bar like on google app (video in thread) with lazylist underneath. I’ve tried to react on list scroll and it’s working almost as I need: search hides but then shows on every new list item
    • 1
    • 1
  • n

    nuhkoca

    04/18/2022, 1:55 AM
    Hello, I have a page with a custom
    TopBar
    mimic(it is not a Scaffold
    TopBar
    , rather just a
    Box
    due to transparency) and I need to use a sticky header in my
    LazyColumn
    but the header doesn’t stick to custom
    Box(TopBar mimic)
    as it probably doesn’t treat it as a
    TopBar
    . How do I manage to have a sticky header with a custom mimic?
    z
    • 2
    • 8
  • m

    myanmarking

    04/18/2022, 10:32 AM
    Is there a better way of doing this animation?
    c
    • 2
    • 12
  • i

    Ilya Kalibrov [JB]

    04/18/2022, 10:43 AM
    ❗Hi, everyone ! I am currently running a series of interviews with Compose Multiplatform users, that are developing for both desktop + Android. If you are willing to spend 30-40 mins on the interview, please, write me in DM :kotlinnew:. No pre-requisitions needed ! Thank’s everyone in advance !
    f
    m
    • 3
    • 4
  • s

    Slackbot

    04/18/2022, 10:53 AM
    This message was deleted.
    a
    • 2
    • 1
  • f

    Filip Wiesner

    04/18/2022, 1:51 PM
    🤔 Subjective question: What is the size (LOC) of
    @Composable
    function when you ask yourself "should I divide this into separate composables/files"? 1️⃣ 50 lines 2️⃣ 100 lines 3️⃣ 200 lines 4️⃣ 300 lines 5️⃣ It's not dependant on number of lines but rather number and cohesion of parameters 6️⃣ It's fine as long it does "one thing". 7️⃣ Other 👉 comment
    2️⃣ 3
    5️⃣ 2
    6️⃣ 14
    g
    z
    +3
    • 6
    • 40
  • n

    Nthily

    04/18/2022, 6:30 PM
    When will rememberSaveable's data actually be cleared?
    s
    z
    • 3
    • 2
  • d

    David Corrado

    04/18/2022, 8:57 PM
    Is it possible to determine if a modifier is used such as clickable? Or is it possible to clear the clickable modifier? Or is it possible to ensure a modifier passed as a param is only able to have a subset of modifiers?
    k
    c
    d
    • 4
    • 15
  • n

    natario1

    04/18/2022, 11:02 PM
    Are there plans to open
    androidx.compose.foundation.lazy.layout.LazyLayout
    , or even better smaller parts like
    LazyLayoutItemContentFactory
    and
    LazyLayoutPrefetcher
    ? They would help so much for creating custom lazy layouts.
    👀 1
    a
    • 2
    • 2
  • a

    aniruddha dhamal

    04/19/2022, 12:52 AM
    In
    LazyColumn
    , I'm using fading animation for item animation. When item is added, all the items on the screen animate. How to get only that item animated and rest of the items shift the positions? Details in the 🧵
    a
    • 2
    • 5
  • d

    David W

    04/19/2022, 6:24 AM
    My business layer doesn't include Compose, but I'd like a method in it to suspend while waiting for the user to respond to a dialog. Showing the dialog uses
    @Composable
    , which doesn't exist in the business layer. Any patterns on how to structure that? I'll put what I have so far in the thread.
    a
    • 2
    • 13
  • n

    Nana Vong

    04/19/2022, 6:55 AM
    How can I nest LazyColumn inside LazyColumn? The page as a whole is a LazyColumn, but its subcards also need to be a list
    c
    a
    • 3
    • 3
  • j

    Jonas Frid

    04/19/2022, 8:53 AM
    Any way to keep it vertically centered when the field has focus?
    z
    • 2
    • 1
  • c

    Colton Idle

    04/19/2022, 1:31 PM
    Does this answer still hold true? "What's the purpose of paddingvalues in a scaffold?" https://stackoverflow.com/a/70210638
    n
    a
    • 3
    • 3
  • a

    Ayfri

    04/19/2022, 4:24 PM
    Hi, how can I set a Column element to have a maximum width as a fraction ? (like
    fillMaxWidth()
    but I only want to limit the maximum size)
    c
    j
    c
    • 4
    • 7
  • m

    Mikael Alfredsson

    04/19/2022, 4:53 PM
    Can I get hold of the “Window” object from a composable function, or do I have to send that in as a parameter?
    m
    • 2
    • 2
  • a

    agrosner

    04/19/2022, 5:31 PM
    im sure this has been asked before, but at my company with a rather large app, migration will take time to Compose. We currently have a few screens that make use of shared element transitions. is there any support for shared element transitions between traditional UI and Compose?
    k
    c
    • 3
    • 14
  • c

    Chris Fillmore

    04/19/2022, 7:08 PM
    Can someone advise on using
    MultiplePermissionsState
    as the
    key
    in a LaunchedEffect?
    • 1
    • 5
  • t

    Tash

    04/19/2022, 7:30 PM
    If using AGP 7.1+, will compose’s baseline profiles automatically be bundled with APKs/App Bundles, or does the app module need to declare a dependency on
    androidx.profileinstaller:profileinstaller:1.2.0-alpha01
    ? According to the docs, it seems like that dependency is only necessary when creating custom profiles, but just double-checking 🙏🏼
    y
    a
    • 3
    • 4
  • t

    Tin Tran

    04/20/2022, 2:52 AM
    I want a composable to have a max height of 80%. Is there a way to do that other than this?
    BoxWithConstrain {
       val maxHeight = maxHeight
       Box(
         Modifier.heightIn(min = 0.dp, max = maxHeight * .8f)
       )
    }
    a
    • 2
    • 2
  • r

    Rafal

    04/20/2022, 12:23 PM
    I want to slowly migrate to Jetpack Compose view by view and I have a horizontal
    RecyclerView
    in my
    NavigationView
    . When I use the
    LazyRow
    or
    Row(Modifier.horizontalScroll())
    the touch events are not intercepted properly and instead of scrolling the row, the
    NavigationView
    is closing. Is there any way to make the
    ComposeView
    intercept touch events?
    a
    m
    • 3
    • 6
  • g

    Gabriel Lasso

    04/20/2022, 12:34 PM
    I also want to migrate to Jetpack Compose, I created a component that is fixed at the bottom of screen and it has a section that expands on click. When I used it in a compose activity, it worked fine, but when I used the same component in a old activity using
    ComposeView
    inside a
    ConstraintLayout
    it began flickering when it is expanding or contracting. Anyone can help me? I created a minimal example of it happening here (video on README.md)
    c
    • 2
    • 6
  • y

    Yves Kalume

    04/20/2022, 12:41 PM
    Hi, how can i get LazyColumn scroll percentage ?
    j
    f
    n
    • 4
    • 6
  • m

    Marko Novakovic

    04/20/2022, 12:47 PM
    private fun <T : Any> SavedStateHandle.saveableMutableStateOf(
        key: String,
        saver: Saver<T, out Any> = autoSaver(),
        init: () -> T,
    ): MutableState<T> {
        @Suppress("UNCHECKED_CAST")
        (saver as Saver<T, Any>)
        val value = mutableStateOf(restoreOrInit(key, saver, init))
        saveToStateHandle(key, saver, value)
        return value
    }
    
    private fun <T : Any> SavedStateHandle.restoreOrInit(
        key: String,
        saver: Saver<T, Any>,
        init: () -> T,
    ): T = run {
        val restored = get<Bundle>(key)?.get("value")?.let(saver::restore)
        restored ?: init()
    }
    
    private fun <T : Any> SavedStateHandle.saveToStateHandle(
        key: String,
        saver: Saver<T, Any>,
        value: MutableState<T>,
    ) = setSavedStateProvider(key) {
        val saverScope = SaverScope { true }
        with(saver) {
            bundleOf("value" to saverScope.save(value.value))
        }
    }
    
    ...
    //usage
    private var _state by savedStateHandle.saveableMutableStateOf(STATE) { initialState }
    this used to work but now in
    1.2.0-alpha07
    setting
    _state
    doesn’t save value to
    SavedStateHandle
    a
    • 2
    • 8
  • j

    Jhonatan Sabadi

    04/20/2022, 12:56 PM
    I have a
    data class
    , and i created a mutableStateOf<MyClass>(). What is the best way to update this data class with mutable state on ViewModel? • Set value directly:
    myClass.property = "value"
    • Or use copy function:
    myClass.copy(property = "value")
    m
    • 2
    • 3
  • t

    Tolriq

    04/20/2022, 6:13 PM
    New compose generate crash
    java.lang.IllegalArgumentException: Inconsistency between the count of nodes tracked by the state (0) and the children count on the SubcomposeLayout (3). Are you trying to use the state of the disposed SubcomposeLayout?
    with LazyList. Anyone can explain more the error so I can build a repro before opening an issue ?
    a
    f
    r
    • 4
    • 9
  • z

    zalewski.se

    04/20/2022, 6:28 PM
    What’s the timeline for new stable version release based on Kotlin
    1.6.20
    ? 🙂
    ⏳ 2
    🛌 2
    k
    a
    +2
    • 5
    • 6
Powered by Linen
Title
z

zalewski.se

04/20/2022, 6:28 PM
What’s the timeline for new stable version release based on Kotlin
1.6.20
? 🙂
⏳ 2
🛌 2
k

kenkyee

04/20/2022, 6:53 PM
was just released (alpha08) alpha is mostly stable 🙂
:blob-thinking-upside-down: 1
a

andrew

04/20/2022, 8:44 PM
mostly*
j

James Black

04/21/2022, 2:36 AM
I just upgraded and didn't realize I had to move to 1.6.20 but will test it out. 😄
a

Arkadii Ivanov

05/15/2022, 10:11 AM
Still no stable version on 1.6.20(21) ☹️
k

kenkyee

05/15/2022, 10:37 AM
Beta01 is "stable"🙂
a

Arkadii Ivanov

05/15/2022, 10:38 AM
It's "stable", whereas I would like to have stable. 😀 Beta means API is stable but there are possible bugs, isn't it?
😂 1
👍 1
View count: 4