Jetpack Compose for Desktop and Web, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.

Overview

official project Latest release Latest build

Compose Multiplatform, by JetBrains

Compose Kotlin UI framework port for desktop platforms (macOS, Linux, Windows) and Web, components outside of the core Compose repository at https://android.googlesource.com/platform/frameworks/support.

Preview functionality (check your application UI without building/running it) for desktop platforms is available via IDEA plugin (https://plugins.jetbrains.com/plugin/16541-compose-multiplatform-ide-support).

Repository organization

Getting latest version of Compose Multiplatform

See https://github.com/JetBrains/compose-jb/tags for the latest build number.

Comments
  • free(): invalid pointer - when running on Linux

    free(): invalid pointer - when running on Linux

    Trying to run almost any Compose app (including, for instance, the codeviewer sample) results in the JVM crashing with a free(): invalid pointer error. This was observed on a fresh install of Ubuntu 20.04 in a virtual machine, but is presumably true of all Ubuntus and a wide variety of other distributions and hardware configurations. Interestingly, @olonho tested on his physical Ubuntu 20.04 machine and did not encounter this failure, so the percentage of users impacted is not yet known. This appears to be a regression introduced between 0.3.0-build154 and 0.3.0-rc1.

    For more details, I know @theapache64 encountered the same error in https://github.com/JetBrains/compose-jb/issues/275#issuecomment-782896658 and posted a full backtrace dump. His dump also includes a shader compile error, which I do not see when running the codeviewer app, so is presumably unrelated.

    Questions for @theapache64 : (1) More just curiosity than anything, but also looking for patterns, are you running on a VM or physical hardware? (2) When running the codeviewer sample for instance, but I don't get nearly the same amount of debug info as you and I don't seem to be getting a hs_err_pid file. How did you get your full backtrace dump?

    opened by jimgoog 27
  • Exception during IR lowering

    Exception during IR lowering

    I've been trying to get JetBrains Compose to work with my existing project, but it keeps on giving me this error:

    java.lang.IllegalStateException: Backend Internal error: Exception during IR lowering
    File being compiled: C:/Users/20047/IdeaProjects/TradisAgnostic/src/main/kotlin/io/ejekta/core/struct/GameRegistry.kt
    The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.backend.common.ir.IrUtilsKt.copyValueParametersToStatic(IrUtils.kt:245)
    	at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:239)
    	at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(PhaseBuilders.kt:124)
    	at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(PhaseBuilders.kt:112)
    	at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94)
    	at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:30)
    	at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94)
    	at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:41)
    	at org.jetbrains.kotlin.backend.jvm.JvmLower.lower(JvmLower.kt:395)
    	at org.jetbrains.kotlin.backend.jvm.JvmBackendFacade.doGenerateFilesInternal$backend_jvm(JvmBackendFacade.kt:138)
    	at org.jetbrains.kotlin.backend.jvm.JvmBackendFacade.doGenerateFilesInternal$backend_jvm$default(JvmBackendFacade.kt:125)
    	at org.jetbrains.kotlin.backend.jvm.JvmBackendFacade.doGenerateFiles(JvmBackendFacade.kt:112)
    	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.generateModule(JvmIrCodegenFactory.kt:40)
    	at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:35)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:647)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:210)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:162)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:169)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
    	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:371)
    	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:105)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:249)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.access$compileIncrementally(IncrementalCompilerRunner.kt:38)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner$compile$2.invoke(IncrementalCompilerRunner.kt:80)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:92)
    	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:602)
    	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:93)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1644)
    	at jdk.internal.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
    	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    
    

    This is with build 0.3.0-build141 and Kotlin 1.4.21. Attached is what GameRegistry.kt looks like.

    GameRegistry.txt

    compiler 
    opened by ejektaflex 27
  • Support for animated gif images.

    Support for animated gif images.

    Trying to display the following animated gif image displays only the first frame because it supports only the Bitmap.

    Image(
         bitmap = imageFromResource("lottie-sample.gif"),
         modifier = Modifier.align(Alignment.BottomCenter).preferredSize(100.dp,100.dp)
    )
    

    lottie-sample

    enhancement discussion resources desktop 
    opened by sureshg 26
  • Example Todo app

    Example Todo app

    Hello! I played with MPP Jetpack Compose and I really enjoyed it! I'm impressed with the ability to just copy @Composable functions from Android to common. You rock! As a result I created a sample Todo app. The key point of this example is that 99% of the code is common (data, business logic, presentation, navigation and UI).

    This app uses the following libraries:

    There are multiple common modules:

    • utils - just some useful helpers
    • database - SQLDelight database definition
    • main - displays a list of todo items and a text field, adds items to the database
    • edit - accepts an item id and allows editing
    • root - navigates between main and edit

    The root module is integrated into both Android and Desktop apps.

    Here are some screenshots:

    During my work I discovered some issues/bugs.

    Common:

    • Caught a compiler error, can be reproduced in this separate branch - just try to build e.g. the Android app, there should be "Backend internal error".

    Android:

    • Keyboard overlaps the bottom input field sometimes
    • The app is not clickable after the keyboard is closed via "Back" button (minimize/restore solves the problem)
    • Saving UI state seems not working properly. I tried to use port my solution from Decompose (using UiSavedStateRegistry) and the list scrolling position is not preserved. It works well with normal Jetpack Compose alpha04.

    Desktop:

    • Built-in Compose icons do not compile. E.g. using Icons.Default.ArrowBack throws kotlin.NotImplementedError: An operation is not implemented during compilation.
    • The app does not honor system screen scale factor. I am using Ubuntu 19.04 and have 4k screen with 200% scale factor set in the settings. The app is rendered on the bottom left quarter of the window, but reacts on mouse in correct coordinates. Changing scale type to 100% solves the problem, but in this case I had to reduce the resolution. Please check the attached GIF of the ImageViewer sample app.
    • Maybe unrelated, desktop module shows all the code from dependent modules as red. But compiles and runs fine. External dependencies are also fine.
    • Jetpack Crossfade animation renders only first and last frames
    • Check boxes are just filled with solid color, no "tick" icons
    opened by arkivanov 26
  • "androidx dependency" is compiled by a new Kotlin compiler backend and cannot be loaded by the old compiler

    Hello,

    I created the base project using you getting started tutorial. Well, it runs, it works, but IntelliJ IDEA thinks it should not work. It shows me the error that I specified in the issue name. How can I fix this?

    image

    bug 
    opened by ggoraa 25
  • java.lang.NullPointerException at androidx.compose.ui.node.DelegatableNodeKt.requireOwner(DelegatableNode.kt:308)

    java.lang.NullPointerException at androidx.compose.ui.node.DelegatableNodeKt.requireOwner(DelegatableNode.kt:308)

    Hi. I'm playing with jetbrains compose and Decompose library https://github.com/arkivanov/Decompose using it's navigation

    On one of the page I'm using .fillMaxWidth() modifier and when navigates to this page I'm getting the next exception.

    The same code works fine on desktop version

    E/AndroidRuntime: FATAL EXCEPTION: main Process: com.serhiy.connect, PID: 10207 java.lang.NullPointerException at androidx.compose.ui.node.DelegatableNodeKt.requireOwner(DelegatableNode.kt:308) at androidx.compose.ui.node.SemanticsModifierNodeKt.invalidateSemantics(SemanticsModifierNode.kt:44) at androidx.compose.ui.node.NodeKindKt.autoInvalidateNode(NodeKind.kt:171) at androidx.compose.ui.node.NodeChain.updateNodeAndReplaceIfNeeded(NodeChain.kt:513) at androidx.compose.ui.node.NodeChain.updateFrom$ui_release(NodeChain.kt:130) at androidx.compose.ui.node.LayoutNode.setModifier(LayoutNode.kt:735) at androidx.compose.ui.node.ComposeUiNode$Companion$SetModifier$1.invoke(ComposeUiNode.kt:42) at androidx.compose.ui.node.ComposeUiNode$Companion$SetModifier$1.invoke(ComposeUiNode.kt:42) at androidx.compose.runtime.ComposerImpl$apply$operation$1.invoke(Composer.kt:1621) at androidx.compose.runtime.ComposerImpl$apply$operation$1.invoke(Composer.kt:1619) at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:808) at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:839) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:585) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:503) at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34) at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109) at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1228) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1238) at android.view.Choreographer.doCallbacks(Choreographer.java:898) at android.view.Choreographer.doFrame(Choreographer.java:826) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1213) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7892) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@bef7741, androidx.compose.ui.platform.MotionDurationScaleImpl@891c4e6, StandaloneCoroutine{Cancelling}@ff31a27, AndroidUiDispatcher@da434d4]

    question android 
    opened by serrg1994 24
  • Followed

    Followed "Milestone 2" release tutorial. End up with `Window` with red underline

    I followed the tutorial here: https://blog.jetbrains.com/cross-post/jetpack-compose-for-desktop-milestone-2-released/

    but I ended up with a red underline under Window Screen Shot 2020-12-04 at 7 22 12 PM

    Using Intellij 2020.3 community edition. Can repro every time I create a new project. Screen Shot 2020-12-07 at 4 13 15 AM Screen Shot 2020-12-07 at 4 13 33 AM

    ide 
    opened by ColtonIdle 24
  • Document how to use ProGuard with Compose for Desktop

    Document how to use ProGuard with Compose for Desktop

    I build my binary with packageDmg / packageMsi and I'm looking for a sample how I must modify my build.gradle.kts to include an obfuscation step. I don't find an answer to that.

    I think it would be nice if the official template would just contain such a step because it's a hard requirement for anybody who ships business software to customers.

    In issue #607 this was asked, but the answer was using packageUberJarForCurrentOS and obfuscate that. I find that not really satisfying, because I want the DMG / MSI as a result.

    Further the Gradle task for Android comes with easy proguard support. Why shoul the nativeDistributions section not contain a proguardConfFile param just to make it work out of the box?

    enhancement native distribution 
    opened by AshStefanOltmann 23
  • Exported deb file renders blank screen - Ubuntu

    Exported deb file renders blank screen - Ubuntu

    When using run

    image

    When running deb file

    image

    OS : Ubuntu 16.04

    IDE Version

    IntelliJ IDEA 2020.3.1 (Community Edition)
    Build #IC-203.6682.168, built on December 29, 2020
    Runtime version: 11.0.9.1+11-b1145.63 amd64
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
    Linux 4.15.0-129-generic
    GC: ParNew, ConcurrentMarkSweep
    Memory: 1934M
    Cores: 6
    
    Current Desktop: Unity
    
    wait for reply rendering native distribution 
    opened by theapache64 23
  • Skia crash when calling Image.makeFromEncoded(bytes).asImageAsset()

    Skia crash when calling Image.makeFromEncoded(bytes).asImageAsset()

    Unfortunately i am not able to reproduce it reliable. But when i am loading many images and display it some times it crashes. To reproduce it execute the following code and scroll fast up and down. Sometimes it happens after just 10-20 images loadings. Sometimes it takes much longer. Also it is not every time necessary to scroll fast. I also tried to load the data into bytearrays first and than show alle images instantly without loading but it will still not crash reliable. Please see the crash details in this file: hs_err_pid15251.log Here is the code to reproduce the bug:

    import androidx.compose.desktop.Window
    import androidx.compose.foundation.Image
    import androidx.compose.foundation.layout.Box
    import androidx.compose.foundation.layout.aspectRatio
    import androidx.compose.foundation.layout.fillMaxSize
    import androidx.compose.foundation.layout.fillMaxWidth
    import androidx.compose.foundation.lazy.LazyColumnFor
    import androidx.compose.runtime.*
    import androidx.compose.ui.Modifier
    import androidx.compose.ui.graphics.ImageAsset
    import androidx.compose.ui.graphics.asImageAsset
    import androidx.compose.ui.unit.IntSize
    import kotlinx.coroutines.Dispatchers
    import kotlinx.coroutines.withContext
    import org.jetbrains.skija.Image
    import java.net.URL
    
    data class RemoteImage(val url: String, val width: Int, val height: Int)
    
    suspend fun loadImageUrl(url: String) = withContext(Dispatchers.IO) {
        val bytes = URL(url).openStream().use { it.readAllBytes() }
        log("Decode bytes: ${bytes.size}")
        Image.makeFromEncoded(bytes).asImageAsset()
    }
    
    @Composable
    fun loadImageAsyn(url: String): ImageAsset? {
        var state: ImageAsset? by remember(url) { mutableStateOf(null) }
        LaunchedEffect(url) {
            state = try {
                loadImageUrl(url)
            } catch (err: Exception) {
                println("Unable to load image $url: ${err.message}")
                null
            }
        }
        return state
    }
    
    fun main() {
        val width = 1000
        val height = 600
        val remoteImageList = (0..500).map {
            RemoteImage(
                url = "https://picsum.photos/id/$it/$width/$height",
                width = width,
                height = height
            )
        }
    
        Window(
            title = "Image Browser",
            size = IntSize(200,800),
            centered = true,
        ) {
            LazyColumnFor(remoteImageList) { item ->
                val image = loadImageAsyn(item.url)
                val aspectRatio = item.width.toFloat() / item.height.toFloat()
                Box(Modifier.aspectRatio(aspectRatio).fillMaxWidth()) {
                    image?.let {
                        Image(modifier = Modifier.fillMaxSize(), asset = it)
                    }
                }
            }
        }
    }
    
    bug rendering 
    opened by timo-drick 23
  • Material icons extended only being published for desktop

    Material icons extended only being published for desktop

    I was having trouble using the extended material icons in my common code. It turns out it is only being built/published for desktop.

    You can verify here: https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/compose/material/

    Material icons core does not have this issue.

    multiplatform infrastructure 
    opened by luca992 22
  • Improve documentation for signing on macOS

    Improve documentation for signing on macOS

    • Removed "Developer ID" as that certificate type is not actually used when following steps for App Store
    • Added note that notarization will not work for the App Store
    • Fixed a broken link
    opened by Thomas-Vos 0
  • Crash with

    Crash with "The frame is displayable" when changing Window undecorated value

    Compose-jb: 1.3.0-rc01 OS: Linux 6.0.15-300.fc37.x86_64

    Code to reproduce:

    fun main() = application {
        val undecorated = remember { mutableStateOf(true) }
    
        Window(
            onCloseRequest = ::exitApplication,
            undecorated = undecorated.value,
        ) {
            Button(
                onClick = {
                    undecorated.value = !undecorated.value
                }
            ) {
                Text("ChangeMe")
            }
        }
    }
    

    P.S. Is it legal to change window undecorated property this way? Maybe it is not a bug...

    bug desktop 
    opened by Wertual08 4
  • ExperimentalUnpackSkikoWasmRuntimeTask Gradle Configuration cache compatibility

    ExperimentalUnpackSkikoWasmRuntimeTask Gradle Configuration cache compatibility

    When I run ./gradlew jsBrowserDevelopmentWebpack I get errors relating to Gradle Configuration cache in my console output

    7 problems were found storing the configuration cache, 2 of which seem unique.
    - Task `:site2:unpackSkikoWasmRuntimeJs` of type `org.jetbrains.compose.experimental.web.tasks.ExperimentalUnpackSkikoWasmRuntimeTask`: invocation of 'Task.project' at execution time is unsupported.
      See https://docs.gradle.org/7.6/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
    - Task `:unpackSkikoWasmRuntimeJs` of type `org.jetbrains.compose.experimental.web.tasks.ExperimentalUnpackSkikoWasmRuntimeTask`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultConfiguration', a subtype of 'org.gradle.api.artifacts.Configuration', as these are not supported with the configuration cache.
      See https://docs.gradle.org/7.6/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
    

    https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

    A task must not use any Project objects at execution time. This includes calling Task.getProject() while the task is running.

    However, ExperimentalUnpackSkikoWasmRuntimeTask does use Task.getProject() during the execution phase:

    https://github.com/JetBrains/compose-jb/blob/d6ff80c062e43395923d6da8c59b395c17c8478b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/tasks/ExperimentalUnpackSkikoWasmRuntimeTask.kt#L26-L27

    https://github.com/JetBrains/compose-jb/blob/d6ff80c062e43395923d6da8c59b395c17c8478b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/tasks/ExperimentalUnpackSkikoWasmRuntimeTask.kt#L40-L41

    https://github.com/JetBrains/compose-jb/blob/d6ff80c062e43395923d6da8c59b395c17c8478b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/tasks/ExperimentalUnpackSkikoWasmRuntimeTask.kt#L46

    https://github.com/JetBrains/compose-jb/blob/d6ff80c062e43395923d6da8c59b395c17c8478b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/tasks/ExperimentalUnpackSkikoWasmRuntimeTask.kt#L47

    Some of these usages have drop-in replacements

    image

    Fixing the use of project.configurations is slightly more tricky. The Gradle docs give examples:

    • https://docs.gradle.org/7.6/userguide/more_about_tasks.html#sec:task_input_using_dependency_resolution_results
    • https://docs.gradle.org/7.6/samples/sample_tasks_with_dependency_resolution_result_inputs.html
    enhancement gradle web 
    opened by aSemy 0
  • DropDownMenu: rest of the window is clickable when expanded

    DropDownMenu: rest of the window is clickable when expanded

    I'm trying to create a simple DropDownMenu with an IconButton to expand it, but when expanded is true, and we click on the icon button, onDismissRequest is called in the first place but onClick of the icon button is also called. I tried the same thing on Android and the onClick function is not called.

    I don't know if it has to be different on Desktop but I can't figure it out a solution to this problem. Here is a simplified version of my code:

    @Composable
    fun dropDownMenu() {
        val expanded = remember { mutableStateOf(false) }
        Row {
            Text("label")
            IconButton(
                onClick = { expanded.value = !expanded.value }
            ) {
                Icon(
                    painter = when (expanded.value) {
                        true -> getIcon("expand_less")
                        false -> getIcon("expand_more")
                    }
                )
            }
        }
        DropdownMenu(
            expanded = expanded.value,
            onDismissRequest = { expanded.value = false }
        ) {
            DropdownMenuItem(onClick = {}) {
                Text("content")
            }
        }
    }
    
    bug desktop 
    opened by wiiznokes 1
  • [CfD, Linux] Surface size changes immediately after lunch

    [CfD, Linux] Surface size changes immediately after lunch

    The following code:

        application {
            Window(onCloseRequest = ::exitApplication) {
                Surface(modifier = Modifier.fillMaxSize().onSizeChanged { println(it) }) {
                    MaterialTheme {
                        Text("Hello")
                    }
                }
            }
        }
    

    Produces the following output:

    1592 x 1172
    1600 x 1114
    

    This causes undesired animations immediately after the app lunch, e.g. in the case when BoxWithConstraints is used and the animation relies on constraints. It would be good to have the size calculated properly in the very beginning.

    Compose: 1.2.0 and 1.3.0-rc01 Kotlin: 1.7.20 OS: Ubuntu 22.04.1

    bug linux desktop 
    opened by arkivanov 1
Releases(v1.3.0-beta04-dev903)
Owner
JetBrains
JetBrains open source projects
JetBrains
FirestoreCleanArchitectureApp is an app built with Kotlin and Firestore that displays data in real-time using the MVVM Architecture Pattern. For the UI it uses Jetpack Compose, Android's modern toolkit for building native UI.

FirestoreCleanArchitectureApp FirestoreCleanArchitectureApp is an app built with Kotlin and Cloud Firestore that displays data in real-time using Andr

Alex 66 Dec 15, 2022
🎲 Kotlin Symbol Processor to auto-generate extensive sealed classes and interfaces for Android and Kotlin.

SealedX ?? Kotlin Symbol Processor to auto-generate extensive sealed classes and interfaces for Android and Kotlin. Why SealedX? SealedX generates ext

Jaewoong Eum 236 Nov 30, 2022
Simple Kotlin application that displays the currently available network interfaces on your machine

Network-Interface-Checker Simple Kotlin application that displays the currently available network interfaces on your machine. An executable jar can be

Joshua Soberg 3 Jun 10, 2022
A clone of hn.premii.com implemented in KMP with Web (React), iOS (Swift UI), Android and Desktop (Compose) UIs

An clone of hn.premii.com implemented in Kotlin Multiplatform with shared Android/Desktop Compose UI, SwiftUI on iOS and React for Web This example su

Tarek Belkahia 7 Feb 5, 2022
Building Web Applications with React and Kotlin JS Hands-On Lab

Building Web Applications with React and Kotlin JS Hands-On Lab This repository is the code corresponding to the hands-on lab Building Web Application

Brian Donnoe 0 Nov 13, 2021
Scaloid makes your Android code easy to understand and maintain.

Simpler Android Scaloid is a library that simplifies your Android code. It makes your code easy to understand and maintain by leveraging Scala languag

Sung-Ho Lee 2.1k Dec 27, 2022
A modular framework for building Discord bots in Kotlin using Kordex and Kord

Mik Bot A modular framework for building Discord bots in Kotlin using Kordex and Kord **If you are here for mikmusic, click here and there Deployment

Michael Rittmeister 31 Dec 24, 2022
KVision allows you to build modern web applications with the Kotlin language

KVision allows you to build modern web applications with the Kotlin language, without any use of HTML, CSS or JavaScript. It gives you a rich hierarchy of ready to use GUI components, which can be used as builder blocks for the application UI.

Robert Jaros 985 Jan 1, 2023
Web Container: A simple web container library for Android to help fellow developer to open WebView easily

WebContainer Description Web Container is a simple web container library for And

Achmad Ichsan Thaib 8 Nov 22, 2022
Template for a modern spring web service.

Spring Service Scaffold A scaffold for a web service operating with a Spring Framework backend, reactjs as frontend and a continuous testing and build

null 0 Nov 15, 2021
🛒 Mercado Libre App Clone using modern Android development with Hilt, Coroutines, Jetpack (Room, ViewModel), and Jetpack Compose based on MVVM architecture.

Meli Clone ?? Mercado Libre App Clone using modern Android development with Hilt, Coroutines, Jetpack (Room, ViewModel), and Jetpack Compose based on

Esteban Aragon 7 Sep 22, 2022
Consumer desktop from nutrition-framework API

About This Project (work-in-progress ?? ??️ ??‍♀️ ⛏ ) Consumer Dari Nutrition Framework General Framework for Application Development Around Nutrition

Faisal Amir 6 Dec 1, 2022
A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations.

kotlin-ktor-rest-api A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations. F

Selim Atasoy 32 Dec 20, 2022
Ktor is an asynchronous framework for creating microservices, web applications and more.

ktor-sample Ktor is an asynchronous framework for creating microservices, web applications and more. Written in Kotlin from the ground up. Application

mohamed tamer 5 Jan 22, 2022
A TODO list app with location reminders that remind the user to do something when the user is at a specific location

Project Title Location Reminder Getting Started A TODO list app with location reminders that remind the user to do something when the user is at a spe

Raghav Saboo 0 Dec 5, 2021
Build with Jetpack Compose & all modern techniques and architecture of android app development

IMDB Movie App Build with Jetpack Compose & all modern techniques and architecture of android app development ScreenShots ?? Built With ?? Kotlin - Fi

Jayant Kumar 7 Dec 17, 2022
Math Your Brain is a math game built using Jetpack Compose and Modern MVVM Architecture

Math Your Brain is a math game built using Jetpack Compose and Modern MVVM Architecture. I built this so that programmers learning Jetpack Compose Can use this repository as a learning material for Jetpack Compose.

Somnath Mishra 47 Jan 1, 2023
A project that takes advantage of docker and makes the load test easier

Performance Test It's a project that takes advantage of docker and makes the load test easier. Also, it collects metrics from each running container.

jorge cabrera 1 Dec 9, 2021
A Tachidesk Desktop UI built in JetBrains Compose

TachideskJUI A free and open source manga reader to read manga from a Tachidesk server. TachideskJUI can run the Tachidesk server on its own, or conne

null 226 Jan 6, 2023