Skip to content

Commit e5be833

Browse files
committed
More docs
1 parent fd8a86d commit e5be833

3 files changed

Lines changed: 42 additions & 7 deletions

File tree

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,51 @@
11
# Compose QR Code
22
__A simple, flexible QR Code Renderer For Jetpack Compose__
33

4-
[image: ./docs/images/purple_and_gold.png]
4+
<img src="./docs/images/purple_and_gold.png" width="150px" height="150px" />
5+
<img src="./docs/images/lightning.png" width="150px" height="150px" />
6+
<img src="./docs/images/light_smile_square.png" width="150px" height="150px" />
57

68
## Usage
79

10+
Here's a plain ol' boring QR Code:
811

912
```kotlin
13+
@Composable
14+
fun BoringPreview() {
15+
QrCodeView(
16+
data = "https://github.com/lightsparkdev/compose-qr-code",
17+
modifier = Modifier.size(300.dp)
18+
)
19+
}
20+
```
21+
22+
It'll look like this:
23+
24+
<img src="./docs/images/boring.png" width="150px" height="150px" />
25+
26+
Meh... Let's spice it up a bit with a smiley face:
27+
28+
```kotlin
29+
@Composable
30+
fun SmileyPreview() {
31+
QrCodeView(
32+
data = "https://github.com/lightsparkdev/compose-qr-code",
33+
modifier = Modifier.size(300.dp),
34+
overlayContent = {
35+
Box(
36+
contentAlignment = Alignment.Center,
37+
modifier = Modifier.fillMaxSize()
38+
) {
39+
Smile(
40+
modifier = Modifier.fillMaxSize(),
41+
backgroundColor = Color.Yellow,
42+
smileColor = Color.Black
43+
)
44+
}
45+
})
46+
}
47+
```
48+
49+
<img src="./docs/images/light_smile_square.png" width="150px" height="150px" />
1050

1151
TODO: Add a documentation and examples.

composeqrcode/src/main/java/com/lightspark/composeqr/Examples.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,7 @@ fun SmileyLightSquarePreview() {
125125
fun BoringPreview() {
126126
QrCodeView(
127127
data = URL_DATA,
128-
modifier = Modifier.size(300.dp),
129-
colors = QrCodeColors(
130-
background = Color.White,
131-
foreground = Color.Black
132-
),
133-
dotShape = DotShape.Square,
128+
modifier = Modifier.size(300.dp)
134129
)
135130
}
136131

docs/images/lightning.png

182 KB
Loading

0 commit comments

Comments
 (0)