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

    Yofou

    02/16/2021, 5:47 PM
    Back again, is it possible to either replace or turn off the ripple effect on a clickable?
    k
    • 2
    • 2
  • y

    Yan Pujante

    02/16/2021, 6:48 PM
    I am seeing this exception (seems to depend on which build I am using)
    Cause: cannot assign instance of java.util.Collections$EmptyList to field java.lang.StackTraceElement.moduleVersion of type java.lang.String in instance of java.lang.StackTraceElement
    Any idea? I am using java15 / kotlin 1.4.30 / compose 0.3.0-build154. Is this combination the problem?
    k
    i
    • 3
    • 12
  • y

    Yan Pujante

    02/16/2021, 7:15 PM
    I would like to implement a "progress bar" in the form of a circle with a certain width to it. It starts full grey and then the fill color goes around (like a clock). In svg I would draw an arc. I have no idea how to do this in this model. I guess I need a way to draw on the canvas somehow...
    i
    • 2
    • 3
  • e

    eygraber

    02/17/2021, 7:50 AM
    I originally asked in #compose but linking here because I realize keyboard shortcuts might be more applicable on desktop (also because no one responded 😒miling_face_with_tear:) I posted some of my code in a snippet in a thread on that message. https://kotlinlang.slack.com/archives/CJLTWPH7S/p1613446388062200?thread_ts=1613446388.062200&cid=CJLTWPH7S
    j
    o
    • 3
    • 3
  • y

    Yan Pujante

    02/17/2021, 2:24 PM
    Is there a timer I can run that would run in the UI thread only (equivalent to JS / settimeout)? Or can I post a message to the UI message queue? How do I do that? I am just worried that modifying the state from another thread is never a good idea in UI development.
    b
    i
    j
    • 4
    • 8
  • g

    gbaldeck

    02/17/2021, 2:32 PM
    Why is the defaultFactory parameter all of a sudden required in compositonLocalOf as of build 154? It has made it difficult to dynamically provide a current value for the compositionLocal
    a
    k
    • 3
    • 5
  • r

    rsktash

    02/17/2021, 6:00 PM
    SOLVED: Hi. I’m having this error after updating to latest version and adding activity compose dependency to android app module.
    androidx.activity:activity-compose:1.3.0-alpha02
    It’s a multi-platform project with common UI for both android and desktop
    i
    • 2
    • 2
  • d

    Dirk Hoffmann

    02/17/2021, 9:02 PM
    What is/are the recommended replacements for
    ClickableText
    ?
    k
    • 2
    • 7
  • t

    theapache64

    02/18/2021, 3:05 PM
    Any updates on this? https://github.com/JetBrains/compose-jb/issues/275
    j
    • 2
    • 4
  • t

    TheOnlyTails

    02/19/2021, 10:09 AM
    Hi! I'm getting started with compose, and I got this error on `Window`:
    Window(String = ..., IntSize = ..., IntOffset = ..., Boolean = ..., BufferedImage? = ..., MenuBar? = ..., Boolean = ..., Boolean = ..., WindowEvents = ..., (() -> Unit)? = ..., () -> Unit = ...): Unit' is only available since Kotlin 1.4.30 and cannot be used in Kotlin 1.4
    This is my build.gradle.kts:
    import org.jetbrains.compose.compose
    import org.jetbrains.compose.desktop.application.dsl.TargetFormat
    
    plugins {
    	kotlin("jvm") version "1.4.30"
    	id("org.jetbrains.compose") version "0.3.0-build153"
    }
    
    val mavenGroup = "com.theonlytails.jetpackcompose"
    
    group = mavenGroup
    
    repositories {
    	jcenter()
    	maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
    }
    
    dependencies {
    	implementation(compose.desktop.currentOs)
    }
    
    compose.desktop {
    	application {
    		mainClass = "$mavenGroup.MainKt"
    
    		nativeDistributions {
    			targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
    			packageName = mavenGroup
    		}
    	}
    }
    I have no idea what's wrong, or how to solve it. Looking at the list of dependencies, I can see kotlin 1.4.30 is there.
    j
    d
    +2
    • 5
    • 24
  • t

    TheMrCodes

    02/19/2021, 11:02 PM
    Wrote a small tab switcher component for learning to better use compose for functionality across multiple composables. Would love to get some feedback of what could be improved or handeled differently. Thanks for your time in advance 🤗 https://github.com/TheMrCodes/Compose-Tab-Component
    :kotlin-intensifies: 7
    🎉 13
    🔥 5
    t
    • 2
    • 1
  • a

    Adam Brown

    02/20/2021, 6:05 PM
    Hi there, I'm just getting started with the Compose Desktop & Mobile project template. I've noticed IntelliJ seems to have trouble automatically finding imports for things, is that common? For instance, it didn't seem to know about
    TextFieldValue
    (as in I wasn't able to alt+enter to automatically add the import) but if I manually add the import, than it's fine.
    k
    • 2
    • 6
  • a

    Adam Brown

    02/20/2021, 6:07 PM
    My second question is, I don't see any dependency declarations for the various android compose libraries, are these being automagically imported for me? If so by what? And which ones exactly? I wanted to use the compose navigation library, and I don't know if it's being automatically imported for me by something, or if I need to include it my self.
    t
    a
    s
    • 4
    • 19
  • a

    Adam Brown

    02/21/2021, 3:02 AM
    I have the desktop client building and running now, however when I go to build the Android client, I get a raft of duplicate class errors. I've been poking around at the dependencies for a while but can't make any progress, anyone run into this before? this repo: https://github.com/Wavesonics/notional
    Duplicate class androidx.compose.animation.AlignmentBasedSizeAnimation$animateTo$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AlignmentBasedSizeAnimation$offset$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimStates found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimatedVisibilityKt found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibility$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibility$2 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibility$3 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$2 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$2$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$3 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
      Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$animations$1$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
    :thread-please: 1
    s
    k
    +3
    • 6
    • 15
  • o

    olonho

    02/21/2021, 10:34 AM
    Dear Compose fans! We’re preparing Milestone 3 release, and would love to get some feedback on our candidate build. So feel free to test
    0.3.0-rc1
    build and give your feedback. https://github.com/JetBrains/compose-jb/blob/master/CHANGELOG.md#m3 contains list of changes in this build.
    🎉 19
    👍 5
    a
    j
    +2
    • 5
    • 5
  • y

    Yan Pujante

    02/21/2021, 2:14 PM
    Alignment issue with the following snippet:
    @Composable
    fun TestLayout() {
      Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.fillMaxWidth()) {
        Text("line1")
        Divider()
        Box(modifier = Modifier.border(width = 1.dp, color = Color.Blue), contentAlignment = Alignment.Center) {
          Text("0", style = MaterialTheme.typography.h1)
          CircularProgressIndicator(
            progress = 1.0F,
            strokeWidth = 10.dp,
            modifier = Modifier.size(100.dp, 100.dp)
          )
        }
        Divider()
        Text("line3")
      }
    }
    This generates the following rendering: 1. why is the circle sticking out of the box? 2. why is the 0 not centered (which is what I am trying to do)?
    i
    • 2
    • 1
  • o

    orangy

    02/21/2021, 5:13 PM
    I’ve got this exception out of nowhere as soon as I added
    Popup
    to some UI. Luckily it happens if there are 2
    Popup
    elements in the composition hierarchy, but not sure.
    Untitled
    i
    • 2
    • 7
  • o

    orangy

    02/21/2021, 5:25 PM
    I’m trying to use
    Popup
    , but after adding it to composition hierarchy
    onDismissRequest
    never gets called and mouse never registers clicks anywhere else (but the application is running and UI keeps updating).
    i
    • 2
    • 14
  • s

    Shabinder Singh

    02/21/2021, 8:41 PM
    Hello Guys , I am building a desktop app , and I want to ship FFmpeg libs within app , as there are different different libs for Mac,Windows,etc , how would you suggest I accomplish this?
    j
    k
    • 3
    • 4
  • o

    orangy

    02/22/2021, 12:13 PM
    How do I load a
    Font
    from JVM resources? Can’t find anything…
    • 1
    • 1
  • r

    rsktash

    02/22/2021, 3:59 PM
    https://github.com/JetBrains/compose-jb/releases/tag/0.3.0
    🤫 1
    👍 3
    🎉 18
    🤯 5
    :party-parrot: 4
    :jetpack-compose: 2
    t
    t
    • 3
    • 2
  • d

    darkmoon_uk

    02/23/2021, 2:19 AM
    What does it take to support a Desktop Compose Application on Linux? Specifically; could a Desktop Compose Linux App be run full-screen on a Framebuffer + Keyboard and Mouse inputs without the need for e.g. the X Windowing environment? I'm interested in having a Compose App run on an 'embedded' Linux device e.g. Raspberry Pi with touchscreen.
    j
    o
    +2
    • 5
    • 10
  • l

    Lazard

    02/23/2021, 11:52 AM
    I tried to create a new Compose Desktop project to see if the laggy UI on Linux was fixed running the project fails with this error : see thread However if I set the env var
    SKIKO_RENDER_API
    to
    SOFTWARE
    it works just fine so it's definitely an OpenGL problem. Anyone has the same problem ? I'm on Ubuntu 18.04.5 LTS
    o
    • 2
    • 4
  • y

    Yan Pujante

    02/23/2021, 5:07 PM
    I have essentially copy/pasted the svg example from SVG support in the M3 milestone blog post, using my own svg file (which opens fine everywhere) and getting this:
    Image(
            painter = svgResource("images/logo.svg"),
            contentDescription = "Logo",
            modifier = Modifier.fillMaxSize(),
          )
    
    
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Size is unspecified
    	at androidx.compose.ui.geometry.Size.getWidth-impl(Size.kt:48)
    	at androidx.compose.ui.geometry.Size.times-7Ah8Wj8(Size.kt:111)
    	at androidx.compose.ui.res.SVGPainter.getIntrinsicSize-NH-jbRc(DesktopSvgResources.desktop.kt:80)
    	at androidx.compose.ui.draw.PainterModifier.getUseIntrinsicSize(PainterModifier.kt:104)
    	at androidx.compose.ui.draw.PainterModifier.modifyConstraints-ZezNO4M(PainterModifier.kt:202)
    i
    • 2
    • 3
  • m

    Marcin Wisniowski

    02/23/2021, 6:00 PM
    Hello, is there any guidance on how to actually package/release a Compose Desktop app? I mean how to build executables for Linux/macOS/Windows end users can run.
    👍 2
    j
    o
    • 3
    • 3
  • s

    samuel

    02/24/2021, 6:19 PM
    not sure where to look for this, but does anyone know how to load images from
    resources
    folder when developing an intellij plugin? I’ve tried
    imageResource
    and
    makeFromEncoded
    but each of these methods fails to find the image resource
    b
    • 2
    • 6
  • e

    eygraber

    02/24/2021, 10:39 PM
    Can someone with a Windows or Mac OS check if this issue occurs for them - https://github.com/JetBrains/compose-jb/issues/419
    b
    • 2
    • 1
  • a

    abbic

    02/25/2021, 11:10 AM
    hi all! wondering if there’s a roadmap document anywhere?
    p
    j
    o
    • 4
    • 13
  • t

    TheMrCodes

    02/25/2021, 2:14 PM
    Is there a way to prevent a mouse click event of going throw the composable and triggering the click event of the composable underneath (in a Box)?
    t
    • 2
    • 3
  • r

    rsktash

    02/25/2021, 2:17 PM
    Hi. What media playing library we can use in desktop compose app?
    d
    • 2
    • 11
Powered by Linen
Title
r

rsktash

02/25/2021, 2:17 PM
Hi. What media playing library we can use in desktop compose app?
I found javax AudioSystem. I’ll try it
d

Dominaezzz

02/25/2021, 2:38 PM
Doesn't work for arbitrary audio codecs iirc.
r

rsktash

02/25/2021, 2:40 PM
What is arbitrary audio codec?
d

Dominaezzz

02/25/2021, 2:52 PM
MP3, aac, etc. It only supports wav.
r

rsktash

02/25/2021, 2:54 PM
hmm. Can we use java FX MediaPlayer?
https://mvnrepository.com/artifact/org.openjfx/javafx-media/16-ea+7
d

Dominaezzz

02/25/2021, 2:55 PM
Haven't tried it yet. You'll have to pull in library for it.
Yeah that one.
r

rsktash

02/25/2021, 3:23 PM
What a lib is this. There isn’t any code except meta-inf
d

Dominaezzz

02/25/2021, 4:13 PM
Strange
r

rsktash

02/25/2021, 4:36 PM
I’ll try https://github.com/korlibs/korau
View count: 6