Commit Graph

194 Commits

Author SHA1 Message Date
Sylvia van Os
0c61abf4f0 Add barcode encoding support
- 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
2025-12-25 16:08:05 +01:00
Sylvia van Os
e03c883a9c Swap currency and balance fields to reduce chance of accidental conversions
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
2025-11-29 11:59:31 +01:00
Sylvia van Os
f91b94d100 Dep/bump ucrop (#2748)
* Bump com.github.yalantis:ucrop from 2.2.10 to 2.2.11

Bumps [com.github.yalantis:ucrop](https://github.com/Yalantis/uCrop) from 2.2.10 to 2.2.11.
- [Release notes](https://github.com/Yalantis/uCrop/releases)
- [Commits](https://github.com/Yalantis/uCrop/compare/2.2.10...2.2.11)

---
updated-dependencies:
- dependency-name: com.github.yalantis:ucrop
  dependency-version: 2.2.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix build

While testing on Android 15, no difference was found in the status bar
colour on Android 15 with or without the setting

* Use non-native release

* Apply autogenerated ProGuard missing rules

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-04 14:11:42 +02:00
StellarSand
996cd2cd2c Proper fix for FAB being hidden by keyboard (#2579) 2025-07-25 20:04:24 +02:00
StellarSand
b3356b6575 close keypad if open on back pressed 2025-07-18 02:24:26 +05:30
Sylvia van Os
e893923164 Remove spotBugs
We've been running an old version for very long because there hasn't
been any time to update it. A newer version doesn't support Java 21.
Given Java 21 ihas more priority, let's just get rid of spotBugs.
2025-05-14 20:53:14 +02:00
perepujal
4b77700b97 Merge pull request #2254 from perepujal/main
Adding the ability to resize the width in the fullscreen view.
2025-04-21 17:06:49 +02:00
Sylvia van Os
cc7553850a Target Android 15
We apply window insets to basically not draw behind the top and bottom
bar. While this is a slight visual downgrade (we used to draw behind the
top bar before), it at least allows us to target Android 15.
2025-03-09 16:51:06 +01:00
Sylvia van Os
e0786594bc Load images on request
This prevents loading the front and back images when scrolling through
the loyalty card list and should allow scaling to more images/files more
easily
2024-12-07 15:23:07 +01:00
Sylvia van Os
7fe67960bf Move TaskHandler to ViewModel
This should make it possible to properly cancel the running barcode
generation threads on rotation and prevent CPU rising on many rotations.
2024-12-07 15:23:07 +01:00
Sylvia van Os
83fca93649 Use ViewModel to prevent hammering storage
When you turn a LoyaltyCard into a bundle, it writes the files to
storage as it can't otherwise fit in the limited storage size. This
means that, on rotation, you write all images to storage and load them
again. Using a ViewModel prevents that storage hit due to holding it in
memory (as a ViewModel has a longer lifecycle).
2024-12-07 15:23:07 +01:00
Sylvia van Os
1cb9ddecac Support for returning images from PkpassParser 2024-12-07 15:23:07 +01:00
Sylvia van Os
8eeff0058b Refactor ScanActivity result code (use ParseResult) 2024-12-07 15:23:07 +01:00
Sylvia van Os
e6345bc2fe Make thumbnails in edit view consistent with card view
Commit 88c1dd1bc6 changed the behaviour of
the background colour of the thumbnails, but the edit view still used
the old behaviour. This creates more consistency.
2024-12-03 00:33:21 +01:00
Sylvia van Os
727d9ce781 Refactor to allow updating a loyalty card from a bundle (#2051)
This allows us to send any (partial) loyalty card into the edit
activity, granting us greater flexibility in what kind of scan result we
can parse
2024-09-22 10:20:58 +02:00
Sylvia van Os
47b076b41d Support setting front or back image as thumbnail 2024-07-13 18:15:05 +02:00
Sylvia van Os
0e873b9ea5 Basic selector when multiple barcodes found 2024-03-23 23:54:57 +01:00
FC (Fay) Stegerman
7fa8ae8697 refactor nav bar colour & colour patching 2024-01-28 12:08:30 +01:00
Aayush Gupta
55595159be LoyaltyCardEditActivity: Handle configuration changes for MaterialDatePicker
MaterialDatePicker is final and thus cannot be extended to handle loss of callback
on configuration changes. We aren't using ViewModel as well that would help us to persist
changes till lifecycle.

Fallback to how DatePicker was handling this situation with a couple of more hacks.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2023-11-02 14:20:54 +05:30
Aayush Gupta
4d6c08fc73 LoyaltCardEditActivity: Migrate to materialdatepicker dialog
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2023-11-02 11:39:44 +05:30
Aayush Gupta
aea1ea0cbf Migrate to from OnBackPressed to OnBackPressedDispatcher
Closes: https://github.com/CatimaLoyalty/Android/issues/1498

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2023-10-01 18:51:06 +05:30
Sylvia van Os
97343515a3 Consistency: may not/cannot -> must not 2023-09-23 18:11:42 +02:00
Sylvia van Os
12e7aaa615 Trim spaces in store name 2023-09-22 22:02:15 +02:00
Sylvia van Os
4aa56a55fe Balance validation fixes
Remove old string which may sometimes display "does not seem like a
valid balance." and default to 0 as balance if field is emptied.
2023-09-17 17:59:42 +02:00
Sylvia van Os
00d08d741c Don't regenerate barcode if value is empty 2023-09-17 17:37:24 +02:00
Sylvia van Os
2f33be6b3c Improve validation
If a field is empty when it shouldn't be, show it at the correct UI
element and focus
2023-09-17 17:37:21 +02:00
Sylvia van Os
7be1ee99ca Merge pull request #1463 from obfusk/fix-colorpicker
LoyaltyCardEditActivity: fix color picker dialog crash & bug
2023-08-05 12:00:49 +02:00
FC Stegerman
7e3a5a9831 LoyaltyCardEditActivity: fix wrong balance parse after locale changes (#1454) 2023-08-05 11:29:59 +02:00
FC Stegerman
29919851f5 LoyaltyCardEditActivity: fix color picker dialog crash & bug 2023-08-04 04:15:45 +02:00
FC Stegerman
6dfbb169df LoyaltyCardEditActivity: fix noDataLossOnResumeOrRotate test 2023-07-29 21:30:08 +02:00
FC Stegerman
f671c6b0d1 LoyaltyCardEditActivity: fix state loss on rotation for dates 2023-07-29 21:14:51 +02:00
Quang Trung
682fc8303c Fix crash on configuration changes in DatePickerFragment (#1431) 2023-07-19 20:52:25 +02:00
FC Stegerman
7c766d0832 LoyaltyCardEditActivity: work around Currency.getSymbol() bug 2023-06-11 17:30:19 +02:00
Sylvia van Os
6e390717da Make header colour code more consistent (#1363)
- Ensure a header colour is picked for the main screen
- Simplify all different header colour code pickers into a single code
  path
2023-06-10 18:34:49 +02:00
FC Stegerman
e859e7849d add top content padding to dialogs 2023-06-03 23:14:49 +02:00
Swayam Khare
5ff002da51 Added margin to EditText in AlertDialog (#1328) 2023-06-02 19:47:23 +02:00
Sylvia van Os
ab6955cf9b Fix set icon menu sometimes re-opening after returning from image cropper 2023-05-30 12:29:55 +02:00
Sylvia van Os
419d28163e Long-press card icon in view activity to change it 2023-05-29 16:09:27 +02:00
Sylvia van Os
65acb885af Fix crash on disabled camera app 2023-05-21 14:34:39 +02:00
Sylvia van Os
b48de921fc Redesign of home screen and view UI (#1296)
* Redesign of home screen and view UI

* Update screenshots and CHANGELOG

* Make spotbugs happy

* Fix double store name announcement
2023-05-17 21:15:56 +02:00
Sylvia van Os
339750e97c Update AGP to 8.0.0 2023-04-14 20:56:29 +02:00
Alexander Ivanov
3a9b92231e Set min/max date in the DatePickerDialog when 'valid from' or 'expiry' dates are set
Signed-off-by: Alexander Ivanov <vanogrid@gmail.com>
2023-02-01 19:22:22 +01:00
Alexander Ivanov
f1753ea943 Add Valid From field
Signed-off-by: Alexander Ivanov <vanogrid@gmail.com>
2023-02-01 19:22:20 +01:00
Sylvia van Os
614753303f Fix crash when permissionRequestResult gets cancelled 2023-01-25 18:30:47 +01:00
Sylvia van Os
89a13cecf5 Create extra result function to work around onPermissionResult not existing on Android 5 2023-01-24 23:14:57 +01:00
Sylvia van Os
fd2400eaf5 Refactor permission code
- Remove write permission (was never needed)
- Only use read permission for Android 5 and 6
- Simplify logic by mocking a valid permission result if permission
  already granted
2023-01-24 20:44:17 +01:00
Sylvia van Os
6508a6d5f7 Merge pull request #1116 from pfaffenrodt/feature/pick-image-file
Add support to pick image from content provider
2022-11-22 19:04:48 +01:00
Pfaffenrodt
77ef0a2833 Extract same logic to enable back button of toolbar
ManageGroupActivity setDisplayShowHomeEnabled was redundant
2022-10-29 14:19:34 +02:00
Pfaffenrodt
e97f7c8645 Add support to pick image from content provider 2022-10-28 23:46:40 +02:00
Alexander Ivanov
7dfa7071e3 Fix DatePickerDialog sometimes storing dates at 12:00 PM instead of 12:00 AM 2022-10-22 20:46:22 +03:00