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

    Evgeniy Shmoilov

    02/07/2021, 8:01 PM
    Hi! Is there a way to get pixel color on
    Canvas
    by coordinates?
    👀 1
    a
    r
    +1
    14 replies · 4 participants
  • l

    loloof64

    02/07/2021, 8:07 PM
    Hi ! In this documentation : https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Animatable#init. The snippet use
    launch
    in order to start a new Coroutine. But, though I've installed the coroutine dependency in
    gradle.build
    , I still get an error in Android Studio What did I forget to set ?
    a
    3 replies · 2 participants
  • t

    Tlaster

    02/08/2021, 3:03 AM
    I wonder since there is a
    dialog
    for the
    NavGraphBuilder
    , is there any chance to have
    composableDialog
    ?
    i
    2 replies · 2 participants
  • u

    Utkarsh Tiwari

    02/08/2021, 4:17 AM
    Is there any way to show the placeholder text in OutlinedTextField even when the field is not focused? I found a workaround, but it causes flicker when the user focuses the field. I am basically, replacing the value with placeholder when the field is not focused and changing the textcolor to placeholder color.
    j
    s
    +1
    5 replies · 4 participants
  • m

    Marko Novakovic

    02/08/2021, 9:41 AM
    where can I find animation tutorial/guide?
    d
    1 reply · 2 participants
  • m

    Mikołaj Kąkol

    02/08/2021, 10:54 AM
    hi, can I draw outside box bounds? something smiliar to xml’s
    clipToPadding=false
    ?
    t
    c
    +1
    4 replies · 4 participants
  • s

    Shabinder Singh

    02/08/2021, 1:58 PM
    Jetpack Compose Build Error: java.util.NoSuchElementException: Sequence contains no element matching the predicate. Compose: 1.0.0-alpha11
    j
    c
    +1
    5 replies · 4 participants
  • d

    Denis

    02/08/2021, 2:21 PM
    Is there a way to force
    @Preview
    to draw wireframes? Most of the time it shows them, but sometimes there are no wireframes or just a part of it.
    c
    11 replies · 2 participants
  • j

    julioromano

    02/08/2021, 2:49 PM
    Is there such thing as a
    Row
    composable which, when it has too many children, instead of overflowing continues on a “new line” ?
    a
    3 replies · 2 participants
  • d

    Denis

    02/08/2021, 4:37 PM
    The code in the thread causes the next exception on change of a theme:
    java.lang.IllegalArgumentException: Layer is redrawn for LayoutNode in state NeedsRelayout [LayoutNode@5aef729 children: 0 measureBlocks: MeasuringIntrinsicsMeasureBlocks@d83eaae{ measureBlock=androidx.compose.foundation.layout.BoxKt$boxMeasureBlocks$1@340204f }]
    There was a similar issue https://github.com/android/compose-samples/issues/129. I don't know if it's the same problem.
    a
    9 replies · 2 participants
  • k

    Kari Kähkönen

    02/08/2021, 9:10 PM
    I'm implementing a screen that contains a LazyColumn with items that have a checkbox in each of them. I want to have all the checkboxes disabled until the user makes an action (selects an option from separate dropdown menu). The problem is that when I update a checkbox state to enabled=true, the checkbox doesn't update until it is scrolled away from the screen and then back again. I made a simplified version (see thread below) with a single checkbox that is initially disabled and a button that enables it. Pressing the button, however, does not update the checkbox (it is not recomposed?). If I set the checkbox enabled initially and change the button to update the checked state, it works. Is there something special about the enabled parameter that I'm not getting or is there a bug?
    j
    r
    +1
    10 replies · 4 participants
  • c

    Colton Idle

    02/08/2021, 10:08 PM
    I have an E2E (edge to edge) app already, and I'm adding compose to the project. According to Chris Banes' accompanist insets lib I added
    Modifier.statusBarsPadding()
    to my Toolbar that's in a scaffold, but my statusbar is white instead of Purple (my Toolbar is purple). Am I doing something wrong?
    m
    c
    15 replies · 3 participants
  • r

    Rick Regan

    02/09/2021, 12:27 AM
    Is there a way to get a callback when a user scrolls a scrollable
    Text
    ? (I'm using
    Modifier.horizontalScroll(scrollState)
    on the Text, and the text has
    maxLines = 1
    .) I was looking for it in
    ScrollState
    but it looks like that's just used to programatically scroll. I'd like to use the scroll as a trigger to generate more characters of text; for example, more decimal places of a given number. (I guess this is kind of a "lazy" or "pagination" like behavior for Text.)
    d
    2 replies · 2 participants
  • k

    knthmn

    02/09/2021, 7:32 AM
    I have a
    ViewModel
    that is injected by Hilt with the new
    @Assisted
    annotation. How do I create the
    ViewModel
    inside a composable?
    a
    t
    4 replies · 3 participants
  • s

    Shakil Karim

    02/09/2021, 8:07 AM
    Is there any Example of using ViewPager2 with Compose?
    t
    n
    +3
    14 replies · 6 participants
  • j

    Jason Ankers

    02/09/2021, 12:22 PM
    How’s compose perf for frequently updating UI? I have a screen which displays a feed of data updating every 100ms. In React I would normally separate something which frequently updates into its own small component, do these sorts of optimisations also hold true in compose?
    t
    r
    +3
    18 replies · 6 participants
  • t

    TheMrCodes

    02/09/2021, 2:17 PM
    When a Box is clickable and has padding via Modifierer the clickbox will only contain the content. Is this a bug or a feature? Solved
    ✅ 1
    j
    s
    4 replies · 3 participants
  • e

    Elnur Jeksenov

    02/09/2021, 3:05 PM
    I want to make dashed border like this to my button, for this I am drawing rectangle with dashed stroke, but there is obscure exception: “java.lang.NullPointerException: null cannot be cast to non-null type androidx.compose.ui.graphics.AndroidPathEffect”
    Canvas(modifier = Modifier.fillMaxSize(), 
    onDraw = {
                                drawRect(
                                    size = Size(packFloats(200f, 50f)),
                                    color = Color.Blue,
                                    style = Stroke(width = 1f, pathEffect = PathEffect.dashPathEffect(floatArrayOf(10f, 10f), 0f))
                                )
    }
    )
    Have you got any idea, why this exception is appearing?
    k
    j
    +3
    6 replies · 6 participants
  • t

    Tuba Kesten

    02/09/2021, 3:11 PM
    Hi, I am using paging compose 1.0.0-alpha06 and paging-runtime-ktx 3.0.0-alpha10. The problem is I can load the data perfectly for the first time. But when I take action such as delete message from inbox, I want to refresh data but I couldn't manage to do that. If I move the collectAsLazyPagingItems call in messageInboxScreen function it loads as it is in the first time and of course the data is refreshed. In pagination, the data is not observable like in livedata so I stucked how to manage refresh. Any idea for that ? Is there any example related to pagination data refresh?
    c
    s
    +1
    4 replies · 4 participants
  • d

    Denis

    02/09/2021, 7:32 PM
    Could anybody explain how
    lineHeight
    works? Why doesn't it affect the first line? What is the space below the first line? (Code in thread)
    ➕ 1
    c
    s
    4 replies · 3 participants
  • a

    ak

    02/09/2021, 7:45 PM
    Hello, I am working on a application utilizing
    AndroidView
    to display a
    MapView
    in Compose. I am able to get the map to display fine, but there are interactions within my screen that require me to modify the map after a user clicks a button. i.e. displaying a route on the map after doing a network call from the Google Directions API. The trouble I am having is my
    AndroidView
    Composable
    update
    block is not firing when my Directions API call is ready. e.g. when my
    mutableStateOf(directions)
    changes.
    j
    c
    +1
    21 replies · 4 participants
  • z

    Zach Klippenstein (he/him) [MOD]

    02/09/2021, 8:27 PM
    Has anyone working with
    AndroidView
    noticed that the view state of their nested Android view hierarchies isn’t being restored correctly either after config changes or navigation, or weird stuff with lifecycles? I’ve been exploring some of these interactions and found what I’m pretty sure are a number of bugs. The README in this repo describes a number of the (potential) issues I found, but if people have found other repro cases it would probably be good to add them to the Google issue.
    a
    h
    +2
    13 replies · 5 participants
  • t

    Thomas

    02/09/2021, 9:13 PM
    What is the alternative for
    dragGestureFilter
    with
    startDragImmediately = true
    since it was deprecated?
    d
    g
    9 replies · 3 participants
  • u

    ursus

    02/10/2021, 3:03 AM
    When I map a request being in flight to button being enabled, and on success move to next screen, what I notice is that given the screen transitions are animated, I can see the button being enabled during the transition for a split second. Has anyone idea as how to workaround this, given the next screen is backable, I cant just map success to button.enabled = false (somehow reset the state after transition)
    d
    i
    5 replies · 3 participants
  • d

    darkmoon_uk

    02/10/2021, 9:43 AM
    Any updates on a
    1.4.30
    compatible release? Reason being: I've hit a
    NotImplementedException
    while using the IR backend with
    1.4.21-2
    , hoping praying it's resolved in the next... 😨
    j
    a
    +1
    4 replies · 4 participants
  • k

    Kyant

    02/10/2021, 10:21 AM
    androidx.dev is 502 now? 😰
    j
    3 replies · 2 participants
  • j

    julioromano

    02/10/2021, 2:32 PM
    What are the Compose-related implications regarding Kotlin’s JDK IR backend being now beta in 1.4.30? Can this possibly mean we can reasonably expect future updates to Kotlin not to break older versions of compose anymore (starting from alpha12 on)?
    j
    1 reply · 2 participants
  • d

    Denis

    02/10/2021, 3:33 PM
    I heard HSL color space is easier to reason about, but I see nothing about it in compose packages [1] [2]. There's [3], is it OK to use it? [1] https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color [2] https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace [3] https://developer.android.com/reference/kotlin/androidx/core/graphics/ColorUtils#HSLToColor(kotlin.FloatArray)
    k
    4 replies · 2 participants
  • i

    Ilias Zosimadis

    02/10/2021, 4:41 PM
    I tried CameraX using the AndroidViewBinding. It works fine with
    kotlinx-coroutines-android:1.4.1
    but for
    kotlinx-coroutines-android:1.4.2
    the camera preview layout is not centered on the screen.
    3 replies · 1 participant
  • t

    tcracknell

    02/10/2021, 6:35 PM
    Hello! The latest Jetpack Compose minor release, alpha12, is here! You can get it now from Google’s Maven Repository. Release notes are available at https://developer.android.com/jetpack/androidx/versions/all-channel. Please log issues at https://issuetracker.google.com/issues/new?component=612128.
    🏄‍♀️🏽 1
    🎉 46
    :party-parrot: 10
    t
    t
    +3
    5 replies · 6 participants
Powered by Linen
Title
t

tcracknell

02/10/2021, 6:35 PM
Hello! The latest Jetpack Compose minor release, alpha12, is here! You can get it now from Google’s Maven Repository. Release notes are available at https://developer.android.com/jetpack/androidx/versions/all-channel. Please log issues at https://issuetracker.google.com/issues/new?component=612128.
🏄‍♀️🏽 1
🎉 46
:party-parrot: 10
t

tylerwilson

02/10/2021, 6:41 PM
From the release notes samples, they use 1.4.30, but that plugin version is not yet in Arctic Fox. I suppose that should be coming in shortly?…
👍 1
t

Thomas

02/10/2021, 7:11 PM
https://android-review.googlesource.com/c/platform/frameworks/support/+/1561984
Always try to use the whole item object as a key but something like an id of it.
I think this contains a typo, I assume you mean: not the whole item but only identifiers.
c

cb

02/10/2021, 7:13 PM
You can enable the new plugin by switching to the "Early Access Preview 1.4.x" in Android Studio's settings (Language & Frameworks ➡️ Kotlin)
🙏🏼 1
j

jim

02/10/2021, 7:15 PM
If you're upgrading to alpha12, you may run into an issue with the release which we just discovered (
No static method setContent
). Please hang tight as we resolve an issue; we hope to have an update by end of day.
❤️ 14
i

Ian Lake

02/10/2021, 10:47 PM
Activity Compose 1.3.0-alpha02 is out now, fixing the
compiled with an unstable version
and
No static method setContent
errors. Please make sure you add an explicit dependency on
androidx.activity:activity-compose:1.3.0-alpha02
when upgrading to Compose Alpha 12: https://developer.android.com/jetpack/androidx/releases/activity#1.3.0-alpha02
😽 6
👍 22
🔥 6
View count: 7