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

    Lucas

    10/18/2022, 11:02 PM
    And back to the beta alpha versions 😎 1.3.0-alpha01-dev824
  • d

    Dragos Rachieru

    10/19/2022, 7:51 AM
    Does compose multiplatform support Bazel?
    b
    • 2
    • 5
  • s

    spierce7

    10/19/2022, 1:59 PM
    I have a multiplatform application compose library. How do I properly support desktop + js with the latest version of compose, given that they use 2 different versions of Kotlin?
    k
    • 2
    • 8
  • c

    Cedric Lindigkeit

    10/20/2022, 9:17 AM
    Do ClickableText composables support Modifier.testTag()? Below I have an example of what I want to do and beneath that the error message I am getting. Sample:
    ClickableText(
                text = "Awesome text",
                modifier = Modifier.testTag("SOME_TEST_TAG"),
                onClick = { ... }
            )
    ErrorMessage:
    Failed to assert the following: (OnClick is defined)
    Reason: Expected exactly '1' node but could not find any node that satisfies: (TestTag = 'SOME_TEST_TAG')
    However, the unmerged tree contains '1' node that matches. Are you missing `useUnmergedNode = true` in your finder?
    c
    z
    • 3
    • 6
  • s

    Sean Proctor

    10/20/2022, 11:08 PM
    I'm trying to get the desktop target of a compose MP build working with proguard. It runs fine when packaged w/o proguard, but with proguard it produces the following error:
    Error: Unable to initialize main class packageName.MainKt
    Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 58
    j
    • 2
    • 2
  • c

    czuckie

    10/21/2022, 2:51 PM
    I feel slightly daft asking this, but which IDE are you supposed to use for compose desktop?
    k
    a
    • 3
    • 3
  • s

    Sebastian Schuberth

    10/22/2022, 11:20 AM
    Is there something like a "logging panel" UI widget that provides an "appender" for a logging frameworks like Logback to display log statatements in the UI, similar to like IDEs do?
  • s

    Slackbot

    10/22/2022, 6:26 PM
    This message was deleted.
    j
    n
    • 3
    • 4
  • n

    Norbi

    10/23/2022, 8:44 AM
    Is the Jetbrains Space Desktop application created with Compose/Desktop?
    o
    • 2
    • 2
  • r

    Ryan Smith

    10/23/2022, 3:42 PM
    Has anyone here tried using the RxJava3 extensions for Compose in Compose Desktop? I have the right maven coordinates in my build.gradle.kts dependencies block, but IntelliJ can't resolve the
    subscribeAsState
    functions outlined in the docs here https://developer.android.com/reference/kotlin/androidx/compose/runtime/rxjava3/package-summary
    a
    j
    • 3
    • 21
  • r

    Ryan Smith

    10/23/2022, 7:22 PM
    Can anyone help me understand why constructing a
    MaterialTheme
    object like this
    MaterialTheme(colors = darkColors()) {
        Text("Hello, world!")
    }
    doesn't change anything? The surface color should be
    0xFF121212
    (dark grey) and the text white, but my app still opens with a white surface color and black text which is the default light theme color.
    b
    a
    • 3
    • 4
  • s

    spierce7

    10/24/2022, 4:20 PM
    Why was the decision made to support proguard workflows, instead of an r8 workflow? R8 has many more compose optimizations, right?
    e
    j
    +4
    • 7
    • 18
  • a

    andylamax

    10/25/2022, 1:24 PM
    can I develope a compose desktop app using the
    kotlin("jvm")
    gradle plugin instead of
    kotlin("multiplatform")
    gradle plugin??
    l
    a
    +3
    • 6
    • 10
  • l

    Luis Alonso Ato Neyra

    10/26/2022, 2:32 AM
    Hey, folks! Does anyone knows is there is as way to implement tabs in compose desktop?
    k
    • 2
    • 3
  • p

    PHondogo

    10/26/2022, 9:52 AM
    Hello! How to enable LazyColumn scrolling by gestures? Now I'm able to scroll only by mouse wheel.
    d
    l
    • 3
    • 4
  • a

    alexfacciorusso

    10/26/2022, 1:21 PM
    Hi all! I am writing a small toolbox-style app, and I am using kotlinx serialization to deserialize a YAML file via the Kaml library. All works perfectly when launching the app directly, but by generating a package (e.g. dmg or msi) and installing the app, it seems the de-serializer gets thrown out. That, and also the
    packageDmg
    also uses proguard, when it isn’t supposed to as per documentation, and also disabling obfuscation via the
    buildTypes.release.proguard.obfuscate = false
    still runs proguard. Very strange. Any ideas? This is the error I get:
    a
    • 2
    • 13
  • a

    alexfacciorusso

    10/26/2022, 3:49 PM
    Another question, which I don’t know how other people have tackled. The JetBrains Toolbox app has its main UI in what I suppose is a dialog, transparent and undecorated. But still, it has a shadow produced by the system, both in MacOS and Windows. I have a similar setup (I have tried both with a Window and with a Dialog, which I create manually via the
    Dialog
    factory function with the
    create
    block, in which I make a
    ComposeDialog
    with all the settings), but my dialog seems to not being picked up by the system’s shadow creation routine (or whatever it can be called!). I have checked the system’s window sizes and I know for sure JetBrains Toolbox is not creating a fake shadow (e.g. a shadow drawn by Compose) and the shadow is instead system-native, and it also follows very nicely the shape of the transparent dialog. Anyone who knows how to achieve a similar setup?
    c
    c
    • 3
    • 10
  • r

    Ryan Smith

    10/27/2022, 12:52 AM
    Could anyone try to help me understand something with
    Flow
    and
    Compose
    ? One of the predominant lessons I've been learning is "make your composables stateless by hoisting". I'm trying to adhere to this by exposing as much state as makes sense through properties on my view models. For example, my data layer has an in-memory Repository that exposes a collection of items through a
    Flow
    . My view model is meant to
    collect
    that flow as state, and expose that state to my
    Table
    composable to be displayed on the screen. But since
    collectAsState
    is marked as
    @Composable
    I can't call it from my view model. As I see it I could either pass the
    Flow
    directly through my view model to my
    Table
    composable or stick with
    mutableStateOf
    and collect the
    Flow
    internally to the view model and just expose the
    MutableState
    to my
    Table
    . More generally, though, it feels like the two ideas "state through the view model" and "collectAsState is Composable-only" are at odds here, which makes me think there's "the way" to do this sort of thing that I'm not seeing right now.
    c
    k
    • 3
    • 4
  • p

    PHondogo

    10/27/2022, 7:42 AM
    open class A {
      
      @Composable
      fun test(
        x: String,
        lambda: @Composable () -> Unit = {} // runtime exception below is caused by this parameter 
      ) {
         Text(x)
         lambda()	
      }
    
    }
    
    
    open class B  : A {
    
    }
    
    
    open class C : B { // C -> B - > A
    
      @Composable 
      fun anotherTest() {
        test("1") // while incremental compile (change for example "1" -> "2") throws runtime error: java.lang.ClassCastException: class androidx.compose.runtime.internal.ComposableLambdaImpl cannot be cast to class kotlin.jvm.functions.Function0 
      }
    
    }
    Compose Desktop version 1.3.0-alpha01-dev831 Edit: In my case A, B are located in one Gradle module, while C in another. But may be it will reproduce when all classes in the same module (I didn't check it).
    • 1
    • 1
  • d

    Daniyar Mukhanov

    10/27/2022, 11:04 AM
    has anyone used koin with annotations in multiplatform(desktop, android) project?
  • s

    Samuel Ochuba

    10/27/2022, 2:19 PM
    Hi Everyone !. Just new to the channel . i am exploring building a desktop app for my firm with compose for desktop . i want to know is it a good idea to do ?. Is compose for desktop stable ? . and please what are its limitations or issues. the app already works on android and i am trying to build a desktop counterpart for it . The app basically deals with databases , internet . and printing . i would like to know your experiences. Thank you very much for your anticipated answers !!
    l
    m
    m
    • 4
    • 10
  • a

    andylamax

    10/28/2022, 6:03 AM
    How do I share images with compose-android?
    m
    g
    • 3
    • 3
  • k

    Kirill Grouchnikov

    10/28/2022, 3:21 PM
    Every once in a while, I start getting
    e: java.lang.UnsupportedClassVersionError: androidx/compose/compiler/plugins/kotlin/ComposeComponentRegistrar has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 53.0
    in both IntelliJ and terminal build with compose desktop. My Java stays on
    11.0.16+11-LTS-199
    in both places. Once that starts, pretty much the only way out is to reboot my machine. Is there anything I can run to help diagnose this once it starts happening? Otherwise I’m not sure how useful it would be to file it as a bug.
    i
    • 2
    • 4
  • s

    Sean Proctor

    10/28/2022, 8:03 PM
    I'm working on a dropdown selector. Has anyone come up with an acceptable solution? My current implementation in thread.
    o
    • 2
    • 15
  • a

    Arjan van Wieringen

    10/29/2022, 7:43 AM
    Is
    .shadow
    somehow stretching with the size of the component?
    Column {
                Box(modifier = Modifier.padding(16.dp).size(width = 800.dp, height = 200.dp).shadow(4.dp).background(Color.White))
                Box(modifier = Modifier.padding(16.dp).size(width = 1600.dp, height = 200.dp).shadow(4.dp).background(Color.White))
            }
    I thought it was related to the ambient and spot color parameters, but it isn't. Changing them has no impact?
    Screen Recording 2022-10-29 at 09.41.19.mov
    c
    t
    • 3
    • 4
  • a

    Alex Styl

    10/30/2022, 8:33 AM
    MacOs changes the tray icon colors depending on the wallpaper set. I am currently using an svg as my tray icon. is there a way to detect the color and apply the one needed accordingly? I gave isSystemInDarkTheme() a go but those colors are unrelated to the system theme
    a
    • 2
    • 5
  • j

    Jesus Medina

    10/30/2022, 10:42 PM
    hello, excuse me, can ktor client be implemented for desktop applications with compose?
    s
    l
    • 3
    • 6
  • d

    Dragos Rachieru

    10/31/2022, 8:52 AM
    Can I reuse compose-jb code for wearOS? I have some composables written in multiplatform that I want to use on wearOS as well.
    g
    t
    • 3
    • 10
  • j

    Jules Marche

    10/31/2022, 1:56 PM
    Hello, Excuse me, i have a problem. Since 2 days, i try to create a database with Room. I'am currenty working on Compose Desktop Application .. I have seen lot of documentations but i have any idea 🙂 Has anyone worked with Room or has a GitHub link of a project using Room ? (I'm not closed to using Sqldelight either) Cheers ! (sorry for my english)
    a
    d
    • 3
    • 4
  • a

    Alex Styl

    11/01/2022, 8:56 AM
    has anyone figured out a way to have their jetpack compose desktop app start at computer login?
    c
    m
    • 3
    • 12
Powered by Linen
Title
a

Alex Styl

11/01/2022, 8:56 AM
has anyone figured out a way to have their jetpack compose desktop app start at computer login?
c

czuckie

11/01/2022, 9:02 AM
there's a packaging tool that's been advertised about in this channel and maybe #multiplatform which can be used to create installers and perform tasks like this (configuring a system, agnostic of OS to start an app at startup) but I forget what it's called :S. If you just want to achieve for a development app you don't plan to release however, the easiest way would be to create a
package
of your application (on Linux for example by running
./gradlew packageDeb
), installing the resultant binary and then using the tools made available by the OS. Think you can use msconfig on windows, launchctl on Mac OS and maybe even just a .xinitrc on Linux (though most desktop managers have their own section in config for this kind of stuff)
a

Alex Styl

11/01/2022, 9:08 AM
it is for an app that i will distribute. also it is for mac os
what i am trying to achieve is have an option within the app to let people choose if they want to launch the app on login or not. it’s a standard thing in mac os apps
c

czuckie

11/01/2022, 9:19 AM
I'd say this isn't strictly a kotlin question, but a quick google uncovers this: https://stackoverflow.com/questions/3358410/programmatically-run-at-startup-on-mac-os-x
a

Alex Styl

11/01/2022, 9:39 AM
found that link. thanks 👍. I was hoping there was some sort of automatic way of doing it via java. ie in electron you have a nice api that you pass true/false if you want the app to be launched at startup.
c

czuckie

11/01/2022, 10:37 AM
it's definitely a convenient thing to have, but I wonder if a UI framework should be concerned about something that OS specific. There must be an off the shelf java library that does this, if not, it's begging to be made isn't it.
a

Alex Styl

11/01/2022, 10:54 AM
absolutely 💯
m

mikehearn

11/01/2022, 1:38 PM
The tool is called Conveyor
https://conveyor.hydraulic.dev/
It has an option to start at boot, however, it's for Windows. macOS isn't currently supported. It could be added fairly easily though.
These days you can manage which app start at login through the settings apps, so it's not so important to have it be toggleable through the app itself. On Ventura you can apparently deep-link to the relevant part of the settings pane.
c

czuckie

11/01/2022, 4:33 PM
Conveyor! That's the one! Cheers Mike
View count: 7