Skip to content

Commit a289c76

Browse files
hamenalisen
authored andcommitted
Add CodeWithBoi
1 parent f43d92e commit a289c76

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package de.berlindroid.zepatch.patchable
2+
3+
import androidx.compose.foundation.Image
4+
import androidx.compose.foundation.background
5+
import androidx.compose.foundation.layout.Box
6+
import androidx.compose.foundation.layout.padding
7+
import androidx.compose.foundation.layout.size
8+
import androidx.compose.material3.ExperimentalMaterial3Api
9+
import androidx.compose.runtime.Composable
10+
import androidx.compose.ui.Modifier
11+
import androidx.compose.ui.graphics.Color
12+
import androidx.compose.ui.graphics.ImageBitmap
13+
import androidx.compose.ui.res.painterResource
14+
import androidx.compose.ui.tooling.preview.Preview
15+
import androidx.compose.ui.unit.dp
16+
import de.berlindroid.zepatch.R
17+
import de.berlindroid.zepatch.annotations.Patch
18+
import de.berlindroid.zepatch.ui.SafeArea
19+
20+
@OptIn(ExperimentalMaterial3Api::class)
21+
@Patch("CodeWithBoi")
22+
@Composable
23+
fun CodeWithBoi(
24+
shouldCapture: Boolean = false,
25+
onBitmap: (ImageBitmap) -> Unit = {},
26+
) {
27+
SafeArea(
28+
shouldCapture = shouldCapture,
29+
onBitmap = onBitmap,
30+
) {
31+
Box(
32+
Modifier.background(Color.White).padding(16.dp)
33+
) {
34+
Image(
35+
modifier = Modifier.size(200.dp),
36+
painter = painterResource(R.drawable.codewithboi),
37+
contentDescription = null
38+
)
39+
}
40+
}
41+
}
42+
43+
44+
@Preview
45+
@Composable
46+
private fun CodeWithBoiPrev() {
47+
CodeWithBoi { }
48+
}
43.8 KB
Loading

0 commit comments

Comments
 (0)