xetra11
11/25/2020, 2:10 PMxetra11
11/25/2020, 2:31 PMJetpack Compose
vs
JetBrains Compose Android/JVM/Multiplatform
xetra11
11/25/2020, 3:55 PMxetra11
11/25/2020, 3:56 PMTimo Drick
11/25/2020, 5:57 PMxetra11
11/25/2020, 8:21 PMList<String>
. However I'd like to manipulate that state from another @Composable
function (a popup dialog that opens). The values added in the popup should be added to the List<String>
of the mentioned table so the content is updated there immediatly.
I have a hard time grasping the concepts of state in Compose for Desktop. I am coming from a Vue.js background and I could not build the bridge regarding understanding the way to do that in Compose for Desktop.
Therefore I'd like to ask for some keywords I should look out for on Google. I already tried a lib called Decompose
but I do not fully understand it as it seems to only care about state within a component and not appwide (from my understanding)Dominaezzz
11/26/2020, 9:42 AMLazyColumnFor
not supposed to have a scroll bar by default?Martin Nowosad
11/26/2020, 1:05 PMtitle
are all lambdas in form of ()->Unit
?Adam Powell
11/26/2020, 3:46 PMAdam Powell
11/26/2020, 3:47 PMTimo Drick
11/27/2020, 4:53 PMNikky
11/28/2020, 10:05 AMexpect
/`actual` ? is there anyone who has built a android + desktop UI with this that shares components ?Lazard
11/28/2020, 4:36 PMval (counter, setCounter) = remember { mutableStateOf(0) }
If I want to create a incrementCounter()
function to prevent writing setCounter(counter + 1)
each time, inside my component I can write :
fun incrementCounter(value = 1) { setCounter(counter + value) }
But doing so, Jetpack Compose will behave weirdly and won't update the counter each time.
If I instead declare it like that :
val incrementCounter = fun(value: Int) { setCounter(counter + value) }
It work without any problem ! The only problem is that I cannot use default values with this syntax.
It reminds me of the arrow function in javascript and the reference of this
.
After a lot of trial and error, it seems the destructuration of the mutableState return is the culprit.
Does anybody have an idea ? Is it possible to write an internal function in a Jetpack Compose component while still using destructuration ?xetra11
11/28/2020, 8:36 PMAnimesh Sahu
11/29/2020, 10:15 AMjava.awt.Toolkit.getDefaultToolkit().screenSize
the correct way to obtain current screen dimensions?
If yes, how'd ya obtain it in K/N in the future? Otherwise what's the correct way...Tomoaki Iwasaki
11/29/2020, 12:09 PMAnimesh Sahu
11/29/2020, 1:54 PMxetra11
11/29/2020, 2:09 PMWindow()
call. However it is not allowed due the following error:
(24, 5): Functions which invoke @Composable functions must be marked with the @Composable annotation
(25, 56): @Composable invocations can only happen from the context of a @Composable function
(32, 35): @Composable invocations can only happen from the context of a @Composable function
(33, 16): @Composable invocations can only happen from the context of a @Composable function
This is the snippet:
fun main() {
val characterState: SnapshotStateList<Character> = remember {
mutableStateListOf(
CharacterTemplate.DEFAULT_CHARACTER,
CharacterTemplate.DEFAULT_CHARACTER,
CharacterTemplate.DEFAULT_CHARACTER
)
}
val window = AppWindowAmbient.current!!.window
val file = remember { mutableStateOf(File("")) }
Window(
title = "CK3 Mod Workbench",
menuBar = MenuBar(
Menu("File", MenuItem("Exit", onClick = { AppManager.exit() })),
Menu(
"Characters",
MenuItem("Import characters", onClick = { }),
MenuItem("Dynasties", onClick = {})
),
)
) {
MaterialTheme(
colors = workbenchLightColors(),
shapes = workBenchShapes()
) {
CharacterModuleView()
}
}
}
Arkadii Ivanov
11/29/2020, 3:07 PM0.2.0-build132
requires Kotlin 1.4.20, whereas Jetpack Compose 1.0.0-alpha07
requires Kotlin 1.4.10. Looks like I'm forced to use some older version of JetBrains Compose.Animesh Sahu
11/29/2020, 3:56 PMkevin
11/29/2020, 9:44 PMkevin
11/30/2020, 12:35 AMMichael Paus
11/30/2020, 2:00 PMLazard
11/30/2020, 9:38 PMTimo Drick
12/01/2020, 1:06 AMThomas
12/01/2020, 12:56 PM@Composable
fun ThirdRow(currentPos: Int, checksums: List<String>) {
val items = if (checksums.isNotEmpty())
df.getFiles(checksums[currentPos]) else emptyList()
LazyColumnFor(items,
modifier = Modifier.fillMaxSize().padding(8.dp),
itemContent = { item ->
ListItem(text = { Text(item.parent) },
secondaryText = { Text(item.name) })
})
}
ckloss
12/01/2020, 9:11 PMHamza GATTAL
12/01/2020, 11:02 PMsuresh
12/02/2020, 7:29 PM./gradlew packageUberJarForCurrentOS
without any additional plugin (shadow)Dominaezzz
12/02/2020, 8:20 PMDominaezzz
12/02/2020, 8:20 PMArkadii Ivanov
12/02/2020, 8:23 PMDominaezzz
12/02/2020, 8:24 PM