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

    py

    01/07/2021, 6:10 PM
    Filed https://github.com/JetBrains/compose-jb/issues/255
    r
    k
    j
    • 4
    • 4
  • p

    py

    01/08/2021, 12:10 AM
    Sorry for the dump of messages 🙂 All this hacking of the past few days led to a new demo: https://twitter.com/Piwai/status/1347334496442478592
    🎉 14
    j
    c
    • 3
    • 3
  • n

    nfrankel

    01/08/2021, 5:09 AM
    still trying to wrap my head around compose for desktop i still have two concerns mainly related to the fact that it’s an port from an android framework • is there any table component? the best i could do was to use a
    SwingPanel
    to use the faithful
    JTable
    • how do you bind the tab key to jump to another field?
    g
    x
    +5
    • 8
    • 25
  • o

    orangy

    01/08/2021, 1:34 PM
    Is there any guidance to implementing modal dialogs? As far as I understand it should be part of the composition through the whole lifetime of the dialog, are there any established practices on doing so? Also, how do I disable interaction with the rest of the UI while the dialog is open? Similar question about popup windows – like floating tooltips, popup menus, dismissing when clicked outside, etc.
    j
    c
    k
    • 4
    • 4
  • o

    orangy

    01/08/2021, 2:20 PM
    The most annoying thing for me now is
    androidx.compose.material.Text
    vs
    androidx.compose.foundation.Text
    🙂 Not that big deal, but since I use a lot of
    Image
    components, the foundation’s Text comes into place in almost every situation. Do you plan to bring some order into packages/components?
    j
    s
    • 3
    • 8
  • o

    orangy

    01/08/2021, 2:24 PM
    Another confusing piece is
    imageResource
    (composable with remember) vs
    imageFromResource
    (just creates ImageBitmap). In a composable context it’s easy to use the wrong one and cause excessive bitmap creations. Consider renaming one of them to be not so similar and making it more obvious from the name when to use which.
    j
    • 2
    • 6
  • o

    orangy

    01/08/2021, 4:25 PM
    I’m trying to implement
    backgroundImage
    modifier like this:
    @Composable
    fun Modifier.backgroundImage(bitmap: ImageBitmap, contentScale: ContentScale = ContentScale.Crop): Modifier {
        val imagePainter = remember(bitmap) { ImagePainter(bitmap) }
        return paint(imagePainter, false, contentScale = contentScale)
    }
    But if I do it like this it doesn’t show any content. If I implement my own
    DrawImageBackgroundModifier
    with trivial draw using drawImage and drawContent, it works as expected. What I’m missing?
    j
    n
    • 3
    • 6
  • k

    Kirill Grouchnikov

    01/08/2021, 4:37 PM
    These all should go to #compose
    o
    j
    c
    • 4
    • 6
  • e

    eloew

    01/08/2021, 7:48 PM
    I am trying to copy text to clipboard and access outside of compose app. Appears to be on the clipboard but I can't paste outside the compose app. Am I using the correct Clipboard code?
    fun copyToClipboard(value: String) {
    val c = Clipboard("")
    val s = StringSelection(value)
    c.setContents(s, s)
    //Test
    val stringValue = c.getData(DataFlavor.stringFlavor)
    val data = c.getContents(null)
    }
    j
    k
    s
    • 4
    • 9
  • g

    Glenn Martin

    01/09/2021, 4:47 AM
    noobie here, how do I add a view or Composable to a state object, so I can basically pass in various views or composables
    k
    • 2
    • 1
  • k

    Kirill Grouchnikov

    01/09/2021, 10:32 PM
    The first snapshot of Aurora has been uploaded to Sonatype. Instructions for experimenting at https://github.com/kirill-grouchnikov/aurora#playing-with-snapshot-builds
    n
    x
    • 3
    • 7
  • s

    sigmadelta

    01/10/2021, 8:24 AM
    Hey everyone, for my Compose-Desktop app, I want to integrate with an API which makes use of an OIDC authorization code flow and therefor needs access to a browser session to complete successfully. Is there any form of support for browser session management (either through a webview, or even delegation to a system browser) for Compose-Desktop currently?
    j
    • 2
    • 2
  • g

    Glenn Martin

    01/10/2021, 8:48 AM
    is ViewModel available for desktop? seems like its only adroidx
    ✅ 1
    a
    j
    +2
    • 5
    • 7
  • g

    Glenn Martin

    01/10/2021, 1:36 PM
    @ExperimentalLayout
    @Composable
    fun mainLayout(view: @Composable () -> Unit) {
    
        Row(Modifier.fillMaxSize()) {
            Box(modifier = Modifier.fillMaxWidth(0.2f), contentAlignment = Alignment.Center) {
                sideBarItems()
            }
            view()
        }
    }
    this works on first load, but when i call this from an onClick() event on those sidebar items I get an error about calling composable from an onclick()
    d
    a
    x
    • 4
    • 24
  • c

    Colton Idle

    01/10/2021, 7:45 PM
    Built a DMG and sent it to a friend but he said it seems like it's corrupted. Any ideas? Do I need to sign my code? Are there instructions for it, or any ways around signing it for just sending little dumb apps to a friend?
    b
    s
    j
    • 4
    • 13
  • s

    suresh

    01/10/2021, 11:05 PM
    I am using Gradle
    6.8
    + Kotlin
    1.4.21-2
    + Compose
    0.3.0-build13
    +
    OpenJDK15
    and getting this weird error on compilation. Has anybody seen this error earlier? Haven't seen this issue with regular kotlin projects though.
    e: java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.com.intellij.pom.java.LanguageLevel
            at org.jetbrains.kotlin.com.intellij.core.CoreLanguageLevelProjectExtension.<init>(CoreLanguageLevelProjectExtension.java:26)
            at org.jetbrains.kotlin.com.intellij.core.JavaCoreProjectEnvironment.<init>(JavaCoreProjectEnvironment.java:42)
            at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment.<init>(KotlinCoreProjectEnvironment.kt:26)
            at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.<init>(KotlinCoreEnvironment.kt:118)
            at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:420)
            at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:226)
            at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:152)
            at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
            at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
    j
    x
    • 3
    • 11
  • t

    Thomas

    01/11/2021, 12:26 PM
    Inspired by a very helpful comment by Roman Sedaikin (thanks again) to an issue I created on GitHub, I did a small post about AlertDialog and DesktopDialogProperties: https://dev.to/tkuenneth/customize-a-compose-for-desktop-alertdialog-a6e
    🎉 1
    p
    • 2
    • 2
  • s

    SrSouza

    01/11/2021, 1:49 PM
    Hi folks, is possible to use Compose for Desktop on a OpenGL application, example: I have a game writing in Kotlin using OpenGL and I want to do some GUI in Compose. I think that the currently Compose for Desktop is not possible, but using a Low Level API from Compose should be possible?
    j
    • 2
    • 4
  • m

    mzgreen

    01/11/2021, 8:49 PM
    Hey! If I understand correctly, Compose Desktop uses https://github.com/JetBrains/skiko which in turn uses https://github.com/JetBrains/skija (a library that provides java bindings for https://skia.org/). And Skia is an actual rendering library. I’m asking because I recently contributed Skottie (https://skia.org/user/modules/skottie) bindings to Skija. If my understanding is correct then Compose Desktop doesn’t expose Skija in public API so it’s not possible to create a 3rd party library for playing Lottie animations. I’m thinking about contributing something similar to: http://airbnb.io/lottie/#/android-compose directly to Compose Desktop. But before I pull the Compose repo and start learning its tooling, I wanted to ask if you think it’s a good idea and if my understanding is correct.
    j
    g
    +4
    • 7
    • 15
  • p

    py

    01/12/2021, 12:38 AM
    👋 When I make a mistake and end up causing an exception in my compose code, it looks like the default handling is to just log it and keep going. Is that expected behavior? On Android the default behavior is to crash, and that’s kind of what I expected. Should I file a bug?
    c
    r
    k
    • 4
    • 10
  • s

    sigmadelta

    01/12/2021, 12:02 PM
    I would like to modularize my current Compose-Desktop project, but I'm not sure which type of modules I should choose (Java/Gradle/Kotlin/...) and I'm wondering if someone has a good example of what a
    build.gradle.kts
    file for a Compose-Desktop submodule would look like as well?
    g
    • 2
    • 3
  • p

    py

    01/12/2021, 7:09 PM
    Made some more progress on SharkApp, sharing here if anyone’s looking for sample code that does some of these things: https://twitter.com/Piwai/status/1349070351108435968
    :jetpack-compose: 1
    🎉 6
    👍🏼 9
    c
    a
    • 3
    • 6
  • t

    Thomas

    01/12/2021, 8:01 PM
    An undecorated Compose for Desktop AlertDialog can be dragged around using good old Swing. Will be posting the short piece of code soon, this clip is to wet your appetite. 😂 The white bar at the bottom needs to be investigated, I think it might be a reproducible issue in Compose for Desktop. If so, will open an issue on GitHub
    Move undecorated Compose for Desktop dialog.mp4
    :jetpack-compose: 1
    🎉 9
    k
    • 2
    • 3
  • a

    Aru

    01/12/2021, 11:19 PM
    Hi. JB-Compose is pretty cool. I want to use it for an embedded linux project. Is there going to be a ARM 64-bit packaging target ?
    j
    s
    o
    • 4
    • 23
  • s

    Suser

    01/13/2021, 7:40 AM
    I'm just working through the Jetpack Pathway using Desktop and ran into an issue with the Custom Layouts section. just thought i'd mention it here. [detail in comment]
    j
    • 2
    • 5
  • m

    Marek Venc

    01/13/2021, 9:48 PM
    Hey, I am trying to create a column containing rows to make a 3x3 grid of buttons that fill the window with all of them the same size. Is there some way to accomplish this? Thanks
    s
    • 2
    • 2
  • s

    Suser

    01/14/2021, 5:21 AM
    is constraint layout on compose desktop? maybe i need to add a dependency but i'm unsure how and documentation is a little thin.
    2️⃣ 1
    k
    s
    +2
    • 5
    • 8
  • a

    Animesh Sahu

    01/14/2021, 8:14 AM
    Can we minimize the app to the system tray?
    o
    • 2
    • 5
  • o

    olonho

    01/14/2021, 2:10 PM
    Question to people considering using Compose for Desktop in their projects: job, commercial, hobby. How much it will affect you when we reach 1.0 version of Compose for Desktop in terms of ability to use the technology? Update: a bit rephrased question, to emphasize that we all want to reach 1.0, and question is mainly about how important the version for convincing other people. 1️⃣ - critical, blocker 2️⃣ - important, but not blocker 3️⃣ - not important, version is just a number
    3️⃣ 36
    1️⃣ 5
    2️⃣ 16
    d
    s
    +10
    • 13
    • 21
  • a

    Animesh Sahu

    01/14/2021, 4:06 PM
    Seems like calling
    AppWindow.close()
    calls System.exit() or something, and process exits immediately, anyway to stop that (still closing the window, but not let process die)?
    k
    s
    • 3
    • 13
Powered by Linen
Title
a

Animesh Sahu

01/14/2021, 4:06 PM
Seems like calling
AppWindow.close()
calls System.exit() or something, and process exits immediately, anyway to stop that (still closing the window, but not let process die)?
k

Kirill Grouchnikov

01/14/2021, 4:08 PM
So you want the app to continue running in the background but not display any UI? That's a pretty hostile action to take against your user who just told you to close the app. I hate such apps (looking at you, Skype) that pretend to exit but continue running in the background.
🤔 1
☝️ 1
a

Animesh Sahu

01/14/2021, 4:13 PM
App necessarily has to be UI only? cleanup before closing the window (probably will make window exit slower)..
👍 1
k

Kirill Grouchnikov

01/14/2021, 4:16 PM
If you have some sort of a persistent service / daemon running in the background all the time, that's not related to Compose. Cleaning up before closing the window is a separate question, so perhaps you can be a little bit more clear on the exact scenario you have in mind.
a

Animesh Sahu

01/14/2021, 4:18 PM
Want to have sort of minimized app, maybe freeing the UI resources when not in use :blob-thinking-upside-down:, invoking the window back from some other source.
I'm just experimenting with different stuffs tbh 😅
k

Kirill Grouchnikov

01/14/2021, 4:20 PM
Well, you need to be specific about such scenarios. Swing has clear meaning on what happens when the last visible window is closed if DISPOSE_ON_CLOSE is used. And there's the
windowClosing
callback for cleaning up. But if you want to leave your daemon running in the background, that's a completely different area.
a

Animesh Sahu

01/15/2021, 3:44 AM
Well wait, even this slack seems to run in background and doesn't exit...
Even discord and other daemon services like download managers, 👀.
s

Sebastian Sellmair [JB]

01/15/2021, 9:25 AM
I think there are many good reasons why an App developer might want to continue the process in such cases 👀
➕ 4
k

Kirill Grouchnikov

01/15/2021, 2:50 PM
Depends if Compose (or Skiko?) wants to be in the business of such things as background services and daemons on the desktop. I fully expect the red / close button on my mac to close the window and exit the app. Slack is bad. Slack goes to the dock, but that is what the minimize semaphore button is for.
a

Animesh Sahu

01/15/2021, 2:53 PM
Well X (or Ctrl+W) is for closing the slack, and
File -> Quit
(or Ctrl+Q) is for quitting the app.
It still enhances the experience sometimes, as redrawing and connecting to the socket may take upto 5-6 sec (atleast for me :P)
k

Kirill Grouchnikov

01/15/2021, 2:57 PM
Sorry, this is not going anywhere productive for me, so I'm going to check out
👀 2
View count: 2