* Improve ShortcuHelper.updateShortcuts to take all actions into account
* Remove now useless calls to removeShortcut
* Add doc to explain the usage of maxShortcut
* Fix typo in doc of maxShortcuts
This will not catch one edge case: use exporting a backup in Catima
2.41.0 - 2.41.2, then uninstall Catima, then installing Catima 2.41.3
and then importing the database. But this seems rare enough to be
acceptable.
This fixes old pkpass files imported before Catima 2.41.0 to be forced
to "Automatic", which may guess UTF-8. New pkpass files will have the
encoding read from the file and newly scanned barcodes will use
Automatic.
This does have the unfortunate side effect of everyone who already
scanned a QR code with UTF-8 data since Catima 2.41.0 to have it forced
to ISO-8859-1, but it will fix Deutschlandtickets imported before 2.41.0
which is a rather large amount of the Catima userbase.
If zxing is not explicitly told a barcode is UTF-8, it may render it
incorrectly. Which caused
https://github.com/CatimaLoyalty/Android/issues/2555.
However, when an encode hint is set, it will cause zxing to set an ECI
hint inside the barcode, which some scanners may trip over and cause
scanning failures, leading to
https://github.com/CatimaLoyalty/Android/issues/2921.
This change only passes the encoding in automatic mode if zxing
explicitly guesses it to be UTF-8, and otherwise doesn't pass anything,
to keep the ECI empty. This might need to be expanded for other types
like SJIS, but as nobody ever reported such a bug let's assume it's not
necessary for now.
This simplifies the codebase and new Compose implementation. If this
feature is really wanted by the community, it could possibly be
reimplemented in a much more flexible way (choosing the exact colour)
after all UIs are migrated to Compose, as Compose can generate a theme
based on just a primary colour.
* WIP
* test: Add test tags for compose components
* test: Add basic test for compose about screen
* refactor: Add defaults for `AboutScreenContent`
* refactor: Move compose tests to unit tests
* refactor: Make `showRateOnGooglePlay` default to `app/build.gradle.kts/defaultConfig` value
* refactor: Best practise to make previews private to reduce pollution
* refactor: Best practise apply theme as high as possible for most cases
* style: Format AboutActivity.kt
* test: Add more comprehensive tests for about screen
* test: Fix configuration of compose tests
* Fix Gradle setup
* Fix build issues
* Adjust text sizing
* Use full black OLED theme in Compose if chosen in settings
---------
Co-authored-by: LooKeR <iamlooker@proton.me>
- Add new barcodeencoding field to database
- Read barcode encoding from pkpass file
- Add barcodeencoding to import/export
- Add barcodeencoding to share URI
- On default, use zxing's GuessEncoding function in StringUtils (this
should not use UTF-8 unless needed)
- Allow manually forcing ISO-8859-1 or UTF-8
This swaps the currency and balance fields to reduce the risk of users
entering a decimal value (1,23) first and having to changed to 1 due to
the default currency (Points) having no decimals.
The changes in the LoyaltyCardEditActivity are purely cosmetic, just a
swap of function order to more closely stick to the order in the XML
layout file