Skip to content

Commit 961a7a9

Browse files
committedSep 7, 2024
Update Box
1 parent bd90acd commit 961a7a9

File tree

2 files changed

+4
-19
lines changed
  • app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout
  • docs/layout

2 files changed

+4
-19
lines changed
 

‎app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/layout/BoxExample.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import androidx.compose.ui.unit.dp
1313

1414

1515
@Preview(showBackground = true)
16+
//# --8<-- [start:func]
1617
@Composable
1718
fun BoxExample() {
1819
Box(Modifier.fillMaxSize()) {
@@ -30,4 +31,5 @@ fun BoxExample() {
3031
Text("+")
3132
}
3233
}
33-
}
34+
}
35+
//# --8<-- [end:func]

‎docs/layout/box.md

+1-18
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,7 @@ The children of the Box layout will be stacked over each other. You can use the
1111

1212

1313
```kotlin
14-
@Composable
15-
fun BoxExample() {
16-
Box(Modifier.fillMaxSize()) {
17-
Text("This text is drawn first", modifier = Modifier.align(Alignment.TopCenter))
18-
Box(
19-
Modifier.align(Alignment.TopCenter).fillMaxHeight().width(
20-
50.dp
21-
).background(Color.Blue)
22-
)
23-
Text("This text is drawn last", modifier = Modifier.align(Alignment.Center))
24-
FloatingActionButton(
25-
modifier = Modifier.align(Alignment.BottomEnd).padding(12.dp),
26-
onClick = {}
27-
) {
28-
Text("+")
29-
}
30-
}
31-
}
14+
--8<-- "layout/BoxExample.kt:func"
3215
```
3316

3417
## Content Alignment

0 commit comments

Comments
 (0)
Failed to load comments.