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

    Kirill Grouchnikov

    05/08/2022, 4:01 AM
    @Igor Demin - can the 1.2.0-dev branch be switched to the latest release 0.7.18 of Skiko - so that it gets the recently added bindings for runtime shaders? Also, would be nice to have a rough idea on the timeline for 1.2.0 release if possible.
    🙏🏼 1
    🙏 2
    🙏🏻 1
    i
    • 2
    • 1
  • k

    Keith Karanu

    05/08/2022, 6:27 AM
    Is there any way to remove the shadow from the interior of the element?
    k
    a
    • 3
    • 17
  • m

    Michael Paus

    05/08/2022, 10:11 AM
    Can anybody tell me how to properly set up a Compose multiplatform library project. There does not seem to be any specific template for that. If there is no better approach I would like to start from a Kotlin multiplatform library project created by the Idea “New project” wizard and then extend that to support Compose. Whatever I have tried so far there always seems to be something missing. For the time being support for Android and Desktop would be enough.
    b
    a
    • 3
    • 7
  • x

    Xad Kile

    05/09/2022, 4:27 PM
    My compose app renders around 100 composables on the screen at the same time. I notice that it is very slow/laggy when it starts. Any action takes around 0.5-1 seconds to complete, but if I leave it alone for about 1-2 minutes, it somehow "stabilizes" and becomes very smooth. Is there anything I can do to fix this? I am testing on a low spec PC - CPU i5-4th gen, 8GB of RAM
    r
    d
    m
    • 4
    • 11
  • s

    spierce7

    05/09/2022, 9:02 PM
    Is there a provided way that we have to interpret a hex string color, or is the best way to do something like
    colorString.removePrefix("#").toInt(16)
    k
    t
    • 3
    • 7
  • m

    miguelsesma

    05/10/2022, 1:14 PM
    I'm trying to create a deb package for installing in Linux Arm64 (Nvidia jetson nano) from a M1 macbook. I know that I can't do it directly so I have installed a linux vm using Canonical Multipass. Once Java nad Gradle are configures I have this environment:
    ubuntu@primary:~/Home/IdeaProjects/untitled$ uname -a
    Linux primary 5.4.0-109-generic #123-Ubuntu SMP Fri Apr 8 09:12:14 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
    ubuntu@primary:~/Home/IdeaProjects/untitled$ gradle -version
    
    ------------------------------------------------------------
    Gradle 7.4.2
    ------------------------------------------------------------
    
    Build time:   2022-03-31 15:25:29 UTC
    Revision:     540473b8118064efcc264694cbcaa4b677f61041
    
    Kotlin:       1.5.31
    Groovy:       3.0.9
    Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
    JVM:          16.0.1 (Private Build 16.0.1+9-Ubuntu-120.04)
    OS:           Linux 5.4.0-109-generic aarch64
    Now I try to create the package but gradle complains about not having `skiko`:
    ubuntu@primary:~/Home/IdeaProjects/untitled$ gradle createDistributable
    
    > Task :run FAILED
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/ubuntu/.skiko/301a4ed732d2008e05d036470d72b8c7a7df9df1b3cc0d356615c8129124eae2/libskiko-linux-arm64.so: libGL.so.1: cannot open shared object file: No such file or directory
            at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
    I cannot install intellij idea
    ubuntu@primary:~/Home/IdeaProjects/untitled$ sudo snap install intellij-idea-community --classic
    error: snap "intellij-idea-community" is not available on stable for this architecture (arm64) but
           exists on other architectures (amd64).
    So I need to somewhat configure skiko, skia or whatever is need, but I'm lost. After reading everythinh in this channel related to raspberry pi, I'm even more confused. Perhaps trying to install intellij as explained here https://youtrack.jetbrains.com/articles/IDEA-A-48/JetBrains-IDEs-on-AArch64 will provide me the skia / skiko needed dependencies? Any help is welcomed.
    • 1
    • 1
  • a

    Abdelilah El Aissaoui

    05/10/2022, 5:25 PM
    I've been trying to track down an issue where any compose app would slow down after a few hours of standby, so I would like to measure the app FPS (ubuntu for example) as commented by this issue by @Igor Demin. Any ideas of how can I do that without the app being full screen?
    i
    • 2
    • 2
  • k

    Kirill Grouchnikov

    05/11/2022, 6:30 PM
    A little shader demo that tracks mouse clicks and does dynamic RGB channel displacement.
    rgb-displacement.mov
    👏 2
    😮 6
    👀 6
    😍 22
    ➕ 4
    g
    s
    n
    • 4
    • 9
  • s

    samuel

    05/11/2022, 10:02 PM
    Perhaps this is general desktop development question but using Jetpack compose is my first time doing this and I have a question regarding storing sensitive data e.g tokens in a desktop context. I’m playing around with building a Mac app and i wonder how to approach saving sensitive data specifically on Mac that would be entered once but should be persisted for as long as it does not need to change. What is the recommended approach? Does anyone have/know a sample of something like this?
    b
    m
    m
    • 4
    • 9
  • s

    smit01

    05/12/2022, 4:35 PM
    I am newbie with jetpack compose and i am trying to create dashboard desktop application to learn and i am seeing this error tried looking on stack overflow but didn't find any solution. Would you mind helping me resolve this.
    d
    • 2
    • 4
  • b

    Brian Guertin

    05/12/2022, 7:15 PM
    Is there some way to disable Compose for iOS target? I don't use it on iOS but it's breaking my multiplatform build:
    > Task :jgosdk:compileKotlinIosArm64
    e: Compilation failed: Cannot find the Composer class in the classpath
    • 1
    • 1
  • s

    saket

    05/13/2022, 5:06 AM
    Has anyone managed to create a menu bar app that displays a window on click? Something similar to Jetbrains Toolbox.
    • 1
    • 1
  • a

    Alexander Maryanovsky

    05/13/2022, 6:05 AM
    Hi. I found the direct cause of a rather frequent crash that has been reported (twice) a while ago. I added a comment to the ticket(s), but it doesn’t seem to be getting any attention, probably because it’s an existing, old, ticket. Should I open another ticket, or wait patiently? https://github.com/JetBrains/compose-jb/issues/940 https://github.com/JetBrains/compose-jb/issues/575
    s
    i
    • 3
    • 6
  • l

    Landry Norris

    05/13/2022, 6:11 PM
    I am glad to see how well compose multiplatform does with platform integration. I am using the experimental support for iOS in a toy project, and I can already render a static UIView to a Composable. Working on touch support now.
    t
    f
    • 3
    • 4
  • a

    Alexander Suraphel

    05/14/2022, 12:16 PM
    Is it possible to use Android widgets like
    androidx.compose.material.Button
    to build a compose desktop app? I want to reuse the layout I have for tablets…
    :yes: 4
    k
    • 2
    • 1
  • a

    Alexander Suraphel

    05/15/2022, 12:29 PM
    How do you handle navigation on compose desktop app? I’m coming from Android and I am trying to port the tablet layout to desktop.
    l
    x
    d
    • 4
    • 3
  • p

    PHondogo

    05/16/2022, 10:50 AM
    Hello! When running desktop version of compose and making first right click on text field, message logged:
    Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions/FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData
    what does it means?
    👀 1
    m
    m
    +2
    • 5
    • 6
  • y

    Yan Pujante

    05/16/2022, 5:41 PM
    I am trying to size a canvas based on an image that I draw into the canvas, but there is a mismatch between the size the canvas expect (dp) and the size of the image (pixels). Is there a way to go around this?
    @Composable
    fun Panel(image: ImageBitmap) {
        Canvas(modifier = Modifier
            .size(image.width.dp, image.height.dp) // doesn't work (mismatch size)
            .border(1.dp, Color.Red)) {
            drawIntoCanvas { canvas ->
                canvas.withSave {
                    canvas.drawImage(image, Offset(0f, 0f), Paint())
                }
            }
        }
    }
    k
    z
    • 3
    • 10
  • l

    Lawrence

    05/16/2022, 8:25 PM
    I want to open a window when a barcode scanner scans something. The scanner operates like a keyboard so I get a string of information. I want to add a listener that can intercept keyboard input and open the window if it matches the barcode format. I am thinking I need to add like a hidden TextField in my view and then handle it from there. Any suggestions?
    k
    • 2
    • 3
  • s

    Sebastian Kürten

    05/16/2022, 8:41 PM
    I'd like to render my UI to a PNG file in order to automate taking screenshots of an app. I found out it is possible for Swing like this (https://stackoverflow.com/questions/5853879/swing-obtain-image-of-jframe). I have not tried it, but I'm presuming this method won't work with compose as rendering goes through skija/skiko right? Would there be a similar mechanism that could be employed for compose's rendering engine?
    k
    • 2
    • 7
  • j

    Jose Luis Torres Aguilar

    05/17/2022, 4:20 PM
    Hey Guys, I’m having an issue with the date picker on desktop compose. When I use my app on the secondary monitor and try to open the datepicker it shows on my principal monitor, so Anyone know how to keep the datepicker and my app on the same window?
    k
    • 2
    • 3
  • j

    Jakob K

    05/17/2022, 6:30 PM
    How can I disable the gray hover effect for hoverable composables? In this case it is a
    NavigationRailItem
    inside a
    NavigationRail
    (both from
    material3
    and not m2).
    k
    • 2
    • 5
  • l

    Lawrence

    05/17/2022, 7:10 PM
    Is it possible to allow a layout such as Column to have flexible size but also have a cap on its maximum size? Like using
    Modifier.fillMaxWidth(0.75f)
    to allow it to grow to occupy 75% of max width but also limiting the max width to
    500.dp
    ?
    k
    • 2
    • 2
  • j

    Jakob K

    05/18/2022, 9:14 PM
    Every time I try to handle (catch etc) an exception inside
    produceState
    it throws another exception at a higher level and crashes the application (I posted that exception inside the thread). Am I doing something wrong here?
    k
    • 2
    • 3
  • s

    smallshen

    05/19/2022, 12:14 AM
    https://github.com/smallshen/JWM-Compose Use Jetpack compose with JWM(https://github.com/HumbleUI/JWM) There are problems with keys (https://github.com/smallshen/JWM-Compose/blob/00cc0a31872a3220850f5e7f1af7c62e2eae292e/src/main/kotlin/club/eridani/compose/jwm/ApplicationWindow.kt#L115) It would be nice if someone could fix these problems (but I think compose-jb needs to make some awt hardcoded parts more "generic").
    k
    • 2
    • 2
  • n

    Norbi

    05/19/2022, 8:06 AM
    Was anyone able to try compose-jb v1.2.0-alpha01-dev686? I tried to upgrade to it from 1.1.1 but I always get various build errors like
    Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.jetbrains.compose.compiler:compiler:1.2.0-alpha01-dev686.
    or some other error 😞 My goal is to use Kotlin 1.6.21... Thanks.
    j
    m
    +2
    • 5
    • 9
  • s

    spierce7

    05/19/2022, 7:34 PM
    Does anyone know how to do either of the following: 1. Turn a
    Painter
    into a skia
    Image
    2. Turn an SVG into a skia
    Image
    instead of a
    Painter
    m
    • 2
    • 1
  • d

    David W

    05/20/2022, 1:35 AM
    Is there a way to tell Compose "do not position anything here, it's out of bounds"?
    • 1
    • 2
  • x

    xxfast

    05/20/2022, 7:08 AM
    is there a way to have a platform-native context menu (right-click menu)?
    k
    a
    • 3
    • 8
  • y

    ynsok

    05/20/2022, 7:18 AM
    Hi 😄 I’m trying run a multiplatform project on Windows and this error occurs, any idea what is happening ?
    p
    d
    • 3
    • 5
Powered by Linen
Title
y

ynsok

05/20/2022, 7:18 AM
Hi 😄 I’m trying run a multiplatform project on Windows and this error occurs, any idea what is happening ?
p

PHondogo

05/20/2022, 10:29 AM
You should add dependency ComposePlugin.Dependencies.desktop.currentOs
y

ynsok

05/20/2022, 11:26 AM
I’ve added and still doesn’t work
d

Dragos Rachieru

05/23/2022, 1:29 PM
did you sync before running again? Try building the project to see if it fails
you also forgot a
}
in the last screenshot
and I don't know if
jvmMain {
works, I only use
val jvmMain by getting {
  dependencies {
    implementation(compose.desktop.currentOs)
  }
}
View count: 7