The preferred way to create a shortcut is through the launcher.
Although it is possible for an app to create shortcuts, there is
concern that allowing the app to do so may not be desirable
due to potentials for abuse.
As there is support now for adding shortcuts through the launcher,
this app do not need to also support creating them itself.
When a shortcut launches the view activity, if the activity
already exists it will get onNewIntent() called. This needs to
clear out the view items so the next card will be redrawn.
This will prevent shortcuts from creating many views, and causing
them to leak. However, do not use singleTop for all launches
of the view activity, else the edit mode cannot be entered.
When a card is being added or created, a checkbox will now
be presented asking if a shortcut should be made. If selected,
when saving a shortcut will be added to the home screen. The
shortcut will directly launch the given card in view mode.
This adds app shortcuts for the most recently used cards.
When a new card is accessed, it is added to the shortcuts list.
When the list exceeds its maximum size, the least recently
used shortcut is discarded.
Android limits the maximum number of shortcuts to 5, however
it recommends in its documentation to limit this to 4. This
commit limits this to 3, however, as that is aesthetically pleasing.
This case was hit at least once by a user, though the scenario
is not known. If it is hit, post a message and bail gracefully,
until the reason can be determined.
When passing a phone to a clerk to scan the barcode, if the
phone is rotated and the screen reloads it can be bothersome
or confusion. To avoid this situation, a new option is
added to lock the screen.
A menu icon is now added which defaults as unlocked. When
touched the app sets its orientation to the "natural" orientation
of the device. When touched again the sensor dictates the
orientation of the device.
If someone is editing an existing card, or is adding a card
and wants to change the value, update the name of the button
from "Enter card" to "Edit card", to give the impression that
a new card id need not by typed from scratch.
If a user is attempting to update a card id of an existing card,
before when the Enter Card button was selected the barcode selector
view would be empty. To be more useful, the view will now be
pre-populated with the existing card id.
Earlier when a card was viewed it was shown in an EditView which
was disabled. This was not optimal, as the resulting text was
dimmed. To help the text be easier to read, a TextView is now
used to display the data.
In addition, the layout of the card viewing screen has been adjusted
Some users have mentioned that a barcode scanner has the best
success when the screen is at its brightest. To enable the best
results, the screen brightness will now be adjusted to its
maximum when displaying a loyalty card.
https://github.com/brarcher/loyalty-card-locker/issues/21
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
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.
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.