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

    03/22/2022, 5:28 PM
    Playing with animatable render effects. Demo code starts here.
    blur-filter.mov
    r
    j
    k
    • 4
    • 12
  • s

    Sean Proctor

    03/22/2022, 11:08 PM
    Is it possible to have the CfD installer associate a custom URI protocol with the app? I'm trying to implement an oauth/oidc flow and that seems to be the most appropriate way to get the response from the browser.
    s
    s
    • 3
    • 8
  • p

    Pavle Joksovic

    03/23/2022, 1:48 PM
    What do you use for crash reports, is there a Crashlytics equivalent?
    b
    a
    • 3
    • 3
  • l

    Leon

    03/23/2022, 2:34 PM
    Is there any way that we can customize the WixToolset configuration when packaging an application. I would like to write some registry keys to support custom URIs for a Windows Application.
    s
    • 2
    • 1
  • d

    Dra

    03/23/2022, 3:56 PM
    Hey everyone! So I'm making a game for classes, I'm currently in a pretty advanced state, the last thing I'm lacking is a simple UI, as my whole project is in Kotlin, I thought that going with Compose was the best way to go... As I don't want to spend too much time on the UI (I want a simple grid to display my map and a sort of move-logger on the side), I tried to go with the following thing :
    @Composable
    fun TileMatrixViewer(matrix: TileMatrix) {
        Text(Helper.displayer.showMap(matrix), fontFamily = FontFamily.Monospace)
    }
    
    object Helper {
        val displayer by lazy { BaseDisplayer() }
        /* some other things */
    }
    But the
    Text
    widget never updates when I change the position of a player, how can I make it so it is updated? You can see the whole class for
    TileMatrix
    right here on my git if it might help to answer -> https://github.com/HFDrae/RoguEngine/blob/main/src/main/kotlin/util/graph/tiles/TileMatrix.kt Another question that might make this one useless, how should I go if I want to display my grid as a grid of components rather than a String that represents the whole grid ? Thanks in advance !
    d
    c
    • 3
    • 16
  • t

    tuan tran

    03/25/2022, 7:22 AM
    Hi everyone! I’m a JetpackCompose beginner, I’m customing the TextField to center for content in TextField. But the cursor does not center when beginning focus. After inputting the value was center-aligned. How I can fix the cursor center when begin to focus the TextField? Thanks!!!!
    d
    • 2
    • 1
  • n

    Norbi

    03/26/2022, 6:40 PM
    Is it somehow possible to visualize (or debug) recompositions?
    z
    m
    • 3
    • 2
  • k

    Kirill Grouchnikov

    03/28/2022, 10:38 AM
    Closing the functionality gap with Android T / Compose on Android for shader-backed render effects that can run on any node in Compose hierarchy. This Skiko issue has a bit more technical detail. Once the PR linked in it is merged, and Compose Desktop picks up that version of Skiko, it will be made available for all supported desktop platforms. This demo is a simpler one, applying a static shader render effect. This demo is a bit more complex (see attached video). It shows a dynamic shader that "combines" two child shaders, one that blurs the left part of the button, and another that colorizes the right part of the button to be red-tinted. The slider under the button is wired to change the horizontal boundary between the two child shaders, showing how to combine
    remember { mutableStateOf }
    together with the newly added binding to the underlying
    SkRuntimeShaderBuilder::uniform
    . When the mouse is moved over the button, the amount of blur and red tinting goes down, showing how to combine
    derivedStateOf
    with the same
    SkRuntimeShaderBuilder::uniform
    . Apart from the more demo-ey nature of this video, this should enable not only the things done in Android (stretch overscroll, content blur, fancy ripples), but also things like image editing with quick live previews of effects, introduction tutorials that blur / highlight relevant parts of the UI, and many more.
    runtime-shader-render-effect.mov
    🥰 1
    🤯 8
    👍 2
    👏 8
    😮 7
    👏🏻 1
    👍🏻 1
    m
    • 2
    • 13
  • b

    Bino

    03/28/2022, 11:36 AM
    Sorry if this is a stupid question, but when I ran a desktop application on mac, there is always this
    MainKt
    reference as the process name. Can this be adjusted by an application name?
    a
    t
    • 3
    • 4
  • j

    james

    03/29/2022, 9:56 PM
    I guess this is OS specific, but I know that at least on macOS there are apps which change this titlebar colour (ie. IntelliJ does it, iTerm does it, etc) is there a way to do this with my CfD app? I’ve tried switching between dark/light theme and that doesn’t seem to have any effect on the title bar EDIT: ☝️ figured it out, see 🧵 if you’re interested 😄
    x
    k
    • 3
    • 6
  • x

    xxfast

    03/29/2022, 11:42 PM
    Can we use compose-jb for an android-only project without the multiplatform plugin?
    ✅ 3
    t
    • 2
    • 2
  • d

    David W

    03/30/2022, 5:45 AM
    The OpenGL renderer supports more/older computers. What is the argument for not making OpenGL the default renderer for my CfD application, rather than DirectX 12?
    m
    m
    • 3
    • 6
  • t

    theapache64

    03/30/2022, 7:06 AM
    @Kebbin extending from here :thread-please:
    How onerous is it to actually create a CfD program for macOS?
    m
    k
    • 3
    • 5
  • i

    Ivan Pavlov

    03/30/2022, 9:00 AM
    Is it possible to get light and dark variants for a
    Color
    ?
    k
    • 2
    • 3
  • k

    Kirill Grouchnikov

    03/30/2022, 2:39 PM
    Along the same vein of Android's shimmer ripple, here's a more realistic example of a "decorator" shader-based runtime effect applied on a button. The button on the left is a regular Aurora button, and the one on the right is configured with a render effect that uses a shader to draw an outside glow when the mouse moves over that button. No need to increase the layout bounds of the button. No need for the button composable itself to be "aware" of this glow drawn around it. The render effect layer handles all of that, and all you need to do is pass all the relevant info (in this case corner radius, glow amount, max glow distance and glow color) into the shader. And of course, write the shader itself 😅
    glow-shaders.mov
    :kotlin-intensifies: 1
    👍🏻 1
    🤩 6
    👍 8
    j
    r
    +2
    • 5
    • 40
  • i

    Ivan Pavlov

    03/31/2022, 5:59 PM
    I try to use outlined icons, but they are always filled. Does anyone know what am I doing wrong?
    Icon(
        imageVector = Icons.Outlined.Star,
        contentDescription = "contentDescription",
    )
    l
    • 2
    • 2
  • a

    Alexander Maryanovsky

    04/01/2022, 6:20 AM
    Why does an empty desktop compose app (just showing an empty window) take 100MB in memory (Mac OS X)? Is there anything I can do to reduce this? An empty regular Kotlin app takes 30MB, for comparison.
    m
    • 2
    • 3
  • d

    Dragos Rachieru

    04/01/2022, 7:10 AM
    Hello, are PRs allowed for this repository? I want to make the
    ViewModel
    and some of the navigation componenet multiplatform.
    g
    i
    +2
    • 5
    • 10
  • l

    Long Tran

    04/01/2022, 7:48 AM
    I’m setting up my project, including both desktop and android, to run in multiple environments, but the error below occurred. How can I run my project in different environments?
    org.gradle.api.InvalidUserCodeException: Only one of the JVM targets can be configured to work with Java. The target 'common' is already set up to work with Java; cannot setup another target 'dev'
    :android-wave: 1
    d
    l
    b
    • 4
    • 13
  • l

    Luc Girardin

    04/01/2022, 8:33 PM
    Just for the sake of being the first one to ask: when will there be a version of CfD for the freshly released Kotlin 1.6.20?
    g
    c
    +4
    • 7
    • 11
  • r

    rcd27

    04/02/2022, 9:03 PM
    Any good examplse about how to implement internationalization on desktop, guys?
    👀 2
    m
    • 2
    • 1
  • a

    abbic

    04/03/2022, 10:33 AM
    Hi all, i'm trying to render 16x16 px tiles on a compose Canvas. Im unsure about how do do this in a relatively sane manner (i know that probably anything i try will be "good enough"), my thoughts are to create ImageBitmaps for each tile on start (complicated by the fact that the tiles are saved onto a single png, im assuming i can slice an ImageBitmap of the sprite sheet) and draw them individually onto the Canvas, but do thoughts jump out to anyone?
    • 1
    • 1
  • n

    Norbi

    04/03/2022, 3:26 PM
    Is it possible to hide the cursor of
    OutlinedTextField
    ? I would like to use it as an uneditable value holder for a dropdown list (to have the other nice features like the label animation). Thanks.
    t
    • 2
    • 2
  • a

    Abdelilah El Aissaoui

    04/03/2022, 5:51 PM
    Would a contribution to the docs about native distribution with flatpak be accepted? To even bother writing it or not 😛 It would allow to support tons of linux distros compared to the limited
    .deb
    currently allowed by jpackage. Adding a dedicated section for flatpak here: https://github.com/JetBrains/compose-jb/tree/master/tutorials/Native_distributions_and_local_execution
    b
    • 2
    • 10
  • l

    Leander Behr

    04/03/2022, 9:22 PM
    Hey, I currently can't use compose v1.1 because
    Could not resolve org.jetbrains.skiko:skiko:0.7.16
    . Is there some repository where that's available or do I have to wait for it to land in one? edit: (ahh maybe this is for #compose)
    n
    • 2
    • 2
  • s

    spierce7

    04/05/2022, 5:08 AM
    Does anyone know of a Crash reporting solution that supports proguard / mappings.txt for java?
    j
    a
    +3
    • 6
    • 31
  • d

    David W

    04/05/2022, 4:17 PM
    Feeling a little lost on what to use for a Map of data that's manipulated in a non-compose module but reflected in the UI.
    SnapshotStateMap
    seems like the ideal way to expose it to the UI, but I can't use that in my non-compose module.
    StateFlow<Map<T, V>>
    seems like the only option, but that emits the entire map on each change, rather than only what changed about it. Any other better options? I could make a
    SnapshotStateMap
    observe the
    StateFlow
    but that's kinda gross, right?
    k
    • 2
    • 6
  • c

    Clyde

    04/06/2022, 6:28 AM
    Does
    rememberSaveable
    save and restore across app invocations on desktop? Specifically my window size is not being remembered on MacOs, which it seems it should be since
    rememberWindowState
    delegates to
    rememberSaveable
    .
    f
    d
    k
    • 4
    • 8
  • d

    darkmoon_uk

    04/06/2022, 7:41 AM
    ❓ Is the need to notarize a DMG really a hard 'Apple' limitation for distributing Mac Apps beyond your local build machine? What makes me doubtful is that you frequently come across ad-hoc distributed Mac Apps in the wild; which refuse to run normally due to having not being signed; and yet you can still run them with 'Right Click -> Open' on the App, as a kind of 'confirmation' that you accept the risk. What makes CfD's packaging different? Could we not achieve the same experience? It's not ideal of course, but still very useful in many situations e.g. just wanting to share a utility App with colleagues.
    e
    m
    k
    • 4
    • 3
  • k

    Kirill Grouchnikov

    04/06/2022, 3:29 PM
    Now that Skiko has bindings to enable shader-based render effects, this is another glimpse of what that enables to do. Here is a combination of blur, drop shadows, gradients and noise texture, all with a single composite shader applied on top of the
    Canvas
    composable.
    👍🏻 1
    👀 8
    🔥 21
    👍🏼 1
    :kotlin-intensifies: 23
    👍 5
    🤩 6
    😮 7
    🎉 5
    j
    k
    +3
    • 6
    • 9
Powered by Linen
Title
k

Kirill Grouchnikov

04/06/2022, 3:29 PM
Now that Skiko has bindings to enable shader-based render effects, this is another glimpse of what that enables to do. Here is a combination of blur, drop shadows, gradients and noise texture, all with a single composite shader applied on top of the
Canvas
composable.
👍🏻 1
👀 8
🔥 21
👍🏼 1
:kotlin-intensifies: 23
👍 5
🤩 6
😮 7
🎉 5
Demo code over here, based on visuals from here.
j

james

04/06/2022, 10:57 PM
this is really, really cool @Kirill Grouchnikov! nice work mate every time you post your shader examples my eyes light up :grinning_face_with_star_eyes:
🖐️ 1
k

Kebbin

04/07/2022, 12:51 AM
Yes, it's really pushing boundaries of awesome appearance and presentation! That sample pic has amazing effects!
💯 1
👍 2
Mate, the more I look at that pic, the more I love it! All the effects, the colours, the bleed, the frosting, the sharpness... It's pure art!
➕ 1
d

Dragos Rachieru

04/07/2022, 6:59 AM
does this work on android?
f

Filip Wiesner

04/07/2022, 8:36 AM
I think that custom shader support is coming to Android 13 but not sure
I've listened to the latest ADB podcast episode about this but I understood only maybe 5% of the conversation because I know nothing about graphics or shaders 😅
➕ 2
k

Kirill Grouchnikov

04/07/2022, 1:48 PM
It's not going to be a 1-to-1 mapping since the API surface of https://developer.android.com/reference/android/graphics/RuntimeShader is slightly different than that of Skia itself that is exposed more directly in Skiko. The concepts are the same, since it's Skia underneath in both cases though.
a

andylamax

04/07/2022, 6:42 PM
This is disturbingly good mate. I am suddenly feeling hot just looking at this. Dope work
💯 4
View count: 3