AbhranilNXT/ComposeQRGenerator
A Jetpack Compose Library used to generate QR Code from text or url.
QR Generator Compose Library
A Jetpack Compose Library which can be used to generate QR Codes from texts.
Badges
๐ About the Library
This Library can be used to generate QR Codes in any Android Applications from a text or url. It can be used by calling the function qrGenerator(content = "<your_text>" inside the painter parameter of the
Image composable as Image(painter = qrGenerator(content = "<your_text>"), contentDescription = "QR Image"). Additional parameters of the qrGenerator function include size and padding which can be used as
qrGenerator(content = "<your_text>", size = <your_size>.dp, padding = <your_padding>.dp)
Implementation
Add it to your settings.gradle.kts file using:
dependencyResolutionManagement {
repositories {
maven { url = uri("https://jitpack.io") }
}
}and in your build.gradle.kts file using:
dependencies {
implementation("com.github.AbhranilNXT:ComposeQRGenerator:1.1.0")
}Demo Usage
Refer to the below code for using this library :
@Composable
fun Demo() {
Surface(modifier = Modifier.fillMaxSize()) {
Image(painter = qrGenerator(content = "https://github.com/AbhranilNXT/ComposeQRGenerator",
size = 300.dp,
padding = 8.dp), contentDescription = "Demo QR")
}
}The above code upon execution gets displayed as :
Author
License
Feedback
If you have any feedback, please reach out to us at abhranilnxt@gmail.com
Platforms/softwares(s) used to develop this:
Android: Android Studio, Jetpack Compose, ZWing, BitMap Painter
Source Code
To clone this repo and look into the source code, go to the terminal in your workspace and then type
Contributing
Contributions are always welcome!
Please adhere to this project's code of conduct.
