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

    Kirill Grouchnikov

    11/19/2020, 3:19 PM
    :no_red: 4
    o
    z
    j
    • 4
    • 5
  • m

    morganbovi

    11/19/2020, 10:23 PM
    Is it possible to produce a desktop .deb package for ARM cpus (raspberrypi)?
    j
    i
    • 3
    • 5
  • k

    Kirill Grouchnikov

    11/20/2020, 1:32 AM
    For anybody interested in playing with procedurally generated textures in Compose Desktop, take a look at https://github.com/kirill-grouchnikov/mosaic/blob/master/components/src/desktopMain/kotlin/org/pushingpixels/mosaic/utils/NoiseFactory.kt#L61 (generates an int array of pixels, applies a convolution and then converts the int array to a byte array to create a Skija / Skia bitmap out of it). Convolution is over at https://github.com/kirill-grouchnikov/mosaic/blob/master/components/src/desktopMain/kotlin/org/pushingpixels/mosaic/utils/ConvolutionUtils.kt#L46 and a more complete example of reading pixels from an image, applying a colorization pass and then creating another image out of it at https://github.com/kirill-grouchnikov/mosaic/blob/master/components/src/desktopMain/kotlin/org/pushingpixels/mosaic/painter/decoration/ImageWrapperDecorationPainter.kt#L164
    😮 1
    🎉 5
    👍 2
    • 1
    • 1
  • v

    Vadim Kapustin

    11/20/2020, 8:33 AM
    I read @Arkadii Ivanov's article Fully cross-platform Kotlin applications and liked the idea of wrapping Composable in components. This is probably more familiar to me... So, I want to ask how ideologically correct this approach is and what pitfalls await me on this path? For example, I converted the interface Component to an open class (for add logging of rendering and may be later other service information). And I make derived abstract class to make it easier to create child Windows:
    abstract class DialogComponent(
        componentContext: ComponentContext,
        name: String,
    ) : Component(componentContext, name) {
        private val _opened = mutableStateOf(false)
        protected val _title = mutableStateOf(name)
    
        fun open() { _opened.value = true }
        fun close() { _opened.value = false }
    
        @Composable
        override fun render() {
            if (!_opened.value) return
            super.render()
            Dialog(_title.value, onDismissEvent = ::close
            ) {
                content()
            }
        }
    
        @Composable
        abstract fun content()
    }
    Now I can create a derived components with the implementation of content:
    class LoginDialog(
        componentContext: ComponentContext,
        private val onLogged: (Operator) -> Unit
    ) : DialogComponent(componentContext, "Login") {
        val password = remember { mutableStateOf("") }
        // ...
        @Composable
        override fun content() {
            // ...
            Button(
                onClick = {
                    if (controller.authorize(operator, password.value))
                        onLogged(operator)
                        password.value = ""
                        close()
                    }
                }
            ) {
                Text("Login")
            }
        }
    }
    Then I can call window rendering in the root component:
    //...
        private val dialog = LoginDialog(componentContext,onAuthorize)
    
        @Composable
        override fun render() {
            // ...
            Button(onClick = dialog::open) { Text("Login") }
            dialog.render()
            // ...
        }
    So, what do you think about this approach?
    j
    a
    • 3
    • 4
  • g

    Glen

    11/20/2020, 9:01 AM
    I was just thinking: Since Skia is a C/C++ library, is it possible to use Kotlin/Native to create Kotlin bindings for it and use it as a multiplatform library for iOS?
    f
    t
    l
    • 4
    • 11
  • s

    saket

    11/20/2020, 5:42 PM
    why would you assume reactive frameworks to be slow?
    s
    j
    • 3
    • 4
  • s

    spierce7

    11/20/2020, 5:46 PM
    My goal isn’t to devolve into a discussion about reactive framework performance. My core question is, “Is there a non-reactive layer that we can jump into, similar to the render object layer in Flutter?”
    j
    z
    • 3
    • 7
  • k

    Kirill Grouchnikov

    11/20/2020, 5:49 PM
    It's weird to be talking about game rendering engines in a channel that is A) Compose (reactive framework) and B) Desktop (as in writing "traditional" desktop apps)
    s
    • 2
    • 3
  • p

    pakoito

    11/20/2020, 5:50 PM
    I’m testing Compose for Desktop in OSX High Sierra, 10.13, and I’m finding a linking issue
    > Task :desktop:run FAILED
    dyld: lazy symbol binding failed: Symbol not found: _objc_alloc_init
      Referenced from: /Users/paco/.skiko/b9408918342fa3c0511232e1869d6b3885a57b45a57800586f357a2461785a4e/libskiko.dylib (which was built for Mac OS X 10.15)
      Expected in: /usr/lib/libobjc.A.dylib
    Are there any plans to provide binaries that are backwards compatible, or will Big Sur be the baseline for C4D apps?
    k
    o
    +2
    • 5
    • 22
  • t

    Timo Drick

    11/21/2020, 12:32 AM
    It would be nice if we could bunlde a compose-desktop app as fat-jar (Jar which contains all dependency) I know that there is this nativeDistributions support in the compose.desktop plugin. But it generates very complicated install packages (Even for small projects over 100mb). Are there any plans to support this?
    s
    o
    +2
    • 5
    • 13
  • j

    John O'Reilly

    11/21/2020, 11:12 AM
    Has anyone managed to show a map in a Compose for Desktop app?
    • 1
    • 4
  • j

    John O'Reilly

    11/21/2020, 3:18 PM
    Looks like
    launchInComposition
    is no longer available in latest build?
    d
    h
    • 3
    • 3
  • d

    Dominaezzz

    11/21/2020, 10:23 PM
    Anyone tried using
    Popup { ... }
    yet? When I do it, the popup renders in place, like in a stack view or something.
    • 1
    • 1
  • a

    alilosoft

    11/21/2020, 11:07 PM
    Hey, I know that compose is in alpha, but I want to use it in a personal project for a basic Cart & Inventory app. Is that possible with the current state of the project? Can I use swing components if I need some use case that is not supported yet?
    c
    i
    • 3
    • 2
  • o

    Oussama Haff.

    11/22/2020, 10:23 AM
    Hello 👋 is it possible to use Compose Desktop in a separate Gradle module in Android Studio 4.2-Canary16 ? I can’t find a way to activate the use of the new kotlin compiler backend for compose desktop like in Android Module via
    useIR = true
    i
    • 2
    • 4
  • j

    jordan29.04.1197

    11/22/2020, 7:25 PM
    Wrong behaviour for TextField inside Row
    @Composable
    fun marketView(market: Market) {
    
        @Composable
        fun marketParamRow(children: @Composable RowScope.() -> Unit) {
            Row(
                    horizontalArrangement = Arrangement.SpaceBetween,
                    modifier = Modifier
                            .fillMaxWidth()
                            .padding(horizontal = 4.dp),
                    children = children)
        }
    
        Column(modifier = Modifier
                .fillMaxWidth()
                .padding(8.dp)) {
            marketParamRow { 
                val resultKindStage = remember { mutableStateOf(market.resultKind?.toString() ?: "") }
    
                Text("resultKind")
                TextField(
                        modifier = Modifier.width(50.dp),
                        maxLines = 1,
                        value = resultKindStage.value,
                        onValueChange = {
                            resultKindStage.value = it
                        },
                )
            }
            marketParamRow {
                Text("marketType")
                Text(market.marketType.toString())
            }
            marketParamRow {
                Text("period")
                Text(market.period.toString())
            }
            marketParamRow {
                Text("subPeriod")
                Text(market.subPeriod.toString())
            }
        }
    }
    Does somebody can help me?
    m
    • 2
    • 2
  • s

    spierce7

    11/23/2020, 12:44 AM
    All my text is selectable in my desktop app. How would I make text non-selectable
    e
    o
    • 3
    • 6
  • s

    spierce7

    11/23/2020, 3:34 AM
    Has anyone found a clever way to share image assets between Desktop and Android?
    b
    i
    • 3
    • 4
  • a

    Ananiya

    11/23/2020, 1:51 PM
    Is it safe to use Picasso for image loading in " jp comose for desktop " since it runs on Android architecture
    🇳🇴 5
    s
    j
    g
    • 4
    • 9
  • x

    xetra11

    11/23/2020, 4:59 PM
    🙋 Anwesend! Wer ist sonst noch hier?
    k
    a
    c
    • 4
    • 4
  • x

    xetra11

    11/23/2020, 5:05 PM
    I'd love to know if it is possible with Jetpack Compose for Desktop to be developed in Android Studio and use the
    @Preview
    annotation for UI preview? I am completly new to Compose and that stuff. Using Kotlin only for Web Backend Engineering
    j
    j
    +2
    • 5
    • 13
  • k

    Kirill Grouchnikov

    11/23/2020, 6:14 PM
    Looks like build128 requires Kotlin 1.4.20. Using 1.4.10 shows some kind of an IR incompatible error message
    s
    s
    d
    • 4
    • 3
  • s

    spierce7

    11/23/2020, 6:58 PM
    Are there any tools to collect and aggregate crashes from production jvm applications (similar to crashlytics for mobile)?
    j
    • 2
    • 2
  • o

    Oussama Haff.

    11/23/2020, 8:16 PM
    I have come to a conclusion that sharing a gradle module having pure Kotlin Composables between an android app module and a desktop app module is actually impossible (because they use different artifacts of Compose), but copying the same code will work correctly for each module. Please tell me I’m wrong : /
    j
    o
    s
    • 4
    • 6
  • x

    xetra11

    11/23/2020, 9:42 PM
    is there already something like data tables?
    k
    • 2
    • 7
  • s

    spierce7

    11/24/2020, 12:18 AM
    Is there any way to deal with image resolution for screen DPI inside desktop compose yet? Images show larger on my 1080p monitor vs my laptop retina screen.
    j
    t
    s
    • 4
    • 7
  • x

    xetra11

    11/24/2020, 11:58 AM
    @Composable
    fun CharacterModuleView() {
        Button(
            onClick = {
                LOG().info("clicked")
            }
        ){
            Text("Import Characters")
        }
    }
    When clicking the button I'd like to open a new window like a dialog-popup to ask the user for a file path. I tried to put a "Window" in there which did not work. However there is a way to do that I assume eh?
    c
    i
    • 3
    • 5
  • k

    Kirill Grouchnikov

    11/24/2020, 6:51 PM
    Is there some kind of a timing threshold on
    clickable
    and
    toggleable
    modifiers? When I do the "regular" down/up mouse click, I see the matching
    onClick
    and
    onValueChange
    getting fired. But if I do a mouse down, wait for a second or so, and then do a mouse up, those lambdas do not get fired.
    i
    • 2
    • 2
  • k

    Kirill Grouchnikov

    11/24/2020, 6:52 PM
    If there's any long-press logic in there, it should only block the regular clicks if it is configured to do something - like in pretty much every desktop app that I just tested on my mac
    o
    • 2
    • 2
  • m

    Martin Nowosad

    11/25/2020, 9:02 AM
    Hi, how do I get the compose intelli J plugin? I can’t find it
    x
    • 2
    • 8
Powered by Linen
Title
m

Martin Nowosad

11/25/2020, 9:02 AM
Hi, how do I get the compose intelli J plugin? I can’t find it
x

xetra11

11/25/2020, 9:21 AM
IntelliJ Plugin? I think you mean the Gradle Plugin:
plugins {
    kotlin("jvm") version "1.4.20"
    id("org.jetbrains.compose") version "0.2.0-build128"
}
This will bring in the dependency and those nice gradle tasks to build for different OS'
m

Martin Nowosad

11/25/2020, 9:43 AM
there’s an intelli J plugin
I found it, you need the newest intelli j
actually its the early accessor version
x

xetra11

11/25/2020, 10:15 AM
Ah well I think this is just the new version of the "Kotlin" Plugin which I do not consider a plugin anymore but a built in feature 😄
😀 1
m

Martin Nowosad

11/25/2020, 10:17 AM
😛
View count: 3