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

    Sudeep Bhowmick

    06/22/2021, 10:05 PM
    Hello All, I am seeing this when trying to setup Compose:
    Could not resolve androidx.compose:compose-compiler:1.0.0-beta09.
             > Could not get resource '<https://s3.amazonaws.com/tgl.maven/androidx/compose/compose-compiler/1.0.0-beta09/compose-compiler-1.0.0-beta09.pom>'.
                > Could not GET '<https://s3.amazonaws.com/tgl.maven/androidx/compose/compose-compiler/1.0.0-beta09/compose-compiler-1.0.0-beta09.pom>'. Received status code 403 from server: Forbidden
    Seems strange since this is a public beta I think..any pointers?
    j
    l
    • 3
    • 8
  • t

    tad

    06/23/2021, 12:10 AM
    I have a pretty simple layout with three TextFields in a Column, the first two set up with
    ImeAction.Next
    . Should tapping the IME action just do the right thing and focus the next field, or do I need to set this up manually with FocusRequester and KeyboardActions?
    ➕ 2
    m
    l
    m
    • 4
    • 4
  • m

    mattinger

    06/23/2021, 12:51 AM
    anyone know how to use ComposeTestRule so that it doesn’t auto launch the activity? With ActivityScenario i can just delay creating it until i’m ready for that (and with ActivityTestRule, which i think is deprecated) you could tell it not to auto launch. The problem with auto launch is that if you have processes (like a data load) that kick off on onStart or something like that, you can’t effectively stub out the calls without creating a test class for each unique set of responses from that data load.
    • 1
    • 1
  • j

    james

    06/23/2021, 5:10 AM
    How do you go about aligning items alternately to the start and end of a LazyColumn?
    j
    a
    • 3
    • 2
  • l

    lhwdev

    06/23/2021, 6:14 AM
    Why are the exceptions thrown in
    LaunchedEffect
    not shown in the logcat? Normally errors is not caught so default thread exception handler works. It still freezes the UI, making it a lot harder to debug... (compose 1.0.0-beta09)
    t
    • 2
    • 2
  • s

    shruti.d.bansal

    06/23/2021, 7:04 AM
    any alternative for date time picker in jetpack compose
    s
    • 2
    • 1
  • l

    Laodice Melliti

    06/23/2021, 8:15 AM
    Hello! Does anyone have a good resource to properly integrate compose in Android TV apps? Specifically, how to make Rows and Columns scroll when using a remote control device instead of a touch screen gesture?
    w
    a
    +5
    • 8
    • 36
  • g

    georgiy.shur

    06/23/2021, 10:33 AM
    Hello, I have troubles migrating one of the views to
    ComposeView
    using interop. I have a custom view which extends
    AbstractComposeView
    , then I’m trying to add this view programmatically with
    listItem.addView(myComposeView)
    inside the
    onBindViewHolder
    method of RV adapter (inside one of the items). It crashes with
    java.lang.IllegalStateException: ViewTreeLifecycleOwner not found from id/listItem
    . I’ve tried to debug it and I found that it tries to recursively find a parent with
    android.R.id.content
    , but the problem with RecyclerView is that sometimes it returns
    null
    for its children’
    getParent()
    , because they’re not yet attached to viewholder. So the parent is null means it doesn’t have
    ViewTreeLifecycleOwner
    . Is it a bug or expected behavior? Should I do it differently? Is there a way to work around it?
    a
    • 2
    • 1
  • n

    Nipun Rajput

    06/23/2021, 11:38 AM
    Have any one faced performance issue in
    LazyColumn
    and
    LazyRow
    recent
    beta09
    compose migration? I am facing hard to scroll when migrated to compose beta 09
    a
    • 2
    • 8
  • m

    mattinger

    06/23/2021, 1:57 PM
    Anyone have an idea of how much overhead there is adding semantic properties? I’m working on testing, and there’s definitely some stuff i’d like to verify. For instance, we have a “Fill” and “Stroke” button (ie. Button and OutlinedButton) that can have a “Tone” that affects the color of the button. The normal semantic tree would only put a “Role” of “Button”. I was thinking of adding a ButtonType and Tone semantic property. Just looking for an idea of the overhead. There’s also a loading indicator, so i was thinking of a Loading property as well.
    ➕ 1
    a
    m
    • 3
    • 11
  • e

    eneim

    06/23/2021, 2:15 PM
    Reading the source code (currently beta09), I find that the
    WrappedComposition
    will
    dispose
    when the lifecycle is destroyed (lifecycle event
    ON_DESTROY
    is observed). Considering that the onDestroy callback of an Activity may not be called in some critical situations, I wonder why the
    ON_STOP
    event is not a better choice? (Not sure if it is appropriate to ping @Ian Lake for this question …)
    a
    • 2
    • 1
  • c

    Colton Idle

    06/23/2021, 2:48 PM
    Has anyone made a compose calendar with airbnb-like date ranges?
    :nope: 1
    a
    • 2
    • 2
  • m

    miqbaldc

    06/23/2021, 2:49 PM
    wdyt about ui testing in compose? any alternative approach or references to learn beside from official docs? https://developer.android.com/jetpack/compose/testing espresso & robolectric might resulting a flaky test been looking this library: https://github.com/cashapp/paparazzi/issues/225 unfortunately compose not supported at the moment 🙏
    ➕ 1
    n
    • 2
    • 2
  • j

    Joey

    06/23/2021, 3:01 PM
    What’s the recommended way to make a TextField readonly and clickable, but not focusable?
    a
    • 2
    • 3
  • f

    FunkyMuse

    06/23/2021, 3:16 PM
    Hey guys, anyone running into a weird issue where using compose with pro-guard enabled, minify and shrink resources gets this exception when using Retrofit with Moshi code-gen ? Everything works fine in debug mode without proguard, same network code is used on non-compose project, there isn't any crash like this.
    java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
    e
    e
    • 3
    • 7
  • m

    Marko Novakovic

    06/23/2021, 3:44 PM
    am a bit confused with
    hilt-navigation
    documentation.
    inline fun <reified VM : ViewModel> hiltViewModel()
    and
    internal fun <VM : ViewModel> hiltViewModel(
        kClass: KClass<VM>,
        backStackEntry: NavBackStackEntry
    )
    and
    hiltNavGraphViewModel()
    documentation says that it gets or creates
    ViewModel
    scoped to the current navigation graph. as far as I know and what I see in code if current
    ViewModelStoreOwned
    is
    NavBackStackEntry
    , which composables in graph are,
    ViewModel
    is scoped to
    NavBackStackEntry
    .
    hiltViewModel<HomeViewModel>(backStackEntry)
    and
    hiltViewModel<HomeViewModel>()
    should be the same right? it scopes
    ViewModel
    to current back stack entry?
    i
    • 2
    • 6
  • f

    FunkyMuse

    06/23/2021, 3:47 PM
    Does
    collectAsLazyPagingItems()
    respect something like
    flow.flowWithLifecycle(lifecycleOwner.lifecycle, Lifecycle.State.STARTED)
    or the data is updated even when the UI isn't in started mode?
    a
    a
    • 3
    • 11
  • l

    Lucien Guimaraes

    06/23/2021, 4:46 PM
    I have a very weird behaviour with 
    BasicTextField
    , when it's being focused I want to erase the text. But it's only working when the focus occur after a click outside the 
    innerTextField()
     from the 
    decorationBox
    , as you can see in the following video. Any idea why it's happening ?
    20210623_173458.mp4
    a
    • 2
    • 2
  • p

    Prafull M

    06/23/2021, 4:56 PM
    Made an interactive parallax effect that rotates based on user's input gesture, made with Jetpack compose. For source code, see this thread: https://twitter.com/NotYourPM/status/1407722449651650561?s=19
    2021_06_23_20_02_16~4.mp4
    ❤️ 6
    👍 10
    :party-parrot: 6
    👍🏼 2
    🔥 22
    t
    • 2
    • 2
  • b

    Boris Kachscovsky

    06/23/2021, 5:23 PM
    We’re trying to implement an indeterminate progress spinners whose animations are synchronized between screens. Is this possible in compose? Would it be possible to base it off some shared value (e.g. time)?
    d
    • 2
    • 7
  • r

    Ravi

    06/23/2021, 9:22 PM
    I’m unable to find
    CircleCropTransformation
    for glide lib mentioned in the accompanist documentation.
    import androidx.compose.foundation.Image
    import com.google.accompanist.glide.rememberGlidePainter
    
    Image(
        painter = rememberGlidePainter(
            request = "<https://picsum.photos/300/300>",
            requestBuilder = {
                transformations(CircleCropTransformation())
            },
        ),
        contentDescription = stringResource(R.string.image_content_desc),
    )
    e
    n
    a
    • 4
    • 5
  • n

    Neal Sanche

    06/24/2021, 3:31 AM
    Attempting to upgrade our app to Compose beta09, and encountering a crash at startup, stack trace in thread. I tried updating to a newer coroutines library, 1.5.0, but that didn't help. Any ideas?
    • 1
    • 3
  • k

    kevindmoore

    06/24/2021, 5:18 AM
    I have a list of items that I have added a SwipeToDismiss on. They get deleted correctly but when I try to add the same items back in, they get immediately deleted
    • 1
    • 1
  • k

    Kunal Raghav

    06/24/2021, 9:33 AM
    How to scope a ViewModel to a screen in navgraph when using hilt and navigation component?
    c
    • 2
    • 3
  • f

    FunkyMuse

    06/24/2021, 11:30 AM
    Hey guys, does anyone have similar performance issues with LazyList even in release mode, beta-09 On the first screen the app is fully compose, the second one is recyclerview, it really is noticable difference
    screen-20210624-132911.mp4
    ➕ 3
    l
    s
    • 3
    • 2
  • i

    iamthevoid

    06/24/2021, 11:39 AM
    i want to nav controller navigate to route when
    Flow
    emits the concrete value. Is it correct to do that in compose or i must think different? If correct, what is the best way to do that?
    c
    i
    • 3
    • 3
  • j

    julioromano

    06/24/2021, 1:19 PM
    In
    @Composable
    APIs, is it preferable to have a default
    onClick
    param as an empty lambda (
    onClick: () -> Unit = {}
    ) or as a nullable function (
    onclick: (() -> Unit)? = null
    )? Are there any pros and cons?
    ✅ 1
    a
    b
    +2
    • 5
    • 12
  • n

    nacholopez

    06/24/2021, 2:05 PM
    Hello folks! I was wondering if there is any way of forcing the Robolectric idling strategy to work on tests? RobolectricDetector in the Compose codebase checks specifically for Robolectric runners by looking for specific traits in your runner, however at my current company we use a custom runner with a bunch of extra configuration that we can't remove and it doesn't fall into the categories checked: this runner we use doesn't extend AndroidJUnit4 nor the robolectric ones, but it is indeed a Robolectric runner. Would it be possible to add some way of configuring the runner to let the composeTestRule know we are using Robolectric even if it doesn't seem so?
    j
    • 2
    • 9
  • c

    Christopher Elías

    06/24/2021, 3:24 PM
    Can I build for wearables with Compose UI?
    a
    • 2
    • 2
  • t

    tylerwilson

    06/24/2021, 4:11 PM
    Will the current Compose beta09 work with Kotlin 1.5.20, or should we wait for Compose beta10 to upgrade?
    a
    • 2
    • 3
Powered by Linen
Title
t

tylerwilson

06/24/2021, 4:11 PM
Will the current Compose beta09 work with Kotlin 1.5.20, or should we wait for Compose beta10 to upgrade?
a

Adam Powell

06/24/2021, 7:01 PM
Compose is not currently compatible with 1.5.20
at beta09 or in the
main
development branch
t

tylerwilson

06/24/2021, 7:02 PM
Thanks for the info! Did not want to update and then have to revert.
View count: 3