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

    Carl Benson

    06/03/2021, 10:27 PM
    I'd like to create a progress button, where the text is replaced with a circular progress when it is in a loading state, but I don't seem to be able make it work. I would like the button to keep its size when the loading progress is showing, does it mean I would have to do my own measurements? code and current state in 🧵
    s
    • 2
    • 6
  • t

    Tlaster

    06/04/2021, 5:33 AM
    It seems that setting activity's
    android:configChanges="uiMode"
    on beta08, theme will not work properly when changing the device's dark theme, which is working on beta07.
    a
    • 2
    • 2
  • i

    iamthevoid

    06/04/2021, 6:04 AM
    I get message
    Unable to resolve activity for: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=ru.rt.designsystem.android.compose.test/androidx.activity.ComponentActivity }
    since updated to beta07 when calling
    @get:Rule
        val composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity> =
            createAndroidComposeRule()
    when updating to beta08 nothing changes. Anybody knows how can it be resolved?
    n
    g
    • 3
    • 3
  • t

    Tlaster

    06/04/2021, 6:04 AM
    Shouldn't this be a breaking change? This break the behavior for drag event handling which we only consume the change if needed before but after beta08 will always consume the change even if we don't need to.
    m
    • 2
    • 6
  • a

    Abhishek Dewan

    06/04/2021, 6:51 AM
    Hi I am seeing something weird with the bottomSheetScaffold where the following scenario is leading to the bottom sheet not showing up. Starting with a collapsed state -> call expand on the bottomSheetState -> Do some work -> call collapse on the bottomSheetState -> call expand on the bottom sheet state again and the sheet doesn't expand. Upon debugging I do see that the bottomSheetState.isCollapsed is set to true before I call expand a second time. Also putting a debug pointer in the animateTo function the
    latestNonEmptyAnchorsFlow
    never collects. Am I doing something wrong here ?
    Fixed 😄
    • 1
    • 3
  • c

    Carl Benson

    06/04/2021, 8:36 AM
    anyone else experiencing that code completion window disappears constantly because the compose views are being updated?
    n
    • 2
    • 2
  • m

    myanmarking

    06/04/2021, 9:12 AM
    Space doesn’t allow background
    p
    • 2
    • 1
  • i

    iamthevoid

    06/04/2021, 9:58 AM
    What is the minimal set to use
    Preview
    in compose? A have
    build.gradle.kts
    like i’ll post in thread shortly, but i receive error when try to build preview
    c
    • 2
    • 7
  • r

    Rooparsh

    06/04/2021, 10:35 AM
    Anyone having any sample or any knowledge about how to architect multi screen app (say 30-35) in pure jetpack Compose with MVVM? Do you guys use single activity and single viewmodel and handle it there only? Or you prefer creating multiple activities or fragments?. The question is related to how to properly architect the MVVM based Compose app.
    o
    a
    +2
    • 5
    • 20
  • d

    Danish Ansari

    06/04/2021, 10:37 AM
    Hello fellow developers, Is there anyway to set animation completion time for AnimatedVisibilty? I checked docs https://developer.android.com/jetpack/compose/animation#animatedvisibility but nothing is mentioned regarding the time. By default animation is too fast for my requirement.
    f
    • 2
    • 5
  • p

    Pardip

    06/04/2021, 10:55 AM
    I upgraded kotlin 1.5.10, upgrade compose compiler to 1.0.0-beta08 and upgrade navigation-compose to 2.3.5. Got issue at navigation library, Could not find androidx.navigation:navigation-compose:2.3.5. Although, navigation compose work in alpha version (2.4.0-alpha02). Anyone have face similar issue in 2.3.5 version.
    s
    • 2
    • 3
  • s

    Slackbot

    06/04/2021, 11:27 AM
    This message was deleted.
    m
    • 2
    • 1
  • m

    myanmarking

    06/04/2021, 11:54 AM
    Default AS compose project gives this error:
    Process: com.recoverrelax.samplecompose, PID: 25973
    java.lang.NoSuchMethodError: No static method drawRect-w2WG-Gw$default(Landroidx/compose/ui/graphics/drawscope/DrawScope;JJJFLandroidx/compose/ui/graphics/drawscope/DrawStyle;Landroidx/compose/ui/graphics/ColorFilter;Landroidx/compose/ui/graphics/BlendMode;ILjava/lang/Object;)V in class Landroidx/compose/ui/graphics/drawscope/DrawScope$DefaultImpls; or its super classes (declaration of 'androidx.compose.ui.graphics.drawscope.DrawScope$DefaultImpls' appears in /data/app/~~N4u3ZpQc0VQmQWkVneo2fA==/com.recoverrelax.samplecompose-7T8CqVR-pfvTlb_4zi7DpQ==/base.apk)
    at androidx.compose.foundation.Background.drawRect(Background.kt:111)
    at androidx.compose.foundation.Background.draw(Background.kt:103)
    at androidx.compose.ui.node.ModifiedDrawNode.performDraw(ModifiedDrawNode.kt:102)
    at androidx.compose.ui.node.LayoutNodeWrapper$invoke$1.invoke(LayoutNodeWrapper.kt:260)
    at androidx.compose.ui.node.LayoutNodeWrapper$invoke$1.invoke(LayoutNodeWrapper.kt:259)
    at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:121)
    at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:75)
    at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.kt:259)
    at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.kt:53)
    at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:156)
    at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:229)
    at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:210)
    n
    • 2
    • 1
  • a

    André Thiele

    06/04/2021, 1:12 PM
    How can I force to recompose LazyColumn when the list does not update even if the list is changed?
    f
    a
    • 3
    • 12
  • n

    nglauber

    06/04/2021, 1:29 PM
    Generic question: How can I pass a lambda for a screen using Navigation? 🤔 Specific explanation: I’m creating a Generic Error screen which should have an option to “Retry”. So my plan was
    if (error) navController.navigate(ERROR_SCREEN)
    , but I’m stuck in how to pass this action to the ErrorScreen… Any thoughts?
    z
    • 2
    • 4
  • m

    myanmarking

    06/04/2021, 3:12 PM
    is there any standard way of preserving the same viewModel instance across composables navigation, for instance, BottomNavigation?
    z
    z
    +2
    • 5
    • 23
  • z

    zhuinden

    06/04/2021, 3:18 PM
    [SOLVED] I updated Compose in my sample (example-dogs) to 1.0.0-beta08, now if I tap 4 dogs at the same time (thus "opening 4 pages quickly"), the app crashes with the following exception (see in thread) this crash is new and was not present in 1.0.0-beta07
    z
    f
    n
    • 4
    • 13
  • z

    zhuinden

    06/04/2021, 3:22 PM
    exception in thread:
    :thread-please: 4
    🙏🏻 1
    z
    • 2
    • 5
  • m

    myanmarking

    06/04/2021, 5:07 PM
    how to make the icon to match parent size
    d
    a
    • 3
    • 8
  • s

    Shakil Karim

    06/04/2021, 5:10 PM
    Is there any API introduced in Beta 08 for Screen Transitions Animations ?
    j
    d
    +2
    • 5
    • 9
  • n

    nglauber

    06/04/2021, 5:50 PM
    I’m trying to add an error message below the
    TextField
    . I’m setting
    isError
    to true ~and adding
    semantic { error("Message") }
    modifier~… do I need to do something else?
    c
    • 2
    • 5
  • m

    myanmarking

    06/04/2021, 5:58 PM
    does DrawScope.drawRoundRect support only partial round corners (ie, only at start-top and start-bottom) ?
    • 1
    • 1
  • s

    Steven Elliott

    06/04/2021, 8:18 PM
    When using a text field is there a way to prevent the composable from triggering the onValueChange callback? For example let's say I only want the text field to allow numerical input.
    s
    z
    • 3
    • 5
  • t

    tylerwilson

    06/04/2021, 8:31 PM
    I have a Compose view that scrolls with maybe 56 ‘subviews’ and performance is not good. I know the Compose team is still working on optimization, but is there anything I can do to measure performance or provide info to the team to assist? I tried using the latest layout inspector, but it just crashes the app. Thanks.
    ➕ 1
    c
    r
    m
    • 4
    • 10
  • s

    Slackbot

    06/04/2021, 9:13 PM
    This message was deleted.
    z
    • 2
    • 1
  • f

    FunkyMuse

    06/04/2021, 10:40 PM
    Hey guys, what's the correct way to listen for scroll position on Lazy column?
    s
    a
    • 3
    • 2
  • o

    orangy

    06/04/2021, 11:25 PM
    I’ve got Sony TV which runs Google TV (which is still Android TV afaik), so is it possible to run Compose on it? :) or may be #compose-desktop fits better? Did anyone try it already?
    a
    c
    a
    • 4
    • 29
  • m

    Mitchell Skaggs

    06/05/2021, 7:13 AM
    I'm interested in writing Arrow Optics integration with Compose's state management, but I'm not how or even if it's possible to create new mutable state types. Creating naïve implementations of
    State<T>
    and
    MutableState<T>
    that read and write eagerly seems to work for now (haven't tested snapshotting extensively yet), but I'm concerned that I might need to be observing some types like
    dependentStateOf
    does. Is there a way to integrate my new state types nicely with the existing state types?
    a
    • 2
    • 17
  • k

    Kunal Raghav

    06/05/2021, 10:01 AM
    Hi after updating to beta08, whenever I scroll a lazy list my app crashes, with the following crash exception:
    👀 1
    f
    z
    +3
    • 6
    • 17
  • a

    André Thiele

    06/05/2021, 12:01 PM
    How can I remove this padding from the Outlined Text Field that is reserved to the label if I dont want to show a label? Or should I wrap it and clip its contents?
    c
    n
    • 3
    • 13
Powered by Linen
Title
a

André Thiele

06/05/2021, 12:01 PM
How can I remove this padding from the Outlined Text Field that is reserved to the label if I dont want to show a label? Or should I wrap it and clip its contents?
c

Colton Idle

06/05/2021, 2:14 PM
Star https://issuetracker.google.com/issues/189971673
n

nglauber

06/05/2021, 5:54 PM
@Colton Idle here we are again 😄 I’ll add a reference to the last time people ask this question, so we can do a stack trace 😅 https://kotlinlang.slack.com/archives/CJLTWPH7S/p1622729349245100
@André Thiele please also check this helps you… https://stackoverflow.com/questions/67320990/android-jetpack-compose-cant-set-backgroundcolor-for-outlinedtextfield/67323383#67323383
a

André Thiele

06/05/2021, 5:57 PM
@nglauber yea thanks, the background is only for you to see that theres a padding applied!
👍 1
n

nglauber

06/05/2021, 6:00 PM
Yeah… The padding will still be there 😕 I had a long discussion regarding this padding “issue” in TextField… If you want that for now, you must have to copy the
OutlinedTextField
implementation and remove the padding… 🤷‍♂️ It’s not so complicated actually, but Compose does not currently provide this right now.
a

André Thiele

06/05/2021, 6:01 PM
okay, will just live with it for now and. Actually I just apply top padding to other components so they are centered vertically
:think-smart: 1
c

Colton Idle

06/05/2021, 8:17 PM
If anyone creates a gist for something that allows customizing padding, please share. 😄
n

nglauber

06/05/2021, 9:37 PM
@Colton Idle I did one to remove that horizontal padding from TextField… Basically I copied the
TextField.kt
and
TextFieldImpl.kt
and did my changes… 🤷‍♂️
👍 1
But I have to say that it was very easy to do… Google, please add a single param:
horizontalMargin
and boom: everything works and we stop to see “how can I removed the padding from TextField?” 😄
a

André Thiele

06/08/2021, 8:38 AM
After some thinking I really think this is a bug, if your lambda is empty or not provided, it should be rendered without a padding this could easily be done by overloading
c

Colton Idle

02/04/2022, 11:06 AM
@nglauber https://issuetracker.google.com/issues/189971673 👀
n

nglauber

02/09/2022, 12:44 AM
You’re welcome 😄
This one was also fixed… 🙂 https://issuetracker.google.com/issues/187746439
View count: 117