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

    David W

    01/09/2022, 4:40 AM
    Feature request for the Compose Preview plugin: "Refresh Preview" button in the Preview panel that re-executes the last run preview task. Purpose: Shortcut that would prevent a lot of scrolling. Current workflow is to edit a composable, then scroll to the preview function and click Preview, then scroll back to the composable to edit as needed, rinse and repeat.
    👍 1
    k
    4 replies · 2 participants
  • a

    Ayfri

    01/09/2022, 2:59 PM
    Hi, how can I create a new separate Window ?
    d
    k
    9 replies · 3 participants
  • k

    Kebbin

    01/09/2022, 3:15 PM
    Hello again all! Maybe I'm just tired seeing it's 2am, but I can't find any reference online to show me how to send simple character data output to a COM port from my CfD program on Windows. Any tips appreciated! Thanks.
    a
    d
    3 replies · 3 participants
  • e

    eygraber

    01/09/2022, 4:52 PM
    Is there a ConstraintLayout Flow / flexbox like composable for CfD?
    👀 1
    c
    f
    +1
    10 replies · 4 participants
  • a

    Ayfri

    01/09/2022, 10:49 PM
    Hey, is it possible to have a TextField required to be filled ?
    k
    1 reply · 2 participants
  • s

    Sebastian Kürten

    01/11/2022, 8:33 AM
    In IDEA, when I navigate to the source of say
    singleWindowApplication()
    I end up in artifact
    org.jetbrains.compose.ui:ui-desktop:1.0.1
    and a file
    androidx.compose.ui.window.Window_desktopKt.class
    . Now I thought the sources for that would be somewhere in https://github.com/JetBrains/compose-jb but I cannot find it there anywhere. Can anybody enlighten me where the sources actually are?
    2 replies · 1 participant
  • v

    Vivek Sharma

    01/11/2022, 10:51 AM
    How can we navigate in compose-desktop? Is there any library or the mobile one is used
    r
    h
    +6
    17 replies · 9 participants
  • c

    Colton Idle

    01/11/2022, 3:05 PM
    Should I be updating to v1.1.0-alpha1-dev550 or v1.0.1 I guess my question is moreso. Is 1.0.1 using jetpack compose 1.0.5, and it 1.1.0-alpha using jetpack compose 1.1.0-rc01?
    j
    1 reply · 2 participants
  • s

    Sebastian Kürten

    01/11/2022, 4:49 PM
    Is there any switch to enable layout bounds debugging where the whole app starts looking like a wireframe?
    a
    2 replies · 2 participants
  • a

    Aman Kapoor

    01/11/2022, 7:29 PM
    Hi, on native distributions, I am not able to read/write files on system. Works with kar though. Seems like some permission issue. Is there anything extra which I need to do to make it work?
    k
    d
    8 replies · 3 participants
  • d

    David W

    01/12/2022, 2:18 AM
    Is this normal for CfD apps? The drop is when I quit the app.
    👀 1
    k
    c
    +1
    29 replies · 4 participants
  • v

    Vivek Sharma

    01/12/2022, 11:49 AM
    Just curious, in compose-desktop do we have a local database like
    room
    ? I think other desktop app uses remote db for their apps, no?
    a
    x
    +6
    32 replies · 9 participants
  • s

    spierce7

    01/12/2022, 3:36 PM
    Our signed release builds started failing ever since upgrading to Kotlin 1.6.10 and Compose 1.0.1. I filed a ticket around it. The error seems to be happening with jpackage, and it’s giving no useful information. https://github.com/JetBrains/compose-jb/issues/1689
    t
    k
    +2
    9 replies · 5 participants
  • h

    halirutan

    01/13/2022, 1:44 AM
    I have a data/state question. In my business layer I fetch data-points from a webservice and synchronize a local db. I have a listener API where I can execute code every time a new datapoint is ready. All this happens in the
    <http://Dispatchers.IO|Dispatchers.IO>
    coroutine scope. Now, since I'm a compose noob, I have a mutable state list, where I append the datapoints. I rarely get a
    ConcurrentModificationException
    exception which I guess is because the list is modified in the IO scope and read in the UI by compose. I read that one solution is to basically use a mutable state of an immutable list and assign a new list. That sounds a lot like I don't want to do this. Isn't there a better way to have a long list of datapoints that I can update from the IO thread?
    k
    m
    +1
    7 replies · 4 participants
  • g

    Grégory Lureau

    01/13/2022, 9:37 AM
    Hello ! I'm having an issue with IntelliJ 2021.3.1, when adding KMP 1.5.31 + Compose 1.0, dependencies are not properly indexed. Looks like simply removing the plugin fixes the indexing. I've tried re-installing, Repair IDE, rebuild, invalidate cache & restart, ... in vain so far. Any idea what could create this issue?
    d
    c
    +1
    13 replies · 4 participants
  • g

    Gordon

    01/13/2022, 1:59 PM
    Hi, i have created a simple image preview, that shows an image and a slider to visually compare images. But it's not performing well (slow). Can you see at the code and suggest a better approach?
    @OptIn(ExperimentalComposeUiApi::class)
    @Composable
    @Preview
    fun ImagePreview(args: Array<String>) {
    
        if (args.size != 2) {
            Text(text = "Usage: app image1 image2, args:${args.size}")
            return
        }
        val bitmap = loadImageBitmap(FileInputStream(args[1]))
        val bitmap2 = loadImageBitmap(FileInputStream(args[0]))
        var mousePos by remember { mutableStateOf(IntOffset(320, 0)) }
        Box(
            modifier = Modifier.background(color=Color.Gray).fillMaxSize()
            .clickable(onClick = {
                println("click at $mousePos")
            }).onPointerEvent(PointerEventType.Move) {
                mousePos = IntOffset(it.changes.last().position.x.toInt(), 0)
            }
        ) {
            Image(bitmap = bitmap, "kotlin", contentScale = ContentScale.None, modifier = Modifier.fillMaxSize() )
            Box(modifier = Modifier.fillMaxHeight().fillMaxWidth()) {
               Image(bitmap = bitmap2, contentDescription = "bla", contentScale = ContentScale.None, modifier = Modifier.fillMaxSize().clip(MyShape(mousePos.x)))
            }
            Box(
                modifier = Modifier.width(4.dp).fillMaxHeight().offset { mousePos }.background(color = Color.Red)
            )
        }
    }
    
    class MyShape(private val maxWidth: Int) : Shape {
        override fun createOutline(size: Size, layoutDirection: LayoutDirection, density: Density): Outline {
            return Outline.Rectangle(Rect(Offset(0f,0f), Size(maxWidth.toFloat(), size.height)))
        }
    }
    f
    k
    8 replies · 3 participants
  • m

    Michael Paus

    01/14/2022, 12:36 PM
    How do you handle tooltips in a multi-platform project? I have a project where I would like to show tooltips in the desktop variant but not in the Android variant. In order to show a tooltip I have to wrap the relevant content in a TooltipArea but this code then won’t compile for Android where TooltipAreas are not supported. I can work around this by writing my own wrapper via expect/actual but is that really necessary? Isn’t there a more elegant solution?
    b
    o
    6 replies · 3 participants
  • m

    Michael Paus

    01/14/2022, 1:26 PM
    How can I get rid of this error in the editor window. I have a multi-platform project and when I use
    expect
    somewhere I get the following error when I open the relevant file. Funnily the project builds and runs just fine and does what I
    expected
    it to do.
    b
    f
    +1
    5 replies · 4 participants
  • j

    John O'Reilly

    01/14/2022, 4:18 PM
    Is there way to know when user has finished selecting say an accented letter (when using for example
    TextField
    ). Looks like, when long-pressing, we get
    onValueChange
    for the non-accented version first and then again when user picks one of options shown
    t
    l
    17 replies · 3 participants
  • t

    Thomas

    01/14/2022, 5:59 PM
    Does anyone here have experience publishing Jvm apps (or any non-Xcode app) to the Mac App Store? I am working on a PR for Compose (https://github.com/JetBrains/compose-jb/pull/1613). Apps can be uploaded (and I think published) to the App Store, but there is still an issue with TestFlight. See screenshot. Any ideas?
    s
    x
    5 replies · 3 participants
  • k

    Kirill Grouchnikov

    01/14/2022, 9:38 PM
    Coming soon in Aurora 1.1 - the breadcrumb bar component
    😃 2
    :kotlin-intensifies: 17
    t
    1 reply · 2 participants
  • m

    Marin Tolić

    01/15/2022, 9:56 PM
    Hey folks, Do all three Compose ui libraries (Jetpack, Desktop, Web Compose) have different foundation implementations? EDIT: Remove Compose for Web from that equation, I just noticed that it has a very different implementation from its two counterparts. I’m thinking about writing a simple graphing library and trying to see if there’s a way to avoid having separate projects for all three the two since it’s just UI code with some light modelling that should - at least in theory - be identical across all both platforms. (this may yet prove itself a folly of course) Sorry for any silly questions, this is the first time I’m having to think about deploying a library to three two similar implementations of a given technology. 😄 Thanks for any eventual answers.
    z
    s
    +3
    10 replies · 6 participants
  • b

    Brian Guertin

    01/16/2022, 10:33 PM
    So, I can't help but notice that
    compose-jb
    repository now has an example for using common widgets on web canvas (using wasm) and on UIKit on iOS?? https://github.com/JetBrains/compose-jb/tree/master/examples/falling-balls-mpp/src
    👀 8
    f
    3 replies · 2 participants
  • q

    Quentin Dommerc

    01/17/2022, 6:48 AM
    👋 I think the AlertDialog (which is experimental yes), have a little
    shape
    issue. It’s relying on
    Surface
    which, by default has a RectangleShape. Doesn’t really matter what we put in the
    shape
    parameter of the AlertDialog then. Should I file an issue on gh? (see the grey rectangle corners on my screenshot) edit: sorry for the colors, sorry for your eyes 🙈
    s
    3 replies · 2 participants
  • p

    Pavle Joksovic

    01/17/2022, 8:39 AM
    Hey everyone, what do you use for navigation in your desktop apps?
    h
    d
    +3
    6 replies · 6 participants
  • k

    Kebbin

    01/18/2022, 2:20 PM
    Also, is there a way to combine pan and rotate animations? I'm using coroutines to
    animatePanBy
    and
    animateRotateBy
    , but one runs, then the other after the first has finished. So the object pans across, then rotates. I'd like the object to pan while it is rotating. Is this possible somehow? Thanks! Goodnight all.
    z
    6 replies · 2 participants
  • m

    Michael King

    01/18/2022, 2:41 PM
    anyone aware of anyone doing the “make a rogue-like challenge” with compose-desktop / -mpp yet?
    b
    3 replies · 2 participants
  • h

    Hecki

    01/18/2022, 7:23 PM
    Hi, is there still no way of adding global hotkeys?
    b
    o
    +2
    8 replies · 5 participants
  • p

    pavi2410

    01/19/2022, 8:08 AM
    How to achieve window blur like shown in the image?
    a
    j
    +5
    9 replies · 8 participants
  • s

    simon.vergauwen

    01/19/2022, 9:54 AM
    Hey everyone 👋 , I’m (finally) looking into Compose Desktop, and was trying to send a notification from a
    Tray
    . I’m following the tutorial on
    compose-jb
    , but the notification is not showing on my machine. I’m on MacOs BigSur 11.6. However, I can see that the
    trayState.sendNotification
    is correctly being called. My
    build.gradle.kts
    is the one from
    templates/desktop-template
    . https://github.com/JetBrains/compose-jb/blob/master/templates/desktop-template/build.gradle.kts (using 1.0.1 version, not rc2)
    Untitled.cpp
    i
    16 replies · 2 participants
Powered by Linen
Title
s

simon.vergauwen

01/19/2022, 9:54 AM
Hey everyone 👋 , I’m (finally) looking into Compose Desktop, and was trying to send a notification from a
Tray
. I’m following the tutorial on
compose-jb
, but the notification is not showing on my machine. I’m on MacOs BigSur 11.6. However, I can see that the
trayState.sendNotification
is correctly being called. My
build.gradle.kts
is the one from
templates/desktop-template
. https://github.com/JetBrains/compose-jb/blob/master/templates/desktop-template/build.gradle.kts (using 1.0.1 version, not rc2)
Untitled.cpp
i

Igor Demin

01/19/2022, 10:12 AM
macOs should ask for permission to show notifications for
java
(or for your application, when you ship it as native distribution). Try to open macOs notifications, and there should be a request for it, with button "Allow"
s

simon.vergauwen

01/19/2022, 11:35 AM
Hey @Igor Demin, Thanks for replying so quickly. That makes a lot of sense! It doesn’t seem to solve it though 😕 I build a
dmg
, and tried it that way too but that also didn’t work. Although I did get a pop-up requesting if I wanted to allow notifications when I ran the installed
dmg
. I gave both
java
, and the installed
dmg
permission to send notifications.
i

Igor Demin

01/19/2022, 12:06 PM
It seems it is a regression in JDK 16/17 🤔. Can you try it with JDK 15?
👍 2
s

simon.vergauwen

01/19/2022, 1:47 PM
Still not working for me. I have JAVA_HOME pointed to JDK 15, and Gradle/IntelliJ is pointing to JAVA_HOME. Before I was running on JDK 11 though, I just installed JDK 15 today to build the
dmg
. So it could not be 16/17 unless it’s baked into IntelliJ and I missed something (I’m double checking the ticket).
i

Igor Demin

01/19/2022, 2:24 PM
It seems yes, it is nothing to do with JDK 16/17. In my Notifications settings I have disabled notifications for one of the
java
some time ago. Do notifications work in other applications?
Gradle/IntelliJ is pointing to JAVA_HOME.
When we run via IDEA, IDEA uses JDK that is set in the
Settings/.../Gradle
(see the screenshot). But even with Java 11 it should work. If it doesn't work, and all notifications are turned on in the macOs settings, and the other applications are able to send notifications, then it is some rare incompatibility with the notifications mechanism that was implemented by JDK. By the way, IDEA probably also uses this mechanism. Do notifications work in it?
s

simon.vergauwen

01/19/2022, 2:41 PM
I was just thinking that. Any way I can force a notification from IDEA? It’s definitely worked on this machine in the passed, but I want to verify it’s still working properly in my current setup 😅
IntelliJ pops up separately in the notification settings though, but so did the Compose app if I installed it through the
dmg
.
i

Igor Demin

01/19/2022, 3:04 PM
I was able to force a notification in Android Studio Bumblebee, but not in IDEA. 1. open build.gradle 2. add some compilation error into it 3. run Gradle Sync 4. make Android Studio window inactive (Cmd-Tab) 5. wait for the notification about failed sync
s

simon.vergauwen

01/19/2022, 4:47 PM
I got my local Compose Desktop (1.0.1) project to work on JDK 11 & 15. Although I couldn’t get the notification to pop-up in AS 🤕
i

Igor Demin

01/20/2022, 8:46 AM
project to work
With or without notifications?
s

simon.vergauwen

01/20/2022, 8:52 AM
The notifications are working for me now on MacOs BigSur (11.6). At some point I got a notification asking me to allow
java
notifications, and after that it started working. However, I now have 3x
java
in my notification settings and not sure what the difference is. (Different JDK versions ?)
🎉 1
i

Igor Demin

01/20/2022, 8:56 AM
Different JDK versions
Yes, those are different JDK versions. Usually Compose applications ship as
dmg
, and they have their own (single) name in Notification settings.
👌 1
s

simon.vergauwen

01/20/2022, 9:08 AM
Yes, I saw that I get a different app there also when I install it through
packageDmg
. It should also automatically request to allow notification for it, right? Let me also double check that.
View count: 11