Created
October 4, 2019 13:30
-
-
Save NickHolcombe/73ee783ec3c6c1d7fcd06996a11e49a6 to your computer and use it in GitHub Desktop.
Barcode blog displayBitmap.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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