File tree Expand file tree Collapse file tree
composeqrcode/src/main/java/com/lightspark/composeqr Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
1151TODO: Add a documentation and examples.
Original file line number Diff line number Diff line change @@ -125,12 +125,7 @@ fun SmileyLightSquarePreview() {
125125fun 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
You can’t perform that action at this time.
0 commit comments