mirror of
https://github.com/smyalygames/checklist-tester.git
synced 2026-01-01 09:18:43 +01:00
feat(dissertation): add code example for modular compose functions
This commit is contained in:
55
pub/dissertation/code/compose-modular.kt
Normal file
55
pub/dissertation/code/compose-modular.kt
Normal file
@@ -0,0 +1,55 @@
|
||||
@Composable
|
||||
override fun Content() {
|
||||
// Content variables...
|
||||
|
||||
Scaffold(
|
||||
topBar = {/* Composable content... */},
|
||||
) {
|
||||
Column(/* Column option parameters... */) {
|
||||
Box(/* Box option parameters... */) {
|
||||
LazyColumn(/* LazyColumn option parameters... */) {
|
||||
|
||||
item {
|
||||
Header()
|
||||
}
|
||||
|
||||
items(
|
||||
items = inputs,
|
||||
key = { input -> input.id }
|
||||
) { item ->
|
||||
ActionItem(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Header() {
|
||||
Text(text = "Edit Actions")
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ActionItem(item: Action) {
|
||||
Column (/* Column option parameters... */) {
|
||||
Row(/* Row option parameters... */) {
|
||||
Text(text = "Action ${item.step + 1}")
|
||||
|
||||
IconButton(/* IconButton definition parameters... */) {
|
||||
Icon(
|
||||
Icons.Outlined.Delete,
|
||||
// Rest of Icon options...
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Row(/* Row option parameters... */) {
|
||||
OutlinedTextField(/* TextField definition parameters... */)
|
||||
|
||||
OutlinedTextField(/* TextField definition parameters... */)
|
||||
}
|
||||
|
||||
HorizontalDivider()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user