darkmoon_uk
12/03/2021, 4:23 AMKrystian Kaniowski
12/03/2021, 4:10 PMe: This version (1.1.0-beta01) of the Compose Compiler requires Kotlin version 1.5.31 but you appear to be using Kotlin version 1.6.0 which is not known to be compatible. Please fix your configuration (orPS compose-android 1.1.0-beta04 works with 1.6.0but don't say I didn't warn you!).suppressKotlinVersionCompatibilityCheck
Humphrey
12/05/2021, 8:22 AMSean Proctor
12/07/2021, 2:04 PMDave Barrett
12/09/2021, 2:23 PMDirk Hoffmann
12/10/2021, 1:56 PMBasicTextField
I want to trigger some stuff on pressing Ctrl-Space:
modifier.onPreviewKeyEvent {
val awtKeyEvent = it.nativeKeyEvent as java.awt.event.KeyEvent
println(it)
println(awtKeyEvent)
...
on pressing Ctrl-Space the KeyEvents for the Space char never come along, only for the Ctrl key ... but not the space key:
KeyEvent(nativeKeyEvent=java.awt.event.KeyEvent[KEY_PRESSED,keyCode=17,keyText=⌃,keyChar=Undefined keyChar,modifiers=⌃,extModifiers=⌃,keyLocation=KEY_LOCATION_LEFT,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x11] on canvas0)
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=17,keyText=⌃,keyChar=Undefined keyChar,modifiers=⌃,extModifiers=⌃,keyLocation=KEY_LOCATION_LEFT,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x11] on canvas0
KeyEvent(nativeKeyEvent=java.awt.event.KeyEvent[KEY_RELEASED,keyCode=17,keyText=⌃,keyChar=Undefined keyChar,keyLocation=KEY_LOCATION_LEFT,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x11] on canvas0)
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=17,keyText=⌃,keyChar=Undefined keyChar,keyLocation=KEY_LOCATION_LEFT,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x11] on canvas0
compared to pressing Alt-Space where also Key Events for the space char DO come along. e.g.:
KeyEvent(nativeKeyEvent=java.awt.event.KeyEvent[KEY_PRESSED,keyCode=32,keyText=␣,keyChar=' ',modifiers=⌥,extModifiers=⌥,keyLocation=KEY_LOCATION_STANDARD,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x0] on canvas0)
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=32,keyText=␣,keyChar=' ',modifiers=⌥,extModifiers=⌥,keyLocation=KEY_LOCATION_STANDARD,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x0] on canvas0
KeyEvent(nativeKeyEvent=java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Unknown keyCode: 0x0,keyChar=' ',modifiers=⌥,extModifiers=⌥,keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x0] on canvas0)
Why Ctrl-Space events for the Space key do not come along, but Alt-Space space key does??d.medina
12/11/2021, 7:21 PMd.medina
12/11/2021, 7:22 PMAli Albaali
12/13/2021, 10:17 PM@NonRestartableComposable
@Composable
inline fun <T> PagingEffect(
iterable: Iterable<T>,
currentIndex: Int,
crossinline block: (T) -> Unit,
) {
SideEffect {
iterable.runOnIndex(currentIndex, block)
}
}
inline fun <T> Iterable<T>.runOnIndex(currentIndex: Int, block: (T) -> Unit) {
withIndex().last().apply {
if (index == currentIndex)
block(value)
}
}
And using it like this:
LazyColumn {
val list = listOf<Item>()
itemsIndexed(list) { index, item ->
PagingEffect(list, index) {
// Request more items
}
}
}
Is there a better way?spierce7
12/15/2021, 4:30 PMSrSouza
12/16/2021, 7:59 PMJavier
12/17/2021, 2:42 PMAli Albaali
12/18/2021, 6:26 AMWaqas Tahir
12/18/2021, 4:31 PMjw
12/18/2021, 4:32 PMWaqas Tahir
12/18/2021, 4:32 PMAyfri
12/20/2021, 11:01 PMAyfri
12/23/2021, 2:59 PMTechcable
12/25/2021, 2:35 AMTechcable
12/25/2021, 2:35 AMTechcable
12/25/2021, 2:36 AMmalloc
(since valgrind can't trace it either).xxfast
12/25/2021, 8:04 AMKirill Grouchnikov
12/27/2021, 8:47 PMMichał Kalinowski
12/29/2021, 1:17 PMKirill Grouchnikov
12/29/2021, 8:23 PMTechcable
12/31/2021, 12:41 AMTechcable
12/31/2021, 12:41 AMStuie
12/31/2021, 10:28 PMOffz
01/07/2022, 1:40 AMfoundation-layout
module without having to depend on all the UI code that uses Skia (or deal with internal classes.) Really I just want a way to provide a custom canvas and have nodes that render to that canvas with the existing layout system. Are there perhaps other projects I could look at?Jan
01/07/2022, 1:27 PM