spierce7
11/11/2020, 9:37 PMspierce7
11/12/2020, 2:39 AMColumn(
Modifier
.fillMaxSize()
.padding(20.dp)
) {
Text(
text = "Test test test asdfasdfa sfj aslf lajsdlf jlajdsfl jlasjf jaslkfj klajdfl jaslf lkasjfljaslk f",
style = typography.h3,
color = Color.White,
textAlign = TextAlign.End,
modifier = Modifier.background(Color.Black),
)
}
Se7eN
11/12/2020, 8:12 AMdrawLayer(rotationY = 35f, transformOrigin = TransformOrigin(0))
but it doesn't look 3d. Do I have to scale or something like that? I tried different scale values but no luck.mayojava
11/12/2020, 10:01 AMVadim Kapustin
11/12/2020, 11:51 AM@Composable
fun IconWithHint(
asset: ImageAsset,
modifier: Modifier = Modifier,
tint: Color = AmbientContentColor.current,
hint: @Composable() () -> Unit
) {
val entered = remember { mutableStateOf(false) }
Box {
Icon(asset,
modifier.pointerMoveFilter(
onEnter = {
entered.value = true
false
},
onExit = {
entered.value = false
false
}
),
tint
)
if (entered.value) hint()
}
}
spierce7
11/12/2020, 3:27 PMMichał Kalinowski
11/12/2020, 5:37 PMMahdi Safarmohammadloo
11/12/2020, 6:17 PMFoso
11/12/2020, 6:29 PMsuresh
11/12/2020, 10:03 PMAdrianTodt
11/13/2020, 12:32 AMsuresh
11/13/2020, 7:41 AMcom.intellij.psi.stubs.UpToDateStubIndexMismatch: PSI and index do not match.
Please report the problem to JetBrains with the files attached
INDEXED VERSION IS THE CURRENT ONE file=KtFile: ProduceStateScopeImpl.class, file.class=class org.jetbrains.kotlin.idea.decompiler.classFile.KtClsFile, file.lang=Language: kotlin, modStamp=1
AST INCONSISTENT, perhaps after incremental reparse; KtFile: ProduceStateScopeImpl.class
stub debugInfo=created in getStubTree(), with AST = false; with backReference
latestIndexedStub=StubTree{myDebugInfo='created from index; with backReference', myRoot=PsiJetFileStubImpl[package=androidx.compose.runtime]}1615692120
same size=true
debugInfo=created from index; with backReference
viewProvider=org.jetbrains.kotlin.idea.decompiler.KotlinDecompiledFileViewProvider{vFile=jar:///Users/xxx/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.runtime/runtime-desktop/0.1.0-build113/3210ec4f762a877390f2b6462f3919cd3a6580e9/runtime-desktop-0.1.0-build113.jar!/androidx/compose/runtime/ProduceStateScopeImpl.class, vFileId=1202084, content=VirtualFileContent{size=5451}, eventSystemEnabled=true}
viewProvider stamp: 0; file stamp: 0; file modCount: 1605036751442; file length: 5451
doc saved: true; doc stamp: 0; doc size: 772; committed: true
indexing info: indexing timestamp = 1605036751442, binary = true, byte size = 5451, char size = -1
at com.intellij.psi.stubs.StubTreeLoader.handleUpToDateMismatch(StubTreeLoader.java:135)
Fudge
11/13/2020, 11:37 AMVadim Kapustin
11/13/2020, 11:53 AMAnimesh Sahu
11/13/2020, 2:01 PMval shape = GenericShape { size ->
moveTo(size.width / 2f, 0f)
lineTo(size.width, size.height)
lineTo(0f, size.height)
}
After copy pasting the triangle shape (which I'm going to change later), I don't have idea of how to draw it.
Shape seems to be a parameter of Modifier.border
, Modifier.drawLayer
, so I tried, but nothing works 😛 :
fun main() =
Window(
title = "Compose for Desktop",
size = IntSize(300, 300),
) {
DesktopMaterialTheme(
colors = lightColors(background = Color.Cyan),
) {
Box(modifier = Modifier.border(5.dp, Color.Cyan, shape))
}
}
Any thoughts?Dominaezzz
11/14/2020, 11:28 AMKirill Grouchnikov
11/15/2020, 8:39 PMAppWindowAmbient.current.y
gives the top location of the current desktop window. Is there a way to get the vertical offset from the window top for Canvas
or DrawScope
? That would allow doing vertical gradients across multiple composables without trying to place them into a common container.Kirill Grouchnikov
11/15/2020, 9:12 PMGreg Steckman
11/15/2020, 10:30 PMandylamax
11/17/2020, 3:26 PMalorma
11/17/2020, 4:26 PMalorma
11/17/2020, 5:06 PMColumn(
modifier = Modifier.padding(16.dp),
) {
Surface(
elevation = 4.dp,
modifier = Modifier.clip(MaterialTheme.shapes.medium)
.background(color = MaterialTheme.colors.primary)
.clickable {}
.padding(8.dp)
) {
Text(text = "${repo.owner.login}/${repo.name}")
}
}
Paul Nogas
11/17/2020, 7:14 PMKirill Grouchnikov
11/17/2020, 7:32 PMZach Klippenstein (he/him) [MOD]
11/17/2020, 11:43 PMKyant
11/18/2020, 4:56 AMPaul Woitaschek
11/18/2020, 10:36 AMjava {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
But when running from the command line:
./gradlew run
It shows an error:
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: org/jetbrains/skiko/Library has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Vadim Kapustin
11/18/2020, 11:32 AMIcon(imageFromResource("images/logo.png"))
But sometimes, when the system is under heavy load I have NullPointerException in DesktopImageAssetKt.loadResource()
Apparently the icon doesn't have time to load...
How to make waiting for the icon to load and then display it?bjonnh
11/18/2020, 2:50 PMTimo Drick
11/19/2020, 1:55 PMTimo Drick
11/19/2020, 1:55 PM#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007efd5f0d3f4a, pid=46282, tid=46347
#
# JRE version: OpenJDK Runtime Environment (15.0+32) (build 15-ea+32-Ubuntu-220.04)
# Java VM: OpenJDK 64-Bit Server VM (15-ea+32-Ubuntu-220.04, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C [libskiko.so+0x95af4a] SkSwizzler::swizzle(void*, unsigned char const*)+0xa
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/timo/dev/compose/my_gitlab/imagebrowser/core.46282)
#
# If you would like to submit a bug report, please visit:
# Unknown
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- S U M M A R Y ------------
Command Line: -javaagent:/home/timo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm/1.3.9/4be434f5e86c1998a273e7f19a7286440894f0b0/kotlinx-coroutines-core-jvm-1.3.9.jar -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea MainKt
Host: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz, 8 cores, 15G, Ubuntu 20.04.1 LTS
Time: Sun Nov 15 04:57:57 2020 CET elapsed time: 152.624555 seconds (0d 0h 2m 32s)
--------------- T H R E A D ---------------
Current thread (0x00007efce4000e50): JavaThread "DefaultDispatcher-worker-1 @coroutine#9327" daemon [_thread_in_native, id=46347, stack(0x00007efd0850e000,0x00007efd0860f000)]
Stack: [0x00007efd0850e000,0x00007efd0860f000], sp=0x00007efd0860c3c8, free space=1016k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libskiko.so+0x95af4a] SkSwizzler::swizzle(void*, unsigned char const*)+0xa
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 6629 org.jetbrains.skija.Canvas._nDrawImageIRect(JJIIIIFFFFJZ)V (0 bytes) @ 0x00007efde8724815 [0x00007efde87247a0+0x0000000000000075]
J 7354 c1 org.jetbrains.skija.Canvas.drawImage(Lorg/jetbrains/skija/Image;FFLorg/jetbrains/skija/Paint;)Lorg/jetbrains/skija/Canvas; (48 bytes) @ 0x00007efde1347c64 [0x00007efde1347640+0x0000000000000624]
J 7353 c1 org.jetbrains.skija.Canvas.drawImage(Lorg/jetbrains/skija/Image;FF)Lorg/jetbrains/skija/Canvas; (9 bytes) @ 0x00007efde10382a4 [0x00007efde10381a0+0x0000000000000104]
J 7352 c1 androidx.compose.ui.graphics.DesktopImageAssetKt.toBitmap(Lorg/jetbrains/skija/Image;)Lorg/jetbrains/skija/Bitmap; (51 bytes) @ 0x00007efde13d9654 [0x00007efde13d8b80+0x0000000000000ad4]
J 6846 c1 de.appsonair.compose.FileUtilsKt$toImageAsset$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; (50 bytes) @ 0x00007efde18ace1c [0x00007efde18ac880+0x000000000000059c]
J 6848 c1 de.appsonair.compose.FileUtilsKt$toImageAsset$2.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; (19 bytes) @ 0x00007efde18adc04 [0x00007efde18ad960+0x00000000000002a4]
J 6490 c1 kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Lkotlinx/coroutines/internal/ScopeCoroutine;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object; (265 bytes) @ 0x00007efde1473d4c [0x00007efde1473880+0x00000000000004cc]
J 4776 c1 kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; (212 bytes) @ 0x00007efde16b49dc [0x00007efde16b3ca0+0x0000000000000d3c]
J 6844 c1 de.appsonair.compose.FileUtilsKt.toImageAsset(Lorg/jetbrains/skija/Image;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; (30 bytes) @ 0x00007efde18ab514 [0x00007efde18ab200+0x0000000000000314]
J 6874 c1 de.appsonair.compose.FileUtilsKt$toScaledImageAsset$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; (450 bytes) @ 0x00007efde18c6074 [0x00007efde18c3940+0x0000000000002734]
J 6646 c1 de.appsonair.compose.FileUtilsKt$toScaledImageAsset$2.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; (19 bytes) @ 0x00007efde0da6c04 [0x00007efde0da6960+0x00000000000002a4]
J 6490 c1 kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Lkotlinx/coroutines/internal/ScopeCoroutine;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object; (265 bytes) @ 0x00007efde1473d4c [0x00007efde1473880+0x00000000000004cc]
J 4776 c1 kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; (212 bytes) @ 0x00007efde16b49dc [0x00007efde16b3ca0+0x0000000000000d3c]
J 6627 c1 de.appsonair.compose.FileUtilsKt.toScaledImageAsset(Lorg/jetbrains/skija/Image;Ljava/lang/String;IILkotlin/coroutines/Continuation;)Ljava/lang/Object; (34 bytes) @ 0x00007efde10124d4 [0x00007efde1012180+0x0000000000000354]
J 6089 c1 de.appsonair.compose.FileUtilsKt$loadImageSizeFile$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; (201 bytes) @ 0x00007efde17c8214 [0x00007efde17c76e0+0x0000000000000b34]
J 3605 c2 kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Ljava/lang/Object;)V (142 bytes) @ 0x00007efde83f0660 [0x00007efde83f05e0+0x0000000000000080]
J 6572 c2 kotlinx.coroutines.DispatchedTask.run()V (580 bytes) @ 0x00007efde8715acc [0x00007efde8715820+0x00000000000002ac]
J 6611 c1 kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(Lkotlinx/coroutines/scheduling/Task;)V (85 bytes) @ 0x00007efde0e565ac [0x00007efde0e564a0+0x000000000000010c]
J 6608 c1 kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(Lkotlinx/coroutines/scheduling/Task;)V (39 bytes) @ 0x00007efde115ff0c [0x00007efde115fc80+0x000000000000028c]
j kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker()V+44
j kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run()V+1
v ~StubRoutines::call_stub
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000002e64
Register to memory mapping:
.....
olonho
11/19/2020, 2:06 PMTimo Drick
11/19/2020, 2:08 PMIgor Demin
11/19/2020, 2:33 PMSo maybe is it necessary to be on the Main/UI threadBy design "Image.asImageAsset()" should be allowed to be called from any thread (because it doesn't use common resources) Maybe it is a bug in skia/skija. Reproducer will help a lot to understand where the bug is.
Timo Drick
11/19/2020, 2:45 PM