Sam Michael
08/06/2021, 5:16 AMSam Michael
08/06/2021, 7:39 AM@Composable
private fun tileButton(
isVisible: MutableState<Boolean> = mutableStateOf(false),
turn: MutableState<Int> = mutableStateOf(0)
) = Box(
modifier = Modifier.background(accentAmber).size(60.dp).padding(0.dp).border(0.dp, accentAmber)
.clickable(onClick = {
isVisible.value = true
turn.value += 1
}).drawBehind {
drawVerticalLine()
drawHorizontalLine()
}.drawWithContent {
drawCorrectColorCircle(isVisible, turn)
}) {
}
Stefan Oltmann
08/06/2021, 10:17 AMAlexey Glushkov
08/06/2021, 1:41 PMcompileJava
task: https://pastebin.com/ghZLKS21 (Could not resolve all task dependencies for configuration)
Is it correct that I can’t build a compose desktop app with java source code? I tried to bring Dagger in my compose-jb target and as it generated java files I got such an error…
The changes for ToDo sample app to reproduce the behavior: https://github.com/soniccat/compose-jb/commit/df0dc8a88e8cbb4bb0abd8e88e22f20ac8d676ea
Also I had the same problem here for some reasons: https://kotlinlang.slack.com/archives/C01D6HTPATV/p1628078176106900darkmoon_uk
08/06/2021, 3:15 PM1.0.0-alpha3
)? It's failing with this in the Preview window:
The following classes could not be found:
- androidx.compose.ui.tooling.preview.ComposeViewAdapter
...searching this error shows it was notoriously common throughout the Arctic Fox Beta's, but supposedly fixed for release. Does the Multiplatform Compose artifact need to be updated?
Desktop Preview's working, but Android doesn't.darkmoon_uk
08/06/2021, 3:19 PMcommon
source set i.e. define a @Preview
from within some materialCommon
(Desktop + Android) source set. When we develop a Multiplatform Project for Desktop + Mobile this is (very happily) where we can define most of our Compose components, so not being able to define @Preview
here as well, sadly makes the Preview feature useless in this scenario. I played with different `expect`/`actual` definitions for the Preview
annotation, but couldn't make anything that improved the experience.theapache64
08/06/2021, 5:32 PMonCloseRequest
of the new Window
API?
Why onCloseRequest: () -> Unit
and why not onCloseRequest: () -> Unit = { exitProcess(0) }
? 🤔theapache64
08/06/2021, 5:41 PMicon
property not working 🧵dbaelz
08/06/2021, 7:09 PMContextMenuDataProvider
work on every Composable and show menu (with custom entries) on right click? Doesn't work for me on Text, but works fine (with defaults) on TextField. Tested with alpha 2 and alpha3. Code in 🧵Colton Idle
08/07/2021, 1:19 AMnamed("commonMain") {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
// Needed only for preview.
implementation(compose.preview)
}
}
Does this mean that preview is available in common code?Ayfri
08/07/2021, 3:25 AMFrank
08/07/2021, 9:33 AMimplementation("io.coil-kt:coil:1.3.2")
But then I build i I get the following error message(s):
Could not resolve all files for configuration ‘:compileClasspath’.> Could not resolve io.coil-kt:coil:1.3.2. Required by: project : > No matching variant of io.coil-kt:coil:1.3.2 was found. The consumer was configured to find an API of a library compatible with Java 15, Any ideas how to solve this?
Konyaco
08/07/2021, 2:34 PMjava.lang.OutOfMemoryError: Java heap space
on :android:mergeExtDexDebug
task when building android mudule.
My compose version is "1.0.0-alpha3".
Here is my project structure:
common module
---- service (written as expect class
)
---- compose ui, viewmodel (dependens on service)
android module
---- actual
service
---- Activity that boots compose ui.
jvm module
---- actual
service (exactly the same as android)
---- Main function that boots compose ui.
If I only build jvm module, all work fine.
I try to move the code from common module to android module, and that works fine too.
My codes were shared to my github repository, as a branch (https://github.com/Konyaco/CollinsDictionary/tree/multiplatform).
And I wonder that is there a best way to reuse code between JVM and Android targets? The apis are same in most occasions.darkmoon_uk
08/07/2021, 3:07 PM@Preview
support 'Interactive mode' like Android?
One of the very best things about Preview in Android is the ability to run Views with real ViewModels behind them; just with mocked services/data plugged in.Christian Babsek
08/07/2021, 4:34 PMmouseClickable
on the Modifier. Is it possible, to register it multiple times? It currently consumes the event and just the last "registration" takes effect. I tried to create some convenient extensions, but just the last of it seems to be called:
@Composable
fun Modifier.onLeftClickOnly(action: () -> Unit) = mouseClickable {
println("left")
if (buttons.isPrimaryPressed && !buttons.isSecondaryPressed && !buttons.isTertiaryPressed) {
action()
}
}
@Composable
fun Modifier.onMiddleClickOnly(action: () -> Unit) = mouseClickable {
if (!buttons.isPrimaryPressed && !buttons.isSecondaryPressed && buttons.isTertiaryPressed) {
action()
}
}
@Composable
fun Modifier.onRightClickOnly(action: () -> Unit) = mouseClickable {
println("right")
if (!buttons.isPrimaryPressed && buttons.isSecondaryPressed && !buttons.isTertiaryPressed) {
action()
}
}
PHondogo
08/08/2021, 5:44 PMColton Idle
08/09/2021, 4:24 PMColton Idle
08/09/2021, 4:35 PMRuckus
08/09/2021, 9:37 PMlouiscad
08/09/2021, 10:31 PMjava.lang.Thread
) of a Compose for Desktop app?
My use case is checking whether some code is running on the main thread or not, to disallow running some blocking code where it could affect the UI.Abe Sol
08/10/2021, 8:53 AMpainterResource
can't be found (on Desktop). Is there an alternative?Mak Ho-Cheung
08/11/2021, 1:39 AMKonyaco
08/11/2021, 9:12 AMval WordNotFoundLRes = painterResource("wordnotfound_l.svg")
Image(
painter = WordNotFoundLRes,
contentDescription = "Word Not Found",
colorFilter = null
)
dbaelz
08/11/2021, 1:02 PMonNodeWithText
) can't find the text and I assume it's because it's in a different window and the rule can't access it? Did look into the DesktopComposeTestRule
and saw that it creates a window for the test and so on, but can't figure out a way to test the visibility of the dialog texts.Colton Idle
08/11/2021, 3:34 PMkevindmoore
08/11/2021, 3:44 PMspierce7
08/11/2021, 8:29 PMyeungkc
08/13/2021, 4:33 PMkevindmoore
08/14/2021, 7:46 PMYou are using an outdated version of Compose Runtime that is not compatible with the version of the Compose Compiler plugin you have installed. The compose compiler plugin you are using (version 1.1.0-alpha01) expects a minimum runtime version of 1.1.0-alpha01
Ayfri
08/14/2021, 9:40 PMAyfri
08/14/2021, 9:40 PMIgor Demin
08/14/2021, 11:42 PM