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

    gpaligot

    08/24/2021, 7:11 PM
    Hello all! I'm looking for a function to convert a rgb
    Color
    to a HSL representation but I can only find a HSL to RGB function in the
    Color
    class. Someone can confirm me that the RGB to HSL function doesn't exist?
    z
    r
    • 3
    • 14
  • a

    Angeles Bilbao

    08/24/2021, 8:39 PM
    Hello!! I am trying to convert my Jetpack Compose Desktop application into an Android Studio plugin, does anyone knows an easy way to accomplish it?
    c
    • 2
    • 1
  • a

    adjpd

    08/24/2021, 9:01 PM
    How long does a new Compose release normally take? I'm wondering about 1.1.0. It fixes the
    TextField
    focus adding to the backstack problem.
    m
    • 2
    • 3
  • s

    Stylianos Gakis

    08/24/2021, 9:05 PM
    Curious about when a composable function should return a
    State<T>
    or just
    T
    . An example from “Crane” the official android samples inside thread 🧵
    z
    c
    • 3
    • 12
  • d

    Doris Liu

    08/25/2021, 1:27 AM
    Hi all, is there something about compose animation that you are interested to know? I'd love to hear about it. 🙂 🙏 You could also cast your vote here: https://twitter.com/doris4lt/status/1430334987388080129
    p
    t
    • 3
    • 6
  • t

    Tin Tran

    08/25/2021, 7:09 AM
    Hi! Does compose text support these attributes?
    android:autoSizeMinTextSize="12sp"
    android:autoSizeMaxTextSize="100sp"
    n
    f
    +2
    • 5
    • 6
  • m

    Magnus Gudmandsen

    08/25/2021, 8:16 AM
    Is there any good way to debug why things are recomposing? I.e. what fields are causing a recomposition to happen.
    ☝️ 2
    b
    d
    • 3
    • 4
  • s

    Samiullah Kalhoro

    08/25/2021, 9:03 AM
    Hello guyz, can i start android development from scratch using jetpack compose? Any resources?
    a
    • 2
    • 5
  • d

    Daniele Segato

    08/25/2021, 9:11 AM
    I'm integrating ExoPlayer in Compose. I need it in a LazyColumn and the video is supposed to pause/resume every time it leave the screen or enter it. Can anyone help me on how to monitor the visibility of a composable on the Screen? (code in the thread)
    🧵 1
    f
    c
    a
    • 4
    • 18
  • r

    rsktash

    08/25/2021, 9:14 AM
    Hi I have implemented accompanist inset animation. But when the keyboard is showing the textfields are staying under the keyboard. How can I run scroll animation synchronized with keyboard show animation?
    d
    • 2
    • 20
  • b

    BenjO

    08/25/2021, 10:13 AM
    Hi everyone 👋 I would like to create a Composable that looks like the first picture : rounded corners (circle shape) only on the right side. Do do that I use
    RoundedCornerShape(0.dp, 28.dp, 28.dp, 0.dp)
    . the problem is that I need to keep them same CornerSize even when the composable width is really small (see the second picture). RoundedCornerShape adapts the corner size (see the third picture in greyscale) does anyone have a hint on how to achieve such rendering ? Many thanks !
    t
    d
    l
    • 4
    • 6
  • d

    danieldisu

    08/25/2021, 11:00 AM
    Is there any way to listen for keyboard events? (when the keyboard is shown and when the keyboard is hidden (without pressing next/done) inside a composable?)
    d
    • 2
    • 2
  • h

    Heikki Rauhala

    08/25/2021, 11:36 AM
    In an app with both d-pad and touch event support, what would be the best way to react to any touch event to reset and hide the d-pad focus?
    a
    n
    w
    • 4
    • 33
  • l

    louiscad

    08/25/2021, 12:23 PM
    Hello, what could cause recomposition to not trigger in a
    ComposeView
    despite the
    State
    objects being mutated from the class holding them?
    b
    a
    a
    • 4
    • 28
  • r

    Rafiul Islam

    08/25/2021, 12:53 PM
    Navigation with compose official doc have stated "You should only call navigate() as part of a callback and not as part of your composable itself, to avoid calling navigate() on every recomposition" so should I not do this? Check the thread for details.
    t
    • 2
    • 9
  • n

    Napa Ram

    08/25/2021, 12:54 PM
    is there any way to reduce textfiled inline padding for leading or trailing icon
    c
    • 2
    • 1
  • t

    tylerwilson

    08/25/2021, 12:57 PM
    So the age-old question: with the Kotlin 1.5.30 release, what version(s) of Compose are (will be) compatible…
    :plus-one: 6
    a
    t
    • 3
    • 3
  • r

    rajesh

    08/25/2021, 1:34 PM
    How to create bottom sheet with following structure: 1. TopBar 2. Content (Body) 3. ModalBottomSheet (open when item from content is clicked) 4. BottomAppBar
    c
    n
    • 3
    • 9
  • v

    VitalNik

    08/25/2021, 2:26 PM
    In my Jetpack Compose project I'm using BackPressHandler from Android examples. Everything works as expected until I pause and resume the app. At this point BackPressHandler is not intercepting back button anymore and navigation just defaults to regular back press behaviour. Gist example: https://gist.github.com/vitalnik/2a444c20cb9f370c405ee1ddb86d3e66
    i
    • 2
    • 2
  • r

    Rafiul Islam

    08/25/2021, 2:32 PM
    I have single activity and 3 composable screens Login, Enter Pin, Home. Then from home, there are some other screens. When a user visits for the first time the flow is Login page -> Enter Pin -> Home saves the API key to the Datastore. From next time , Enter Pin -> Home What should be my nav graph? See details in the thread.
    • 1
    • 1
  • t

    Tin Tran

    08/25/2021, 2:36 PM
    Hi. Does this mean I must set target sdk to 31 if I want to upgrade to compose 1.1.0-alpha02?
    The minCompileSdk (31) specified in a
    dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
    is greater than this module's compileSdkVersion (android-30).
    Dependency: androidx.compose.ui:ui-tooling:1.1.0-alpha02.
    ✅ 3
    l
    m
    k
    • 4
    • 16
  • t

    Todor Grudev

    08/25/2021, 2:46 PM
    Hello, is there a way to print the stack of rendered composables elements? I am trying to find this for debugging purposes, but can’t really find a way to print them.
    a
    • 2
    • 2
  • c

    Colton Idle

    08/25/2021, 3:39 PM
    This complains about
    align
    , but it works fine if I just drop this image code into a Box. How can I make a reusable bottomAlignedImage composable like this?
    @Composable
    fun bottomAlignedImage(){
        Image(
                modifier = Modifier.fillMaxWidth().align(Alignment.BottomCenter),
                painter = painterResource(id = R.drawable.myImage),
                contentDescription = null
    )}
    n
    • 2
    • 3
  • b

    bohregard

    08/25/2021, 4:18 PM
    I’m having an issue with LazyColumn not showing the last item in a list when it’s in
    androidx.compose.ui.platform.ComposeView
    XML file.
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="<http://schemas.android.com/apk/res/android>"
        android:id="@+id/user_list_fragment_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:orientation="vertical">
    
        <androidx.compose.ui.platform.ComposeView
            android:id="@+id/composeView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    
    </RelativeLayout>
    // Composable
    Column(
        modifier = Modifier
            .fillMaxWidth()
            .fillMaxHeight()
            .background(Color.White)
    ) {
        Row(
            modifier = Modifier.fillMaxWidth()
        ) {
            ...
        }
        LazyColumn(
            modifier = Modifier.fillMaxWidth(),
            state = listState
        ) {
            ...
        }
    }
    If I set the height to a manual number, the last item shows. It’s like the Lazy column is being drawn off screen. This is in a ViewPager fwiw
    :thread-please: 1
    • 1
    • 1
  • k

    Kaustubh Patange

    08/25/2021, 4:29 PM
    Why isn't there a built-in tooltip composable (shows on long press)? Currently I'm using
    Popup
    to achieve this functionality but it would be great if there is an official support from the team.
    a
    • 2
    • 1
  • r

    rsktash

    08/25/2021, 4:35 PM
    This sample is not working with the latest compose(jetbrains compose). Is something going to be changed? BringIntoViewDemo
    r
    • 2
    • 20
  • k

    K Merle

    08/25/2021, 4:58 PM
    For a new android composable project, should I be using single activity or have multiple activities within the app? What would best most appropriate approach at this point?
    c
    • 2
    • 1
  • s

    Scott Kruse

    08/25/2021, 5:11 PM
    How does lazy rows resizing behave with dynamic sized items? RecyclerView had interesting issues, curious how compose will handle the issue: https://stackoverflow.com/questions/57890199/how-to-set-recycler-height-to-highest-item-in-recyclerview
    a
    • 2
    • 2
  • s

    Sergey Y.

    08/25/2021, 5:48 PM
    Is it possible to implement drag-and-drop functionality with pure compose widgets? I am worried about the moment when I need to take a screenshot of the element that we will be dragging. 🤔
    :google: 1
    • 1
    • 1
  • n

    Nick

    08/25/2021, 6:43 PM
    I’m trying to understand this: https://google.github.io/accompanist/pager/#reacting-to-page-changes
    The 
    PagerState.currentPage
     property is updated whenever the selected page changes. You can use the 
    snapshowFlow
     function to observe changes in a flow:
    LaunchedEffect(pagerState) {
        snapshotFlow { pagerState.currentPage }.collect { page ->
            // Selected page has changed...
        }
    }
    Why can’t I just access the current page via
    pagerState.currentPage
    ? Why do I have to wrap it in a
    LaunchedEffect
    and
    snapshotFlow
    ?
    c
    • 2
    • 3
Powered by Linen
Title
n

Nick

08/25/2021, 6:43 PM
I’m trying to understand this: https://google.github.io/accompanist/pager/#reacting-to-page-changes
The 
PagerState.currentPage
 property is updated whenever the selected page changes. You can use the 
snapshowFlow
 function to observe changes in a flow:
LaunchedEffect(pagerState) {
    snapshotFlow { pagerState.currentPage }.collect { page ->
        // Selected page has changed...
    }
}
Why can’t I just access the current page via
pagerState.currentPage
? Why do I have to wrap it in a
LaunchedEffect
and
snapshotFlow
?
In an example about integrating tabs with this, they directly access
PagerState.currentTab
c

cb

08/25/2021, 6:53 PM
Reading the value in composition is fine. That example is showing you how to turn page changes into an event stream, for things like analytics
🙏 1
n

Nick

08/25/2021, 6:53 PM
ahh, ok thanks!
View count: 7