If a user is unable to scan a barcode, this commit allows a
user to enter is manually.
If the user selects to Enter Card instead of Capture Card,
the user may enter the card's id. As it may not be known which barcode
format the user expects, and the user may not know what barcode
type is what, all barcode types are generated from the user
input. Those that are valid are displayed to the user. The user
may then select the barcode image which matches what the user wants.
Italian translations provided by Michael Moroni (Airon90)
Dutch translations provided by PanderMusubi
It was observed that some barcode encoders will fail if the
data passed to them is not valid for the format. For example,
the ITF encoder will throw an ArrayIndexOutOfBoundsException
on the input "this is a test".
It turns out that the library used to create datamatrix barcodes
returns the smallest image necessary to contain the barcode. That
is, the size passed into the barcode writer. If the ImageView
scales the tiny image itself into the full size it will use
bi-linear filtering, which results in a blurry barcode.
To avoid this, if scaling is needed do so without using filtering.
The size of the ImageView may not yet be known when the
barcode generation is needed. If this is the case, wait
until the final layout is complete then start the
barcode generation.
This change moves the generation of the barcode into its
own async task. In addition, the size of the ImageView is
used to determine the barcode size to use.
There will be cases when the size of the ImageView will not
be known when the barcode generation starts. This will be resolved
in a future commit.
The selection of SDK 17 was arbitrarily based on the version
available on my device at the time. As no APIs are being used
at that level, a lower SDK version can be targeted.
According to the current distribution of Android device versions,
99.9% of devices are at SDK 11+. Changing to this for the min SDK
for now.
This about page layout is borrowed from K-9 Mail:
https://github.com/k9mail
Italian translations provided by Airon90.
Dutch translations provided by PanderMusubi.
Typically one will open the view activity to bring up a
barcode, and the keyboard is not expected. Disable the
keyboard until an editable field is selected.
There are loyalty cards which are not product codes but are 1D
barcodes. Enabling support for all types of 1D barcodes to
enable more types of loyalty cards.