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

    andylamax

    03/06/2021, 7:55 AM
    I don't know where to ask this, but. How is android studio able to preview composables directly in the application? does it use compose 4 desktop? If not, what does it use?
    j
    t
    3 replies · 3 participants
  • t

    theapache64

    03/06/2021, 3:03 PM
    Is there any way we can add ✅ Launch <Program> checkbox to windows installer? (to launch the program after pressing "Finish")
    o
    2 replies · 2 participants
  • g

    gbaldeck

    03/06/2021, 3:53 PM
    I am getting the below error very regularly when I build in IntelliJ with Kotlin 1.4.31 and Compose for desktop 0.4.0-build171. The only way I have found to fix it is to do a gradle clean and build. Is there a way I can get it to go away permanently? It seems to happen only when I edit my composable functions.
    c
    j
    4 replies · 3 participants
  • y

    Yan Pujante

    03/06/2021, 5:48 PM
    so there is jetpack compose for mobile, compose desktop for desktop, what about compose web? is this in the pipeline?
    b
    o
    +2
    7 replies · 5 participants
  • g

    Glenn Martin

    03/07/2021, 4:37 AM
    hello, what would be the best way to keep a list of global states that get updated constantly by background thread? currently just adding a bunch of
    mutableStateOf
    on the main class at the top of my app
    t
    4 replies · 2 participants
  • t

    TheMrCodes

    03/07/2021, 10:06 AM
    Observation of today: Don't
    launch
    a new Coroutine in an
    @Composeable
    function to load resources in Background without using
    LaunchedEffect
    , it will be a death loop 🤦
    😮 1
    ➕ 2
    a
    4 replies · 2 participants
  • d

    Dirk Hoffmann

    03/07/2021, 11:04 AM
    I have a TabRow like so:
    Column(modifier) {
            TabRow(selectedTabIndex = activeTab()) {
                Tab(selected = activeTab() == 0, onClick = { activeTab(0) }, enabled = true) {
                    Text("Tab 1", Modifier.padding(3.dp), textAlign = TextAlign.Center)
                }
                Tab(selected = activeTab() == 1, onClick = { activeTab(1) }, enabled = true) {
                    Text("Search: Result", Modifier.padding(3.dp), textAlign = TextAlign.Center)
                }
                Tab(selected = activeTab() == 2, onClick = { activeTab(2) }, enabled = true) {
                    Text("Tab 3", Modifier.padding(3.dp), textAlign = TextAlign.Center)
                }
            }
    no matter what I try, I don't get the Tab Texts vertically centered. Isn't TabRow missing a "verticalAligment" parameter???
    g
    i
    +1
    5 replies · 4 participants
  • t

    TheMrCodes

    03/08/2021, 2:41 PM
    Do we have some kind of Performance Profile like Android for Compose for Desktop?
    s
    4 replies · 2 participants
  • y

    Yan Pujante

    03/08/2021, 6:13 PM
    I am having issue with naming in general. It seems that from what I can read, functions are named XXX and "models" are named XXXViewModel which for me seems very non intuitive. Especially since function start with a capital letter. For example if I have a Song "concept", then when I see Song in my code, it looks like it should be the object "song" not the function that renders a SongViewModel... Maybe it's just me and I know that I can do whatever I want in my code but was wondering if others felt that way and what other conventions they have been using...
    j
    2 replies · 2 participants
  • y

    Yan Pujante

    03/08/2021, 7:38 PM
    I am trying to emulate a table (since it looks there is none) and I have the following code:
    Column {
            parts.value.forEach { part ->
                Row(modifier = Modifier.fillMaxWidth().background(color = Color.LightGray)) {
                    Text(part.name, modifier = Modifier.fillMaxWidth(0.33333F).background(color = Color.Red))
                    Text(part.description ?: "N/A", modifier = Modifier.fillMaxWidth(0.33333F).background(color = Color.Green))
                    Text(part.price.toString(), modifier = Modifier.fillMaxWidth(0.33333F).background(color = Color.Blue))
                }
            }
        }
    It renders this way so I guess I don't understand the fraction parameter...
    z
    r
    +2
    8 replies · 5 participants
  • y

    Yan Pujante

    03/09/2021, 4:50 PM
    Let's say I have a Database with User and it is encapsulated in a UserMgr layer (ex:
    UserMgr.getUsers(userFilter) -> List<User>, UserMgr.removeUser(userID)
    ). I want to display this list of users and offer the ability to remove any item from the list (with the click of a button). I am not entirely sure how to handle this use case with compose-desktop. If I use
    val userFilter = xxx
    val users = remember { userMgr.getUsers(userFilter) }
    
    // ...
    // for each user
    val id = ...
    Button(onClick = { userMgr.delete(id) } // ...
    // ...
    Then of course it does not get recomposed because there is no way for the framework to know that the list has changed... I apologize if this question has been asked before. Can somebody point me to the recommended way to handle a compose-dekstop application backed by a database with essentially screens that implement CRUD access to it?
    t
    r
    3 replies · 3 participants
  • t

    TheMrCodes

    03/09/2021, 9:22 PM
    I encountered an very very strange bug were Compose or maybe the Kotlin Compiler ignores if conditions 😬 This happend the second time now and the first time I thought it's just a visual bug but in the second case it's definitly a problem. Has enyone encountered something simular? I'll post a video of the debugger flow in the Thread 🧵
    j
    y
    7 replies · 3 participants
  • s

    SrSouza

    03/10/2021, 12:53 PM
    Hi folks, is possible to adjust the Window size to the space that my components take on the screen? I want to achieve something like this (prints in the thread)
    t
    t
    4 replies · 3 participants
  • m

    Marcin Wisniowski

    03/10/2021, 5:52 PM
    All of this looks so good, but I already built my app with TornadoFX. I wonder if there is a migration path or some learnings to read from someone who did it?
    j
    2 replies · 2 participants
  • t

    theapache64

    03/10/2021, 9:54 PM
    How can I move focus to next focusable composable when pressing
    Tab
    from a
    TextField
    ? Do we have any built-in support? (other than manually moving the focus using a state). I am looking for something like tabIndex
    👀 2
    ➕ 1
    a
    t
    5 replies · 3 participants
  • l

    Lin Zhang

    03/11/2021, 9:04 AM
    Anyone notice that a translate animation(by default, from the start of screen to the end) is added for FAB in
    1.0.0-beta02
    ? I don’t think that’s a good idea… the animation looks so wired on initializing UI and no API to disable it https://android-review.googlesource.com/c/platform/frameworks/support/+/1580345
    l
    a
    +2
    7 replies · 5 participants
  • y

    Yan Pujante

    03/11/2021, 3:55 PM
    Following up on my threading issue, here it is in action:
    :thread-please: 1
    j
    4 replies · 2 participants
  • t

    tad

    03/12/2021, 2:38 AM
    How do I tell the compose-desktop plugin to use a password for the macOS keychain?
    j
    4 replies · 2 participants
  • b

    Bruno Blazinc

    03/12/2021, 8:35 AM
    Hi, I was wondering if there is a Compose component like
    Image
    that can handle loading from network? Something that a library like Coil, Glide or Picasso provide. Eg. Coil: https://github.com/google/accompanist/tree/main/coil I am creating a Multiplatform Kotlin app(Android & Desktop, iOS in the works) and I wan’t to share the Compose UI code as a module that is imported in the Android and Desktop module. Everything else works fine but I would love to be able to load images in a platform independent way.
    t
    4 replies · 2 participants
  • t

    theapache64

    03/12/2021, 3:24 PM
    🧵 Thread : MenuBar Style (UI) - Linux
    i
    k
    7 replies · 3 participants
  • s

    samuel

    03/12/2021, 7:32 PM
    I experience an error while running an intellij plugin built with compose in Android Studio 4.1.2 🧵
    j
    9 replies · 2 participants
  • s

    spechard

    03/12/2021, 9:42 PM
    Hey guys, Is there a parameter to vertically align input text in TextField? In Widgets Gallery example, such text is higher than expected, as seen here:
    c
    j
    +2
    6 replies · 5 participants
  • g

    Glenn Martin

    03/13/2021, 12:36 AM
    checkout my docker client peeps, no animations yet just trying to get the docker stuff working
    :kotlin-intensifies: 15
    b
    s
    7 replies · 3 participants
  • s

    Sudhir Singh Khanger

    03/13/2021, 2:26 AM
    Is there system tray support in Compose Desktop?
    :yes: 2
    c
    j
    5 replies · 3 participants
  • d

    Dirk Hoffmann

    03/13/2021, 10:41 AM
    I am (unsuccessfully) searching for how to e.g. open a popup, if the user inside a textfield presses a keyboard shortcut like ctrl+space. Has anybody a codesnippet on how to "do" something if the user presses some kind of shortcut key combination while inside a Component? thanx (also am totally clueless on how I could open the popup below the current cursor position)
    t
    i
    +1
    15 replies · 4 participants
  • o

    orangy

    03/13/2021, 2:49 PM
    I’m trying to get rid of MaterialTheme, but as soon as I remove it, I get this:
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: LayoutNode@108e4651 children: 1 measurePolicy: androidx.compose.foundation.Scrollbar_desktopKt$verticalMeasurePolicy$1@7d30d0b0 is not ready. layoutState is NeedsRemeasure
    Build 0.4.0-build173 Any ideas?
    j
    i
    10 replies · 3 participants
  • y

    Yan Pujante

    03/13/2021, 7:52 PM
    I am having a really hard time wrapping my head around the state/flow concepts to build my own compose-desktop app. I am currently looking at the Jetcaster jetpack compose app as an example that uses a database (from https://github.com/android/compose-samples). So this is the part that I really don't understand:
    // from DiscoverViewModel
        init {
            viewModelScope.launch {
                // Combines the latest value from each of the flows, allowing us to generate a
                // view state instance which only contains the latest values.
                combine(
                    categoryStore.categoriesSortedByPodcastCount() //. simplified cause not important
                    _selectedCategory
                ) { categories, selectedCategory ->
                    DiscoverViewState(
                        categories = categories,
                        selectedCategory = selectedCategory
                    )
                }.collect { _state.value = it }
            }
        }
    
    // then in CategoryStore
        /**
         * Returns a flow containing a list of categories which is sorted by the number
         * of podcasts in each category.
         */
        fun categoriesSortedByPodcastCount(
            limit: Int = Integer.MAX_VALUE
        ): Flow<List<Category>> {
            return categoriesDao.categoriesSortedByPodcastCount(limit)
        }
    
        /**
         * Adds the category to the database if it doesn't already exist.
         *
         * @return the id of the newly inserted/existing category
         */
        suspend fun addCategory(category: Category): Long {
            return when (val local = categoriesDao.getCategoryWithName(category.name)) {
                null -> categoriesDao.insert(category)
                else -> local.id
            }
        }
    when addCategory is called, how does the DiscoverViewModel state gets updated exactly? Clearly after adding a category to the database, the list of categories is different. I just don't see from this code how that gets propagated. Is there something missing? Am I missing something?
    t
    2 replies · 2 participants
  • g

    gbaldeck

    03/13/2021, 11:27 PM
    are there any examples on how to setup textboxes so the will work with copy and paste (ctrl-c & ctrl-v) ?
    👀 1
    m
    a
    +2
    8 replies · 5 participants
  • d

    Dirk Hoffmann

    03/14/2021, 12:01 PM
    Why is it a Box/Card drawn over the boundaries of "its" component is opaque whilst on its component, but transparent over neighbour components??
    d
    i
    9 replies · 3 participants
  • o

    orangy

    03/14/2021, 2:19 PM
    Shouldn’t
    ScrollbarStyleAmbient
    be renamed to
    LocalScrollbarStyle
    to match compose current style?
    :tnx: 2
    i
    3 replies · 2 participants
Powered by Linen
Title
o

orangy

03/14/2021, 2:19 PM
Shouldn’t
ScrollbarStyleAmbient
be renamed to
LocalScrollbarStyle
to match compose current style?
:tnx: 2
i

Igor Demin

03/14/2021, 2:22 PM
Yes, it should, we will rename it
o

orangy

04/17/2021, 10:59 AM
Do you have an issue on that or should I create one? It’s not really important to me, just revisiting threads after vacation 🙂
i

Igor Demin

04/17/2021, 11:35 AM
https://github.com/JetBrains/compose-jb/issues/186 🙂
:tnx: 1
View count: 1