Giter Site home page Giter Site logo

composedbarcodes's Introduction

Composed Barcodes

Make barcode views with ease in Jetpack Compose.

Gradle users:

implementation("com.simonsickle:composed-barcodes:1.1.1")

Examples

Displaying barcodes is super easy! Simply call the composable in your layout.

val URL = "https://github.com/simonsickle/ComposedBarcodes"
// Make sure the value is valid for the type of barcode selected. The library will
// just show an infinite spinner in place of a barcode if the data is not valid.
if (BarcodeType.QR_CODE.isValueValid(URL)) {
    Barcode(
        modifier = Modifier.align(Alignment.CenterHorizontally)
            .width(150.dp)
            .height(150.dp),
        resolutionFactor = 10, // Optionally, increase the resolution of the generated image
        type = BarcodeType.QR_CODE, // pick the type of barcode you want to render
        value = URL // The textual representation of this code
    )
}

// You must handle invalid data yourself
if (!BarcodeType.CODE_128.isValueValid(URL)) {
    Text("this is not code 128 compatible")
}

Supported Barcode Types

We are using ZXing to generate our barcodes and are limited to the types supported by that library. The following are all supported:

EAN_8
UPC_E
EAN_13
UPC_A
QR_CODE
CODE_39
CODE_93
CODE_128
ITF
PDF_417
CODABAR
DATA_MATRIX
AZTEC

composedbarcodes's People

Contributors

simonsickle avatar alexodus avatar martyup avatar mortenholmgaard avatar simonsickle-old avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.