Commit Graph
922 Commits
Author SHA1 Message Date
Sylvia van Os 3fffc83c08 Fix importing pkpasses file from network location
In the scan activity, the mime type info is not always available. This
made pkpasses files fail to parse, because they only went down the
pkpass path
2026-09-07 21:23:34 +02:00
Matt Van HornandMatt Van Horn f3424b716d fix: Import cloud-backed PKPASS files off the main thread (#3282)
* fix: Import cloud-backed PKPASS files off the main thread

Fixes #2464

* Address review: move all import parsing off the main thread, restore failure toasts

- Route image/PDF/pkpass/espass imports through one background importFile
- Restore errorReadingFile / errorReadingImage / noBarcodeFound toasts via a
  main-looper-marshalling showToast helper
- Replace fixed-timeout awaits in the activity tests with a waitFor predicate

* Start the import coroutine on the main dispatcher, hop to IO for the read

launch(Dispatchers.IO) starts the coroutine on a background thread immediately,
so a paused Robolectric main looper never drives it and the activity tests time
out. Launch on the lifecycle scope's default (main) dispatcher and wrap only the
blocking read in withContext(Dispatchers.IO).

* Fix the two failing import tests

Two separate bugs, both in the tests I added:

- new Intent(ACTION_VIEW, uri).setType(...) clears the data URI (setType and
  setData clear each other), so the activity received a null Uri and the read
  never started. Use setDataAndType.
- The intermediate-state assertions (no started activity / RESULT_CANCELED)
  are not observable: waiting on the main looper drains it, and Robolectric
  drains it again during .visible(), so the import has already run to
  completion by the time the test regains control. Assert the off-main-thread
  read directly instead, which is the property these tests exist to prove.

* fix: make showToast reusable with a caller-supplied duration

Take the toast length as a parameter instead of hardcoding LENGTH_LONG, so
the helper can serve short toasts too, and document why it exists: it shows
the toast directly when already on the main looper and otherwise posts it
there, which is what the off-main-thread import path needs.

Reorders the modifiers to the file's `static private` convention.

All existing call sites pass LENGTH_LONG, so behavior is unchanged.

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-09-05 12:31:04 +02:00
Sylvia van Os 59e2083511 Update list widgets on card open
This ensures the order is correct for users who sort by most recently
used
2026-08-24 23:22:46 +02:00
Sylvia van Os bfa79a6f68 Notify on foreground service start failure 2026-08-11 22:06:01 +02:00
Sylvia van Os 2960585250 Prepare new versioning and CHANGELOG structure 2026-08-11 22:06:01 +02:00
Sylvia van Os ff830ee50d Improve notification icons
This improves the sizing of the notification icons and uses a generic
sync icon for the Bluetooth server running (so users don't get used to
ignoring the Catima icon).

Generated throudh Android Studio New -> Image Asset -> Notification
Icons -> Path: .design/master_monochrome.svg -> Trim: Yes -> Padding: 0%
2026-08-11 22:06:01 +02:00
Sylvia van Os 3c917da56a Modify code to support minor API versions 2026-08-11 22:06:01 +02:00
Sylvia van Os 9459c78e7c Migrate WearOS app to Material3
Also always display sync status on screen
2026-08-11 22:06:01 +02:00
Fabio ManganielloandSylvia van Os b326a7148d feat(bluetooth): Add trusted device pairing (#3223)
Co-authored-by: Sylvia van Os <sylvia@hackerchick.me>
2026-08-11 22:06:01 +02:00
Sylvia van Os 5ae850dbe8 Restructure smartwatch support settings 2026-08-11 22:06:01 +02:00
Fabio ManganielloandSylvia van Os 2ef9c9c68e Add WearOS companion app (#3185)
Co-authored-by: Sylvia van Os <sylvia@hackerchick.me>
2026-08-11 22:06:01 +02:00
KamiDaga dc7498e505 Merge pull request #3219 from KamiDaga/feature/overflow-menu-to-image-gallery
Added overflow menu to open card image in image gallery
2026-07-26 19:18:00 +02:00
Ilya ZarubinandSylvia van Os bbae3351a5 Add internal image viewer for zooming (#3184)
Co-authored-by: Sylvia van Os <sylvia@hackerchick.me>
2026-07-12 17:52:24 +02:00
J. Bhargava Gopal 5388bbfc16 Merge pull request #3191 from Bhargav-24/add-most-recently-added-sort
Add most-recently-added card sort option
2026-07-04 22:27:08 +02:00
Matt Van Horn 888869d5fc Merge pull request #3174 from mvanhorn/feat/2742-display-card-id
Add option to display card ID in card list
2026-07-04 22:07:12 +02:00
Sylvia van Os ed412c221a Merge pull request #3132 from CatimaLoyalty/workaround/nfc_crash
Work around NFC crash
2026-05-16 14:53:14 +02:00
Sylvia van Os cd2eb2e0d9 Ensure correct NFC state on onResume
This fixes going to settings from the view activity and disabling NFC,
followed by a press of the back button from not disabling reader mode
2026-05-02 16:14:50 +02:00
NightShiftNexus dfa1c29fa0 feat: split complex loyaltyCardViewActivity (#3072) 2026-05-02 16:10:03 +02:00
Sylvia van Os 498b885398 Merge pull request #3047 from il-Luca/feature/pause-nfc-while-viewing-card
Add option to pause NFC while viewing a card
2026-04-25 16:02:30 +02:00
Sylvia van Os 774fcfd497 Improve comment clarity 2026-04-25 15:46:23 +02:00
Sylvia van Os 0967e475d5 Pause NFC by default 2026-04-25 15:42:08 +02:00
Sylvia van Os 2bd6fc444e Show snackbar when NFC is paused 2026-04-25 14:07:14 +02:00
ugurtafrali b840d481a8 Add timestamp to export filename 2026-04-14 00:31:40 +03:00
Sylvia van Os 3e9549088a Fix shortcut returning to previous card after rotation 2026-02-28 13:29:04 +01:00
il-Luca 0428a87c71 Add option to pause NFC while viewing a card 2026-02-27 12:37:19 +01:00
Sylvia van Os 4399cdadb0 Fix crash in volume button card switching with no other cards 2026-02-15 11:49:58 +01:00
Sylvia van Os 38a2c3f26b Revert "Reapply "Temporarily re-add Android 5 support (#2925)"" 2026-01-24 16:24:13 +01:00
Sylvia van Os 93d259b1d8 Reapply "Temporarily re-add Android 5 support (#2925)"
This reverts commit 5ac2405834.
2026-01-23 18:32:22 +01:00
Sylvia van Os ce213356b9 Add FIXME 2026-01-23 18:24:17 +01:00
David Kennedy 18ae00f5a4 fix: passes ISO_8859_1 to BarcodeImageWriterTask constructor instead of null 2026-01-22 18:40:56 -07:00
Sylvia van Os 5ac2405834 Revert "Temporarily re-add Android 5 support (#2925)"
This reverts commit 37e6782032.
2026-01-22 20:13:37 +01:00
Sylvia van Os 1a474e9d22 Move info text dialog away from deprecated Linkify.ALL 2026-01-18 22:38:44 +01:00
Sylvia van Os cbb2453f6b Detect links in card ID in card ID popup 2026-01-18 22:37:56 +01:00
Sylvia van Os d5b3796ae9 Fix crash risk on pkpass encoding 2026-01-15 18:14:55 +01:00
Sylvia van Os bc21a53d44 Expose barcode encoding in content provider 2026-01-13 21:17:50 +01:00
Sylvia van Os a5599dc673 Remove automatic barcode encoding type
Migrates all automatic cards to ISO-8859-1 and uses that as default
2026-01-13 19:47:29 +01:00
Matthias Paulmier ace353d71d Fix several bugs related to shortcut handling (#2919)
* 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
2026-01-09 17:24:29 +01:00
Sylvia van Os 93515d2f88 Set Compose TopAppBar to pure black in OLED theme 2026-01-07 17:17:49 +01:00
Sylvia van Os b7c42b5c8c Fix list widget opening on previous card sometimes 2026-01-05 20:20:41 +01:00
Sylvia van Os 29c4ccf4d9 Disable automatic barcode encoding guessing for now 2026-01-04 22:57:50 +01:00
Sylvia van Os d3de9c65e6 Force ISO-8859-1 when importing old backups
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.
2026-01-04 21:20:49 +01:00
Sylvia van Os 48993f0486 On initial upgrade, force all automatic cards to ISO-8859-1
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.
2026-01-04 21:20:44 +01:00
Sylvia van Os 80bad7ad56 Never pass ISO-8859-1 as encode hint
This fully restores the old behaviour for pkpass files with ISO-8859-1 as messageEncoding
2026-01-04 20:13:43 +01:00
Sylvia van Os a10e8d5aab Fix typo in comment 2026-01-03 17:57:06 +01:00
Sylvia van Os 37e6782032 Temporarily re-add Android 5 support (#2925)
* Revert "Bump androidx.activity:activity-compose from 1.10.1 to 1.12.2"

This reverts commit 307f0e12bc.

* Revert "Bump androidx.compose:compose-bom from 2025.11.01 to 2025.12.01"

This reverts commit a0fea79359.

* Revert "Remove Android 5 support"

This reverts commit 23457854b7.

* Update CHANGELOG
2026-01-03 17:54:33 +01:00
Sylvia van Os 2308deba33 Only pass encoding hint in automatic if UTF-8
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.
2026-01-03 15:44:51 +01:00
Sylvia van Os 23457854b7 Remove Android 5 support
Newer dependencies need at least Android 6, so no use in keeping this
2026-01-01 19:58:19 +01:00
Sylvia van Os 17d3d86127 Fix Compose status and navigation bar theming
Especially affects Android 14 and below, but also slightly 15 and up
2025-12-31 12:43:11 +01:00
Sylvia van Os 6d2ac18859 Fix Talkback announcing "greater than arrow" 2025-12-29 17:05:55 +01:00
Sylvia van Os c202c86ce4 Remove theme colour support
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.
2025-12-27 13:11:05 +01:00