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

    Bryan L

    02/25/2021, 7:36 PM
    I'm a bit confused on the coding conventions. I'm running through codelabs for compose and coding for compose desktop. All of the function names are PascalCase. Should I follow the convention as shown or ignore this and stick to camelCase?
    c
    j
    +2
    5 replies · 5 participants
  • y

    Yan Pujante

    02/25/2021, 7:55 PM
    Although not specifically compose-desktop specific, wanted to share how I build the
    .icns
    file that you can use in your dmg image on macOS (because it is NOT trivial), using a svg file as an input and google chrome for the rendering (handle transparency properly)
    // render a single icon with the size
    fun renderIcon(size: Int, filename: String) {
      val html = """
          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
          </head>
          <body style="margin:0;overflow:hidden">
          <img style="padding; margin:0" src="${rootDir}/src/main/resources/images/logo.svg" width="$size" height="$size"></img>
          </body>
          </html>
        """.trimIndent()
      val inputFile = file("$buildDir/icon.html")
      inputFile.writeText(html)
      println(inputFile)
      exec {
        commandLine(
          "/Applications/Google <http://Chrome.app/Contents/MacOS/Google|Chrome.app/Contents/MacOS/Google> Chrome",
          "--headless",
          "--screenshot=$filename",
          "--window-size=$size,$size",
          "--default-background-color=0",
          inputFile.toString()
        )
      }
    }
    
    val iconsetDir = "${buildDir}/app-icon.iconset"
    
    // render all icons required for iconset
    tasks.register("iconset") {
      doLast {
        // make sure the folder exists
        mkdir(iconsetDir)
    
        // generate each icon
        arrayOf(512, 256, 128, 32, 16).forEach { size ->
          renderIcon(size * 2, "$iconsetDir/icon_${size}x${size}@2x.png")
          renderIcon(size, "$iconsetDir/icon_${size}x${size}.png")
        }
      }
    }
    
    // render the .icns file needed for macOS
    val icnsTask = tasks.register("icns") {
      doLast {
        exec {
          commandLine("iconutil", "-c", "icns", iconsetDir)
          workingDir = buildDir
        }
      }
      dependsOn("iconset")
    }
    after running the
    icns
    task you end up with
    app-icon.icns
    file which you can then use in your app distribution
    👍 1
    t
    3 replies · 2 participants
  • w

    Will Johnson

    02/25/2021, 7:56 PM
    Hello! I'm trying to place a Slider() inside a DropDownMenu() like in the following:
    @Composable
    fun sliderDropDown(isExpanded: Boolean, onDismissRequest: () -> Unit) {
        DropdownMenu(expanded = isExpanded, onDismissRequest) {
            var value by remember { mutableStateOf(0f) }
            Slider(
                value,
                { value = it },
                Modifier.width(200.dp)
            )
    
        }
    }
    but I keep getting the error
    Intrinsic measurements are not currently supported by SubcomposeLayout
    I'm able to use a Popup() to show the Slider, but I can't figure out a way to get the same anchoring behavior from the Popup that the DropDownMenu provides by default. Am I missing something when I use DropDownMenu? Is there a way to get the same anchoring effect with a Popup? I'm using compose-0.3.0 and kotlin-1.4.30
    j
    3 replies · 2 participants
  • h

    Hunter Breathat

    02/26/2021, 1:09 AM
    👋 I'm looking to use the
    @Preview
    annotation, but there doesn't appear to be support for it. Is that correct?
    j
    t
    2 replies · 3 participants
  • t

    theapache64

    02/26/2021, 6:26 AM
    Version Naming : Illegal version for 'Dmg': '0.1.0' is not a valid version 🧵
    o
    x
    5 replies · 3 participants
  • p

    Paul Nogas

    02/26/2021, 4:35 PM
    Hi, I'm playing around with jb-compose and seem to be getting in a recomposition loop when I do my "toggle dark mode" from the menu bar but not when I do it from a androidx.compose.material.Swtich in the UI. I've tried wrapping multiple things in remember {} but it doesn't seem to help. Can someone confirm if I'm doing something wrong or if this is a bug in jb-compose? Project is on Github and here's the composable in question https://github.com/pnogas/TempProject/blob/main/src/main/kotlin/com/paulnogas/log/analyzer/WindowActionManager.kt#L38
    j
    t
    9 replies · 3 participants
  • r

    rsktash

    02/26/2021, 5:16 PM
    Hi is there a plan to support javafx? We are encountering for java lib deficiency. For example mp3 playing library
    j
    o
    4 replies · 3 participants
  • o

    olonho

    02/26/2021, 7:39 PM
    We just built Compose 0.3.1 which contains fix for Linux crash, and few other improvements. Please consider using it.
    🎉 14
    l
    1 reply · 2 participants
  • d

    Dominaezzz

    02/26/2021, 8:10 PM
    Building a Matrix Client with Compose for Desktop. Felt like sharing 😄.
    screencast-2021-02-26_20.03.44.mp4
    🎉 20
    :kotlin-intensifies: 19
    s
    j
    +3
    9 replies · 6 participants
  • b

    Bryan L

    02/27/2021, 4:10 PM
    I'm looking to create a program in Compose Desktop that can read data from excel sheets and compare that data to an SQLite Database(with millions of records) which then stores/outputs the results in various formats. Is there any tools/libraries you would recommend me using or looking into for this? Most of the results I see are built in android apps and I'm not sure if that is an ideal route in CD since the their is different options to choose from. I do plan on having this or at least the results shown on android/mobile in the future but not anytime soon.
    j
    t
    3 replies · 3 participants
  • t

    theapache64

    02/28/2021, 6:20 AM
    ❓ Is there any release note or any way to see the commits included in a release?
    r
    2 replies · 2 participants
  • t

    theapache64

    02/28/2021, 3:17 PM
    I am working on a project called Stackzy and am trying to roll out executable for Windows. Since I don't have a windows machine, can anyone help me debug the windows build? 🙂
    a
    o
    +2
    9 replies · 5 participants
  • d

    dector

    02/28/2021, 9:56 PM
    #screenshotsunday Making app that will let students (that are building simple REST API using tutorial) to visualize their result
    screen_00002.mp4
    🎉 7
    🔥 2
    👍 2
    t
    2 replies · 2 participants
  • t

    theapache64

    03/01/2021, 10:51 AM
    ❓ Is there any way to include the file into the build according to the platform? Something like
    productFlavors
    of android
    o
    4 replies · 2 participants
  • c

    Carter

    03/01/2021, 9:58 PM
    I’m following the instructions for signing on macOS. It works great locally, although I’m running into a failure when trying to set it up on CI. The exact error I get is this
    Execution failed for task ':desktop:packageDmg'.
    Process 'command '/usr/bin/codesign'' finished with non-zero exit value 1
    Ad when I add --debug I see
    error: The specified item could not be found in the keychain.
    Is there some additional item that might need to be in the keychain that’s missing in the CI environment, but might already be present in my desktop environment?
    o
    2 replies · 2 participants
  • r

    rsktash

    03/02/2021, 6:42 AM
    Canvas.drawArc is ignoring
    size
    parameter The issue is specific to desktop app. Android app is working as expected
    o
    c
    5 replies · 3 participants
  • r

    rsktash

    03/02/2021, 10:20 AM
    How can we check that point is inside a path? I saw two functions in android
    Path.op(path2: Path, op: Op)
    and
    Path.op(path1: Path, path2: Path, op: Op)
    But in compose there is only one
    Path.op(path1: Path, path2: Path, op: Op)
    d
    16 replies · 2 participants
  • d

    Dirk Hoffmann

    03/02/2021, 11:20 AM
    can someone point me to a good article/documentation on "what gets redrawn when"? especially on the question "if state changes, how does compose decide what has to be redrawn", thanx (as anything is a function, I wonder on what it is inside the function that compose "remembers" and how he "finds" the function to be reexecuted when ... yeah, when what!?)
    👍 1
    t
    a
    +1
    21 replies · 4 participants
  • d

    Draget

    03/02/2021, 3:12 PM
    Trying https://github.com/JetBrains/compose-jb/blob/master/tutorials/Getting_Started/README.md and just wanted to write out some thoughts/experiences. Just opening the automatically created compose demo project sends my IDEA into a indexing-importing-downloading-something frency for over 10+ minutes. Trying to update the Kotlin plugin version in the build.gradle.kts and somehow expecting "1.4.<alt+space>" to be autocompleted to avaiable versions, seeing it still does not work. So updating it by manually searching the versions. Trying to create a regular 'Application' run configuration which fails to find the main class (the searching-dialog looked like it was doing something for 1-2 minutes, but I did not care to wait and find out if it just went into an endless loop or is going down every class ever it finds on my PC). Accepting I should use the gradle task. Realizing the configured gradle-wrapper is 6.7 while 6.8.3 is the latest one. Running
    ./gradlew wrapper --gradle-version 6.8.4
    and noticing the typo after gradle already accepted the command without any feedback whatsoever. Trying any other gradle command including
    ./gradlew wrapper --gradle-version 6.8.3
    no longer works unless I edit the config file manually. Lots and lots of more re-indexing.
    ./gradlew clean
    taking 1m20s. Launching the compose demo application only to see an error about invalid MSI version. Luckily I know MSI and realize it needs three version parts, the wizard created only 1.0, so changing it to 1.0.0. Running the application finally works. Trying to Update the compsoe version and changing some things about the main class, gradle/idea deciding to re-index just random things (it included my JDK!?) and taking another few minutes. While doing this all, had two IDEA errors (which I reported) inbetween. So the whole 'test' took almost two hours… granted, with sidetracking. But the Gradle<->Idea<->compose experience has really not been stellar so far. :(
    o
    y
    4 replies · 3 participants
  • y

    Yan Pujante

    03/02/2021, 5:36 PM
    Looking at the tutorial about the Window https://github.com/JetBrains/compose-jb/tree/master/tutorials/Window_API, I haven't found the answer that I was looking for which is: if I start my app, resize it, close it and restart it, it does not restart with the size it used last. I assume it is something I need to implement on my own. Any suggestion on how to? Use Java
    Preferences
    API?
    t
    1 reply · 2 participants
  • n

    note8g2018

    03/03/2021, 10:13 AM
    Please tell Google to update the code lab for jetpack compose https://developer.android.com/courses/pathways/compose It is not working now Because the code is old and there are many huge changes in the framework jetpack compose Google should update the code
    :google: 3
    j
    c
    +1
    4 replies · 4 participants
  • m

    Marcin Środa

    03/03/2021, 11:40 AM
    Hi guys, does anyone knows how to deal with distributable for macOs? I created a jar just for tests - it works fine. Now I tried to create a distributable, build is finished but due to gson dependency I’ve got :
    Caused by: java.lang.ClassNotFoundException: java.sql.Time
    Am I able to add this module to dmg?
    t
    o
    +2
    14 replies · 5 participants
  • y

    Yofou

    03/03/2021, 12:12 PM
    Is it possible to change the color, of the window topbar and if not is there any examples of making a custom one? I'm particularly curious if there any examples of implementing the draggable window part?
    t
    f
    8 replies · 3 participants
  • t

    theapache64

    03/03/2021, 2:56 PM
    https://twitter.com/theapache64/status/1367126363161784330
    e
    d
    +1
    3 replies · 4 participants
  • y

    Yofou

    03/04/2021, 12:39 PM
    Hello o/, So after implementing the solution to my originoal problem here -> https://kotlinlang.slack.com/archives/C01D6HTPATV/p1614773539213300 I discovered that making my window
    undecorated
    actually makes my window non-resizable, so I was wondering if there's a solution to make my window undecorated but also resizable, thank you in advanced. 🙂
    t
    o
    +1
    9 replies · 4 participants
  • m

    Michael Paus

    03/04/2021, 2:26 PM
    Hi, my old code seems to be broken because the
    rawDragGestureFilter
    of the Modifier is gone. Can anybody tell me how one is supposed to deal with mouse drags over a Canvas now? Any help is appreciated 😀
    a
    2 replies · 2 participants
  • y

    Yan Pujante

    03/04/2021, 3:20 PM
    Yesterday, Flutter 2 was announced. I am just curious if anybody has any experience on how it compares to compose-desktop (besides the obvious difference of kotlin vs dart). https://developers.googleblog.com/2021/03/announcing-flutter-2.html
    m
    1 reply · 2 participants
  • p

    phisch

    03/04/2021, 10:19 PM
    I'm trying to figure out if compose-desktop could be a potential replacement for gtk4 in one of my projects. The main use-case i am looking for is themeability. So a user should be able to provide a configuration (could be custom or css or whatever) to theme the used components. A friend that has used compose-desktop before told me that it isn't possible to change style properties at runtime, and this seems like it can't be true.
    k
    c
    28 replies · 3 participants
  • s

    SrSouza

    03/05/2021, 3:06 PM
    Hey folks, there is any plan to support at the gradle plugin or any type of tutorial to build CfD to snap?
    b
    j
    2 replies · 3 participants
  • d

    darkmoon_uk

    03/06/2021, 7:33 AM
    I know the packaging features of Desktop Compose tooling require JDK 14, but what are the JRE requirements of the produced runtime; does that also have to be JDK14? What's the minimum? My interest is to run Desktop Compose on Raspberry Pi which is 32-bit OpenJDK11 by default. Thanks!
    j
    3 replies · 2 participants
Powered by Linen
Title
d

darkmoon_uk

03/06/2021, 7:33 AM
I know the packaging features of Desktop Compose tooling require JDK 14, but what are the JRE requirements of the produced runtime; does that also have to be JDK14? What's the minimum? My interest is to run Desktop Compose on Raspberry Pi which is 32-bit OpenJDK11 by default. Thanks!
j

jim

03/06/2021, 7:42 AM
When you create a native bundle, the JRE is bundled into the native binary, so there is no need to have a JRE on the device where the native bundle is installed. If the target machine already has a JRE installed on the system, that won't harm anything, it will just be ignored.
That said, the bigger challenge is going to be getting Compose for Desktop to be built for the Raspberry Pi, as that will require building a compatible copy of Skia & friends for that device, since it isn't a platform we (yet) support out of the box. This will require a bit of effort on your end, but should be a very tractable problem if you're willing to do a couple of C++ builds. There are some threads on this topic in this channel if you do a search.
👍 3
https://kotlinlang.slack.com/archives/C01D6HTPATV/p1611675551121700?thread_ts=1611654757.111100&amp;cid=C01D6HTPATV
View count: 3