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

    Adam Brown

    12/01/2021, 9:20 PM
    @Arkadii Ivanov are there going to be breaking changes to Decompose for this new desktop release?
    a
    • 2
    • 3
  • a

    Adam Brown

    12/01/2021, 10:55 PM
    is there any plans to bring compose desktop to kotlin/native? Would be pretty great to have pure binary exe's, no bundled run times or what ever
    d
    s
    +3
    • 6
    • 8
  • m

    Michael Paus

    12/02/2021, 8:50 AM
    Only a short question concerning compatibility. If I create a jvm library compiled against
    org.jetbrains.compose.desktop:desktop-jvm:1.0.0
    should that library be usable on Android too? At the moment my code just seems to be source compatible but not binary compatible.
    b
    • 2
    • 3
  • e

    Erik Bender

    12/02/2021, 1:36 PM
    hi, I'm thinking about using compose for my next project and have a question: Is it possible to create windows binaries on my linux machine?
    b
    k
    +2
    • 5
    • 9
  • d

    David W

    12/02/2021, 5:28 PM
    Does the preview tool actually work for others? It stopped working for me the instant I split things into multiple Composable methods/files.
    m
    o
    +3
    • 6
    • 15
  • c

    Cody Mikol

    12/03/2021, 3:54 AM
    When will the preview tool actually be live updating? Manually pressing the re-render button every time is a bit tedious. A shortcut would even be great.
    a
    • 2
    • 1
  • d

    darkmoon_uk

    12/03/2021, 4:05 AM
    Alright, I have to ask an awkward but important question: ToolBox App (famously implemented with Compose for Desktop). It checks versions. It downloads new versions. 300MB memory footprint 😱 (according to MacOS). This seems really excessive - where is the allocation going? I know the JVM often 'generously' allocates memory for potential usage (Reserved), but still; platform-native Apps are supposed to have lower resource usage vs, say, an Electron App - Toolbox isn't exactly making the case here. I'm a bit shocked.
    o
    e
    • 3
    • 2
  • d

    darkmoon_uk

    12/03/2021, 4:23 AM
    But even allowing for the JVM abstraction; to use 300MB, for the functionality afforded, feels like it can be significantly optimised.
    a
    o
    • 3
    • 11
  • s

    spierce7

    12/03/2021, 6:57 AM
    I’m seeing stutter with my application in animations the first time those animations are run. Subsequent runs are buttery smooth. I’m assuming this is due to JIT. Are there any recommendations for how to combat the initial animation jank?
    c
    • 2
    • 2
  • g

    Geert

    12/03/2021, 9:04 AM
    Can someone tell me why exitApplication is not working? I created a new project and imported the compose 1.0.0 version
    i
    • 2
    • 2
  • b

    Brian G

    12/03/2021, 4:15 PM
    Is there any way to configure the compose compiler version with Jetbrains Compose? E.g. to use
    androidx.compose.compiler:compiler:1.1.0-beta04
    , while using jetbrains compose 1.0.0 for everything else?
    a
    • 2
    • 1
  • c

    Colton Idle

    12/03/2021, 9:51 PM
    There was a video going around of jetbrains toolbox on youtube where they go into some things about compose, but youtube search is failing me. someone happen to have it handy?
    s
    • 2
    • 2
  • m

    Mak Ho-Cheung

    12/04/2021, 3:56 AM
    Hi! Are there libraries for navigation of desktop?
    s
    s
    • 3
    • 3
  • h

    Hecki

    12/04/2021, 1:13 PM
    Hello, is there a solution for platform wide global hotkey support?
    t
    • 2
    • 1
  • a

    Ayfri

    12/04/2021, 11:13 PM
    Hi, is there a way to make a window resizable only to keep an aspect ratio ?
    k
    • 2
    • 1
  • k

    Kebbin

    12/05/2021, 10:10 AM
    Hello, I'm just trying 1.0.0 and I can't get objects to pick up the mouse wheel (
    .isTertiaryPressed
    ) button anymore. I was using the
    Modifier.pointerInput(Unit)
    in 1.0.0-beta5 with Kotlin 1.5.31, and tried just dropping the Compose
    -beta5
    in my Gradle file to upgrade to the release version. I also tried
    .onPointerEvent(PointerEventType.Press)
    in 1.0.0, but still it doesn't work. The scroll wheel rotation still works, and the Primary button presses OK. When pressing the wheel button while holding the Primary button down first, my debugging will show that the middle button is being pressed OK, but my conditional code is not running.
    i
    • 2
    • 48
  • h

    Humphrey

    12/05/2021, 11:31 AM
    Hi folks. How do I set minimum window size for a resizable window?
    fun main() = application {
        Window(
            onCloseRequest = ::exitApplication,
            title = "Compose for Desktop",
            state = rememberWindowState(width = 600.dp, height = 600.dp)
        )
    I want it to be able to expand but I don't want it to be to small.
    a
    • 2
    • 2
  • r

    Radoslaw Juszczyk

    12/05/2021, 5:02 PM
    hey guys, I am experimenting with VideoPlayer from the compose-jb repo (https://github.com/JetBrains/compose-jb/tree/master/experimental/components/VideoPlayer) It is working just fine if I have VLC installed on my machine. But is there a way to add it to the output binary? I am using
    nativeDistributions
    to generate packages which can be installed. Is there a way to include required native libs in these packages ? So the end user doesnt need to instal VLC separately ?
    👀 7
    n
    • 2
    • 4
  • o

    olonho

    12/06/2021, 10:04 AM
    Compose Multiplatform 1.0 running on Raspberry Pi 400.
    Image from iOS.MOV
    🎉 19
    :compose-multiplatform: 15
    🥧 3
    :kotlin-intensifies: 44
    🤓 4
    m
    f
    a
    • 4
    • 6
  • a

    abbic

    12/06/2021, 10:56 AM
    Hi all, very excited about the release of Compose multiplatform! I've been trying to think about how to apply it for game UIs, it's clearly possible but there are some questions i have about how to implement a style that is significantly different from material (for example a pixelated theme) Continued in thread...
    m
    • 2
    • 11
  • c

    Cody Mikol

    12/06/2021, 6:15 PM
    Is there any API available for listening to gestures? Specifically I’m looking to listen for clicking and dragging over a list of items
    z
    • 2
    • 3
  • k

    Kirill Grouchnikov

    12/07/2021, 4:07 PM
    Excited to announce the first official release of Aurora, a library for building modern, elegant and fast Compose Desktop applications. Find all the documentation on the landing page of the project.
    👏 10
    👏🏻 1
    🖥️ 2
    🎉 34
    👏🏼 2
    👍 4
    :compose-multiplatform: 9
    s
    s
    • 3
    • 4
  • k

    Kirill Grouchnikov

    12/07/2021, 5:33 PM
    And I got a matching pillow to celebrate 🙂
    :feather: 5
    😂 6
    :kotlin-intensifies: 13
    i
    k
    • 3
    • 3
  • d

    Dave Barrett

    12/07/2021, 11:57 PM
    Hi Guys! I'm a newbie to Compose(-Desktop) and I'm trying to build an app that has a pop-up window that takes some user input. For some reason, TextFields that I put in the Popup aren't allowing input. To test, I've put some TextFields in the main screen, and they seem to remain as the target for the keyboard input. This even though when you click on the TextFields on the Popup they respond as you'd expect, get focus, and just don't take keyboard input. The Popups are created as part of the screen over-all, and are composed or not via a state change.
    @Composable
    fun presentDialog() {
       val focusManager = LocalFocusManager.current
       if (showDialog.value) Popup(alignment = Alignment.TopStart, offset = IntOffset(150, 30)) {
          Column(modifier = Modifier.background(Color.White).border(width = 4.dp, color = Colours.person).padding(8.dp)) {
             val name = remember { mutableStateOf("Fred") }
             TextField(
                   value = name.value,
                   onValueChange = { name.value = it },
                   label = { Text("Name") },
                   maxLines = 1,
             )
             Spacer(Modifier.height(3.dp))
             val birthYear = remember { mutableStateOf("") }
             TextField(value = TextFieldValue(birthYear.value), onValueChange = { birthYear.value = it.text }, label = { Text("Birth Year: ") }, enabled = true)
             Row(Modifier.align(Alignment.CenterHorizontally)) {
                Button({
                   println("clicked Cancel")
                   showDialog.value = false
                }) { Text("Cancel") }
                Spacer(Modifier.width(6.dp))
                Button({
                   println("clicked Add")
                   showDialog.value = false
                }) { Text("Add Child") }
             }
          }
       }
    }
    Does anyone know what I'm doing wrong? thx, dave
    i
    • 2
    • 2
  • f

    Fabio

    12/08/2021, 5:28 AM
    congrats on 1.0.0 release 🙂 I'm trying to figure out what this error means:
    No matching variant of androidx.compose.runtime:runtime:1.1.0-beta01 was found. The consumer was configured to find an API of a library compatible with Java 15, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
              - Variant 'releaseVariantReleaseApiPublication' capability androidx.compose.runtime:runtime:1.1.0-beta01 declares an API of a library, and its dependencies declared externally:
                  - Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, preferably in the form of class files
                  - Other compatible attributes:
                      - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                      - Doesn't say anything about its target Java version (required compatibility with Java 15)
    when I copy the sample
    imageView
    into my pre-existing project and run
    build
    I noticed that I can change the version required in the following block, but I still don't understand the nature of the error, and I don't know how to reproduce in
    imageviewer
    folder of the
    compose-jb/examples
    itself, only when copied as a subfolder of my project
    kotlin {
        jvm {
            withJava()
        }
        sourceSets {
            named("jvmMain") {
                dependencies {
                   implementation(compose.desktop.currentOs)
                   implementation(project(":desktop:common"))
                   implementation("androidx.compose.foundation:foundation:1.1.0-beta02")
                   
                }
            }
        }
    }
    o
    • 2
    • 6
  • m

    mcpiroman

    12/08/2021, 12:18 PM
    Can I build CfD locally? If so, from which sources? I don't need Web.
    i
    • 2
    • 10
  • a

    Ali Albaali

    12/08/2021, 3:48 PM
    Is there a way to have a modifier for the
    items
    block? I don't want to set a modifier for the whole
    LazyColumn
    .
    m
    f
    • 3
    • 22
  • s

    spierce7

    12/09/2021, 7:20 AM
    Has anyone made a library that does the same thing as androidx navigation, but can be used with compose multiplatform?
    b
    s
    +2
    • 5
    • 6
  • k

    Kirill Grouchnikov

    12/09/2021, 3:54 PM
    A question for @Igor Demin. I'm using a
    OnGloballyPositionedModifier
    to determine the position of this combobox so that I can place the popup / dropdown window accordingly. But in this mode where the window decorations come from the system, both
    coordinates.localToRoot(Offset.Zero)
    and
    coordinates.localToWindow(Offset.Zero)
    give me the same value of
    Offset(110.0, 99.0)
    . Shouldn't
    localToWindow
    account for the height of the title bar?
    o
    i
    • 3
    • 6
  • c

    Cody Mikol

    12/09/2021, 6:13 PM
    How can I have both a
    Monospace
    and
    SansSerif
    font family set at the same time?
    c
    c
    • 3
    • 10
Powered by Linen
Title
c

Cody Mikol

12/09/2021, 6:13 PM
How can I have both a
Monospace
and
SansSerif
font family set at the same time?
c

Casey Brooks

12/10/2021, 3:47 PM
As in, the two different font families used for different portions of the same
Text()
composable? You can use
AnnotatedString
with the builder DSL, or Thistle markup to abstract away that relatively-verbose API.
c

Cody Mikol

12/10/2021, 3:49 PM
Not exactly, I want a font that is both Sans Serif and Monospace
I’m rewriting a tool for authoring git commits and the diff viewer I’m writing needs to be in Monospace, but also needs to not have serifs so it is easier on the eyes
c

Casey Brooks

12/10/2021, 3:53 PM
That really doesn't make sense, as far as Font Families go. You can't just compose two fonts into one, fonts are much more complicated than that. You probably want to just find and use a custom font, Google Fonts is great resource for finding free fonts
c

Cody Mikol

12/10/2021, 3:58 PM
Thanks Casey 🙂
This will be my plan for tonight
👍 1
c

Chris Sinco [G]

12/10/2021, 9:42 PM
Yes, I’d advise using monospace fonts for the code, and then sans-serif for the UI font. They can co-exist in a UI, but will be really jarring if used in the same string token (alternating character fonts).
c

Cody Mikol

12/10/2021, 9:46 PM
See my image Chris, I want a monospaced font without serifs in my diff viewer, not alternating font styles
👍 1
c

Chris Sinco [G]

12/10/2021, 10:15 PM
Gotcha. I would maybe start here to find a monospace, sans serif font: https://www.programmingfonts.org/ Then once you find one you like, see if the font files are available for use, e.g. on Google Fonts.
Though browsing through that site, it’s hard to find a monospace font that is devoid of any serifs 🤷
View count: 1