Skip to content

Instantly share code, notes, and snippets.

@NickHolcombe
Created October 4, 2019 13:30
Show Gist options
  • Save NickHolcombe/73ee783ec3c6c1d7fcd06996a11e49a6 to your computer and use it in GitHub Desktop.
Save NickHolcombe/73ee783ec3c6c1d7fcd06996a11e49a6 to your computer and use it in GitHub Desktop.
Barcode blog displayBitmap.kt
private fun displayBitmap(value: String) {
val widthPixels = resources.getDimensionPixelSize(R.dimen.width_barcode)
val heightPixels = resources.getDimensionPixelSize(R.dimen.height_barcode)
image_barcode.setImageBitmap(
createBarcodeBitmap(
barcodeValue = value,
barcodeColor = getColor(R.color.colorPrimary),
backgroundColor = getColor(android.R.color.white),
widthPixels = widthPixels,
heightPixels = heightPixels
)
)
text_barcode_number.text = value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment