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

    Colton Idle

    05/03/2021, 3:07 PM
    I haven't worked with custom views ever, but for my first attempt, my designer gave me this. Is there a way that I can figure out what kind of curve this is, or should I be asking my designer for the path or curve specs or something? It doesn't make sense to me how to draw this curve programatically that'll work on tablets and phones of all sizes.
    k
    n
    • 3
    • 10
  • v

    Vince Rickey

    05/03/2021, 3:12 PM
    I'm having a little trouble with Intrinsics. I would like for the Text (yellow) to align with the bottom of only be as tall as the Image as indicated by the red dotted line. Can anyone spot if I am using
    IntrinsicSize.Min
    incorrectly or if I misunderstood?
    k
    f
    • 3
    • 17
  • r

    Rahul Sainani

    05/03/2021, 4:27 PM
    I've been wondering what are the things that need to be done before then android platform/os can take advantage of Kotlin and Compose?
    k
    l
    +4
    • 7
    • 17
  • a

    Alexander Karkossa

    05/03/2021, 7:50 PM
    Hello everyone, we needed a RevealSwipe for the Card, so we wrote our own one. Maybe the library will help someone. https://github.com/ch4rl3x/RevealSwipe
    👍🏻 1
    👍 18
    👍🏽 1
    👍🏼 1
    n
    s
    • 3
    • 2
  • s

    Socheat KHAUV

    05/04/2021, 4:28 AM
    I got a project build error org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering File being compiled: TakeVideoScreen.kt The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.backend.jvm.lower
    j
    • 2
    • 3
  • m

    Muhammad Zaryab Rafique

    05/04/2021, 9:08 AM
    Hi Devs, anyone idea about how to add splash screen in jetpack compose
    p
    c
    • 3
    • 3
  • m

    MBegemot

    05/04/2021, 9:20 AM
    What I do is in the mainactivity where screens are dispatched make one of them being the setup screen, and perform all initializations on that screen when they are done I set the current screen to the main one .... But I'm a little bit concerned about startup times of compose app, I'm not sure 100% but I feel they have sensible increased in the last two betas .
    g
    • 2
    • 29
  • p

    Philip Blandford

    05/04/2021, 9:40 AM
    I have a LazyColumn that, when the page loads, must be initialised to have a particular item on top, so I do
    val listState = rememberLazyListState()
    
    LaunchedEffect(itemIdx) {
      coroutineScope.launch {
        listState.scrollToItem(itemIdx)
      }
    }
    But this has a rather jarring effect, in that you see the thing scroll to position - what I want is for it just to be there ready when the page opens
    a
    • 2
    • 1
  • d

    Daniele B

    05/04/2021, 10:21 AM
    Compose Navigation: is there a way to receive a callback each time a composable is popped from the backstack?
    p
    i
    • 3
    • 14
  • j

    Jurriaan Mous

    05/04/2021, 11:54 AM
    With Compose for Android, Web, Desktop being in active development: it seems we only have to wait for a Compose for iOS for a complete multiplatform experience 😄
    o
    • 2
    • 1
  • d

    Deepak Gahlot

    05/04/2021, 12:03 PM
    Hi All, Any idea what will be a best approach on building a dragabble Layout. For example by default it is just a Row with some initial height with the drag handle on the middle and then we can drag it up and the height increases and shows rest of the content. Just like we have the gesture in BottomSheet.
    c
    • 2
    • 1
  • j

    JulianK

    05/04/2021, 1:24 PM
    I have a Unit Test which uses @RunWith(RobolectricTestRunner) and a compose test rule. However, when i start this simple test, i get the following error:
    Functions that involve synchronization (Assertions, Actions, Synchronization; e.g. assertIsSelected(), doClick(), runOnIdle()) cannot be run from the main thread. Did you nest such a function inside runOnIdle {}, runOnUiThread {} or setContent {}?
    How can i possibly not run my assertions/clicks on the main thread? What did i mess up here?
    Test.kt
    z
    • 2
    • 1
  • y

    Yuri Drigin

    05/04/2021, 1:31 PM
    Hi folks. I know this has asked before. But may be something changed. ))) Is there a way to popup navController to root without lot of code?
    navController.popStackToRoot()
    i
    • 2
    • 1
  • s

    Sivan

    05/04/2021, 2:18 PM
    Is it possible to provide a reflection property to a card or an image composable?
    j
    n
    • 3
    • 5
  • n

    nitrog42

    05/04/2021, 2:38 PM
    hey I'm struggling to find the way to do handle onClick between composable... I have a screen with a mapView (used the Crane sample), and I want to have a Center location FAB, I'm not sure how to handle the click to make the mapView center on the wanted location, sample in comment
    • 1
    • 4
  • c

    Chachako

    05/04/2021, 3:11 PM
    I am writing a file manager, when I click on the folder, the LazyColumn items data will be reloaded to enter the folder, then how can I remember the list position of the previous page so that I can automatically display it to the correct one when I return next time position, for example, the path
    a/b/c
    , when go to
    c
    , I should save the location of
    a
    and
    b
    z
    i
    • 3
    • 9
  • a

    Ahmed Mourad

    05/04/2021, 4:48 PM
    Hey everyone, I'm building a simple 
    DatePicker
     and I'm trying to display all the days of the month, e.g. 1..31 I tried using a column of rows for each month, with the months being displayed in a 
    Pager
    , similar to a regular 
    DatePicker
     .. However, the performance of it was pretty terrible. I replaced the rows and columns with a 
    LazyVerticalGrid
    , the performance improved significantly, although a stutter could still be seen when moving between pages. Is anyone else experiencing similar performance problems? I am testing on a middle-end phone, but the old Android 
    DatePicker
     and 
    ViewPager
     work fine on it.
    s
    • 2
    • 2
  • d

    Daniele B

    05/04/2021, 5:41 PM
    what happens to
    myNav
    object, in case both
    model
    and
    navController
    are immutable? will it get instantiated new at each recomposition?
    @Composable
    fun Navigation(model : MyModel) {
       val appState by model.stateFlow.collectAsState()
       ...
       val navController = rememberNavController()
       val myNav = MyNav(model, navController)
       ...
    }
    s
    c
    • 3
    • 6
  • e

    escodro

    05/04/2021, 5:54 PM
    Hello again! Sorry for reposting it, but does anyone has any fix or workaround for this issue in
    ModalBottomSheetLayout
    ? Thanks! ❤️
    a
    • 2
    • 1
  • c

    Chachako

    05/04/2021, 7:28 PM
    Is there a way to scroll the
    LazyColumn
    to the specified item (via the index of the list?) I want it to be displayed immediately, and or to scroll in animation
    m
    a
    • 3
    • 3
  • r

    robnik

    05/04/2021, 9:47 PM
    Is there something like iOS's segmented control for having a screen with 2 or 3 "modes" that you want to switch between at the top?
    z
    • 2
    • 6
  • s

    Se7eN

    05/04/2021, 9:58 PM
    I'm drawing a shadow around my bottom bar using the shadow modifier but it looks sharp. How can I draw a smoother shadow? I've tried playing around with the elevation but got nothing
    ➕ 1
    d
    c
    +2
    • 5
    • 28
  • d

    dewildte

    05/05/2021, 2:42 AM
    Is there an elegant way to achieve a Gaussian Blur in Compose?
    r
    c
    • 3
    • 4
  • n

    Nathan Castlehow

    05/05/2021, 4:18 AM
    Hi has anyone had issues with the androidview throwing an exception from the semantics modifier Reproducible on Pixel 3XL but not on workmates samsung? (More details in thread)
    • 1
    • 2
  • c

    carbaj0

    05/05/2021, 5:45 AM
    Hi! I'm triying to build a TodoApp with the MVI pattern. 🧵
    😒ame: 1
    d
    • 2
    • 22
  • s

    ste

    05/05/2021, 8:12 AM
    I need to draw the exact same icon several times - I'm currently using
    Canvas
    +
    drawPath
    . Is there a legit way to optimize the whole thing? My idea was to save the `Path`(s) using
    staticCompositionLocalOf
    . More in thread
    n
    a
    • 3
    • 7
  • o

    Orhan Tozan

    05/05/2021, 10:55 AM
    So is it possible to run Kotlin 1.5 in a project that uses Compose?
    o
    d
    +2
    • 5
    • 5
  • s

    Samir Basnet

    05/05/2021, 11:11 AM
    https://android-review.googlesource.com/c/platform/frameworks/support/+/1673249 this commit says implementation of prefetching logic in lazyRow/Column . Wasn't it already there ? i am a bit confused can someone tell me the mechanics in current lazyColumn/Row now vs after this update arrives ?
    m
    • 2
    • 2
  • l

    Lucien Guimaraes

    05/05/2021, 11:26 AM
    While having a
    Scaffold
    with a
    BottomNavigation
    , in one of the screen I have a view that can display a
    ModalBottomSheetLayout
    . How to display the bottomsheet on top of the
    BottomNavigation
    ? Even if the default elevation of bottomSheet > bottomNavigation, it's not displaying on top of it.
    s
    • 2
    • 3
  • s

    Slackbot

    05/05/2021, 11:33 AM
    This message was deleted.
    j
    f
    • 3
    • 2
Powered by Linen
Title
s

Slackbot

05/05/2021, 11:33 AM
This message was deleted.
j

julioromano

05/05/2021, 11:40 AM
I’m afraid this looks off topic: Is this question somehow related with Jetpack Compose? I suggest you move this question to a more appropriate channel.
f

Felipe Passos

05/05/2021, 11:41 AM
Ok
:thank-you: 1
View count: 3