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

    Zimri Leisher

    11/09/2020, 4:44 AM
    where are these old and new compilers even located?
    a
    • 2
    • 4
  • z

    Zimri Leisher

    11/09/2020, 5:25 AM
    now im getting "java.lang.UnsupportedClassVersionError: org/jetbrains/skiko/Library 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 54.0"
    a
    • 2
    • 5
  • s

    Shawn Witte

    11/09/2020, 8:00 AM
    Is there an out-of-the-box way to transform a
    Flow
    into a compose
    State
    ?
    a
    • 2
    • 2
  • m

    mayojava

    11/09/2020, 10:20 AM
    Do I have to do anything special to be able to import
    androidx.compose.desktop.DesktopMaterialTheme
    ?
    i
    • 2
    • 5
  • a

    Animesh Sahu

    11/09/2020, 11:29 AM
    I'm surprised whole jre is packed with the compose in just 40mb, when jre itself if of 72mb. How's this optimization done, jpackage?
    s
    • 2
    • 1
  • a

    Animesh Sahu

    11/09/2020, 11:31 AM
    And how much the size we can expect with the Kotlin/Native binaries of compose-desktop in the near future 😁?
    🤔 3
    s
    • 2
    • 6
  • l

    lhwdev

    11/09/2020, 12:23 PM
    (below is background of my computer; just that gray rectangle is the window)
    r
    s
    • 3
    • 4
  • s

    Spikey Sanju

    11/09/2020, 1:11 PM
    How to declare Theme in Compose Desktop. Like the way we do in jetpack compose?
    i
    • 2
    • 1
  • a

    Animesh Sahu

    11/09/2020, 1:17 PM
    How to change background of the whole window? I tried to create a theme component, but that doesn't seem to have any effect (new to compose :p)
    Window(
        title = "Compose for Desktop",
    ) {
        DesktopMaterialTheme(colors = lightColors(background = Color.Cyan)) {
            Text("Test")
        }
    }
    i
    • 2
    • 3
  • s

    Spikey Sanju

    11/09/2020, 1:27 PM
    How to get context in Compose Desktop?
    i
    • 2
    • 4
  • p

    patrick

    11/09/2020, 2:47 PM
    Where can we find the latest version of the compose desktop / where can we see when a new version is available? (I’m asking because this https://github.com/JetBrains/compose-jb/issues/66 is blocking me to try out compose for desktop, but it seems to be fixed already on main 😄 )
    o
    j
    • 3
    • 15
  • j

    John

    11/09/2020, 3:26 PM
    Is there a doc describing how the native interaction with OS APIs work? A lot of io can be handled on the jvm but what about things like notifications, checking for dark mode, etc
    ➕ 1
    b
    • 2
    • 1
  • l

    laith

    11/09/2020, 6:42 PM
    Hello all, have anyone used flutter desktop ? how to compare with compose desktop ?
    i
    s
    j
    • 4
    • 6
  • j

    Javier

    11/09/2020, 10:54 PM
    🤔 https://android-review.googlesource.com/c/platform/frameworks/support/+/1493496
    👀 4
    k
    • 2
    • 1
  • c

    ckloss

    11/10/2020, 12:23 AM
    Maybe I'm missing something, but why is Dialog a Composable and not implemented in a similar way as Window? Don't you think that in a desktop application it would make more sense for it to behave like Window? This way, it would be easier to use at an event like onClick for example.
    z
    o
    • 3
    • 4
  • e

    Eric Ampire [MOD]

    11/10/2020, 10:52 AM
    Hello, the AlertDialog not supposed to work in Jetpack compose desktop ?
    Box {
    
        var isDialogVisible = remember { mutableStateOf(false) }
    
        if (isDialogVisible) {
            AlertDialog(
                onDismissRequest = {
                    isDialogVisible.value = false
                },
                title = { Text(text = "Dialog Title") },
                text = { Text(text = "Salut les amis vous allez bien ?") },
                confirmButton = {
                    TextButton(
                        onClick = { isDialogVisible.value = false },
                        content = {
                            Text(text = "Oui")
                        }
                    )
                },
                dismissButton = {
                    TextButton(
                        onClick = { isDialogVisible.value = false },
                        content = {
                            Text(text = "Non")
                        }
                    )
                }
            )
        }
    }
    Every time I try to display a AlertDialog I get this exception
    Exception in thread "AWT-EventQueue-0" kotlin.NotImplementedError: An operation is not implemented: not implemented
    	at androidx.compose.ui.window.DesktopDialogKt.ActualDialog(DesktopDialog.kt:28)
    	at androidx.compose.ui.window.DialogKt.Dialog(Dialog.kt:42)
    	at androidx.compose.material.AlertDialogKt.AlertDialog-ubiPcs4(AlertDialog.kt:143)
    	at androidx.compose.material.AlertDialogKt.AlertDialog-E7Yi3bI(AlertDialog.kt:80)
    	at MainKt$main$1.invoke(main.kt:70)
    i
    • 2
    • 2
  • x

    Xiaohui

    11/10/2020, 12:30 PM
    hello, how to find compose's all components introduced? have some web? or docs?:kotlin-intensifies:
    i
    • 2
    • 2
  • s

    spierce7

    11/10/2020, 1:20 PM
    In all of the desktop examples, the targets seem to be split into a separate gradle module (i.e. Desktop), that just runs the application, while the core application is in a common module. Why not just run the application from the core module for these small applications? There isn’t much gained by just having
    main
    in a separate module is there?
    o
    i
    g
    • 4
    • 5
  • s

    Se7eN

    11/10/2020, 1:53 PM
    Letter spacing doesn't work for me
    Text("MARCH", style = MaterialTheme.typography.subtitle2)
    
    // MaterialTheme.typography.subtitle2:
    subtitle2 = TextStyle(
        letterSpacing = 2.sp,
        fontSize = 14.sp,
        fontFamily = JosefinSans
    )
    Looks like this:
    a
    • 2
    • 3
  • g

    Grigorii Yurkov

    11/10/2020, 3:13 PM
    Can I make Window
    wrap_content
    ?
    👀 2
    i
    • 2
    • 3
  • b

    Big Chungus

    11/10/2020, 5:47 PM
    How do you guys manage global state? I can't find @Model annotation on desktop-compose
    j
    • 2
    • 2
  • b

    Big Chungus

    11/10/2020, 6:54 PM
    Did anyone try doing simple Dropdown Menu on desktop-compose? Can;t get anything to work and internet searches were not very helpful.
    f
    j
    • 3
    • 5
  • b

    Big Chungus

    11/10/2020, 8:13 PM
    Getting an interesting error when expanding DropDownMenu. Does that mean it's not available for jb-compose?
    Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: 'void androidx.compose.ui.window.PopupKt.Popup(androidx.compose.ui.window.PopupPositionProvider, boolean, kotlin.jvm.functions.Function0, androidx.compose.ui.window.PopupProperties, kotlin.jvm.functions.Function2, androidx.compose.runtime.Composer, int, int)'
            at androidx.compose.material.MenuKt.DropdownMenu-Cfdtu1M(Menu.kt:114)
    i
    • 2
    • 3
  • s

    suresh

    11/10/2020, 8:29 PM
    Whats the preferred way to use native File chooser dialog on Compose desktop applications.
    java.awt.FileDialog
    seems to be working fine. Is that the recommended way?
    👀 5
    i
    m
    • 3
    • 6
  • u

    6qat

    11/10/2020, 8:37 PM
    Do compose binaries need jvm in order to run?
    :yes: 3
    ❓ 1
    j
    e
    +3
    • 6
    • 6
  • l

    laith

    11/10/2020, 11:19 PM
    Do we know what is the timeline for compose-desktop tp be production ready ?
    🇳🇴 6
    o
    c
    • 3
    • 2
  • s

    spierce7

    11/11/2020, 12:56 AM
    I assume we currently have no flexibility in the jpackage with compose? i.e. I can’t create a single jar to embed in the production app that’s been proguarded?
    j
    • 2
    • 1
  • s

    spierce7

    11/11/2020, 7:26 PM
    What is the
    multiplatform-setup
    and the
    multiplatform-compose-setup
    plugins? First time I’m seeing the
    multiplatform-setup
    plugin.
    j
    a
    • 3
    • 38
  • s

    suresh

    11/11/2020, 8:06 PM
    Whats the recommended way to do Navigation on compose desktop? It seems the official one mentioned in compose doc (https://developer.android.com/jetpack/compose/navigation) is not implemented.
    s
    a
    • 3
    • 5
  • a

    Arkadii Ivanov

    11/11/2020, 8:25 PM
    I'm working on Compose Desktop extensions module for the Decompose library. I managed to publish a module which depends on Jetbrains Compose. I'm also able to create a multiplatform project which depends on both Decompose extensions and Jetbrains Compose. So Jetbrains Compose is dependent directly and transitively at the same time. Project compiles just fine. During my work I found one potential issue that possibly can hit us at some point later. If Decompose depends on version
    0.1.0-m1-build62
    and App depends on version
    0.1.0-build113
    then looks like Gradle picks the older version
    0.1.0-m1-build62
    . And the app crashes at runtime. I think version names should comply to Gradle conflict resolution algorithm. Perhaps version names should be padded with zeros (like in Jetpack Compose,
    xxx-alpha08
    ), and there should be no middle substrings like
    m1
    .
    👍 6
    i
    r
    • 3
    • 38
Powered by Linen
Title
a

Arkadii Ivanov

11/11/2020, 8:25 PM
I'm working on Compose Desktop extensions module for the Decompose library. I managed to publish a module which depends on Jetbrains Compose. I'm also able to create a multiplatform project which depends on both Decompose extensions and Jetbrains Compose. So Jetbrains Compose is dependent directly and transitively at the same time. Project compiles just fine. During my work I found one potential issue that possibly can hit us at some point later. If Decompose depends on version
0.1.0-m1-build62
and App depends on version
0.1.0-build113
then looks like Gradle picks the older version
0.1.0-m1-build62
. And the app crashes at runtime. I think version names should comply to Gradle conflict resolution algorithm. Perhaps version names should be padded with zeros (like in Jetpack Compose,
xxx-alpha08
), and there should be no middle substrings like
m1
.
👍 6
i

Igor Demin

11/16/2020, 1:33 PM
Thanks for the information! Now we name versions without middle substrings: 0.2.0-build123 Padding with zeros for "build123" shouldn't be necessary according to this: https://docs.gradle.org/current/userguide/single_versions.html#version_ordering
a

Arkadii Ivanov

11/16/2020, 1:35 PM
Awesome, thanks!
r

rsktash

12/30/2020, 4:19 PM
@Arkadii Ivanov hi . where is gone todo sample app?
a

Arkadii Ivanov

12/30/2020, 4:24 PM
@rsktash It's there https://github.com/JetBrains/compose-jb/tree/master/examples/todoapp
r

rsktash

12/30/2020, 4:27 PM
Thank you. I had a runtime issue with lambda functions. When I tried to update to the latest version app has gone )))
a

Arkadii Ivanov

12/30/2020, 4:29 PM
What app has gone? Where?
r

rsktash

12/30/2020, 4:31 PM
The todo sample app has gone. I found it now. I’ll try to run
a

Arkadii Ivanov

12/30/2020, 4:32 PM
Looks like you are running the one from the Decompose repository. I removed this sample in favour of the one from JetBrains Compose repository.
Btw I fixed similar crash recently. It was crashing when compiled under macOS, but was fine on Linux. https://github.com/arkivanov/Decompose/pull/28
It's an Android module, not Desktop
r

rsktash

12/30/2020, 4:39 PM
Yes I use macOs. The issue seems to occur in extension functions with lambda params
a

Arkadii Ivanov

12/30/2020, 4:40 PM
Yes, in my case when there is a default value for lambda parameter.
r

rsktash

12/30/2020, 10:36 PM
Thank you @Arkadii Ivanov todo sample app in jetbrains project is working
There was a warning. I fixed it
👍 1
@Arkadii Ivanov Hi how can we use Labels as data exchange. For example item selecting from ScreenB to ScreenA? I couldn’t found sample code
a

Arkadii Ivanov

01/02/2021, 8:48 AM
@rsktash I suppose you are referring to MVIKotlin library. You need to bind store's labels to component's output. There was such an example in the removed todo app: https://github.com/arkivanov/Decompose/blob/fbec0ac19f813bb6e619ceb6d482c098e8e1dfc9/sample/todo/add/src/commonMain/kotlin/com/arkivanov/todo/add/integration/TodoAddImpl.kt#L36 Also there is a dedicated channel for MVIKotlin library: #mvikotlin
Here is the bind function: https://github.com/arkivanov/Decompose/blob/fbec0ac19f813bb6e619ceb6d482c098e8e1dfc9/sample/todo/utils/src/commonMain/kotlin/com/arkivanov/todo/utils/BinderExt.kt#L10
r

rsktash

01/02/2021, 6:05 PM
Thank you @Arkadii Ivanov Now I’m having this issue when I try to use shared common jvm classes with gradle dependsOn method. Is it a gradle issue? https://kotlinlang.slack.com/archives/C19FD9681/p1609610398055200
a

Arkadii Ivanov

01/02/2021, 7:48 PM
I think it is. Looks like unrelated to Compose. I see that you specified only jvm target. So androidMain and desktopMain should not work this way. But maybe I'm missing something.
r

rsktash

01/02/2021, 8:32 PM
@Arkadii Ivanov I used your mp compose setup plugin
a

Arkadii Ivanov

01/03/2021, 9:00 AM
Do you have a reproducer project?
r

rsktash

01/03/2021, 12:25 PM
@Arkadii Ivanov I used custom function as a workaround
a

Arkadii Ivanov

01/03/2021, 12:27 PM
Weird
r

rsktash

01/03/2021, 1:28 PM
I think the issue is resolved after removing jvm() from kotlin {} block and changing getting to creating
a

Arkadii Ivanov

01/03/2021, 1:31 PM
This also caught my eye, not sure why I did not pointed on that 😄 glad it works now. Just one point, I normally name JVM common source set as jvmCommonMain and jvmCommonTest. So it's clear what is what.
💪 1
r

rsktash

01/03/2021, 11:08 PM
@Arkadii Ivanov Hi. What is the best practice for user login page navigation step by step(sending phone number, receiving sms, verifying and filling user detail info). Now I’m switching screens using state. But I think ideally I have to use conditional routing. Because with routing later we can do some transition animations between current and previous screens. Do you have any sample code for conditional routing with decompose. Thank you
a

Arkadii Ivanov

01/04/2021, 8:21 AM
@rsktash I don't have any such example. From what I understand, you need one component per screen and one parent component for routing. The parent component should specify configuration classes for all child screens. And each screen should emit Output.Finished when it's done. Parent component should listen for outputs anf push next screen when needed.
r

rsktash

01/17/2021, 4:04 PM
Hi @Arkadii Ivanov I see you have published new release. I am now implementing it in a new project. I have seen sample apps where used sql delight database and observables. In my project I am using ktor witch uses suspend functions/ coroutines. Is there a sample code calling suspend functions and dispatching results . Thank you very much.
OK. I found coroutine extension of mvikotlin, Thank you
a

Arkadii Ivanov

01/17/2021, 4:32 PM
Hey! I have published a new release of Decompose, not MVIKotlin. Looks like MVIKotlin just works, no updates required 😐. There are both Reaktive and Coroutines samples available in the repository.
It's better to ask such questions in the #mvikotlin channel 😀
r

rsktash

01/19/2021, 11:42 AM
Hi @Arkadii Ivanov every time when I ask a question you never ignore it. Now I’m trying to implement dynamic features in a multi module multi platform app with Compose+decompose. I’ve posted a message in main thread but nobody answered. I saw sample projects in github. For accessing dynamic feature module classes they have used reflect and serviceloader. But in compose we have only functions. Have you ever used dynamic features with compose? Can you share your experience Thank you
a

Arkadii Ivanov

01/19/2021, 11:43 AM
Hey. Could you point me on the original message? It's better to answer in that thread.
r

rsktash

01/22/2021, 4:34 AM
Hi @Arkadii Ivanov Is it a right decision to inject feature module dependencies into component store?
I have a default module and some extra feature modules. These extra features make some changes to the ui. I don’t want to duplicate shared logic and ui
a

Arkadii Ivanov

01/22/2021, 3:55 PM
@rsktash this thread is getting very long. Could you please forward this question to GitHub Discussions?
r

rsktash

01/24/2021, 5:47 AM
@Arkadii Ivanov Thank you I forwarded as you said
👍 1
View count: 8