mirror of
https://github.com/markusfisch/BinaryEye.git
synced 2024-09-20 03:52:16 +02:00
Add DX_FILM_EDGE barcode format
And add it to the selected barcodes so it's immediately available for existing installations too.
This commit is contained in:
parent
ef7e2a4b0d
commit
2e89f1530a
@ -36,6 +36,7 @@ ZXing can read the following barcode formats:
|
|||||||
* [CODE 93][code_93]
|
* [CODE 93][code_93]
|
||||||
* [CODE 128][code_128]
|
* [CODE 128][code_128]
|
||||||
* [DATA MATRIX][data_matrix]
|
* [DATA MATRIX][data_matrix]
|
||||||
|
* [DX FILM EDGE][dx_film_edge]
|
||||||
* [EAN 8][ean_8]
|
* [EAN 8][ean_8]
|
||||||
* [EAN 13][ean_13]
|
* [EAN 13][ean_13]
|
||||||
* [ITF][itf]
|
* [ITF][itf]
|
||||||
@ -144,6 +145,7 @@ class YourActivity : Activity() {
|
|||||||
[code_93]: https://en.wikipedia.org/wiki/Code_93
|
[code_93]: https://en.wikipedia.org/wiki/Code_93
|
||||||
[code_128]: https://en.wikipedia.org/wiki/Code_128
|
[code_128]: https://en.wikipedia.org/wiki/Code_128
|
||||||
[data_matrix]: https://en.wikipedia.org/wiki/Data_Matrix
|
[data_matrix]: https://en.wikipedia.org/wiki/Data_Matrix
|
||||||
|
[dx_film_edge]: https://en.wikipedia.org/wiki/DX_encoding
|
||||||
[ean_8]: https://en.wikipedia.org/wiki/EAN-8
|
[ean_8]: https://en.wikipedia.org/wiki/EAN-8
|
||||||
[ean_13]: https://en.wikipedia.org/wiki/International_Article_Number
|
[ean_13]: https://en.wikipedia.org/wiki/International_Article_Number
|
||||||
[itf]: https://en.wikipedia.org/wiki/Interleaved_2_of_5
|
[itf]: https://en.wikipedia.org/wiki/Interleaved_2_of_5
|
||||||
|
@ -21,6 +21,7 @@ class Preferences {
|
|||||||
BarcodeFormat.DATA_BAR.name,
|
BarcodeFormat.DATA_BAR.name,
|
||||||
BarcodeFormat.DATA_BAR_EXPANDED.name,
|
BarcodeFormat.DATA_BAR_EXPANDED.name,
|
||||||
BarcodeFormat.DATA_MATRIX.name,
|
BarcodeFormat.DATA_MATRIX.name,
|
||||||
|
BarcodeFormat.DX_FILM_EDGE.name,
|
||||||
BarcodeFormat.EAN_8.name,
|
BarcodeFormat.EAN_8.name,
|
||||||
BarcodeFormat.EAN_13.name,
|
BarcodeFormat.EAN_13.name,
|
||||||
BarcodeFormat.ITF.name,
|
BarcodeFormat.ITF.name,
|
||||||
@ -218,16 +219,11 @@ class Preferences {
|
|||||||
fun update() {
|
fun update() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||||
preferences.getStringSet(BARCODE_FORMATS, barcodeFormats)?.let {
|
preferences.getStringSet(BARCODE_FORMATS, barcodeFormats)?.let {
|
||||||
// Add rMQR Code for existing installations.
|
barcodeFormats = addFormatsOnUpdate(
|
||||||
val addRMQRCode = "rmqr_added"
|
it,
|
||||||
barcodeFormats = if (!preferences.getBoolean(addRMQRCode, false)) {
|
BarcodeFormat.RMQR_CODE,
|
||||||
preferences.edit().putBoolean(addRMQRCode, true).apply()
|
BarcodeFormat.DX_FILM_EDGE
|
||||||
it.toMutableSet().apply {
|
)
|
||||||
add(BarcodeFormat.RMQR_CODE.name)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
it
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cropHandleX = preferences.getInt(CROP_HANDLE_X, cropHandleX)
|
cropHandleX = preferences.getInt(CROP_HANDLE_X, cropHandleX)
|
||||||
@ -325,6 +321,19 @@ class Preferences {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun addFormatsOnUpdate(
|
||||||
|
restored: Set<String>,
|
||||||
|
vararg formats: BarcodeFormat
|
||||||
|
) = restored.toMutableSet().apply {
|
||||||
|
for (format in formats) {
|
||||||
|
val name = "${format.name}_added"
|
||||||
|
if (!preferences.getBoolean(name, false)) {
|
||||||
|
preferences.edit().putBoolean(name, true).apply()
|
||||||
|
add(format.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun beepTone() = when (beepToneName) {
|
fun beepTone() = when (beepToneName) {
|
||||||
"tone_cdma_confirm" -> ToneGenerator.TONE_CDMA_CONFIRM
|
"tone_cdma_confirm" -> ToneGenerator.TONE_CDMA_CONFIRM
|
||||||
"tone_sup_radio_ack" -> ToneGenerator.TONE_SUP_RADIO_ACK
|
"tone_sup_radio_ack" -> ToneGenerator.TONE_SUP_RADIO_ACK
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<item>DATA BAR</item>
|
<item>DATA BAR</item>
|
||||||
<item>DATA BAR EXPANDED</item>
|
<item>DATA BAR EXPANDED</item>
|
||||||
<item>DATA MATRIX</item>
|
<item>DATA MATRIX</item>
|
||||||
|
<item>DX FILM EDGE</item>
|
||||||
<item>EAN 8</item>
|
<item>EAN 8</item>
|
||||||
<item>EAN 13</item>
|
<item>EAN 13</item>
|
||||||
<item>ITF</item>
|
<item>ITF</item>
|
||||||
@ -28,6 +29,7 @@
|
|||||||
<item>DATA_BAR</item>
|
<item>DATA_BAR</item>
|
||||||
<item>DATA_BAR_EXPANDED</item>
|
<item>DATA_BAR_EXPANDED</item>
|
||||||
<item>DATA_MATRIX</item>
|
<item>DATA_MATRIX</item>
|
||||||
|
<item>DX_FILM_EDGE</item>
|
||||||
<item>EAN_8</item>
|
<item>EAN_8</item>
|
||||||
<item>EAN_13</item>
|
<item>EAN_13</item>
|
||||||
<item>ITF</item>
|
<item>ITF</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user