Skip to content

Commit 8a3af96

Browse files
committed
Test snippet plugin
1 parent ecbdcce commit 8a3af96

File tree

8 files changed

+249
-159
lines changed

8 files changed

+249
-159
lines changed

app/src/main/java/de/jensklingenberg/jetpackcomposeplayground/mysamples/github/activity/backhandler/BackHandlerExample.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import androidx.activity.compose.BackHandler
44
import androidx.compose.material.Text
55
import androidx.compose.runtime.*
66

7+
//# --8<-- [start:func]
78
@Composable
89
fun BackHandlerExample() {
910
var backPressedCount by remember { mutableStateOf(0) }
1011
BackHandler(enabled = true, onBack = {
1112
backPressedCount += 1
1213
})
1314
Text(text="Backbutton was pressed : $backPressedCount times")
14-
}
15+
}
16+
//# --8<-- [end:func]

docs/activity/backhandler.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@ You can use BackHandler to detect the presses on the device back button inside o
88

99
## Example
1010
```kotlin
11-
@Composable
12-
fun BackHandlerExample() {
13-
var backPressedCount by remember { mutableStateOf(0) }
14-
BackHandler(enabled = true, onBack = {
15-
backPressedCount += 1
16-
})
17-
Text(text="Backbutton was pressed : $backPressedCount times")
18-
}
11+
--8<-- "activity/backhandler/BackHandlerExample.kt:func"
1912
```
2013

2114
<p align="left">

docs/index.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ This is a community-driven collection of Jetpack Compose documentation/examples/
1717
<a href="https://twitter.com/intent/tweet?text=Hey, check out Jetpack-Compose-Playground https://github.com/Foso/Jetpack-Compose-Playground via @jklingenberg_ #Android
1818
"><img src="https://img.shields.io/twitter/url/https/github.com/angular-medellin/meetup.svg?style=social" alt="Tweet"></a>
1919

20-
20+
```kotlin
21+
--8<-- "activity/backhandler/BackHandlerExample.kt:func"
22+
```
2123

2224
## What is Jetpack Compose?
2325
"Jetpack Compose is a modern toolkit for building native Android UI. Jetpack Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs. "

gradle/wrapper/gradle-wrapper.jar

-10.6 KB
Binary file not shown.
+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Wed May 12 21:22:59 CEST 2021
21
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
42
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)