Jetbrains Compose (https://www.jetbrains.com/lp/compose/) is a ui toolkit targeting jvm on desktop platforms. It is a port of Android Jetpack Compose (https://developer.android.com/jetpack/compose) which is developed by google
Questions tagged [jetbrains-compose]
52 questions
1
vote
2 answers
How to add ViewModel implementation in build.gradle.kts for IntelliJ IDEA project?
Android Studio as default has access to ViewModel class import androidx.lifecycle.ViewModel.
How can I use this ViewModel into IntelliJ IDEA Kotlin desktop project (compose for desktop).
developer.android.com provide guide how to add the dependices…

Exicode
- 23
- 6
0
votes
1 answer
How can I animate a solid color over an Image?
I have this square image component with rounded corners that I want to overlay a solid color over on hover:
@Composable
fun MyImage(imageUri: String) {
var likeOverlayColor = animateColorAsState(targetValue = Color(0, 0, 0, 100))
val…

Lolmerkat
- 5
- 1
- 4
0
votes
2 answers
How do I access and modify a state from a non-Composable function?
I have this Composable function that holds multiple states:
@Composable
fun MyComponent() {
var stringState by remember { mutableStateOf("foo") }
var booleanState by remember { mutableStateOf(false) }
var integerState by remember {…

Lolmerkat
- 5
- 1
- 4
0
votes
1 answer
How should I be saving a file so that it doesn't hang the main thread, but also doesn't overwrite with stale data
So I'm working on an app using Jetbrains Desktop Compose and I've reached a stall where I cannot figure out what method I should be using to save the information. I need it to autosave whenever a change is made. My method has been to write a save…

Jade Neoma
- 23
- 6
0
votes
1 answer
How to mix selectable text and clickable text at once?
I'm trying to build a panel that contains a lot of information. Those informations must be selectable, in order to able the user to copy it. But, beyond this, this information panel contains some parts that, when clicked, must to perform something…

Lucas Sousa
- 192
- 3
- 14
0
votes
0 answers
Can I prevent the user of a restricted system from minimizing my application?
I have a Kotlin + Jetbrains Compose desktop application. This application will be used in a specific computer, that is only supposed to run this application and the software that the application runs through subprocesses.
Needless to say, this…

Pstr
- 777
- 1
- 8
- 17
0
votes
0 answers
How to load ViewModels in Kotlin Desktop?
I have an multiplatform application based on JetBrains Compose for Android and Desktop. In common module I have screens (as a Composable functions) with ViewModels inherited from dev.icerock.moko.mvvm.viewmodel.ViewModel:
import…

BArtWell
- 4,176
- 10
- 63
- 106
0
votes
2 answers
Jetpack Compose Animation skips to target value immediately
I'm trying to achieve a smooth animation of a simple round timer. Like this, but smoother
However it just skips to targetValue immediately and that's it there's no animation at all. I'm trying to do it like this:
@Composable
private fun…

Overpass
- 433
- 5
- 12
0
votes
2 answers
Unable to use any class,interface or fun created in jetbrains.compose module into non jetbrains.compose module
In Kotlin multiplatform when i try to use compose module interface or class in non-compose module getting this error when i do maven-publish in windows and ios.
For example i created a project and added PR with error…

YLS
- 1,475
- 2
- 15
- 35
0
votes
1 answer
Using Ktor for Spotify PCKE Authorization
I'm building my first desktop application using JetBrains Compose & Ktor. I want to connect to the Spotify API using the Spotify Auth PCKE extension. The flow should be
Send a Get request for auth to accounts.spotify.com/authorize
If the user not…

VirtualProdigy
- 1,637
- 1
- 20
- 40
0
votes
1 answer
Kotlin Multiplatform project building keeps failing after adding dependencies
I created a Kotlin Multiplatform project (for the web).
After adding a dependency (in my case io.ktor:ktor-serialization-kotlinx-json:2.1.1) the building of the project fails. I get following exception:
e: java.lang.IllegalArgumentException:…

Daniel
- 380
- 2
- 14
0
votes
1 answer
Invalid signature when building jar via packageUberJarForCurrentOS
I'm currently trying to migrate one of my older JavaFX projects to compose-jb desktop.
To make the new application compatible with the old one, i want to continue distributing fat jars.
Right now, i'm able to build the fat jar but whenever i try to…

Tommy Schmidt
- 1,224
- 1
- 16
- 30
0
votes
1 answer
How to hide button in Desktop Compose
I am developing an app with Desktop Compose Multi-Platform.
I need to hide the button when it has been clicked.
Please see below code:
OutlinedButton(
onClick = {
// Perform an operation
// Hide the button
})…

SVK
- 676
- 1
- 5
- 17
0
votes
1 answer
What are minimum requirements for running Desktop Compose App on Mac OS and Windows OS
I am developing an app with Desktop Compose Multi-Platform.
It will run on both Mac OS and Windows OS.
The official document(Document Link) states that, in order to build .dmg and .msi executable we need at least JDK 15.
I was able to build a .dmg…

SVK
- 676
- 1
- 5
- 17
0
votes
0 answers
Compose Desktop is based on AWT, is it a permanent decision?
I have a Swing component that I'd like to re-implement from scratch using Compose. What I've found, is that many of the Compose features just wrap AWT. For example, PointerEvent class has a nativeEvent which is an instance of…

Vladyslav Lubenskyi
- 527
- 1
- 7
- 17