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

    dimsuz

    06/21/2021, 10:22 AM
    I have three `material.Button`s in a
    Row
    where I dynamically render buttons with different properties and have the strange ripple behaviour: the button which wasn't interacted with shows ripple effect for some reason. Notice the button in the center (video in the thread). Any ideas why this happens?
    r
    a
    • 3
    • 10
  • r

    Richard Z

    06/21/2021, 10:24 AM
    AlertDialog’s KDocs says that title’s style defaults to “h6”, and text defaults to “body1"… but the actual AlertDialogContent code defaults title to “subtitle1” and text defaults to “body2"… The Material Design guidelines suggest h6 and body1. Curious if this is a code bug or a change to the theming guidelines?
    • 1
    • 2
  • n

    Niklas Bolwede

    06/21/2021, 10:59 AM
    Trying to learn Compose. My goal is to have one activity and no xml/layouts. Only work with composables as views and using one loginscreen and a bottom navigationbar that reuse/saves state of its viewmodels scooped to the views. I need som help and input on how to think about this navigation setup. Code in my comment.
    i
    • 2
    • 5
  • a

    Alex

    06/21/2021, 11:35 AM
    Is there no scroll overflow glow in compose?
    s
    n
    • 3
    • 4
  • m

    Maik

    06/21/2021, 11:37 AM
    I am trying to draw elliptical gradients as well as radial ones. What would be the best approach to implement something like this? The
    RadialGradient
    allows only one radius in the definition.
    n
    • 2
    • 4
  • i

    iamthevoid

    06/21/2021, 12:34 PM
    I want to create clickable sides in row with dynamic size (square, fill parent height). I try to use code (from thread), but each
    Box
    fills size of root, not parent size.
    a
    • 2
    • 4
  • a

    Adrian Landborn

    06/21/2021, 1:58 PM
    Navigating app using a keyboard? I am working on an app which needs to comply to WCAG 2.1 accessibility guidelines https://www.w3.org/TR/WCAG21 I tried to navigate both my own app and the Jetcaster app and nothing. Using the ARROW keys on the bluetooth keyboard I get no response from Compose apps. Is this a bug, not implemented or what is the deal? I am running beta 09 and and a Samsung Galaxy s10.
    ➕ 2
    c
    • 2
    • 2
  • l

    Luis Mierez

    06/21/2021, 2:54 PM
    Question about the
    MaterialTheme
    colors and typography. If I create a
    MaterialTheme
    with a primary color of
    Color.Blue
    , and a button
    TextStyle
    that has the color set to
    Color.White
    , which color takes precedent when using a
    TextButton
    ?
    s
    c
    l
    • 4
    • 24
  • m

    MaxUt

    06/21/2021, 3:38 PM
    Hi guys, I'm storing Webview objects in a Singleton in order to keep their state. When my Composable gets recomposed it simply pass the webview objects to the AndroidView factory. This works perfectly when I change of Composable, however when the recomposition is triggered by an other event such as a Composable passing in front of the webview Composable, I get the following error :
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
    Any ideas ?
    • 1
    • 2
  • d

    dimsuz

    06/21/2021, 5:17 PM
    I have an activity with
    adjustResize
    mode and a
    Column
    with
    verticalScroll
    and a
    TextField
    inside, and when I click on the text field, keyboard obscures it, no scrolling happens. This is the latest beta. Is this a known bug/limitation? See code I use in the thread.
    l
    t
    b
    • 4
    • 6
  • r

    Rick Regan

    06/21/2021, 5:40 PM
    Inside a composable I can copy text to the clipboard by doing something like 
    LocalClipboardManager.current.setText(AnnotatedString("Copied to clipboard"))
    . But how can I copy to the clipboard from a callback? I want to copy the state of a
    Text
    when a "copy all" icon button is pressed. (The composable
    SelectionContainer
    is not suitable for my app for several reasons.)
    l
    • 2
    • 4
  • m

    Mehdi Haghgoo

    06/21/2021, 6:12 PM
    What does the Animation Docs mean by "When LaunchedEffect enters composition"?
    z
    • 2
    • 1
  • z

    Zach Klippenstein (he/him) [MOD]

    06/21/2021, 6:18 PM
    I’m seeing Kotlin’s binary compatibility tool reporting
    ComposableSingletons
    classes being generated and exposed as public. It seems like it might be some sort of a lambda cache, which seems fine, but does it need to be public? It’s not clear where it’s coming from, and I’m nervous about what this means for future binary compatibility because it seems to have appeared after adding a private
    @Preview
    function which I wouldn’t expect to have public API implications. I don’t see anything about this in the bug tracker, and I’m not sure it’s a bug anyway. Some references to this type in stack traces in this thread, but nothing specifically about whether it should be public API either.
    a
    s
    a
    • 4
    • 6
  • m

    Mehdi Haghgoo

    06/21/2021, 6:26 PM
    I want to animate a corner size using TargetBasedAnimation and decide which animation value to stop at. I want to trigger the corner size animation on click, but it is automatically executed. Also, what triggers the target based animation?
    l
    • 2
    • 2
  • m

    mattinger

    06/21/2021, 9:02 PM
    Does anyone know why the typed in text here is underlined for an EditText?
    d
    f
    a
    • 4
    • 7
  • s

    Slackbot

    06/21/2021, 9:52 PM
    This message was deleted.
    :kotlin-intensifies: 7
    🎉 15
    i
    • 2
    • 2
  • w

    Wesley Marquez-Lim

    06/22/2021, 1:24 AM
    I have a question regarding LazyPagingItems and LazyVerticalGrid.. is this possible? or do I have to make a custom composable for this?
    🙌 1
    i
    • 2
    • 2
  • j

    Jason Ankers

    06/22/2021, 4:46 AM
    navigation-compose first renders a null destination before rendering the start destination which creates a brief flicker. Any way around this?
    i
    z
    • 3
    • 6
  • r

    Ruger McCarthy

    06/22/2021, 12:00 PM
    Does anyone know how to disable passing the vertical offset event to the external lazyColumn when the focus is on the item?
    a.mp4
    d
    • 2
    • 3
  • d

    dambakk

    06/22/2021, 12:49 PM
    I’m experiencing an issue where scrolling on a clickable composable (in this case a Card but it happens on buttons as well) makes it non-clickable the next time you try to click it, and after that it is clickable again. I guess it’s somehow related to the scroll+ripple bugfix included in beta08, but not what I want here. The card is wrapped in a Column that is not scrollable if that matters, and it’s only the banner that is written in Compose. Is there anything I can do?
    screen-20210622-132002.mp4
    a
    m
    • 3
    • 17
  • a

    André Thiele

    06/22/2021, 1:06 PM
    Is it possible that compose automatically applies insets? When setting setDecorFitsSystemWindows on my activity, all other fragments draw behind the nav bars etc. while the compose fragment is not. When applying insets now, the other fragments look correct but the compose one has twice the padding now.
    l
    • 2
    • 7
  • m

    mattinger

    06/22/2021, 1:14 PM
    Does anyone know how to test a composable function that that doesn’t actually render UI? For instance, I have an implementation of CheckboxColors which is tied to custom theme attributes. I’d like to test that given a particular theme setup, the right values get returned.
    ➕ 1
    a
    l
    d
    • 4
    • 27
  • m

    mattinger

    06/22/2021, 1:26 PM
    The other thing i’m struggling with is complex semantic properties. Something like SemanticProperties.Text. The expectValue function is going to do a direct comparison. I’m looking for something more along the lines of the “argThat” type function you’d use with mockito. Would i just create a SemanticsMatcher instance rather than use expectValue I assume?
    a
    • 2
    • 2
  • s

    Slackbot

    06/22/2021, 3:18 PM
    This message was deleted.
    😄 1
    f
    m
    • 3
    • 3
  • w

    Wojciech Rozwadowski

    06/22/2021, 5:09 PM
    I use some composables from
    androidx.compose.material
    . I want to re-style/override typography theme value used by this component:
    MaterialTheme.typography.caption
    . Is this a correct way to do it?
    MaterialTheme(
        typography = MaterialTheme.typography.copy(
            caption = MaterialTheme.typography.caption.copy(
                fontSize = 20.sp
            )
        )
    ) {
        // put material composable here
    }
    My first though was to use
    CompositionLocalProvider
    but
    LocalTypography
    has
    internal
    visibility modifier 🤔
    l
    m
    • 3
    • 7
  • a

    Akash Amin

    06/22/2021, 5:19 PM
    Hi, I have an issue with compose, I am using ComposeView in a ViewHolder to my existing RecyclerViewAdapter which resides inside a Swipeable ViewPager. The ComposeView has a LazyRow which shows a list of cards. The issue is: When I am trying to scroll the LazyRow the ViewPager scroll intercepts which makes it difficult to scroll the items in the LazyRow. I think this is something to do with the ComposeView not able to identify the ViewTree. I have detailed the implementation on this SO question https://stackoverflow.com/questions/68038792/scroll-issues-with-lazyrow-inside-traditional-android-viewpager
    ➕ 1
    a
    m
    • 3
    • 6
  • g

    gitai

    06/22/2021, 5:35 PM
    I added a Kotlin file having main() to an AS Compose project for quick testing. Is there an api to execute a root composable function from a non-composable main() , similar to how we can use
    runBlocking()
    to launch a root coroutine from a non-suspendable main?
    m
    m
    • 3
    • 9
  • c

    Colton Idle

    06/22/2021, 5:48 PM
    How would you handle a not showing a progress bar until like 300ms has gone by? I have a single state being emitted and it currently has isLoaded and my animated visibility uses that to fade between a loading spinner and the content. Would I add a third state of like isLoadedButThresholdNotMet?
    d
    d
    +2
    • 5
    • 5
  • a

    AN

    06/22/2021, 7:59 PM
    What's a good way to handle loading state in compose? In my case I have multiple observables in the View Model which are wrapped by a result sealed class that contains states like success, loading and error. it doesn't feel clean to determine if the progress should show based on all the observable states I have. if( r1 is Result.Loading || r2 is Result.Loading || r3 is Result.Loading) showProgress()
    r
    • 2
    • 2
  • p

    Pete Doyle

    06/22/2021, 9:33 PM
    Anyone ever see previews hang / never finish? Seeing this on a complicated home screen with ~15 `@Preview`s. Partly thinking I hit some edge case that’s not common. Screen is ~1500 lines of Composables + Previews in a single file. Not sure if I’ll be able to make a minimal reproducible example/app yet. (In Arctic Fox beta 03 + Compose beta 08 + Kotlin 1.5.10, but was the same in 4.2. Canary 16/Compose alpha 08, Kotlin 1.4.0)
    ➕ 1
    r
    • 2
    • 1
Powered by Linen
Title
p

Pete Doyle

06/22/2021, 9:33 PM
Anyone ever see previews hang / never finish? Seeing this on a complicated home screen with ~15 `@Preview`s. Partly thinking I hit some edge case that’s not common. Screen is ~1500 lines of Composables + Previews in a single file. Not sure if I’ll be able to make a minimal reproducible example/app yet. (In Arctic Fox beta 03 + Compose beta 08 + Kotlin 1.5.10, but was the same in 4.2. Canary 16/Compose alpha 08, Kotlin 1.4.0)
➕ 1
r

Rafs

06/26/2021, 10:04 AM
Previews are pretty fast in Bumblebee so you might wanna use that instead.
View count: 1