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

    darkmoon_uk

    09/07/2021, 6:12 AM
    @xxfast This is a weak area at the moment, the limitations had me frustrated for some time. Here's what you need to do: • First, make sure you are only defining
    @Preview
    s from your top-level Application modules, for either Android or Desktop. You can try to do it from library projects or submodules, and some stuff might work if you import extra dependencies; but it's unsupported and gets ugly (ref: this thread). • Secondly; import the
    compose.preview
    and
    compose.uitooling
    dependencies for Android and Desktop as you would expect to; but for the Android top-level project you must apply a Gradle Dependency Substitution to 'deeply' replace all the JetBrains preview dependencies with the Google ones, for it to work with Android Studio properly. By 'deeply', I mean the replacement will affect all transitive dependencies as well. Just directly depending on the Google one won't work; you'll get duplicate class errors. I will fetch you a code snippet for the dependency substitution...
    👍 2
    ✅ 1
    x
    c
    i
    • 4
    • 27
  • a

    Ayfri

    09/07/2021, 12:27 PM
    Hi, I have a Text that is very long and I want to add a scrollbar but when I do this
    val stateVertical = rememberScrollState(0)
    Box(
        modifier = Modifier.verticalScroll(stateVertical)
    ) {
        Text(myVeryLongText)
    
        VerticalScrollbar(
    			modifier = Modifier.align(Alignment.CenterEnd).fillMaxHeight(),
    			adapter = rememberScrollbarAdapter(stateVertical)
    	)
    }
    I get this error :
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Can't represent a size of 1073741952 in Constraints
    	at androidx.compose.ui.unit.Constraints$Companion.bitsNeedForSize(Constraints.kt:408)
    ✅ 1
    i
    • 2
    • 2
  • s

    Slackbot

    09/09/2021, 11:34 AM
    This message was deleted.
    f
    f
    a
    • 4
    • 30
  • j

    Javier

    09/10/2021, 8:54 AM
    Is there a common function to load local resources or I have to create an expect actual?
    i
    m
    • 3
    • 4
  • b

    Big Chungus

    09/11/2021, 11:00 AM
    Are there any plans to publish compose-mpp on maven central?
    👀 4
    x
    i
    s
    • 4
    • 3
  • k

    Kirill Grouchnikov

    09/11/2021, 9:27 PM
    Build
    1.0.0-alpha4-build344
    is out with new kotlin-based bindings to Skia, including Perlin noise and turbulence shaders 🙂
    🙌 9
    🙌🏼 1
    🎉 7
    • 1
    • 1
  • r

    Rafs

    09/11/2021, 9:30 PM
    Is Accompanist pager available for compose desktop? I've been trying to import it but I keep getting dependency unresolved errors even though I have all the repositories set up properly.
    k
    m
    • 3
    • 4
  • t

    Tristan B.

    09/12/2021, 9:54 AM
    Is there a way to get which mouse button was clicked with
    Modifier.pointerInput
    ? I have a canvas and I need to know where the click happened and which button was used.
    • 1
    • 1
  • m

    Mitchell Syer

    09/13/2021, 1:00 AM
    Im getting a new error that crashes my compose window and makes it stop rendering on build 344. It worked fine on previous builds. I added a file with the stacktrace in the thread
    k
    j
    d
    • 4
    • 17
  • a

    Alonso Ato Neyra

    09/13/2021, 5:22 AM
    I tried this but the textfield show the text anyway
    a
    • 2
    • 2
  • d

    darkmoon_uk

    09/13/2021, 12:29 PM
    I've noticed that the new Window API in Compose for Desktop appears to break animations in my App 😱, or at least make them very flaky. I have an
    AnimatedContent
    driven slide transition between master/detail views. When starting the app with the old
    Window { <content> }
    function, it is reliable and silky smooth 👌. Now when starting with
    application { Window { <content> } }
    the animation works maybe 1 in every 10 triggers. The content is all the same... Is this a known issue; any likely causes? Using
    1.0.0-alpha4-build344
    i
    • 2
    • 5
  • l

    luen

    09/13/2021, 4:35 PM
    Why the console displays this: Failed to create DirectX12 device.
    j
    • 2
    • 3
  • a

    Ayfri

    09/14/2021, 7:10 AM
    Hi, how can I have a Box fixed to the bottom while having a LazyColumn above while having both in a Column ?
    d
    d
    • 3
    • 6
  • a

    Ayfri

    09/14/2021, 7:56 AM
    Hi again, I have another question, why does the Icons object don't contains all the icons of the Material Icons ? (this : https://fonts.google.com/icons)
    i
    • 2
    • 2
  • f

    Frank

    09/14/2021, 8:55 AM
    Hi! Is there a way to find out what position e.g. a Box has in regards to it’s parent?
    i
    • 2
    • 2
  • r

    remco

    09/14/2021, 10:18 AM
    Does anyone else have difficulty to see crash logs when developing for and on mac? Whenever there is a runtime exception the app just crashes and disappears without anything in the logs. I’ve tried to set default uncaught exception handlers but those don’t seem to trigger
    o
    k
    j
    • 4
    • 16
  • b

    burnoo

    09/14/2021, 6:02 PM
    I’d like to introduce you to cokoin - a Dependency Injection library for Compose Multiplatform (simple Koin Wrapper). Please check it out and let me know your feedback ☺️ https://github.com/burnoo/cokoin
    👍 6
    b
    • 2
    • 1
  • a

    Alonso Ato Neyra

    09/15/2021, 2:16 AM
    Hi everyone, I tried to use the id("kotlin-parcelize") but doesnt work. The log says Plugin [id: 'kotlin-parcelize'] was not found in any of the following sources: Any idea how to solve it?
    a
    e
    +2
    • 5
    • 12
  • a

    Aaron Yoder

    09/16/2021, 4:12 PM
    Getting
    UnsupportedOperationException
    when trying to set a
    Menu
    Item
    to
    enabled=false
    while using an icon. Happens on both
    1.0.0-alpha3
    and
    1.0.0-alpha4-build348
    . More info in thread.
    i
    • 2
    • 6
  • k

    Kirill Grouchnikov

    09/16/2021, 4:16 PM
    Starting to play with custom Skia shaders
    💪 5
    😲 18
    👏 10
    s
    s
    +2
    • 5
    • 9
  • k

    Kirill Grouchnikov

    09/16/2021, 7:11 PM
    And now with dynamic real-time updates to the shader
    skia-shaders.mov
    👏🏼 2
    :mind-blown: 10
    👏 18
    👏🏻 1
    r
    j
    +2
    • 5
    • 10
  • u

    uli

    09/16/2021, 8:52 PM
    Hi, is it possible (i.e. has someone tried) to compile a compose desktop application with GraalVM to native executable?
    l
    s
    +2
    • 5
    • 16
  • f

    Frank

    09/17/2021, 7:18 AM
    Hi! When I get the width of e.g. a Box , I get for example 1600, I guess this is in Pixel and not in DP?
    i
    • 2
    • 1
  • s

    seb

    09/17/2021, 9:59 AM
    Isn't the offset in DP tho? Or am I remembering it wrong?
    f
    u
    z
    • 4
    • 4
  • a

    atsushieno

    09/17/2021, 7:30 PM
    I'm trying to build an MPP library which provides Composable functions that differentiate implementation using expect/actual on Desktop and Android, but I'm suffered from
    java.lang.NoSuchMethodError: No static method: (mymethod)
    at run time. Is it that compose compiler plugin does not resolve expect/actual stuff?
    a
    r
    • 3
    • 5
  • y

    Yan Pujante

    09/18/2021, 5:18 PM
    I would like to build an interface like in the screenshot where you have a palette of components (buttons, sliders, etc...) that you can drag and drop on a canvas. Once there you can move them around (again drag and drop involved). Is this kind of interface possible with compose desktop? Would there be some example of such a UI somewhere? Couldn't really find any information on drag and drop in the first place for example. Thanks.
    r
    • 2
    • 1
  • l

    Lukas K-G

    09/21/2021, 4:24 AM
    I have a dependency that requires a specific Kotlin version while compose requires a different one. Is there a way to solve this or did I just loose the dependency lottery? 🤔
    k
    m
    +2
    • 5
    • 15
  • f

    Frank

    09/21/2021, 4:55 PM
    Hi! I want to implement a kind of image gallery like shown in the picture here: There should be a row ( Gallery Row ) which is a child of the “Row Background” and the Gallery Row should be wider than it’s parent. The idea is by changing the xOffset of the GalleryRow different parts of it become visible/hidden. The GalleryRow should contain Box(es) which show some images. How can I make the GalleryRow bigger than it’s parent ( Row Background ) so it’ outer left and outer right part is not visible?
    • 1
    • 1
  • r

    rcd27

    09/21/2021, 9:53 PM
    Am I able to run Compose
    windows
    distributable from console to watch the logs?
    m
    • 2
    • 2
  • c

    Cristian Rosa

    09/22/2021, 12:13 AM
    Hi folks, how do I set minimum size of my compose windows? I’m able to set the initial value, but being the windows resizable, I would like to set a lower value for it to avoid screw everything out!
    👀 1
    o
    • 2
    • 2
Powered by Linen
Title
c

Cristian Rosa

09/22/2021, 12:13 AM
Hi folks, how do I set minimum size of my compose windows? I’m able to set the initial value, but being the windows resizable, I would like to set a lower value for it to avoid screw everything out!
👀 1
o

olonho

09/22/2021, 5:15 AM
Did you check https://github.com/JetBrains/compose-jb/tree/master/tutorials/Window_API_new#listening-the-state-of-the-window?
c

Cristian Rosa

09/22/2021, 9:22 AM
Well, I had a quick look and didn’t really find nothing that fits my needs. There is a way to read current windows size
LaunchedEffect(state) {
snapshotFlow { state.size }
.onEach(::onWindowResize)
.launchIn(this)
private fun onWindowResize(size: WindowSize) {
println("onWindowResize $size")
}
but then… how to stop (don’t allow) to windows be resized only if some condition are matched? My Goal ideally would be: • Compose start (at minimum size possible) • Allow resize only to higher value • Allow future resize down but only until “minimum values” are reached again
View count: 15