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-desktop
  • g

    Gordon

    07/20/2022, 12:10 PM
    Any alternative for IconButton for compose-desktop? The shadow and ripple are too big. And can't make it smaller ;(
    t
    • 2
    • 3
  • l

    lewik

    07/20/2022, 12:57 PM
    Is there a compose multiplatform channel? Where I can ask that type of questions? The question is how to handle mouse/finger moves for canvas? I'm rendering a map with canvas and want to handle drag, zoom etc actions. In the kotlin common code. I found detectTransformGestures but seems it's not working for desktop scroll I found other map libraries, but there is not enough features. And they have complex pointer handling. I feel there should be one builtin way for it (like detectTransformGestures).
    ➕ 4
    d
    s
    +2
    • 5
    • 4
  • k

    K J

    07/20/2022, 8:06 PM
    Hi! I've got an element that acts as a "sandbox" node graph editor where you can drag different nodes around. It can also be panned/scaled/zoomed/etc. Every node inside the sandbox is offset/translated in it's own graphics layer to the right position. However, when the user pans too far in the "sandbox" (past the width of the element), all of the content disappears because it thinks that the sandbox is no longer being rendered, even though some child nodes may have sandbox positions outside of the original box bounds. Any idea what I could do to fix this?
  • o

    orangy

    07/22/2022, 1:47 PM
    Quick Poll: Do you use IntelliJ (not Android Studio) for developing Desktop Compose applications?
    🇳🇴 6
    :yes: 39
    l
    s
    +3
    • 6
    • 8
  • a

    altavir

    07/22/2022, 4:13 PM
    Is there a way to ensure arrangement of drawing on the canvas but for drawing them in the correct order? I want to use a background which is always "behind".
  • s

    spierce7

    07/22/2022, 4:34 PM
    If I use intellij to create a compose gradle module, it instead creates an entire sub project within the project, with it’s own separate
    gradlew
    etc. I created it with the wrong name, and when I folder name for the module, I was getting an error, not because the module / project was referenced from
    settings.gradle.kts
    but rather because the file was referenced inside of
    .idea/workspace.xml
    Is this all something steering me towards a best practice that I’m unaware of?
  • r

    Remo

    07/22/2022, 6:09 PM
    Question regarding the DropdownMenu. Is it possible to implement an Autoscroll-Functionality, whenever the selected index is not visible? If so, how would I do this?
  • s

    spierce7

    07/22/2022, 7:23 PM
    What navigation library / strategy are people using? I normally use decompose, but for small apps, I find that its setup / ceremony is a little much. Does anyone have any recommendations for something a bit simpler?
    m
    b
    t
    • 4
    • 3
  • s

    Stuie

    07/23/2022, 11:10 PM
    Hey, I'm emitting some values via state flow, and one of the windows in my multi-window app collects that state in order to show information. Whenever a new value is emitted, the window containing the composable that collects the flow takes focus. I didn't configure this behavior, and I'm struggling to find how to prevent it. When I search Google I just get a lot of results about Jetpack Compose and text fields taking focus. To be clear, I need the window to be up to date, as it will still be visible beside the focused window, I just don't want focus to change when something is emitted/collected via state flow. How can I achieve this?
    z
    a
    • 3
    • 6
  • a

    Arkadii Ivanov

    07/24/2022, 11:58 AM
    The new
    LookaheadLayout
    and
    movableContentOf
    are available in
    1.2.0-alpha01-dev750
    . They both are accessible from
    commonMain
    targeting Desktop and Android. It compiles just fine for Desktop, but the compilation fails for Android with:
    Unresolved reference: LookaheadLayout
    Unresolved reference: movableContentOf
    Is it not possible to use that yet? Why is it resolved in the IDE?
    i
    • 2
    • 2
  • y

    Yousef

    07/24/2022, 5:01 PM
    Why is this happening? I set up the project using intellij and can't even start doing anything 😔
    a
    r
    • 3
    • 4
  • r

    Remo

    07/25/2022, 12:43 PM
    Hi there Quick question: How would you programatically go to the next radio button for example when Tab is pressed? It’s a row, which can hold n radio buttons. Can I access the children of a row within a
    onPreviewKeyEvent
    or so?
    m
    a
    • 3
    • 4
  • j

    Jerry Yion

    07/26/2022, 7:25 AM
    Hi there
  • j

    Jerry Yion

    07/26/2022, 7:28 AM
    Quick question: I want to build an app running on desktop (mac, win, linux). The issue I met is the package I ran build on mac cannot run on windows well (some class def not found)
    a
    s
    y
    • 4
    • 13
  • j

    Jerry Yion

    07/26/2022, 7:28 AM
    and also, the package built with windows cannot run well on mac
  • l

    Lucas

    07/26/2022, 1:01 PM
    Has anyone had issues with compose being extremely slow on some users? Its a relatively simple app
    m
    c
    a
    • 4
    • 7
  • s

    spierce7

    07/27/2022, 8:30 PM
    I know things have been delayed, but do we have any ETA for when we’re going to see any form of alpha release for iOS and Web?
    l
    d
    • 3
    • 2
  • x

    xxfast

    07/28/2022, 1:06 AM
    is 1.2 compose-jb release on the horizon?
  • r

    Racka N

    07/28/2022, 5:39 AM
    Has anyone here got Proguard or R8 working successfully? I got it to shrink my app and run it after using this: https://github.com/JetBrains/compose-jb/issues/1174#issuecomment-1075155835 But it doesn't seem to respect the proguard-rules. Like all my
    @Serializable
    annotations have been removed despite adding the required rules for
    kotlinx.Serialization
    and I get a runtime crash when I initiate a network call.
    SLF4J
    also gets removed.
    s
    m
    • 3
    • 10
  • s

    Sean Proctor

    07/28/2022, 11:15 AM
    @Arkadii Ivanov In Decompose, why can't configurations on the stack be duplicated?
    a
    • 2
    • 6
  • g

    Guilherme Delgado

    07/28/2022, 2:07 PM
    Is there any way to query for screen dimensions? Let’s say I want the
    windowState.size.width
    to be 1/3 of screen width, how can I achieve this? Didn’t found any samples/docs, but one approach is to use
    Dp.Unspecified
    for it’s width, and make the children use
    width.fillMaxWidth
    , create a
    LaunchedEffect
    and change the value like
    windowState.size.width = windowState.size.width/3
    . But this feels hacky 😅 and obviously it will be visually noticed. So, do I have another way to do it (hope so 🙏 )?
  • j

    Jose Luis Ku Uc

    07/28/2022, 4:39 PM
    Hi guys, I’m trying to make the executable (*.exe) contained in the MSI installer already have admin privileges. The latter works perfectly through gradle when the “CreateDistributable” task is executed, but I realize that this image is not the one used by the “PackageMsi” task. Instead the “PackageMsi” task generates an image in a path like : C:\foo\Temp\jdk.jpackage123456... How can I get that path through gradle? to see the whole process you must set verbose=true of the task “AbstractJPackageTask”
    b
    • 2
    • 1
  • o

    orangy

    07/28/2022, 6:19 PM
    💪 Brave people with
    IDEA 2022.*
    can try this home-built plugin that brings Android Studio features around Compose to IntelliJ in non-Android projects. CfD and CfW are supported. Colored composable functions, compose-specific inspections, support in some refactorings, some helpers in debugger, etc. You might need to configure colors for Composable functions in
    Preferences | Editor | Color Scheme | Compose
    . Install by drag’n’drop into IDEA, or use Plugins feature to install from disk. Feedback is welcome in :thread-please: thread.
    m
    b
    • 3
    • 8
  • k

    Kirill Grouchnikov

    07/28/2022, 10:00 PM
    @Igor Demin - should https://github.com/JetBrains/androidx/blob/jb-main/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposePanel.desktop.kt#L187 also set
    layer
    to
    null
    ? Once this method is done, the existing
    layer
    is marked as disposed, and it’s pretty much unusable from that point on. I do have a rather elaborate scenario where I’m running into
    SkiaLayer.needRedraw
    crashing - see the full stack trace in thread
    i
    • 2
    • 5
  • g

    gbaldeck

    07/29/2022, 1:43 AM
    I am noticing quite a bit of mouse input lag in compose desktop projects for windows. I notice it in my personal projects and even in the JetBrains toolbox. I am using Windows 10. Has anyone else experienced this?
  • g

    gbaldeck

    07/29/2022, 2:06 AM
    Actually looks like this is the issue https://github.com/JetBrains/compose-jb/issues/1648.
  • a

    Ahmad Daneshvar

    07/30/2022, 3:51 PM
    For those with the same problem, I’ve found a solution that works like a charm. Just add this modifier the component that you want it to consume the clicks:
    Modifier.mouseClickable{}
    Also, it’s need to transfer the focus to the one of modal items. You can do this by the
    focusRequester
    and then call
    focusRequester.requestFocus
    on it. By this way you can open new custom modal and transfer focus from main window to it. Thats it!
    a
    • 2
    • 2
  • c

    Christopher Porto

    07/31/2022, 7:00 AM
    I have an object wrapped in
    mutableStateOf
    and inside the object I have string property. Im trying to use that string property for
    TextField
    but when I type in it, it doesn't change the text value in UI. Whats the proper way of doing this? Thanks In parent class I have
    var config by mutableStateOf(SomeConfig(""))
    and then I call it like this
    TextField(config.token, onValueChange = {
                config.token = it
            })
    r
    l
    a
    • 4
    • 4
  • g

    Gordon

    07/31/2022, 7:18 AM
    How can i center AlertDialog in my application window? Currently I use custom dialog provider, to set the dialog to my desired look and fill.
    object CustomDialogProvider : AlertDialogProvider {
        @OptIn(ExperimentalComposeUiApi::class)
        @Composable
        override fun AlertDialog(
            onDismissRequest: () -> Unit,
            content: @Composable () -> Unit,
        ) {
            val painter = rememberVectorPainter(image = <http://Icons.Default.Engineering|Icons.Default.Engineering>)
            Dialog(
                title = "My Awesome Title",
                icon = painter,
                onCloseRequest = onDismissRequest,
                state = rememberDialogState(position = WindowPosition.Aligned(Alignment.Center), size = DpSize(400.dp, 200.dp)),
                undecorated = false,
                resizable = false,
                onKeyEvent = {
                    if (it.key == Key.Escape) {
                        onDismissRequest()
                        true
                    } else {
                        false
                    }
                },
            ) {
                WindowDraggableArea {
                    content()
                }
            }
        }
    }
    But the dialog shows centered in the Screen, and in multi-monitor, it's not even on the correct monitor. So, my app, runs on Monitor 1, and the dialog shows Centered on Monitor 0. And i want it Centered on Monitor 1, and not the entire screen, centered in application window.
  • a

    Arkadii Ivanov

    07/31/2022, 9:13 PM
    That's so sad. There is a new version of a library already on Kotlin 1.7.10. And I can't use the new version, since my project still on Kotlin 1.6.10 because of MPP Compose. I don't want to use an unstable version of MPP Compose, and Compose
    v1.1.1
    doesn't work with Kotlin 1.7.x even with the modern Compose compiler due to the issue:
    > Failed to notify project evaluation listener.
       > 'void org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions.setUseIR(boolean)'
    Kotlin version coupling is very inconvinient. It would be so good to backport Kotlin support to stable versions of Compose. Looks like my project (Decompose) is stuck for now. 😞
    o
    s
    m
    • 4
    • 5
Powered by Linen
Title
a

Arkadii Ivanov

07/31/2022, 9:13 PM
That's so sad. There is a new version of a library already on Kotlin 1.7.10. And I can't use the new version, since my project still on Kotlin 1.6.10 because of MPP Compose. I don't want to use an unstable version of MPP Compose, and Compose
v1.1.1
doesn't work with Kotlin 1.7.x even with the modern Compose compiler due to the issue:
> Failed to notify project evaluation listener.
   > 'void org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions.setUseIR(boolean)'
Kotlin version coupling is very inconvinient. It would be so good to backport Kotlin support to stable versions of Compose. Looks like my project (Decompose) is stuck for now. 😞
o

orangy

07/31/2022, 9:18 PM
You could make an alpha version of your library based on (pretty stable) CfD alpha that supports 1.7.*
a

Arkadii Ivanov

07/31/2022, 9:24 PM
True, how did I not think of that! :kotlin-intensifies:
s

shikasd

07/31/2022, 9:48 PM
Some may say that instability of Kotlin compiler/Gradle plugin apis is inconvenient as well :P
m

mcpiroman

08/01/2022, 7:30 AM
And IMO, at this stage and when considering runtime stability, the stable versions aren't more stable than the alphas are.
a

Arkadii Ivanov

08/01/2022, 7:43 AM
As a library developer, I assume there are binary compatibility guarantees on stable versions. That's why my libraries' stable versions don't depend on unstable libraries, and never use their experimental APIs.
View count: 9