Skip to content

Commit 6b7b962

Browse files
committed
add composable Sheep! :D
1 parent 5b09ce7 commit 6b7b962

5 files changed

Lines changed: 29 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fun HelloWorld(
4949
```
5050

5151
## First steps for attendees
52-
52+
0. Follow local setup to set Python local variable: [Local setup and building](Local setup and building)
5353
1. Get the code
5454
- Open in Android Studio (Narwhal+). Let Gradle sync.
5555
- Or build from CLI: ./gradlew assembleDebug
@@ -111,7 +111,7 @@ If you see missing Python errors, set an environment variable ZEPATCH_PYTHON_PAT
111111
Example (macOS/Linux):
112112

113113
```bash
114-
export ZEPATCH_PYTHON_PATH=/usr/local/bin/python3
114+
export ZEPATCH_PYTHON_PATH=/usr/bin/python3
115115
```
116116

117117

app/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212

1313
defaultConfig {
1414
applicationId = "de.berlindroid.zepatch"
15-
minSdk = 24
15+
minSdk = 25
1616
targetSdk = 36
1717
versionCode = 1
1818
versionName = "1.0"
@@ -59,6 +59,7 @@ dependencies {
5959
implementation(libs.androidx.adaptive.navigation)
6060
implementation(libs.androidx.lifecycle.runtime.compose)
6161
implementation(libs.androidx.lifecycle.viewmodel.compose)
62+
implementation(libs.composableSheep)
6263

6364
// Patch annotations + processor
6465
implementation(project(":patch-annotations"))

app/src/main/java/de/berlindroid/zepatch/patchable/Demo.kt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ import androidx.compose.ui.unit.sp
3232
import de.berlindroid.zepatch.R
3333
import de.berlindroid.zepatch.annotations.Patch
3434
import de.berlindroid.zepatch.ui.SafeArea
35+
import dev.nstv.composablesheep.library.ComposableSheep
36+
import dev.nstv.composablesheep.library.model.Sheep
37+
import dev.nstv.composablesheep.library.util.SheepColor
3538

3639
@OptIn(ExperimentalMaterial3Api::class)
3740
@Patch("AppLogo")
@@ -274,3 +277,22 @@ fun PreviewFlex() {
274277
fun PreviewBerlindroid() {
275278
BerlindroidLogo()
276279
}
280+
281+
@Preview
282+
@Patch("Composable Sheep")
283+
@Composable
284+
fun ComposableSheepPatchable(
285+
shouldCapture: Boolean = false, // used to activate the convert to bitmap
286+
onBitmap: (ImageBitmap) -> Unit = {}, // used to return the bitmap from the SafeArea
287+
) {
288+
SafeArea(
289+
shouldCapture = shouldCapture,
290+
onBitmap = onBitmap,
291+
) {
292+
ComposableSheep(
293+
sheep = Sheep(fluffColor = SheepColor.Green),
294+
modifier = Modifier.size(300.dp),
295+
)
296+
}
297+
}
298+

converter/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android {
1010
compileSdk = 36
1111

1212
defaultConfig {
13-
minSdk = 24
13+
minSdk = 25
1414

1515
ndk {
1616
abiFilters += listOf("arm64-v8a", "x86_64")

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ junitKtx = "1.3.0"
1818
appcompat = "1.7.1"
1919
material = "1.13.0"
2020
jts = "1.20.0"
21+
composableSheep = "1.1.0"
2122

2223
[libraries]
2324
kotlinpoet = { group = "com.squareup", name = "kotlinpoet", version.ref = "kotlinpoet" }
@@ -47,6 +48,7 @@ androidx-junit-ktx = { group = "androidx.test.ext", name = "junit-ktx", version.
4748
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
4849
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
4950
jts = { group = "org.locationtech.jts", name = "jts-core", version.ref = "jts" }
51+
composableSheep = { module = "dev.nstv:composablesheep", version.ref = "composableSheep" }
5052

5153
[plugins]
5254
android-application = { id = "com.android.application", version.ref = "agp" }

0 commit comments

Comments
 (0)