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

    Ronald Toshkollari

    05/29/2022, 1:11 PM
    Hello guys, may I ask why AnimatedVisibility still has ExperimentasApi annotation on 1.1.1 version ?
    d
    1 reply · 2 participants
  • c

    Cristina Uroz

    05/29/2022, 1:46 PM
    Hello everyone! Has anyone had trouble with navigation with a Xiaomi phone? I have a MIUI 13 that doesn’t complete the start navigation flow until you touch the screen
    r
    3 replies · 2 participants
  • o

    Omar

    05/29/2022, 2:43 PM
    What is the appropriate way to implement show/hide
    FloatingActionButton
    when scrolling in compose?
    :stackoverflow: 1
    c
    2 replies · 2 participants
  • s

    Sam Stone

    05/30/2022, 2:38 AM
    Idea: 1-to-1 mapping from Compose to SwiftUI making Compose a cross-platform UI framework with KMM (no UI duplication).
    k
    j
    +2
    7 replies · 5 participants
  • s

    Satyam G

    05/30/2022, 7:36 AM
    Is there any way we can attach Bottom Sheet to Window directly without adding it in any Compose Activity inside Scaffold and invoking it. It should work like when it is needed just attach to window and display it on any composable. Any Idea ???
    s
    2 replies · 2 participants
  • s

    sanggggg

    05/30/2022, 8:16 AM
    Hello, is there any UI Component visualization toolkit for jetpack compose? (like react storybook) Currently, I’m developing design system with jetpack compose with the team’s designers. When a new UI Component is developed, both designers and developers want to make sure that it is implemented as intented. For example, • To check how the UI Component looks in the number of cases in any state it can be (like enabled, disabled, selected) • To check which UI feedbacks (animations, state changes) are played when user interactions occur • … I’m communicating with the android studio preview of compose directly to the designers, but I want to know how to manage it more easily
    👀 2
    y
    2 replies · 2 participants
  • h

    Håkon Pettersen

    05/30/2022, 10:50 AM
    @Composable
    fun List<SecuritySensor>.asListOfRowImageText() = asList {
        RowImageText(
            leadingIconRes = it.icon,
            text = { it.description },
            textStyle = MaterialTheme.typography.body1
        )
    }
    
    @Composable
    private fun <T> List<T>.asList(
        withDividers: Boolean = false,
        itemBuilder: @Composable (T) -> Unit,
    ) = Column {
        forEachIndexed { index, item ->
            itemBuilder(item)
            if (withDividers && index < lastIndex) {
                EvaDivider()
            }
        }
    }
    I am currently getting warning message:
    Composable functions that return Unit should start with an uppercase letter
    . Is there a better way of creating compose functions to avoid getting this message?
    m
    2 replies · 2 participants
  • v

    Valentin Gusselnikov

    05/30/2022, 11:38 AM
    There was a section in documentation about integrating Compose in
    RecyclerView
    , what happened? We do not need to
    setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
    and
    disposeComposition()
    anymore?
    a
    r
    4 replies · 3 participants
  • t

    Tgo1014

    05/30/2022, 3:30 PM
    Is there any way to preview a compose view on a nav graph xml?
    👍🏼 1
    👍 1
    c
    r
    +1
    11 replies · 4 participants
  • j

    jean

    05/30/2022, 6:10 PM
    I’m still struggling with displaying images from URL inside a
    LazyColumn
    with
    coil
    items(photos) { photo ->
        Card(
            modifier = Modifier.fillMaxWidth()
        ) {
            Column {
                Image(
                    painter = rememberAsyncImagePainter(model = photo.url),
                    contentDescription = "location image",
                    contentScale = ContentScale.Crop,
                    modifier = Modifier.fillMaxWidth()
                        .height(160.dp)
                )
                Text(
                    text = photo.title,
                    style = MaterialTheme.typography.h6,
                    modifier = Modifier.padding(8.dp)
                )
                Text(
                    text = "lat: ${photo.lat} / lon: ${photo.lon}",
                    modifier = Modifier.padding(start = 8.dp, bottom = 16.dp)
                )
            }
        }
    }
    This is quite unstable, some picture loads and some doesn’t. Any idea what I’m doing wrong here?
    f
    l
    +2
    20 replies · 5 participants
  • a

    Alex

    05/30/2022, 8:09 PM
    Is there a way to listen to the Animations of
    AnimatedContent
    ? Like if I want to get notified if an animation has finished. e.g.
    AnimatedContent
    gets new
    targetState
    , animates, calls my listener when animation has finished
    i
    d
    6 replies · 3 participants
  • c

    Colton Idle

    05/31/2022, 1:13 AM
    I'm using HorizontalPager and listening to page updates as per the docs. This works well, but I also get notified when I programatically scroll. Is there a way to only listen to updates made by a user and not programatically? I saw the pager docs have something called Interaction source, but I couldn't figure out if its actually meant for my situation (docs dont really lead me to believe that it should be used for my case). Any suggestions?
    ➕ 2
    a
    y
    3 replies · 3 participants
  • m

    Matej Drobnič

    05/31/2022, 5:28 AM
    Hello everyone. Is there a documentation anywhere about how exactly reusing in lazy layouts works behind the scenes? What is reused? Composition still needs to be re-done for every item, right?
    n
    2 replies · 2 participants
  • f

    Frank van der Laan

    05/31/2022, 6:47 AM
    On compose naming conventions: what would be the best name for the below method?
    @Composable
    fun ConfigureSystemBars(
        isContentDark: Boolean = defaultIsContentDark,
    ) {
        val systemUiController = rememberSystemUiController()
        val isDarkTheme = isSystemInDarkTheme()
        LaunchedEffect(isContentDark) {
            systemUiController.setSystemBarsColor(
                color = Color.Transparent,
                darkIcons = isContentDark && !isDarkTheme,
                isNavigationBarContrastEnforced = false,
            )
        }
    }
    It sort of feels (when using it in a component), like it’s displaying a component now. It’s not returning anything, so it cannot be called
    configureSystemBars
    (lower case).
    👀 1
    f
    1 reply · 2 participants
  • j

    James Adefehinti

    05/31/2022, 8:09 AM
    Hello guy , can have been trying to create an otp validation screen having six(6) singled character outlinedtextfield and with the capability of pasting the recieve code on the fields
    c
    1 reply · 2 participants
  • g

    Gumiku

    05/31/2022, 8:37 AM
    Hello guys, seems
    set enabled
    for modifier swipeable
    Modifier.swipeable(enabled = false)
    not work fine now, even set
    enabled = false
    SwipeableState.offset still keep changing any idea about this?
    s
    j
    4 replies · 3 participants
  • n

    nlindberg

    05/31/2022, 10:07 AM
    Anyone else had an issue if you have a BottomSheetDialogFragment with a ComposeView in the onCreateView that has a column with vertical scroll, that you cant scroll the content up without first doing a motion to scroll it down? (it drags the dialog down instead of scrolling the content up). I would assume that the scrollview would intercept the drag and scroll and not pass it to the parent dialog for dragging?
    j
    l
    +1
    8 replies · 4 participants
  • j

    jasu

    05/31/2022, 11:33 AM
    My textfield still hides behind the IME keyboard, why this is P4 issue I don’t understand. https://issuetracker.google.com/issues/192043120 any solution?
    n
    s
    6 replies · 3 participants
  • l

    lilypuchi

    05/31/2022, 2:16 PM
    Can someone explain why
    LocalConfiguration.current
    line exists in
    calculateWindowSizeClass(activity: Activity)
    ? Am I wrong in thinking that it does nothing here? 🤔 https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]ndroidWindowSizeClass.android.kt;l=37?q=calculateWindowSi&amp;sq=
    f
    l
    +3
    10 replies · 6 participants
  • a

    Advitiay Anand

    05/31/2022, 3:31 PM
    Hey, I'm trying to create a simple to-do app, but I'm facing a state-related issue. There are 2 separate LazyColumns: One for completed tasks, another for incomplete. The data itself is stored in Room, but I'm also using MutableState for each item's TextField and CheckBox state. The 2 LazyColumns are recycling items' Mutable State (I think), even after retrieving updated lists from the database. Any pieces of advice? 😐
    n
    23 replies · 2 participants
  • m

    Mehdi Haghgoo

    05/31/2022, 6:09 PM
    How can I use the TakePicture contract to take a picture and display it in Jetpack Compose? (Code in thread)
    i
    4 replies · 2 participants
  • t

    tad

    05/31/2022, 8:01 PM
    A
    derivedStateOf
    lambda walks out of a bar. The bartender waves and shouts, "Calculator!"
    🥁 11
    z
    1 reply · 2 participants
  • d

    darkmoon_uk

    06/01/2022, 12:08 AM
    Silent vindication ripples throughout the Compose community
    😌 3
    😅 10
    n
    1 reply · 2 participants
  • s

    Satyam G

    06/01/2022, 6:50 AM
    Has Anyone implemented In-App updates in any live *Jetpack Compose App*. if you have any references how to integrate in app. Please share. it would be of great help, Thanks in advance 🙂
    t
    3 replies · 2 participants
  • a

    Aaron Waller

    06/01/2022, 8:21 AM
    LaunchedEffect not triggered when mutableStateOf has same value? I want to display a snackbar message when the user clicks on “Favorite Post” It works fine the first time but after that it is not getting triggered anymore. Here is my snackBarMessage State in ViewModel:
    var snackBarMessage: MutableState<String?> = mutableStateOf(null)
        private set
    and the set function:
    fun setSnackbarMessage(msg: String?){
        snackBarMessage.value = null
        snackBarMessage.value = msg
    }
    Here is my Launcheffect which unfortunately is not getting triggered twice:
    LaunchedEffect(key1 = viewModel.snackBarMessage.value){ 
        val message = viewModel.snackBarMessage.value
        message?.let {
            scaffoldState.snackbarHostState.showSnackbar(message, "Ok")
        }
    }
    and on Favorite button click I call:
    viewModel.setSnackbarMessage("Added to Favorite")
    Eventhough I set the snackBarMessage to null it is not getting retriggered, only if the string message is different from the one before. I want to show the snackbar every time the user clicks on the button and not just the first time
    o
    s
    +2
    8 replies · 5 participants
  • h

    henrikhorbovyi

    06/01/2022, 2:36 PM
    Hello, everyone 👋 I’m trying to setup compose in an existing project and I’m facing the following error:
    NoSuchMethod: No Static method setContent
    My dependencies:
    dependencies {
        implementation("androidx.core:core-ktx:1.7.0")
        implementation("androidx.compose.ui:ui:1.1.1")
        implementation("androidx.compose.material:material:1.1.1")
        implementation("androidx.compose.ui:ui-tooling-preview:1.1.1")
        implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.1")
        implementation("androidx.activity:activity-compose:1.4.0")
    
        debugImplementation("androidx.compose.ui:ui-tooling:1.1.1")
        debugImplementation("androidx.compose.ui:ui-test-manifest:1.1.1")
    }
    o
    a
    +1
    28 replies · 4 participants
  • n

    Nikolas Guillen Leon

    06/01/2022, 3:12 PM
    Hi 🙂 I’m having some trouble with paddings/page resize when keyboard is opened, I’m attaching a video of the problem. It looks like if the TextField is in the very bottom of the screen, the imePadding does not work correctly. I’m using AdjustResize in my Manifest and
    WindowCompat.setDecorFitsSystemWindows(window, false)
    in MainActivity. My Column’s modifier is
    modifier = Modifier
                        .fillMaxSize()
                        .padding(horizontal = MaterialTheme.spacing.medium)
                        .padding(paddingValues)
                        .consumedWindowInsets(paddingValues)
                        .imePadding()
                        .verticalScroll(rememberScrollState())
    (Modifier.systemBarsPadding() is in the NavHost)
    bug.mp4
    j
    1 reply · 2 participants
  • m

    mattinger

    06/02/2022, 2:14 AM
    So i’m having trouble testing a TextField with a text style that has an explicit line height. I’m able to isolate this to a pretty simple test. It fails when i try to execute the done ime action, or if i try to do anything else on any node on the screen, including just printing the tree to a string. Removing the lineHeight attribute in the sample test allows the test to run properly
    offset(5) should be less than line limit(0)
    java.lang.IndexOutOfBoundsException: offset(5) should be less than line limit(0)
    	at android.text.TextLine.measure(TextLine.java:353)
    	at android.text.Layout.getHorizontal(Layout.java:1213)
    	at android.text.Layout.getHorizontal(Layout.java:1190)
    	at android.text.Layout.getPrimaryHorizontal(Layout.java:1160)
    See thread for test code.
    1 reply · 1 participant
  • j

    jasu

    06/02/2022, 5:06 AM
    any good reference to implement drag & drop(hold item put it next to other item) in lazyColumn?
    z
    t
    +1
    5 replies · 4 participants
  • a

    allan.conda

    06/02/2022, 5:37 AM
    In latest compose the “Animation duration scale” now affects the LazyList scroll animation (turning it off now causes jumps to end of scroll). Other apps (native or old compose) is not affected by it. Should this be considered as more correct?
    d
    2 replies · 2 participants
Powered by Linen
Title
a

allan.conda

06/02/2022, 5:37 AM
In latest compose the “Animation duration scale” now affects the LazyList scroll animation (turning it off now causes jumps to end of scroll). Other apps (native or old compose) is not affected by it. Should this be considered as more correct?
d

Doris Liu

06/02/2022, 11:11 PM
Could you file a bug on this please? Thank you!
a

allan.conda

06/06/2022, 12:39 PM
done https://issuetracker.google.com/issues/234990942
🙏 1
View count: 4