mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2025-12-24 15:47:53 -05:00
Compare commits
888 Commits
fix/barcod
...
v2.25.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93103c8c6d | ||
|
|
576ec1e6de | ||
|
|
b602ce5d78 | ||
|
|
0ecd38ed1c | ||
|
|
d48e02463c | ||
|
|
b9d9c8d2e3 | ||
|
|
47f1ea80b6 | ||
|
|
b5efa28e85 | ||
|
|
d456a8920d | ||
|
|
4ef0c96b29 | ||
|
|
343c77f9e3 | ||
|
|
673e64924b | ||
|
|
5ea6155c39 | ||
|
|
abb1cd29f0 | ||
|
|
52363cdff4 | ||
|
|
ac4f4e3a9a | ||
|
|
555387e20d | ||
|
|
70ae8ff167 | ||
|
|
86512532f1 | ||
|
|
ebf6318aa2 | ||
|
|
fd482a4cba | ||
|
|
54d91dc8a1 | ||
|
|
9fa7fe388f | ||
|
|
1415d8da3e | ||
|
|
0ad5de18e1 | ||
|
|
9659a2a2cd | ||
|
|
1dd894bd27 | ||
|
|
0d9151294e | ||
|
|
09dda99afc | ||
|
|
a4fb91b9aa | ||
|
|
036b821b28 | ||
|
|
479a35657f | ||
|
|
eca9d1c74c | ||
|
|
95055f1ce6 | ||
|
|
f4a5ae74d6 | ||
|
|
16952186c7 | ||
|
|
7d12279b0d | ||
|
|
15a49344a3 | ||
|
|
ff15ce0615 | ||
|
|
57144c4cd1 | ||
|
|
50387f55d4 | ||
|
|
0fa07d3d0b | ||
|
|
05516f88fc | ||
|
|
841a5e3ddb | ||
|
|
2889b45c51 | ||
|
|
9ebb53b224 | ||
|
|
14b8b3bd7a | ||
|
|
3e4c3e9852 | ||
|
|
fa417cdfe5 | ||
|
|
a9863d1921 | ||
|
|
f2b7a63a02 | ||
|
|
8e0a40ee3f | ||
|
|
21064803eb | ||
|
|
031b751a9d | ||
|
|
bb9b640aa5 | ||
|
|
1681d077b6 | ||
|
|
3500444e0c | ||
|
|
e05ebbe607 | ||
|
|
b3bb20c795 | ||
|
|
b0315f279a | ||
|
|
9e788cb604 | ||
|
|
090f3dc80b | ||
|
|
e4f2f8f46b | ||
|
|
e5ecd59569 | ||
|
|
441ae9587e | ||
|
|
0c1e16592d | ||
|
|
02659f840e | ||
|
|
eca5ec10d3 | ||
|
|
dbc8df018d | ||
|
|
874b887da1 | ||
|
|
5367324219 | ||
|
|
6df58e0574 | ||
|
|
c8b6328cc6 | ||
|
|
90616214f0 | ||
|
|
e3bce7eb50 | ||
|
|
b2d1660cf8 | ||
|
|
3de24bb6f0 | ||
|
|
b4e403d214 | ||
|
|
b66351ab58 | ||
|
|
c9d775f426 | ||
|
|
6d4af3d86b | ||
|
|
37803bd906 | ||
|
|
f3fcea7ab1 | ||
|
|
9a67ea039c | ||
|
|
bf94d208bd | ||
|
|
28c0b488e6 | ||
|
|
dc926bbfe7 | ||
|
|
00d5fa4c2d | ||
|
|
9aca91fb86 | ||
|
|
bdab8624b5 | ||
|
|
9bdfe64c79 | ||
|
|
f5f7e40219 | ||
|
|
2f51e7db68 | ||
|
|
2cb9846f42 | ||
|
|
1dbe46b97e | ||
|
|
7e5611b062 | ||
|
|
d3a7acd9ab | ||
|
|
c023a9787d | ||
|
|
6de0ed6956 | ||
|
|
aa5f0a7bf8 | ||
|
|
6dd5bd957c | ||
|
|
c69df5edfd | ||
|
|
758d034c31 | ||
|
|
7bcf82a619 | ||
|
|
fd755185b9 | ||
|
|
0ac57be5f1 | ||
|
|
bb929a48ea | ||
|
|
218850be33 | ||
|
|
ec07cceced | ||
|
|
71ac1c5dad | ||
|
|
b16ecfbb2c | ||
|
|
c64bfbabc0 | ||
|
|
fc8073f717 | ||
|
|
7f56617a3c | ||
|
|
f5dc2930b5 | ||
|
|
4bdc0fef70 | ||
|
|
2f3c96b97c | ||
|
|
6ff11e22e1 | ||
|
|
0b188f2ba7 | ||
|
|
827d5ba3f9 | ||
|
|
05fea6e208 | ||
|
|
6064d29cb0 | ||
|
|
0a92daa77a | ||
|
|
bb065aead4 | ||
|
|
56467c2680 | ||
|
|
1941db1e52 | ||
|
|
c595981996 | ||
|
|
0145a820de | ||
|
|
224ab7f2e7 | ||
|
|
1b47a62c70 | ||
|
|
f241bad3e4 | ||
|
|
c8657870af | ||
|
|
0ed7a0a6e1 | ||
|
|
325330c542 | ||
|
|
2506f60348 | ||
|
|
5bf6f52425 | ||
|
|
fb1728e5de | ||
|
|
d321f733c1 | ||
|
|
8ff46f8754 | ||
|
|
a061978c93 | ||
|
|
f3bfc9b278 | ||
|
|
43ebe5e029 | ||
|
|
2357f4d430 | ||
|
|
7869feb3a1 | ||
|
|
53ce856c33 | ||
|
|
aa321a71ad | ||
|
|
f721237fbc | ||
|
|
194a7ae365 | ||
|
|
1aa1d8bcc1 | ||
|
|
a8355f609b | ||
|
|
7c766d0832 | ||
|
|
3abe99470e | ||
|
|
6937342226 | ||
|
|
e229aa9565 | ||
|
|
5fd629bdbc | ||
|
|
4c261e1e04 | ||
|
|
c8be038b81 | ||
|
|
268b4cf827 | ||
|
|
ada8fd9bd4 | ||
|
|
285c3d6a38 | ||
|
|
07efe99630 | ||
|
|
a7d3a1c30d | ||
|
|
fcc995397f | ||
|
|
cef0d037f7 | ||
|
|
6e390717da | ||
|
|
f785586c71 | ||
|
|
e66c5e36fb | ||
|
|
fd0ca37a6a | ||
|
|
e926a397a7 | ||
|
|
4f9a6b307f | ||
|
|
df60f6adc2 | ||
|
|
d6287a3cf1 | ||
|
|
7f81d727f0 | ||
|
|
03239f0cab | ||
|
|
4b6497cba2 | ||
|
|
99008291fb | ||
|
|
079049722c | ||
|
|
73200e1ac3 | ||
|
|
39b816ddb1 | ||
|
|
be43c1633d | ||
|
|
f6c9613731 | ||
|
|
99de8cffd8 | ||
|
|
a867265c66 | ||
|
|
f43df37c80 | ||
|
|
cb70b1229f | ||
|
|
b0b54a1065 | ||
|
|
4ccfa7fb84 | ||
|
|
9932b10652 | ||
|
|
60fe6a13ff | ||
|
|
0bf30f08a1 | ||
|
|
112fca041b | ||
|
|
59af5cb07b | ||
|
|
9182837ae8 | ||
|
|
3f3d85c8b6 | ||
|
|
29c068df47 | ||
|
|
03a480f3b9 | ||
|
|
0feb0fcd16 | ||
|
|
7f1a221fec | ||
|
|
7b52338669 | ||
|
|
0a2925eafa | ||
|
|
92f37376a6 | ||
|
|
08fbc30a29 | ||
|
|
91dbcf339f | ||
|
|
24fe6886c9 | ||
|
|
270546d022 | ||
|
|
fe278324f3 | ||
|
|
c7c18a0a14 | ||
|
|
d6fcb71722 | ||
|
|
32ce1e02aa | ||
|
|
8a8faac201 | ||
|
|
2793f38d19 | ||
|
|
654e3f7843 | ||
|
|
2a6fe92b1b | ||
|
|
b3cd102332 | ||
|
|
e12bfa81dc | ||
|
|
e859e7849d | ||
|
|
7a4c9ce84f | ||
|
|
6419ca7d11 | ||
|
|
d1b23c712a | ||
|
|
ef5b525401 | ||
|
|
a8d5cb9ef8 | ||
|
|
42090310d4 | ||
|
|
9d8da2a451 | ||
|
|
fb488af2b7 | ||
|
|
71052c9f69 | ||
|
|
2a285f6d21 | ||
|
|
e668ae7d9d | ||
|
|
4a197c542a | ||
|
|
720c6b6510 | ||
|
|
d932ebb9f2 | ||
|
|
77b6d8724b | ||
|
|
5ff002da51 | ||
|
|
16b3fbdf9c | ||
|
|
4f11eceb3b | ||
|
|
c11d777bcc | ||
|
|
49cda90ac6 | ||
|
|
63e4f4fd0d | ||
|
|
c44845582c | ||
|
|
b0771d3b01 | ||
|
|
285a7a9aa7 | ||
|
|
818c5e1643 | ||
|
|
7ffaf65635 | ||
|
|
bf50dcbaf3 | ||
|
|
3e83035cf6 | ||
|
|
e921aab322 | ||
|
|
1ea125d7f9 | ||
|
|
c828ec516c | ||
|
|
5704ce1381 | ||
|
|
ca33184e81 | ||
|
|
82db76f3a9 | ||
|
|
ab6955cf9b | ||
|
|
a1c81c3223 | ||
|
|
43e7114f16 | ||
|
|
d1b84097f6 | ||
|
|
2c9b3896c9 | ||
|
|
3dbee69847 | ||
|
|
4f9414ab4f | ||
|
|
5a4043bf90 | ||
|
|
f742639925 | ||
|
|
e50cca781e | ||
|
|
1abff7c900 | ||
|
|
8f24fcee96 | ||
|
|
f3e1bfc503 | ||
|
|
65e3b87df4 | ||
|
|
2dbe9ebb8a | ||
|
|
ccfbe1f679 | ||
|
|
3a4467db83 | ||
|
|
419d28163e | ||
|
|
89483c4c4e | ||
|
|
4e921eb5d7 | ||
|
|
0cf266c6f1 | ||
|
|
20f9f971a1 | ||
|
|
0150ca81cf | ||
|
|
4fd6092f8d | ||
|
|
a488003e4a | ||
|
|
9e0e8bab75 | ||
|
|
0eca05d656 | ||
|
|
1c5d102a59 | ||
|
|
400d0f4e22 | ||
|
|
4c0593d333 | ||
|
|
87d82b1b6d | ||
|
|
8ea4a3309d | ||
|
|
18088b30bd | ||
|
|
875309bc5e | ||
|
|
95520a7051 | ||
|
|
ab9391db38 | ||
|
|
e43e4b37ae | ||
|
|
f2d856b661 | ||
|
|
8c6c5fb767 | ||
|
|
bb4ec8f8be | ||
|
|
e5fd277198 | ||
|
|
93b089c646 | ||
|
|
5e37a9b89f | ||
|
|
27cc7b9008 | ||
|
|
0749bbd432 | ||
|
|
9b1e0537c9 | ||
|
|
3b2b45f08f | ||
|
|
60a5e60ae0 | ||
|
|
77513d5528 | ||
|
|
15fa483490 | ||
|
|
40ba47d60c | ||
|
|
986327d141 | ||
|
|
36f0dde3b2 | ||
|
|
f0a695a616 | ||
|
|
810b0f3c14 | ||
|
|
fcf08a8900 | ||
|
|
939bf6a788 | ||
|
|
935f899d0f | ||
|
|
6c8d79ef36 | ||
|
|
178707b482 | ||
|
|
0f2c9cb63d | ||
|
|
0869a00f0c | ||
|
|
b63b8c4ea7 | ||
|
|
76d77a2af4 | ||
|
|
dade0b7a54 | ||
|
|
68801d6958 | ||
|
|
5c3ec85043 | ||
|
|
6332e396cb | ||
|
|
7f022feb6a | ||
|
|
1fa8487474 | ||
|
|
0e040a73eb | ||
|
|
65acb885af | ||
|
|
ee28957cbd | ||
|
|
0e9f4d9f2b | ||
|
|
58974cf738 | ||
|
|
c56c931a70 | ||
|
|
c83e8b6682 | ||
|
|
449ab86b5a | ||
|
|
8f18bbe0ac | ||
|
|
992e61b88a | ||
|
|
47b92fb38c | ||
|
|
b9963bb967 | ||
|
|
d642d57b85 | ||
|
|
9e0e8f6d7f | ||
|
|
e486755e6a | ||
|
|
1bb803ef0a | ||
|
|
f729f9758b | ||
|
|
abe3bc7d87 | ||
|
|
454bb6a1aa | ||
|
|
2d4d4e2309 | ||
|
|
e7c4010e8d | ||
|
|
cc363e0c04 | ||
|
|
deacc4a69b | ||
|
|
ac6e6e0985 | ||
|
|
fd37a2708f | ||
|
|
85ea314dc9 | ||
|
|
7fd5fe6ee0 | ||
|
|
2c35ad3044 | ||
|
|
210e305bae | ||
|
|
b48de921fc | ||
|
|
ebc2bfcbbb | ||
|
|
b1ec67928f | ||
|
|
2beafe954b | ||
|
|
25b6c4d8cc | ||
|
|
a3f1b9c0b9 | ||
|
|
14d5545c88 | ||
|
|
0977b9d20a | ||
|
|
bad0990dfb | ||
|
|
98c34abd66 | ||
|
|
b4d1463453 | ||
|
|
659b86e31a | ||
|
|
d63e269172 | ||
|
|
77aa768c5c | ||
|
|
8c74d4c2d0 | ||
|
|
a6280108ec | ||
|
|
829630219f | ||
|
|
22a736d7fd | ||
|
|
4418492e7c | ||
|
|
c21e12bbf0 | ||
|
|
9af05be128 | ||
|
|
e036443233 | ||
|
|
7e605f284d | ||
|
|
e712b8e18d | ||
|
|
2ff137ee04 | ||
|
|
3b45802a7f | ||
|
|
0de4847f6a | ||
|
|
47e2566043 | ||
|
|
18c17796b9 | ||
|
|
4b2b999653 | ||
|
|
3b51121c9e | ||
|
|
2fc9581643 | ||
|
|
68f3f37e23 | ||
|
|
38658d0aa7 | ||
|
|
339750e97c | ||
|
|
510995a5c5 | ||
|
|
a039d5de9e | ||
|
|
df11bd8f69 | ||
|
|
17c80573bd | ||
|
|
bc71c02e87 | ||
|
|
d892fe40ba | ||
|
|
06839f6ddb | ||
|
|
ee57703ffc | ||
|
|
e780f5fb87 | ||
|
|
6b9a0a0696 | ||
|
|
6653a940ed | ||
|
|
47821752f0 | ||
|
|
bf05bd7e56 | ||
|
|
2dd622b9c4 | ||
|
|
643527a7fb | ||
|
|
0aae4c9c64 | ||
|
|
14c5b756f7 | ||
|
|
ded3c63ec5 | ||
|
|
e3a22e425b | ||
|
|
275d387f3c | ||
|
|
fbbad75c15 | ||
|
|
a55e9da067 | ||
|
|
a5116395c8 | ||
|
|
5cf41ed664 | ||
|
|
bbde3ec3b8 | ||
|
|
db56d56e3b | ||
|
|
f4c0628366 | ||
|
|
1e6641a884 | ||
|
|
b9bd3f5967 | ||
|
|
28eaac0c67 | ||
|
|
5690ca03e7 | ||
|
|
71f7b21112 | ||
|
|
f9ece83f2b | ||
|
|
3bab0f43eb | ||
|
|
941fa929dd | ||
|
|
46846d2448 | ||
|
|
7b7c1b88b9 | ||
|
|
0926bb71e1 | ||
|
|
cfc4ce7c3c | ||
|
|
1f217dd846 | ||
|
|
6c74b95e90 | ||
|
|
9fca77d561 | ||
|
|
1f0873aab4 | ||
|
|
ca3a09740a | ||
|
|
c104de839e | ||
|
|
0f4380c1e2 | ||
|
|
64e3b047d9 | ||
|
|
729639e0e6 | ||
|
|
3e79147673 | ||
|
|
59a656c422 | ||
|
|
bdf8994fed | ||
|
|
3aa595083b | ||
|
|
37f1183208 | ||
|
|
839496aa04 | ||
|
|
4a7a6b109c | ||
|
|
2b2d5ca7cf | ||
|
|
463af746fa | ||
|
|
d75b79fce4 | ||
|
|
2ec29da6b1 | ||
|
|
e80bebe887 | ||
|
|
1555b3b24b | ||
|
|
12f42f86a5 | ||
|
|
a74e17db10 | ||
|
|
96335d3ee8 | ||
|
|
fb3d945f51 | ||
|
|
843ffbb87e | ||
|
|
99e19321f0 | ||
|
|
4e5a90eb93 | ||
|
|
9745ea671e | ||
|
|
94a63d6e0c | ||
|
|
725ca3b9ca | ||
|
|
46a2164143 | ||
|
|
5304be6f54 | ||
|
|
8321e796f5 | ||
|
|
c1f82e90be | ||
|
|
758f265638 | ||
|
|
590020bb6f | ||
|
|
f18c2a2d0c | ||
|
|
3a17ee83e0 | ||
|
|
f36d4aebb6 | ||
|
|
71cb1cace4 | ||
|
|
1e4e035281 | ||
|
|
7da4eb6587 | ||
|
|
d454864fa7 | ||
|
|
f5e6d7be71 | ||
|
|
967a17242d | ||
|
|
6c5dd7a713 | ||
|
|
139b144cb3 | ||
|
|
5deacf7ecc | ||
|
|
6e49aea713 | ||
|
|
68257ce3ad | ||
|
|
149a1caeff | ||
|
|
07e5788cb2 | ||
|
|
c072e2e70d | ||
|
|
0701b9b3de | ||
|
|
f84242d97c | ||
|
|
79f35ed715 | ||
|
|
eff4f3f8df | ||
|
|
ee405f670d | ||
|
|
7dcb9b336d | ||
|
|
923e6dc062 | ||
|
|
2ea04e8715 | ||
|
|
f264941ae4 | ||
|
|
e6ef5c9bb2 | ||
|
|
024cc2d50e | ||
|
|
48b62f6aea | ||
|
|
ff07fe71cc | ||
|
|
402cf57c29 | ||
|
|
e19ac0d0c2 | ||
|
|
fc5d4a6435 | ||
|
|
50754a3430 | ||
|
|
0375f6dbe5 | ||
|
|
deb808ffb6 | ||
|
|
166c1e7bc6 | ||
|
|
bfa19d0166 | ||
|
|
f92805ec64 | ||
|
|
73e6e9f34a | ||
|
|
6a76681412 | ||
|
|
f05a5dde1e | ||
|
|
4a93ba3478 | ||
|
|
af43138ae9 | ||
|
|
dcd6e4b9a9 | ||
|
|
0ce2395605 | ||
|
|
89dbc9e9aa | ||
|
|
788a8f0efe | ||
|
|
d0c9ae2a4a | ||
|
|
c000a8129c | ||
|
|
bfb4fdb61c | ||
|
|
1929401d3e | ||
|
|
eef13a1a91 | ||
|
|
64f340d798 | ||
|
|
f12422fc07 | ||
|
|
d78315ef12 | ||
|
|
af8c3eeb54 | ||
|
|
16e4205028 | ||
|
|
399aa767d2 | ||
|
|
96c735cf80 | ||
|
|
50a8395ec6 | ||
|
|
c720ca1085 | ||
|
|
d82088f66a | ||
|
|
1fce3e17f6 | ||
|
|
569db96f81 | ||
|
|
b7cb1dffc1 | ||
|
|
e17fc66d35 | ||
|
|
8dac7ae9d1 | ||
|
|
28a0417fa8 | ||
|
|
58d4bd7f47 | ||
|
|
1779aef162 | ||
|
|
557ec68428 | ||
|
|
96a7c8ee36 | ||
|
|
3a9b92231e | ||
|
|
f1753ea943 | ||
|
|
36ab78ec6e | ||
|
|
8a3a782558 | ||
|
|
2c5606bf0a | ||
|
|
5eb36aad5b | ||
|
|
b028d32e2c | ||
|
|
dfefdda9f9 | ||
|
|
bc1cc68f27 | ||
|
|
386a5f75b0 | ||
|
|
d30a9fd1e5 | ||
|
|
0c8e5576b8 | ||
|
|
93e40c08aa | ||
|
|
24eb1e9627 | ||
|
|
19e6b8bea9 | ||
|
|
87f844943e | ||
|
|
718738ff78 | ||
|
|
d7bb019068 | ||
|
|
f925404ab7 | ||
|
|
38495546e0 | ||
|
|
36e7ea5b20 | ||
|
|
85d53ae3c7 | ||
|
|
e9b6b5682e | ||
|
|
0abc583d10 | ||
|
|
8c91d30b4c | ||
|
|
76e8715ab2 | ||
|
|
f5f2edca75 | ||
|
|
e648e22ecc | ||
|
|
02b020e9e5 | ||
|
|
e7dc3cd511 | ||
|
|
eb3ac53e46 | ||
|
|
dd683b4a8c | ||
|
|
e90ba5d2db | ||
|
|
07cff7eac4 | ||
|
|
3eea18fc82 | ||
|
|
5d3ceb6d49 | ||
|
|
3dc7a25d88 | ||
|
|
95e02d1646 | ||
|
|
81ecf8ba92 | ||
|
|
bf0e1a2e77 | ||
|
|
4d1c9244fd | ||
|
|
1f1e523100 | ||
|
|
cb32cf9e52 | ||
|
|
af812d8cda | ||
|
|
c8a7addc52 | ||
|
|
3e64d7c5ad | ||
|
|
277462a939 | ||
|
|
24623d5c58 | ||
|
|
4b25b7ad39 | ||
|
|
4016d5499b | ||
|
|
d8b96a8c5f | ||
|
|
614753303f | ||
|
|
50a344b97f | ||
|
|
2cd6da6ffc | ||
|
|
c03fba133f | ||
|
|
f3cba588f6 | ||
|
|
ad364ad0ac | ||
|
|
f4cff85d93 | ||
|
|
cbc86ff131 | ||
|
|
5f733474a9 | ||
|
|
89a13cecf5 | ||
|
|
fd2400eaf5 | ||
|
|
9598f2f4ff | ||
|
|
acca53787c | ||
|
|
060e360344 | ||
|
|
9ef014e05c | ||
|
|
4cb27d3bd5 | ||
|
|
95e21cc112 | ||
|
|
d5f915a290 | ||
|
|
42e89bb5cc | ||
|
|
048fb48300 | ||
|
|
b1c82dbae0 | ||
|
|
ea8c6f96f7 | ||
|
|
201ec78694 | ||
|
|
05a03455c1 | ||
|
|
63f4cbb8ca | ||
|
|
a444607476 | ||
|
|
89102ad0bf | ||
|
|
d2623b8690 | ||
|
|
80ddd48184 | ||
|
|
410a619a70 | ||
|
|
1771f42860 | ||
|
|
1e7af7ab4e | ||
|
|
f4c5af04e3 | ||
|
|
5bcd2cdc32 | ||
|
|
c69a5ae4d2 | ||
|
|
6bd750a60b | ||
|
|
8d77cc3565 | ||
|
|
7a99e0056d | ||
|
|
03e07bc48d | ||
|
|
460d6c2b71 | ||
|
|
9f946094db | ||
|
|
4e92f82176 | ||
|
|
7b905ac120 | ||
|
|
55c5ec929c | ||
|
|
5441231f03 | ||
|
|
1818d24bc0 | ||
|
|
ca88c070c3 | ||
|
|
1be387c4ec | ||
|
|
fa3a956d69 | ||
|
|
8fd244e3a3 | ||
|
|
a0e2fe11dd | ||
|
|
893f34e72a | ||
|
|
cf13a9fc60 | ||
|
|
c6e6d96313 | ||
|
|
20ed9cac88 | ||
|
|
ae6bd937a9 | ||
|
|
e4b69e5cc5 | ||
|
|
5b1062b8d1 | ||
|
|
e06009852e | ||
|
|
50268f6bd1 | ||
|
|
a85e28d46d | ||
|
|
78b6be911f | ||
|
|
bb80478650 | ||
|
|
e0c06cc480 | ||
|
|
b8a508649c | ||
|
|
a8ce37d936 | ||
|
|
43015abbad | ||
|
|
47c8dff52d | ||
|
|
436cf7a068 | ||
|
|
31cc3cd5d0 | ||
|
|
3c11c2ef1e | ||
|
|
fac70f0210 | ||
|
|
6e99a29312 | ||
|
|
5b67ecf157 | ||
|
|
312470cf20 | ||
|
|
4371f46ff8 | ||
|
|
5468415b04 | ||
|
|
6a68ad5d19 | ||
|
|
7576505044 | ||
|
|
b34a43902a | ||
|
|
d3524a50a3 | ||
|
|
6508a6d5f7 | ||
|
|
49a6cf8ae3 | ||
|
|
b4238e0072 | ||
|
|
374170bf05 | ||
|
|
ab11345c3d | ||
|
|
10498ce1a4 | ||
|
|
28901487ff | ||
|
|
8414f51ee8 | ||
|
|
94f8adb6d7 | ||
|
|
844a921a1a | ||
|
|
ae8be3eda8 | ||
|
|
c4c15dbef8 | ||
|
|
ac72035500 | ||
|
|
abff3bcd39 | ||
|
|
05aea28602 | ||
|
|
e4c4dbf5a0 | ||
|
|
bb2393b6c6 | ||
|
|
fb330d16b5 | ||
|
|
c8f1b986ec | ||
|
|
49a2c93d28 | ||
|
|
0992ac4099 | ||
|
|
9ff29af616 | ||
|
|
fbc696047b | ||
|
|
08a4d4b114 | ||
|
|
329056301b | ||
|
|
fac8da69e7 | ||
|
|
fad9eed43e | ||
|
|
58a18bdd7b | ||
|
|
90cb524560 | ||
|
|
ef4c57ce29 | ||
|
|
8872fad73e | ||
|
|
63c3330571 | ||
|
|
37d1bb9477 | ||
|
|
8a67d1d02b | ||
|
|
6f777068ab | ||
|
|
8607e1c23c | ||
|
|
04a319066c | ||
|
|
39f89ca943 | ||
|
|
1092d7a9ba | ||
|
|
b54052182d | ||
|
|
b971c392cf | ||
|
|
cec9306387 | ||
|
|
f6a5cbbf80 | ||
|
|
4b55c414f3 | ||
|
|
1aafcdc6ae | ||
|
|
332e37b2eb | ||
|
|
dff33d3bab | ||
|
|
85ddc9689c | ||
|
|
d91c207b60 | ||
|
|
653606fae3 | ||
|
|
f5a0c8f375 | ||
|
|
c71019951c | ||
|
|
ed7b79ce17 | ||
|
|
08cfb490d4 | ||
|
|
7d284a85bc | ||
|
|
77ef0a2833 | ||
|
|
80130654ec | ||
|
|
e97f7c8645 | ||
|
|
e489ff6a22 | ||
|
|
de549d724c | ||
|
|
5fb2dbd252 | ||
|
|
20013cf7b7 | ||
|
|
78c3146c78 | ||
|
|
ddd7bb9968 | ||
|
|
68935f1489 | ||
|
|
d9a25e1eb9 | ||
|
|
73a837bab5 | ||
|
|
03be45f5a2 | ||
|
|
692adafd8e | ||
|
|
4ff9eb5219 | ||
|
|
286e9fa315 | ||
|
|
e0b6773d2a | ||
|
|
a7cb8a51a3 | ||
|
|
56c7ffa4df | ||
|
|
1498f902c2 | ||
|
|
eea0dd9081 | ||
|
|
1a8c8c07aa | ||
|
|
3901172757 | ||
|
|
3c9507cb7f | ||
|
|
bfc38807c8 | ||
|
|
6dc3a28026 | ||
|
|
eeb507f04e | ||
|
|
2746547194 | ||
|
|
c9a8e81047 | ||
|
|
d87b8ddd4b | ||
|
|
7dfa7071e3 | ||
|
|
92f0091b1d | ||
|
|
54d8f30bf1 | ||
|
|
f7ef13d594 | ||
|
|
2a1157256b | ||
|
|
213ef5060f | ||
|
|
bc24e263b9 | ||
|
|
8da70c41b2 | ||
|
|
4d81846fe0 | ||
|
|
2afdedd0b6 | ||
|
|
8d944cbb24 | ||
|
|
3ffec94b47 | ||
|
|
9176dc98ee | ||
|
|
9881854d13 | ||
|
|
2e4d1fa448 | ||
|
|
97ca1440b0 | ||
|
|
a4688c4450 | ||
|
|
a7ae2a333a | ||
|
|
823e99bd90 | ||
|
|
e32fccc694 | ||
|
|
dd568ab51d | ||
|
|
17f55e577b | ||
|
|
3f77223e65 | ||
|
|
28aad933c5 | ||
|
|
52ca8396db | ||
|
|
bc941544ae | ||
|
|
e3c3b176eb | ||
|
|
3b0b92b954 | ||
|
|
bfcae03420 | ||
|
|
ad4db1ef37 | ||
|
|
fa1a7fd2f1 | ||
|
|
7eac08d0a1 | ||
|
|
dab984b0d4 | ||
|
|
66361dede2 | ||
|
|
628c62fd4b | ||
|
|
84a7e95856 | ||
|
|
fc256d2c4a | ||
|
|
7f81ceeb7e | ||
|
|
3179644fbc | ||
|
|
274a58bcb0 | ||
|
|
dc7f42b0b6 | ||
|
|
f859627d7f | ||
|
|
ccf12bf028 | ||
|
|
c34e2fdd70 | ||
|
|
ea482c6fad | ||
|
|
54f223b5b0 | ||
|
|
74e083bb62 | ||
|
|
a9c36cd171 | ||
|
|
876b0beb2f | ||
|
|
1f73beb895 | ||
|
|
b13aaacdff | ||
|
|
ba67c122fa | ||
|
|
f16550aa9c | ||
|
|
ba57fbbf85 | ||
|
|
ebedb43e72 | ||
|
|
c10f859919 | ||
|
|
8e6e83dfc6 | ||
|
|
326379d222 | ||
|
|
105e85cc63 | ||
|
|
e21dbc85e8 | ||
|
|
78348a6f9c | ||
|
|
f98b98b4f3 | ||
|
|
d362305a25 | ||
|
|
623cfc671c | ||
|
|
456e2112b8 | ||
|
|
af2fbd1ce3 | ||
|
|
91211f07cb | ||
|
|
9c183e84dd | ||
|
|
5e3cebf4a1 | ||
|
|
9437d23e6e | ||
|
|
925a66a12a | ||
|
|
5db8af72a1 | ||
|
|
2b605eb193 | ||
|
|
f16d10995c | ||
|
|
3ef17404b7 | ||
|
|
1316ac731c | ||
|
|
6283a90217 | ||
|
|
84e8857067 | ||
|
|
05a53d7985 | ||
|
|
94b13b7145 | ||
|
|
3e55a147c7 | ||
|
|
f05ed2571f | ||
|
|
c1a37eb2a4 | ||
|
|
4d8d863780 | ||
|
|
d56eec4ba9 | ||
|
|
a05356d0e1 | ||
|
|
4eea6f7f53 | ||
|
|
24e19cc5f8 | ||
|
|
cd7631451b | ||
|
|
d140130b0d | ||
|
|
f0453943da | ||
|
|
42152ccbb5 | ||
|
|
27f8647243 | ||
|
|
b7d520ded6 | ||
|
|
04088ff366 | ||
|
|
d4dcec1a9b | ||
|
|
c8306616e3 | ||
|
|
b34bdebb5c | ||
|
|
9643cb9f94 | ||
|
|
645b29226e | ||
|
|
c56faba922 | ||
|
|
55a19eacc9 | ||
|
|
464a2350ae | ||
|
|
c44f737c99 | ||
|
|
a8794ce60c | ||
|
|
11329ba786 | ||
|
|
e568bd1af9 | ||
|
|
b3fbfdbf9d | ||
|
|
aec4292203 | ||
|
|
82733ca414 | ||
|
|
887424af80 | ||
|
|
f63a25f582 | ||
|
|
635ec748b3 | ||
|
|
fa510e3ffa | ||
|
|
24a5efd5f8 | ||
|
|
547dd55240 | ||
|
|
774705d9ad | ||
|
|
3d756e271c | ||
|
|
2da9a9c1a8 | ||
|
|
cd67d3c919 | ||
|
|
c080fdb244 | ||
|
|
9ee61812b8 | ||
|
|
bccf0a656b | ||
|
|
47ca66e9c7 | ||
|
|
972315ad00 | ||
|
|
0aa8b63c0c | ||
|
|
e77cf403eb | ||
|
|
df89ab29eb | ||
|
|
6c6829bfd5 | ||
|
|
fa531dce81 | ||
|
|
61bc7ad24a | ||
|
|
ce0964e6a7 | ||
|
|
4979ac9d34 | ||
|
|
912bcdf7f7 | ||
|
|
09174e646b | ||
|
|
0c729cb092 | ||
|
|
61faa4aa09 |
19
.github/workflows/android.yml
vendored
19
.github/workflows/android.yml
vendored
@@ -3,12 +3,15 @@ name: Android CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- staging
|
||||
- trying
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -20,17 +23,17 @@ jobs:
|
||||
- name: Fail on bad translations
|
||||
run: if grep -ri "<xliff" app/src/main/res/values*/strings.xml; then echo "Invalidly escaped translations found"; exit 1; fi
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- name: set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '11'
|
||||
- name: set up OpenJDK 17
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y openjdk-17-jdk-headless
|
||||
sudo update-alternatives --auto java
|
||||
- name: Build
|
||||
run: ./gradlew assembleRelease
|
||||
- name: Check lint
|
||||
run: ./gradlew lintRelease
|
||||
- name: Run unit tests
|
||||
run: ./gradlew testReleaseUnitTest || ./gradlew testReleaseUnitTest
|
||||
run: timeout 5m ./gradlew testReleaseUnitTest || { ./gradlew --stop && timeout 5m ./gradlew testReleaseUnitTest; }
|
||||
- name: SpotBugs
|
||||
run: ./gradlew spotbugsRelease
|
||||
- name: Archive test results
|
||||
|
||||
4
.github/workflows/autoclose-needs-info.yml
vendored
4
.github/workflows/autoclose-needs-info.yml
vendored
@@ -13,12 +13,12 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/stale@v4
|
||||
with:
|
||||
days-before-stale: -1
|
||||
days-before-close: 90
|
||||
stale-issue-message: ""
|
||||
stale-pr-message: ""
|
||||
close-issue-message: 'This issue is missing necessary information and cannot be worked on in its current state. It has therefore been closed to keep the issue tracker clean. If you have more information, feel free to reopen it.'
|
||||
close-pr-message: 'This PR is missing necessary information and cannot be merged in its current state. It has therefore been closed to keep the issue tracker clean. If you have more information, feel free to reopen it.'
|
||||
only-labels: 'state: needs info'
|
||||
stale-issue-label: 'state: needs info'
|
||||
stale-pr-label: 'state: needs info'
|
||||
remove-stale-when-updated: false
|
||||
enable-statistics: true
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
name: Compress Images on Push to Master
|
||||
name: Compress Images on Push to Main
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths:
|
||||
- '**.jpg'
|
||||
- '**.jpeg'
|
||||
|
||||
2
.github/workflows/changelog-to-fastlane.yml
vendored
2
.github/workflows/changelog-to-fastlane.yml
vendored
@@ -2,7 +2,7 @@ name: Convert CHANGELOG to Fastlane
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
jobs:
|
||||
convert_changelog_to_fastlane:
|
||||
|
||||
73
.github/workflows/codeql-analysis.yml
vendored
73
.github/workflows/codeql-analysis.yml
vendored
@@ -1,73 +0,0 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: '33 1 * * 4'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'java' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
2
.github/workflows/contributors-to-file.yml
vendored
2
.github/workflows/contributors-to-file.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
jobs:
|
||||
contributors_to_file:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/master'
|
||||
if: github.ref == 'refs/heads/main'
|
||||
name: Write contributors to file
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
|
||||
10
.github/workflows/gradle-wrapper-validation.yml
vendored
Normal file
10
.github/workflows/gradle-wrapper-validation.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
name: "Validate Gradle Wrapper"
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -8,3 +8,8 @@ captures/
|
||||
**/release
|
||||
**/debug
|
||||
app/*.log
|
||||
|
||||
# Bundle
|
||||
/.bundle/
|
||||
/vendor/bundle
|
||||
/lib/bundler/man/
|
||||
|
||||
82
CHANGELOG.md
82
CHANGELOG.md
@@ -1,26 +1,92 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased - 115
|
||||
## v2.25.1 - 128 (2023-07-17)
|
||||
|
||||
- Fix rare crash
|
||||
|
||||
## v2.25.0 - 127 (2023-07-09)
|
||||
|
||||
- Barcode rendering improvements
|
||||
- Basic interoperability with external apps (Android 6.0+)
|
||||
- Reorganized settings screen
|
||||
- Fix importing from some browsers that add a trailing / to the share URL
|
||||
|
||||
## v2.24.2 - 126 (2023-06-18)
|
||||
|
||||
- Various RTL fixes
|
||||
|
||||
## v2.24.1 - 125 (2023-06-11)
|
||||
|
||||
- Deal more gracefully with missing header colours
|
||||
|
||||
## v2.24.0 - 124 (2023-06-10)
|
||||
|
||||
- Support selecting exactly which details to view in card overview
|
||||
|
||||
## v2.23.3 - 123 (2023-06-03)
|
||||
|
||||
- Minor UI improvements
|
||||
- Fix new design not being usable on devices with square screens
|
||||
|
||||
## v2.23.2 - 122 (2023-05-30)
|
||||
|
||||
- Long-press card icon in view activity to change it
|
||||
- Improve button styling in Groups screen
|
||||
- Fix long barcode values causing barcode to scale down to nothing
|
||||
|
||||
## v2.23.1 - 121 (2023-05-27)
|
||||
|
||||
- Update used libraries
|
||||
|
||||
## v2.23.0 - 120 (2023-05-25)
|
||||
|
||||
- Complete redesign of main and loyalty card view screens
|
||||
- Material You design for the settings screen
|
||||
- Fix crash when using "Take a photo" with disabled camera app
|
||||
|
||||
## v2.22.1 - 119 (2023-04-14)
|
||||
|
||||
- Use Material You colours on more devices (Google library update)
|
||||
|
||||
## v2.22.0 - 118 (2023-03-18)
|
||||
|
||||
- Support setting start of card validity
|
||||
- Fix Stocard import (Stocard's export format changed)
|
||||
|
||||
## v2.21.2 - 117 (2023-01-27)
|
||||
|
||||
- Remove unnecessary permissions
|
||||
- Target Android 13
|
||||
|
||||
## v2.21.1 - 116 (2022-12-06)
|
||||
|
||||
- Fix quick spend dialog not allowing , separator
|
||||
- Support loading image from file manager
|
||||
|
||||
## v2.21.0 - 115 (2022-11-06)
|
||||
|
||||
- Open image in gallery on long-press
|
||||
- Apply Material style to dialogs
|
||||
- Support creating card by sharing an image to Catima
|
||||
- Add quick spend button to card screen
|
||||
|
||||
## v2.20.0 - 114
|
||||
## v2.20.0 - 114 (2022-09-21)
|
||||
|
||||
- Add Monochrome icon for Android 13
|
||||
- Improve first launch screen
|
||||
- Fidme import fixes
|
||||
|
||||
## v2.19.0 - 113
|
||||
## v2.19.0 - 113 (2022-08-14)
|
||||
|
||||
- Add previous and next buttons to the loyalty card view
|
||||
- Fix foreground colour on edit button
|
||||
- Replace floppy disk save icon with checkmark
|
||||
|
||||
## v2.18.2 - 112
|
||||
## v2.18.2 - 112 (2022-07-29)
|
||||
|
||||
- Make the possibility to set a custom header more visible
|
||||
|
||||
## v2.18.1 - 111
|
||||
## v2.18.1 - 111 (2022-07-24)
|
||||
|
||||
- Arabic language support
|
||||
- Display archived card count in group overview
|
||||
@@ -30,11 +96,11 @@
|
||||
- Fix crash when leaving cardview in RTL layouts for cards with expiry or balance
|
||||
- Fix back arrow in card view pointing the wrong way in RTL layouts
|
||||
|
||||
## v2.17.1 - 109
|
||||
## v2.17.1 - 109 (2022-06-28)
|
||||
|
||||
- Fix incorrect text colour on "No barcode" button
|
||||
|
||||
## v2.17.0 - 108
|
||||
## v2.17.0 - 108 (2022-06-24)
|
||||
|
||||
- Add card duplication feature
|
||||
- Don't allow choosing expiry before 1970 (they never worked anyway)
|
||||
@@ -596,7 +662,7 @@ Additional features/improvements:
|
||||
## v0.7 - 7 (2016-07-14)
|
||||
|
||||
- Long-click of a card brings up option to copy card ID to the clipboard. ([pull #49](https://github.com/brarcher/loyalty-card-locker/issues/49))
|
||||
- Back button on Input/Export view now works, moving user to main view
|
||||
- Back button on Import/Export view now works, moving user to main view
|
||||
|
||||
## v0.6 - 6 (2016-05-23)
|
||||
|
||||
|
||||
@@ -100,5 +100,5 @@ your real name, saying:
|
||||
Finally, you will need to submit your patches so that they can be reviewed
|
||||
and potentially merged into the main Catima repository. The preferred
|
||||
way to do this is to submit a Pull Request to the Catima project.
|
||||
Changes need to apply cleanly onto the master branch and pass all
|
||||
Changes need to apply cleanly onto the main branch and pass all
|
||||
unit tests and produce no errors during static analysis.
|
||||
|
||||
88
Gemfile.lock
88
Gemfile.lock
@@ -1,27 +1,27 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.5)
|
||||
CFPropertyList (3.0.6)
|
||||
rexml
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
addressable (2.8.4)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
artifactory (3.0.15)
|
||||
atomos (0.1.3)
|
||||
aws-eventstream (1.2.0)
|
||||
aws-partitions (1.597.0)
|
||||
aws-sdk-core (3.131.1)
|
||||
aws-partitions (1.771.0)
|
||||
aws-sdk-core (3.173.1)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
aws-partitions (~> 1, >= 1.525.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-partitions (~> 1, >= 1.651.0)
|
||||
aws-sigv4 (~> 1.5)
|
||||
jmespath (~> 1, >= 1.6.1)
|
||||
aws-sdk-kms (1.57.0)
|
||||
aws-sdk-core (~> 3, >= 3.127.0)
|
||||
aws-sdk-kms (1.64.0)
|
||||
aws-sdk-core (~> 3, >= 3.165.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-s3 (1.114.0)
|
||||
aws-sdk-core (~> 3, >= 3.127.0)
|
||||
aws-sdk-s3 (1.122.0)
|
||||
aws-sdk-core (~> 3, >= 3.165.0)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.4)
|
||||
aws-sigv4 (1.5.0)
|
||||
aws-sigv4 (1.5.2)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
babosa (1.0.4)
|
||||
claide (1.1.0)
|
||||
@@ -34,10 +34,10 @@ GEM
|
||||
rake (>= 12.0.0, < 14.0.0)
|
||||
domain_name (0.5.20190701)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
dotenv (2.7.6)
|
||||
dotenv (2.8.1)
|
||||
emoji_regex (3.2.3)
|
||||
excon (0.92.3)
|
||||
faraday (1.10.0)
|
||||
excon (0.99.0)
|
||||
faraday (1.10.3)
|
||||
faraday-em_http (~> 1.0)
|
||||
faraday-em_synchrony (~> 1.0)
|
||||
faraday-excon (~> 1.1)
|
||||
@@ -65,8 +65,8 @@ GEM
|
||||
faraday-retry (1.0.3)
|
||||
faraday_middleware (1.2.0)
|
||||
faraday (~> 1.0)
|
||||
fastimage (2.2.6)
|
||||
fastlane (2.206.2)
|
||||
fastimage (2.2.7)
|
||||
fastlane (2.213.0)
|
||||
CFPropertyList (>= 2.3, < 4.0.0)
|
||||
addressable (>= 2.8, < 3.0.0)
|
||||
artifactory (~> 3.0)
|
||||
@@ -90,7 +90,7 @@ GEM
|
||||
json (< 3.0.0)
|
||||
jwt (>= 2.1.0, < 3)
|
||||
mini_magick (>= 4.9.4, < 5.0.0)
|
||||
multipart-post (~> 2.0.0)
|
||||
multipart-post (>= 2.0.0, < 3.0.0)
|
||||
naturally (~> 2.2)
|
||||
optparse (~> 0.1.1)
|
||||
plist (>= 3.1.0, < 4.0.0)
|
||||
@@ -106,9 +106,9 @@ GEM
|
||||
xcpretty (~> 0.3.0)
|
||||
xcpretty-travis-formatter (>= 0.0.3)
|
||||
gh_inspector (1.1.3)
|
||||
google-apis-androidpublisher_v3 (0.21.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-core (0.5.0)
|
||||
google-apis-androidpublisher_v3 (0.42.0)
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
google-apis-core (0.11.0)
|
||||
addressable (~> 2.5, >= 2.5.1)
|
||||
googleauth (>= 0.16.2, < 2.a)
|
||||
httpclient (>= 2.8.1, < 3.a)
|
||||
@@ -117,27 +117,27 @@ GEM
|
||||
retriable (>= 2.0, < 4.a)
|
||||
rexml
|
||||
webrick
|
||||
google-apis-iamcredentials_v1 (0.10.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-playcustomapp_v1 (0.7.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-storage_v1 (0.14.0)
|
||||
google-apis-core (>= 0.4, < 2.a)
|
||||
google-apis-iamcredentials_v1 (0.17.0)
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
google-apis-playcustomapp_v1 (0.13.0)
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
google-apis-storage_v1 (0.19.0)
|
||||
google-apis-core (>= 0.9.0, < 2.a)
|
||||
google-cloud-core (1.6.0)
|
||||
google-cloud-env (~> 1.0)
|
||||
google-cloud-errors (~> 1.0)
|
||||
google-cloud-env (1.6.0)
|
||||
faraday (>= 0.17.3, < 3.0)
|
||||
google-cloud-errors (1.2.0)
|
||||
google-cloud-storage (1.36.2)
|
||||
google-cloud-errors (1.3.1)
|
||||
google-cloud-storage (1.44.0)
|
||||
addressable (~> 2.8)
|
||||
digest-crc (~> 0.4)
|
||||
google-apis-iamcredentials_v1 (~> 0.1)
|
||||
google-apis-storage_v1 (~> 0.1)
|
||||
google-apis-storage_v1 (~> 0.19.0)
|
||||
google-cloud-core (~> 1.6)
|
||||
googleauth (>= 0.16.2, < 2.a)
|
||||
mini_mime (~> 1.0)
|
||||
googleauth (1.1.3)
|
||||
googleauth (1.5.2)
|
||||
faraday (>= 0.17.3, < 3.a)
|
||||
jwt (>= 1.4, < 3.0)
|
||||
memoist (~> 0.16)
|
||||
@@ -148,20 +148,20 @@ GEM
|
||||
http-cookie (1.0.5)
|
||||
domain_name (~> 0.5)
|
||||
httpclient (2.8.3)
|
||||
jmespath (1.6.1)
|
||||
json (2.6.2)
|
||||
jwt (2.4.1)
|
||||
jmespath (1.6.2)
|
||||
json (2.6.3)
|
||||
jwt (2.7.0)
|
||||
memoist (0.16.2)
|
||||
mini_magick (4.11.0)
|
||||
mini_magick (4.12.0)
|
||||
mini_mime (1.1.2)
|
||||
multi_json (1.15.0)
|
||||
multipart-post (2.0.0)
|
||||
multipart-post (2.3.0)
|
||||
nanaimo (0.3.0)
|
||||
naturally (2.2.1)
|
||||
optparse (0.1.1)
|
||||
os (1.1.4)
|
||||
plist (3.6.0)
|
||||
public_suffix (4.0.7)
|
||||
plist (3.7.0)
|
||||
public_suffix (5.0.1)
|
||||
rake (13.0.6)
|
||||
representable (3.2.0)
|
||||
declarative (< 0.1.0)
|
||||
@@ -173,12 +173,12 @@ GEM
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
security (0.1.3)
|
||||
signet (0.16.1)
|
||||
signet (0.17.0)
|
||||
addressable (~> 2.8)
|
||||
faraday (>= 0.17.5, < 3.0)
|
||||
faraday (>= 0.17.5, < 3.a)
|
||||
jwt (>= 1.5, < 3.0)
|
||||
multi_json (~> 1.10)
|
||||
simctl (1.6.8)
|
||||
simctl (1.6.10)
|
||||
CFPropertyList
|
||||
naturally
|
||||
terminal-notifier (2.0.0)
|
||||
@@ -194,9 +194,9 @@ GEM
|
||||
unf_ext
|
||||
unf_ext (0.0.8.2)
|
||||
unicode-display_width (1.8.0)
|
||||
webrick (1.7.0)
|
||||
webrick (1.8.1)
|
||||
word_wrap (1.0.0)
|
||||
xcodeproj (1.21.0)
|
||||
xcodeproj (1.22.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
@@ -215,4 +215,4 @@ DEPENDENCIES
|
||||
fastlane
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.4
|
||||
2.3.26
|
||||
|
||||
13
SECURITY.md
Normal file
13
SECURITY.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Security Policy
|
||||
|
||||
Catima is designed to use as little permissions as possible to limit both the attack surface as well as the damage that can be done when abusing a security flaw.
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Only the most recent stable release is supported.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Security vulnerabilities can be reported through [GitHub Security Advisories](https://github.com/CatimaLoyalty/Android/security/advisories) or [the contact info written on my personal website](https://sylviavanos.nl/#contact). Currently, Matrix is the only end-to-end encrypted option.
|
||||
|
||||
Please note that only security vulnerabilities in Catima should be reported as stated above. For other issues, including antivirus false positives and malicious applications trying to trick people into granting them Catima's "Read Cards" permission, please use [regular issues](https://github.com/CatimaLoyalty/Android/issues).
|
||||
@@ -1,7 +1,9 @@
|
||||
import com.github.spotbugs.snom.SpotBugsTask
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.github.spotbugs'
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'com.github.spotbugs'
|
||||
}
|
||||
|
||||
spotbugs {
|
||||
ignoreFailures = false
|
||||
@@ -11,15 +13,14 @@ spotbugs {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion "31.0.0"
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "me.hackerchick.catima"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 31
|
||||
versionCode 114
|
||||
versionName "2.20.0"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 128
|
||||
versionName "2.25.1"
|
||||
|
||||
vectorDrawables.useSupportLibrary true
|
||||
multiDexEnabled true
|
||||
@@ -37,6 +38,10 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
|
||||
bundle {
|
||||
language {
|
||||
enableSplit = false
|
||||
@@ -53,10 +58,6 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable "GoogleAppIndexingWarning", "ButtonStyle", "AlwaysShowAction",
|
||||
"MissingTranslation", "MissingPrefix"
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
test {
|
||||
@@ -76,37 +77,40 @@ android {
|
||||
includeAndroidResources true
|
||||
}
|
||||
}
|
||||
lint {
|
||||
lintConfig file('lint.xml')
|
||||
}
|
||||
namespace 'protect.card_locker'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// AndroidX
|
||||
implementation 'androidx.appcompat:appcompat:1.4.2'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
implementation 'androidx.exifinterface:exifinterface:1.3.3'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.exifinterface:exifinterface:1.3.6'
|
||||
implementation 'androidx.palette:palette:1.0.0'
|
||||
implementation 'androidx.preference:preference:1.2.0'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'com.github.yalantis:ucrop:2.2.8'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.6'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
|
||||
|
||||
// Splash Screen
|
||||
implementation 'androidx.core:core-splashscreen:1.0.0'
|
||||
implementation 'androidx.core:core-splashscreen:1.0.1'
|
||||
|
||||
// Third-party
|
||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0@aar'
|
||||
implementation 'com.google.zxing:core:3.5.0'
|
||||
implementation 'com.google.zxing:core:3.5.1'
|
||||
implementation 'org.apache.commons:commons-csv:1.9.0'
|
||||
implementation 'com.jaredrummler:colorpicker:1.1.0'
|
||||
implementation 'com.github.invissvenska:NumberPickerPreference:1.0.4'
|
||||
implementation 'net.lingala.zip4j:zip4j:2.11.2'
|
||||
implementation 'net.lingala.zip4j:zip4j:2.11.5'
|
||||
|
||||
// SpotBugs
|
||||
implementation 'io.wcm.tooling.spotbugs:io.wcm.tooling.spotbugs.annotations:1.0.0'
|
||||
|
||||
// Testing
|
||||
testImplementation 'androidx.test:core:1.4.0'
|
||||
testImplementation 'androidx.test:core:1.5.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
testImplementation 'org.robolectric:robolectric:4.9'
|
||||
testImplementation 'org.robolectric:robolectric:4.10.3'
|
||||
}
|
||||
|
||||
tasks.withType(SpotBugsTask) {
|
||||
|
||||
@@ -6,5 +6,8 @@
|
||||
<Match>
|
||||
<Class name="~.*Manifest\$.*"/>
|
||||
</Match>
|
||||
<Match>
|
||||
<Class name="~.*Binding" />
|
||||
</Match>
|
||||
|
||||
</FindBugsFilter>
|
||||
|
||||
8
app/lint.xml
Normal file
8
app/lint.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<lint>
|
||||
<issue id="AlwaysShowAction" severity="ignore" />
|
||||
<issue id="ButtonStyle" severity="ignore" />
|
||||
<issue id="GoogleAppIndexingWarning" severity="ignore" />
|
||||
<issue id="MissingTranslation" severity="ignore" />
|
||||
<issue id="MissingPrefix" severity="ignore" />
|
||||
</lint>
|
||||
@@ -1,13 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="protect.card_locker">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<permission
|
||||
android:description="@string/permissionReadCardsDescription"
|
||||
android:icon="@drawable/ic_launcher_foreground"
|
||||
android:label="@string/permissionReadCardsLabel"
|
||||
android:name="${applicationId}.READ_CARDS"
|
||||
android:protectionLevel="dangerous" />
|
||||
|
||||
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="23" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
@@ -33,6 +38,12 @@
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".AboutActivity"
|
||||
@@ -102,7 +113,39 @@
|
||||
<activity
|
||||
android:name=".ImportExportActivity"
|
||||
android:label="@string/importExport"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
android:exported="true"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
|
||||
<!-- ZIP Intent Filter -->
|
||||
<intent-filter
|
||||
android:label="@string/importCards">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="application/zip" />
|
||||
<data android:scheme="content"/>
|
||||
<data android:host="*"/>
|
||||
</intent-filter>
|
||||
|
||||
<!-- JSON Intent Filter -->
|
||||
<intent-filter
|
||||
android:label="@string/importCards">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="application/json" />
|
||||
<data android:scheme="content"/>
|
||||
<data android:host="*"/>
|
||||
</intent-filter>
|
||||
|
||||
<!-- CSV Intent Filter -->
|
||||
<intent-filter
|
||||
android:label="@string/importCards">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:scheme="content"/>
|
||||
<data android:host="*" />
|
||||
<data android:mimeType="text/comma-separated-values" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".CardShortcutConfigure"
|
||||
android:exported="true"
|
||||
@@ -119,6 +162,12 @@
|
||||
android:name=".UCropWrapper"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<provider
|
||||
android:name=".contentprovider.CardsContentProvider"
|
||||
android:authorities="${applicationId}.contentprovider.cards"
|
||||
android:exported="true"
|
||||
android:readPermission="${applicationId}.READ_CARDS"/>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}"
|
||||
|
||||
@@ -1,138 +1,53 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
|
||||
public class AboutActivity extends CatimaAppCompatActivity implements View.OnClickListener {
|
||||
import protect.card_locker.databinding.AboutActivityBinding;
|
||||
|
||||
public class AboutActivity extends CatimaAppCompatActivity {
|
||||
|
||||
private static final String TAG = "Catima";
|
||||
ConstraintLayout version_history, translate, license, repo, privacy, error, credits, rate;
|
||||
|
||||
private AboutActivityBinding binding;
|
||||
private AboutContent content;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setTitle(R.string.about);
|
||||
setContentView(R.layout.about_activity);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
binding = AboutActivityBinding.inflate(getLayoutInflater());
|
||||
content = new AboutContent(this);
|
||||
setTitle(content.getPageTitle());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
enableToolbarBackButton();
|
||||
|
||||
StringBuilder contributors = new StringBuilder().append("<br/>");
|
||||
TextView copyright = binding.creditsSub;
|
||||
copyright.setText(content.getCopyright());
|
||||
TextView versionHistory = binding.versionHistorySub;
|
||||
versionHistory.setText(content.getVersionHistory());
|
||||
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(getResources().openRawResource(R.raw.contributors), StandardCharsets.UTF_8));
|
||||
binding.versionHistory.setTag("https://catima.app/changelog/");
|
||||
binding.translate.setTag("https://hosted.weblate.org/engage/catima/");
|
||||
binding.license.setTag("https://github.com/CatimaLoyalty/Android/blob/main/LICENSE");
|
||||
binding.repo.setTag("https://github.com/CatimaLoyalty/Android/");
|
||||
binding.privacy.setTag("https://catima.app/privacy-policy/");
|
||||
binding.reportError.setTag("https://github.com/CatimaLoyalty/Android/issues");
|
||||
binding.rate.setTag("https://play.google.com/store/apps/details?id=me.hackerchick.catima");
|
||||
binding.donate.setTag("https://catima.app/contribute/#donating");
|
||||
|
||||
try {
|
||||
while (true) {
|
||||
String tmp = reader.readLine();
|
||||
boolean installedFromGooglePlay = Utils.installedFromGooglePlay(this);
|
||||
// Hide Google Play rate button if not on Google Play
|
||||
binding.rate.setVisibility(installedFromGooglePlay ? View.VISIBLE : View.GONE);
|
||||
// Hide donate button on Google Play (Google Play doesn't allow donation links)
|
||||
binding.donate.setVisibility(installedFromGooglePlay ? View.GONE : View.VISIBLE);
|
||||
|
||||
if (tmp == null || tmp.isEmpty()) {
|
||||
reader.close();
|
||||
break;
|
||||
}
|
||||
|
||||
contributors.append("<br/>");
|
||||
contributors.append(tmp);
|
||||
}
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
|
||||
final List<ThirdPartyInfo> USED_LIBRARIES = new ArrayList<>();
|
||||
USED_LIBRARIES.add(new ThirdPartyInfo("Color Picker", "https://github.com/jaredrummler/ColorPicker", "Apache 2.0"));
|
||||
USED_LIBRARIES.add(new ThirdPartyInfo("Commons CSV", "https://commons.apache.org/proper/commons-csv/", "Apache 2.0"));
|
||||
USED_LIBRARIES.add(new ThirdPartyInfo("NumberPickerPreference", "https://github.com/invissvenska/NumberPickerPreference", "GNU LGPL 3.0"));
|
||||
USED_LIBRARIES.add(new ThirdPartyInfo("uCrop", "https://github.com/Yalantis/uCrop", "Apache 2.0"));
|
||||
USED_LIBRARIES.add(new ThirdPartyInfo("Zip4j", "https://github.com/srikanth-lingala/zip4j", "Apache 2.0"));
|
||||
USED_LIBRARIES.add(new ThirdPartyInfo("ZXing", "https://github.com/zxing/zxing", "Apache 2.0"));
|
||||
USED_LIBRARIES.add(new ThirdPartyInfo("ZXing Android Embedded", "https://github.com/journeyapps/zxing-android-embedded", "Apache 2.0"));
|
||||
|
||||
final List<ThirdPartyInfo> USED_ASSETS = new ArrayList<>();
|
||||
USED_ASSETS.add(new ThirdPartyInfo("Android icons", "https://fonts.google.com/icons?selected=Material+Icons", "Apache 2.0"));
|
||||
|
||||
StringBuilder libs = new StringBuilder().append("<br/>");
|
||||
for (ThirdPartyInfo entry : USED_LIBRARIES) {
|
||||
libs.append("<br/><a href=\"").append(entry.url()).append("\">").append(entry.name()).append("</a> (").append(entry.license()).append(")");
|
||||
}
|
||||
|
||||
StringBuilder resources = new StringBuilder().append("<br/>");
|
||||
for (ThirdPartyInfo entry : USED_ASSETS) {
|
||||
resources.append("<br/><a href=\"").append(entry.url()).append("\">").append(entry.name()).append("</a> (").append(entry.license()).append(")");
|
||||
}
|
||||
|
||||
String appName = getString(R.string.app_name);
|
||||
int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||
|
||||
String version = "?";
|
||||
try {
|
||||
PackageInfo pi = getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||
version = pi.versionName;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.w(TAG, "Package name not found", e);
|
||||
}
|
||||
|
||||
TextView copyright = findViewById(R.id.credits_sub);
|
||||
copyright.setText(String.format(getString(R.string.app_copyright_fmt), year));
|
||||
TextView vHistory = findViewById(R.id.version_history_sub);
|
||||
vHistory.setText(String.format(getString(R.string.debug_version_fmt), version));
|
||||
|
||||
setTitle(String.format(getString(R.string.about_title_fmt), appName));
|
||||
|
||||
version_history = findViewById(R.id.version_history);
|
||||
translate = findViewById(R.id.translate);
|
||||
license = findViewById(R.id.license);
|
||||
repo = findViewById(R.id.repo);
|
||||
privacy = findViewById(R.id.privacy);
|
||||
error = findViewById(R.id.report_error);
|
||||
credits = findViewById(R.id.credits);
|
||||
rate = findViewById(R.id.rate);
|
||||
|
||||
version_history.setOnClickListener(this);
|
||||
translate.setOnClickListener(this);
|
||||
license.setOnClickListener(this);
|
||||
repo.setOnClickListener(this);
|
||||
privacy.setOnClickListener(this);
|
||||
error.setOnClickListener(this);
|
||||
rate.setOnClickListener(this);
|
||||
|
||||
StringBuilder contributorInfo = new StringBuilder();
|
||||
contributorInfo.append(HtmlCompat.fromHtml(String.format(getString(R.string.app_contributors), contributors.toString()), HtmlCompat.FROM_HTML_MODE_COMPACT));
|
||||
contributorInfo.append("\n\n");
|
||||
contributorInfo.append(getString(R.string.app_copyright_old));
|
||||
contributorInfo.append("\n\n");
|
||||
contributorInfo.append(HtmlCompat.fromHtml(String.format(getString(R.string.app_libraries), libs.toString()), HtmlCompat.FROM_HTML_MODE_COMPACT));
|
||||
contributorInfo.append("\n\n");
|
||||
contributorInfo.append(HtmlCompat.fromHtml(String.format(getString(R.string.app_resources), resources.toString()), HtmlCompat.FROM_HTML_MODE_COMPACT));
|
||||
|
||||
credits.setOnClickListener(view -> new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.credits)
|
||||
.setMessage(contributorInfo.toString())
|
||||
.setPositiveButton(R.string.ok, (dialogInterface, i) -> {
|
||||
})
|
||||
.show());
|
||||
bindClickListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,36 +60,50 @@ public class AboutActivity extends CatimaAppCompatActivity implements View.OnCli
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
|
||||
String url;
|
||||
if (id == R.id.version_history) {
|
||||
url = "https://catima.app/changelog/";
|
||||
} else if (id == R.id.translate) {
|
||||
url = "https://hosted.weblate.org/engage/catima/";
|
||||
} else if (id == R.id.license) {
|
||||
url = "https://github.com/CatimaLoyalty/Android/blob/master/LICENSE";
|
||||
} else if (id == R.id.repo) {
|
||||
url = "https://github.com/CatimaLoyalty/Android/";
|
||||
} else if (id == R.id.privacy) {
|
||||
url = "https://catima.app/privacy-policy/";
|
||||
} else if (id == R.id.report_error) {
|
||||
url = "https://github.com/CatimaLoyalty/Android/issues";
|
||||
} else if (id == R.id.rate) {
|
||||
url = "https://play.google.com/store/apps/details?id=me.hackerchick.catima";
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url));
|
||||
try {
|
||||
startActivity(intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(this, R.string.failedToOpenUrl, Toast.LENGTH_LONG).show();
|
||||
Log.e(TAG, "No activity found to handle intent", e);
|
||||
}
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
content.destroy();
|
||||
clearClickListeners();
|
||||
binding = null;
|
||||
}
|
||||
|
||||
private void bindClickListeners() {
|
||||
View.OnClickListener openExternalBrowser = view -> {
|
||||
Object tag = view.getTag();
|
||||
if (tag instanceof String && ((String) tag).startsWith("https://")) {
|
||||
(new OpenWebLinkHandler()).openBrowser(this, (String) tag);
|
||||
}
|
||||
};
|
||||
binding.versionHistory.setOnClickListener(openExternalBrowser);
|
||||
binding.translate.setOnClickListener(openExternalBrowser);
|
||||
binding.license.setOnClickListener(openExternalBrowser);
|
||||
binding.repo.setOnClickListener(openExternalBrowser);
|
||||
binding.privacy.setOnClickListener(openExternalBrowser);
|
||||
binding.reportError.setOnClickListener(openExternalBrowser);
|
||||
binding.rate.setOnClickListener(openExternalBrowser);
|
||||
binding.donate.setOnClickListener(openExternalBrowser);
|
||||
|
||||
binding.credits.setOnClickListener(view -> showCredits());
|
||||
}
|
||||
|
||||
private void clearClickListeners() {
|
||||
binding.versionHistory.setOnClickListener(null);
|
||||
binding.translate.setOnClickListener(null);
|
||||
binding.license.setOnClickListener(null);
|
||||
binding.repo.setOnClickListener(null);
|
||||
binding.privacy.setOnClickListener(null);
|
||||
binding.reportError.setOnClickListener(null);
|
||||
binding.rate.setOnClickListener(null);
|
||||
binding.donate.setOnClickListener(null);
|
||||
|
||||
binding.credits.setOnClickListener(null);
|
||||
}
|
||||
|
||||
private void showCredits() {
|
||||
new MaterialAlertDialogBuilder(this)
|
||||
.setTitle(R.string.credits)
|
||||
.setMessage(content.getContributorInfo())
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
111
app/src/main/java/protect/card_locker/AboutContent.java
Normal file
111
app/src/main/java/protect/card_locker/AboutContent.java
Normal file
@@ -0,0 +1,111 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.text.HtmlCompat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
public class AboutContent {
|
||||
|
||||
public static final String TAG = "Catima";
|
||||
|
||||
public Context context;
|
||||
|
||||
public AboutContent(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
this.context = null;
|
||||
}
|
||||
|
||||
public String getPageTitle() {
|
||||
return String.format(context.getString(R.string.about_title_fmt), context.getString(R.string.app_name));
|
||||
}
|
||||
|
||||
public String getAppVersion() {
|
||||
String version = "?";
|
||||
try {
|
||||
PackageInfo pi = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
|
||||
version = pi.versionName;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.w(TAG, "Package name not found", e);
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
public int getCurrentYear() {
|
||||
return Calendar.getInstance().get(Calendar.YEAR);
|
||||
}
|
||||
|
||||
public String getCopyright() {
|
||||
return String.format(context.getString(R.string.app_copyright_fmt), getCurrentYear());
|
||||
}
|
||||
|
||||
public String getContributors() {
|
||||
String contributors;
|
||||
try {
|
||||
contributors = "<br/>" + Utils.readTextFile(context, R.raw.contributors);
|
||||
} catch (IOException ignored) {
|
||||
return "";
|
||||
}
|
||||
return contributors.replace("\n", "<br />");
|
||||
}
|
||||
|
||||
public String getThirdPartyLibraries() {
|
||||
final List<ThirdPartyInfo> usedLibraries = new ArrayList<>();
|
||||
usedLibraries.add(new ThirdPartyInfo("Color Picker", "https://github.com/jaredrummler/ColorPicker", "Apache 2.0"));
|
||||
usedLibraries.add(new ThirdPartyInfo("Commons CSV", "https://commons.apache.org/proper/commons-csv/", "Apache 2.0"));
|
||||
usedLibraries.add(new ThirdPartyInfo("NumberPickerPreference", "https://github.com/invissvenska/NumberPickerPreference", "GNU LGPL 3.0"));
|
||||
usedLibraries.add(new ThirdPartyInfo("uCrop", "https://github.com/Yalantis/uCrop", "Apache 2.0"));
|
||||
usedLibraries.add(new ThirdPartyInfo("Zip4j", "https://github.com/srikanth-lingala/zip4j", "Apache 2.0"));
|
||||
usedLibraries.add(new ThirdPartyInfo("ZXing", "https://github.com/zxing/zxing", "Apache 2.0"));
|
||||
usedLibraries.add(new ThirdPartyInfo("ZXing Android Embedded", "https://github.com/journeyapps/zxing-android-embedded", "Apache 2.0"));
|
||||
|
||||
StringBuilder result = new StringBuilder("<br/>");
|
||||
for (ThirdPartyInfo entry : usedLibraries) {
|
||||
result.append("<br/>")
|
||||
.append(entry.toHtml());
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public String getUsedThirdPartyAssets() {
|
||||
final List<ThirdPartyInfo> usedAssets = new ArrayList<>();
|
||||
usedAssets.add(new ThirdPartyInfo("Android icons", "https://fonts.google.com/icons?selected=Material+Icons", "Apache 2.0"));
|
||||
|
||||
StringBuilder result = new StringBuilder().append("<br/>");
|
||||
for (ThirdPartyInfo entry : usedAssets) {
|
||||
result.append("<br/>")
|
||||
.append(entry.toHtml());
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public String getContributorInfo() {
|
||||
StringBuilder contributorInfo = new StringBuilder();
|
||||
contributorInfo.append(HtmlCompat.fromHtml(String.format(context.getString(R.string.app_contributors), getContributors()), HtmlCompat.FROM_HTML_MODE_COMPACT));
|
||||
contributorInfo.append("\n\n");
|
||||
contributorInfo.append(context.getString(R.string.app_copyright_old));
|
||||
contributorInfo.append("\n\n");
|
||||
contributorInfo.append(HtmlCompat.fromHtml(String.format(context.getString(R.string.app_libraries), getThirdPartyLibraries()), HtmlCompat.FROM_HTML_MODE_COMPACT));
|
||||
contributorInfo.append("\n\n");
|
||||
contributorInfo.append(HtmlCompat.fromHtml(String.format(context.getString(R.string.app_resources), getUsedThirdPartyAssets()), HtmlCompat.FROM_HTML_MODE_COMPACT));
|
||||
|
||||
return contributorInfo.toString();
|
||||
}
|
||||
|
||||
public String getVersionHistory() {
|
||||
return String.format(context.getString(R.string.debug_version_fmt), getAppVersion());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package protect.card_locker;
|
||||
|
||||
public interface BarcodeImageWriterResultCallback {
|
||||
void onBarcodeImageWriterResult(boolean success);
|
||||
}
|
||||
@@ -41,13 +41,15 @@ public class BarcodeImageWriterTask implements CompatCallable<Bitmap> {
|
||||
private final CatimaBarcode format;
|
||||
private final int imageHeight;
|
||||
private final int imageWidth;
|
||||
private final int imagePadding;
|
||||
private final boolean widthPadding;
|
||||
private final boolean showFallback;
|
||||
private final Runnable callback;
|
||||
private final BarcodeImageWriterResultCallback callback;
|
||||
|
||||
BarcodeImageWriterTask(
|
||||
Context context, ImageView imageView, String cardIdString,
|
||||
CatimaBarcode barcodeFormat, TextView textView,
|
||||
boolean showFallback, Runnable callback, boolean roundCornerPadding
|
||||
boolean showFallback, BarcodeImageWriterResultCallback callback, boolean roundCornerPadding
|
||||
) {
|
||||
mContext = context;
|
||||
|
||||
@@ -61,32 +63,39 @@ public class BarcodeImageWriterTask implements CompatCallable<Bitmap> {
|
||||
cardId = cardIdString;
|
||||
format = barcodeFormat;
|
||||
|
||||
int padding = 0;
|
||||
int imageViewHeight = imageView.getHeight();
|
||||
int imageViewWidth = imageView.getWidth();
|
||||
|
||||
// Some barcodes already have internal whitespace and shouldn't get extra padding
|
||||
// TODO: Get rid of this hack by somehow detecting this extra whitespace
|
||||
if (roundCornerPadding && !barcodeFormat.hasInternalPadding()) {
|
||||
padding = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, context.getResources().getDisplayMetrics()));
|
||||
imagePadding = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, context.getResources().getDisplayMetrics()));
|
||||
} else {
|
||||
imagePadding = 0;
|
||||
}
|
||||
|
||||
if (format.isSquare() && imageViewWidth > imageViewHeight) {
|
||||
imageViewWidth -= imagePadding;
|
||||
widthPadding = true;
|
||||
} else {
|
||||
imageViewHeight -= imagePadding;
|
||||
widthPadding = false;
|
||||
}
|
||||
|
||||
final int MAX_WIDTH = getMaxWidth(format);
|
||||
|
||||
int tempImageHeight;
|
||||
int tempImageWidth;
|
||||
|
||||
if (imageView.getWidth() < MAX_WIDTH) {
|
||||
tempImageHeight = imageView.getHeight();
|
||||
tempImageWidth = imageView.getWidth();
|
||||
if (format.isSquare()) {
|
||||
imageHeight = imageWidth = Math.min(imageViewHeight, Math.min(MAX_WIDTH, imageViewWidth));
|
||||
} else if (imageView.getWidth() < MAX_WIDTH) {
|
||||
imageHeight = imageViewHeight;
|
||||
imageWidth = imageViewWidth;
|
||||
} else {
|
||||
// Scale down the image to reduce the memory needed to produce it
|
||||
tempImageWidth = MAX_WIDTH;
|
||||
double ratio = (double) MAX_WIDTH / (double) imageView.getWidth();
|
||||
tempImageHeight = (int) (imageView.getHeight() * ratio);
|
||||
imageWidth = MAX_WIDTH;
|
||||
double ratio = (double) MAX_WIDTH / (double) imageViewWidth;
|
||||
imageHeight = (int) (imageViewHeight * ratio);
|
||||
}
|
||||
|
||||
// Ensure space for padding if wanted
|
||||
imageWidth = tempImageWidth;
|
||||
imageHeight = tempImageHeight - padding;
|
||||
|
||||
this.showFallback = showFallback;
|
||||
}
|
||||
|
||||
@@ -94,12 +103,15 @@ public class BarcodeImageWriterTask implements CompatCallable<Bitmap> {
|
||||
switch (format.format()) {
|
||||
// 2D barcodes
|
||||
case AZTEC:
|
||||
case DATA_MATRIX:
|
||||
case MAXICODE:
|
||||
case PDF_417:
|
||||
case QR_CODE:
|
||||
return MAX_WIDTH_2D;
|
||||
|
||||
// 2D but rectangular versions get blurry otherwise
|
||||
case DATA_MATRIX:
|
||||
return MAX_WIDTH_1D;
|
||||
|
||||
// 1D barcodes:
|
||||
case CODABAR:
|
||||
case CODE_39:
|
||||
@@ -261,6 +273,11 @@ public class BarcodeImageWriterTask implements CompatCallable<Bitmap> {
|
||||
|
||||
if (result != null) {
|
||||
Log.i(TAG, "Displaying barcode");
|
||||
if (widthPadding) {
|
||||
imageView.setPadding(imagePadding / 2, 0, imagePadding / 2, 0);
|
||||
} else {
|
||||
imageView.setPadding(0, imagePadding / 2, 0, imagePadding / 2);
|
||||
}
|
||||
imageView.setVisibility(View.VISIBLE);
|
||||
|
||||
if (isSuccesful) {
|
||||
@@ -282,7 +299,7 @@ public class BarcodeImageWriterTask implements CompatCallable<Bitmap> {
|
||||
}
|
||||
|
||||
if (callback != null) {
|
||||
callback.run();
|
||||
callback.onBarcodeImageWriterResult(isSuccesful);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ import java.util.ArrayList;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import protect.card_locker.databinding.BarcodeSelectorActivityBinding;
|
||||
|
||||
/**
|
||||
* This activity is callable and will allow a user to enter
|
||||
* barcode data and generate all barcodes possible for
|
||||
@@ -26,6 +28,7 @@ import androidx.appcompat.widget.Toolbar;
|
||||
* data and type will be returned to the caller.
|
||||
*/
|
||||
public class BarcodeSelectorActivity extends CatimaAppCompatActivity implements BarcodeSelectorAdapter.BarcodeSelectorListener {
|
||||
private BarcodeSelectorActivityBinding binding;
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
// Result this activity will return
|
||||
@@ -40,17 +43,15 @@ public class BarcodeSelectorActivity extends CatimaAppCompatActivity implements
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = BarcodeSelectorActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.selectBarcodeTitle);
|
||||
setContentView(R.layout.barcode_selector_activity);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setContentView(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
enableToolbarBackButton();
|
||||
|
||||
EditText cardId = findViewById(R.id.cardId);
|
||||
ListView mBarcodeList = findViewById(R.id.barcodes);
|
||||
EditText cardId = binding.cardId;
|
||||
ListView mBarcodeList = binding.barcodes;
|
||||
mAdapter = new BarcodeSelectorAdapter(this, new ArrayList<>(), this);
|
||||
mBarcodeList.setAdapter(mAdapter);
|
||||
|
||||
@@ -66,7 +67,7 @@ public class BarcodeSelectorActivity extends CatimaAppCompatActivity implements
|
||||
runOnUiThread(() -> {
|
||||
generateBarcodes(s.toString());
|
||||
|
||||
View noBarcodeButtonView = findViewById(R.id.noBarcode);
|
||||
View noBarcodeButtonView = binding.noBarcode;
|
||||
setButtonListener(noBarcodeButtonView, s.toString());
|
||||
noBarcodeButtonView.setEnabled(s.length() > 0);
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.widget.TextView;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import protect.card_locker.async.TaskHandler;
|
||||
import protect.card_locker.databinding.BarcodeLayoutBinding;
|
||||
|
||||
public class BarcodeSelectorAdapter extends ArrayAdapter<CatimaBarcodeWithValue> {
|
||||
private static final String TAG = "Catima";
|
||||
@@ -51,9 +52,10 @@ public class BarcodeSelectorAdapter extends ArrayAdapter<CatimaBarcodeWithValue>
|
||||
if (convertView == null) {
|
||||
viewHolder = new ViewHolder();
|
||||
LayoutInflater inflater = LayoutInflater.from(getContext());
|
||||
convertView = inflater.inflate(R.layout.barcode_layout, parent, false);
|
||||
viewHolder.image = convertView.findViewById(R.id.barcodeImage);
|
||||
viewHolder.text = convertView.findViewById(R.id.barcodeName);
|
||||
BarcodeLayoutBinding barcodeLayoutBinding = BarcodeLayoutBinding.inflate(inflater, parent, false);
|
||||
convertView = barcodeLayoutBinding.getRoot();
|
||||
viewHolder.image = barcodeLayoutBinding.barcodeImage;
|
||||
viewHolder.text = barcodeLayoutBinding.barcodeName;
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
|
||||
@@ -14,10 +14,13 @@ import androidx.core.content.pm.ShortcutManagerCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import protect.card_locker.databinding.SimpleToolbarListActivityBinding;
|
||||
|
||||
/**
|
||||
* The configuration screen for creating a shortcut.
|
||||
*/
|
||||
public class CardShortcutConfigure extends CatimaAppCompatActivity implements LoyaltyCardCursorAdapter.CardAdapterListener {
|
||||
private SimpleToolbarListActivityBinding binding;
|
||||
static final String TAG = "Catima";
|
||||
private SQLiteDatabase mDatabase;
|
||||
private LoyaltyCardCursorAdapter mAdapter;
|
||||
@@ -25,15 +28,15 @@ public class CardShortcutConfigure extends CatimaAppCompatActivity implements Lo
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
binding = SimpleToolbarListActivityBinding.inflate(getLayoutInflater());
|
||||
mDatabase = new DBHelper(this).getReadableDatabase();
|
||||
|
||||
// Set the result to CANCELED. This will cause nothing to happen if the
|
||||
// aback button is pressed.
|
||||
setResult(RESULT_CANCELED);
|
||||
|
||||
setContentView(R.layout.simple_toolbar_list_activity);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setContentView(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
toolbar.setTitle(R.string.shortcutSelectCard);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
@@ -50,7 +53,7 @@ public class CardShortcutConfigure extends CatimaAppCompatActivity implements Lo
|
||||
finish();
|
||||
}
|
||||
|
||||
final RecyclerView cardList = findViewById(R.id.list);
|
||||
final RecyclerView cardList = binding.list;
|
||||
GridLayoutManager layoutManager = (GridLayoutManager) cardList.getLayoutManager();
|
||||
if (layoutManager != null) {
|
||||
layoutManager.setSpanCount(getResources().getInteger(R.integer.main_view_card_columns));
|
||||
@@ -78,7 +81,7 @@ public class CardShortcutConfigure extends CatimaAppCompatActivity implements Lo
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu inputMenu) {
|
||||
getMenuInflater().inflate(R.menu.card_details_menu, inputMenu);
|
||||
Utils.updateMenuCardDetailsButtonState(inputMenu.findItem(R.id.action_unfold), mAdapter.showingDetails());
|
||||
|
||||
return super.onCreateOptionsMenu(inputMenu);
|
||||
}
|
||||
|
||||
@@ -86,8 +89,8 @@ public class CardShortcutConfigure extends CatimaAppCompatActivity implements Lo
|
||||
public boolean onOptionsItemSelected(MenuItem inputItem) {
|
||||
int id = inputItem.getItemId();
|
||||
|
||||
if (id == R.id.action_unfold) {
|
||||
mAdapter.showDetails(!mAdapter.showingDetails());
|
||||
if (id == R.id.action_shown_details) {
|
||||
mAdapter.showSelectDetailDisplayDialog();
|
||||
invalidateOptionsMenu();
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -69,10 +68,9 @@ public class CardsOnPowerScreenService extends ControlsProviderService {
|
||||
subscriber.onSubscribe(new NoOpSubscription());
|
||||
for (String controlId : controlIds) {
|
||||
Control control;
|
||||
|
||||
try {
|
||||
Integer cardId = this.controlIdToCardId(controlId);
|
||||
LoyaltyCard card = DBHelper.getLoyaltyCard(mDatabase, cardId);
|
||||
Integer cardId = this.controlIdToCardId(controlId);
|
||||
LoyaltyCard card = DBHelper.getLoyaltyCard(mDatabase, cardId);
|
||||
if (card != null) {
|
||||
Intent openIntent = new Intent(this, LoyaltyCardViewActivity.class)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.putExtra("id", card.id);
|
||||
@@ -85,7 +83,7 @@ public class CardsOnPowerScreenService extends ControlsProviderService {
|
||||
.setControlTemplate(new StatelessTemplate(controlId))
|
||||
.setCustomIcon(Icon.createWithBitmap(getIcon(this, card)))
|
||||
.build();
|
||||
} catch (NullPointerException ignored) {
|
||||
} else {
|
||||
Intent mainScreenIntent = new Intent(this, MainActivity.class)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(getBaseContext(), -1, mainScreenIntent, PendingIntent.FLAG_IMMUTABLE);
|
||||
@@ -137,7 +135,7 @@ public class CardsOnPowerScreenService extends ControlsProviderService {
|
||||
closePowerScreenOnAndroid11();
|
||||
}
|
||||
|
||||
@SuppressLint({"MissingPermission", "deprecation"})
|
||||
@SuppressWarnings({"MissingPermission", "deprecation"})
|
||||
private void closePowerScreenOnAndroid11() {
|
||||
// Android 12 will auto-close the power screen, but earlier versions won't
|
||||
// Lint complains about this but on Android 11 the permission is not needed
|
||||
|
||||
@@ -6,8 +6,11 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.view.WindowInsetsControllerCompat;
|
||||
|
||||
public class CatimaAppCompatActivity extends AppCompatActivity {
|
||||
@Override
|
||||
@@ -29,8 +32,10 @@ public class CatimaAppCompatActivity extends AppCompatActivity {
|
||||
// XXX changing this in onCreate causes issues with the splash screen activity, so doing this here
|
||||
boolean darkMode = Utils.isDarkModeEnabled(this);
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
View decorView = getWindow().getDecorView();
|
||||
WindowInsetsControllerCompat wic = new WindowInsetsControllerCompat(getWindow(), decorView);
|
||||
wic.setAppearanceLightStatusBars(!darkMode);
|
||||
getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||
getWindow().getDecorView().setSystemUiVisibility(darkMode ? 0 : View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
||||
} else {
|
||||
// icons are always white back then
|
||||
getWindow().setStatusBarColor(darkMode ? Color.TRANSPARENT : Color.argb(127, 0, 0, 0));
|
||||
@@ -38,4 +43,14 @@ public class CatimaAppCompatActivity extends AppCompatActivity {
|
||||
// XXX android 9 and below has a nasty rendering bug if the theme was patched earlier
|
||||
Utils.postPatchColors(this);
|
||||
}
|
||||
|
||||
protected void enableToolbarBackButton() {
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void onMockedRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@ public class CatimaBarcode {
|
||||
|
||||
public boolean isSquare() {
|
||||
return mBarcodeFormat == BarcodeFormat.AZTEC
|
||||
|| mBarcodeFormat == BarcodeFormat.DATA_MATRIX
|
||||
|| mBarcodeFormat == BarcodeFormat.MAXICODE
|
||||
|| mBarcodeFormat == BarcodeFormat.QR_CODE;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
public class DBHelper extends SQLiteOpenHelper {
|
||||
public static final String DATABASE_NAME = "Catima.db";
|
||||
public static final int ORIGINAL_DATABASE_VERSION = 1;
|
||||
public static final int DATABASE_VERSION = 15;
|
||||
public static final int DATABASE_VERSION = 16;
|
||||
|
||||
public static class LoyaltyCardDbGroups {
|
||||
public static final String TABLE = "groups";
|
||||
@@ -33,6 +33,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
public static final String TABLE = "cards";
|
||||
public static final String ID = "_id";
|
||||
public static final String STORE = "store";
|
||||
public static final String VALID_FROM = "validfrom";
|
||||
public static final String EXPIRY = "expiry";
|
||||
public static final String BALANCE = "balance";
|
||||
public static final String BALANCE_TYPE = "balancetype";
|
||||
@@ -95,6 +96,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
LoyaltyCardDbIds.ID + " INTEGER primary key autoincrement," +
|
||||
LoyaltyCardDbIds.STORE + " TEXT not null," +
|
||||
LoyaltyCardDbIds.NOTE + " TEXT not null," +
|
||||
LoyaltyCardDbIds.VALID_FROM + " INTEGER," +
|
||||
LoyaltyCardDbIds.EXPIRY + " INTEGER," +
|
||||
LoyaltyCardDbIds.BALANCE + " TEXT not null DEFAULT '0'," +
|
||||
LoyaltyCardDbIds.BALANCE_TYPE + " TEXT," +
|
||||
@@ -314,6 +316,11 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
db.execSQL("ALTER TABLE " + LoyaltyCardDbIds.TABLE
|
||||
+ " ADD COLUMN " + LoyaltyCardDbIds.ARCHIVE_STATUS + " INTEGER DEFAULT '0' ");
|
||||
}
|
||||
|
||||
if (oldVersion < 16 && newVersion >= 16) {
|
||||
db.execSQL("ALTER TABLE " + LoyaltyCardDbIds.TABLE
|
||||
+ " ADD COLUMN " + LoyaltyCardDbIds.VALID_FROM + " INTEGER");
|
||||
}
|
||||
}
|
||||
|
||||
private static ContentValues generateFTSContentValues(final int id, final String store, final String note) {
|
||||
@@ -358,8 +365,8 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
public static long insertLoyaltyCard(
|
||||
final SQLiteDatabase database, final String store, final String note, final Date expiry,
|
||||
final BigDecimal balance, final Currency balanceType, final String cardId,
|
||||
final SQLiteDatabase database, final String store, final String note, final Date validFrom,
|
||||
final Date expiry, final BigDecimal balance, final Currency balanceType, final String cardId,
|
||||
final String barcodeId, final CatimaBarcode barcodeType, final Integer headerColor,
|
||||
final int starStatus, final Long lastUsed, final int archiveStatus) {
|
||||
database.beginTransaction();
|
||||
@@ -368,6 +375,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(LoyaltyCardDbIds.STORE, store);
|
||||
contentValues.put(LoyaltyCardDbIds.NOTE, note);
|
||||
contentValues.put(LoyaltyCardDbIds.VALID_FROM, validFrom != null ? validFrom.getTime() : null);
|
||||
contentValues.put(LoyaltyCardDbIds.EXPIRY, expiry != null ? expiry.getTime() : null);
|
||||
contentValues.put(LoyaltyCardDbIds.BALANCE, balance.toString());
|
||||
contentValues.put(LoyaltyCardDbIds.BALANCE_TYPE, balanceType != null ? balanceType.getCurrencyCode() : null);
|
||||
@@ -391,9 +399,10 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
|
||||
public static long insertLoyaltyCard(
|
||||
final SQLiteDatabase database, final int id, final String store, final String note,
|
||||
final Date expiry, final BigDecimal balance, final Currency balanceType,
|
||||
final String cardId, final String barcodeId, final CatimaBarcode barcodeType,
|
||||
final Integer headerColor, final int starStatus, final Long lastUsed, final int archiveStatus) {
|
||||
final Date validFrom, final Date expiry, final BigDecimal balance,
|
||||
final Currency balanceType, final String cardId, final String barcodeId,
|
||||
final CatimaBarcode barcodeType, final Integer headerColor, final int starStatus,
|
||||
final Long lastUsed, final int archiveStatus) {
|
||||
database.beginTransaction();
|
||||
|
||||
// Card
|
||||
@@ -401,6 +410,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
contentValues.put(LoyaltyCardDbIds.ID, id);
|
||||
contentValues.put(LoyaltyCardDbIds.STORE, store);
|
||||
contentValues.put(LoyaltyCardDbIds.NOTE, note);
|
||||
contentValues.put(LoyaltyCardDbIds.VALID_FROM, validFrom != null ? validFrom.getTime() : null);
|
||||
contentValues.put(LoyaltyCardDbIds.EXPIRY, expiry != null ? expiry.getTime() : null);
|
||||
contentValues.put(LoyaltyCardDbIds.BALANCE, balance.toString());
|
||||
contentValues.put(LoyaltyCardDbIds.BALANCE_TYPE, balanceType != null ? balanceType.getCurrencyCode() : null);
|
||||
@@ -424,15 +434,17 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
|
||||
public static boolean updateLoyaltyCard(
|
||||
SQLiteDatabase database, final int id, final String store, final String note,
|
||||
final Date expiry, final BigDecimal balance, final Currency balanceType,
|
||||
final String cardId, final String barcodeId, final CatimaBarcode barcodeType,
|
||||
final Integer headerColor, final int starStatus, final Long lastUsed, final int archiveStatus) {
|
||||
final Date validFrom, final Date expiry, final BigDecimal balance,
|
||||
final Currency balanceType, final String cardId, final String barcodeId,
|
||||
final CatimaBarcode barcodeType, final Integer headerColor, final int starStatus,
|
||||
final Long lastUsed, final int archiveStatus) {
|
||||
database.beginTransaction();
|
||||
|
||||
// Card
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(LoyaltyCardDbIds.STORE, store);
|
||||
contentValues.put(LoyaltyCardDbIds.NOTE, note);
|
||||
contentValues.put(LoyaltyCardDbIds.VALID_FROM, validFrom != null ? validFrom.getTime() : null);
|
||||
contentValues.put(LoyaltyCardDbIds.EXPIRY, expiry != null ? expiry.getTime() : null);
|
||||
contentValues.put(LoyaltyCardDbIds.BALANCE, balance.toString());
|
||||
contentValues.put(LoyaltyCardDbIds.BALANCE_TYPE, balanceType != null ? balanceType.getCurrencyCode() : null);
|
||||
@@ -494,6 +506,15 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
return (rowsUpdated == 1);
|
||||
}
|
||||
|
||||
public static boolean updateLoyaltyCardBalance(SQLiteDatabase database, final int id, final BigDecimal newBalance) {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(LoyaltyCardDbIds.BALANCE, newBalance.toString());
|
||||
int rowsUpdated = database.update(LoyaltyCardDbIds.TABLE, contentValues,
|
||||
whereAttrs(LoyaltyCardDbIds.ID),
|
||||
withArgs(id));
|
||||
return (rowsUpdated == 1);
|
||||
}
|
||||
|
||||
public static LoyaltyCard getLoyaltyCard(SQLiteDatabase database, final int id) {
|
||||
Cursor data = database.query(LoyaltyCardDbIds.TABLE, null, whereAttrs(LoyaltyCardDbIds.ID), withArgs(id), null, null, null);
|
||||
|
||||
|
||||
@@ -7,15 +7,17 @@ import android.database.sqlite.SQLiteDatabase;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageButton;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import protect.card_locker.databinding.GroupLayoutBinding;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
|
||||
public class GroupCursorAdapter extends BaseCursorAdapter<GroupCursorAdapter.GroupListItemViewHolder> {
|
||||
Settings mSettings;
|
||||
public final Context mContext;
|
||||
private final GroupAdapterListener mListener;
|
||||
SQLiteDatabase mDatabase;
|
||||
@@ -23,7 +25,6 @@ public class GroupCursorAdapter extends BaseCursorAdapter<GroupCursorAdapter.Gro
|
||||
public GroupCursorAdapter(Context inputContext, Cursor inputCursor, GroupAdapterListener inputListener) {
|
||||
super(inputCursor, DBHelper.LoyaltyCardDbGroups.ORDER);
|
||||
setHasStableIds(true);
|
||||
mSettings = new Settings(inputContext);
|
||||
mContext = inputContext;
|
||||
mListener = inputListener;
|
||||
mDatabase = new DBHelper(inputContext).getReadableDatabase();
|
||||
@@ -33,9 +34,14 @@ public class GroupCursorAdapter extends BaseCursorAdapter<GroupCursorAdapter.Gro
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public GroupCursorAdapter.GroupListItemViewHolder onCreateViewHolder(ViewGroup inputParent, int inputViewType) {
|
||||
View itemView = LayoutInflater.from(inputParent.getContext()).inflate(R.layout.group_layout, inputParent, false);
|
||||
return new GroupListItemViewHolder(itemView);
|
||||
public GroupCursorAdapter.GroupListItemViewHolder onCreateViewHolder(@NonNull ViewGroup inputParent, int inputViewType) {
|
||||
return new GroupListItemViewHolder(
|
||||
GroupLayoutBinding.inflate(
|
||||
LayoutInflater.from(inputParent.getContext()),
|
||||
inputParent,
|
||||
false
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public void onBindViewHolder(GroupListItemViewHolder inputHolder, Cursor inputCursor) {
|
||||
@@ -56,8 +62,6 @@ public class GroupCursorAdapter extends BaseCursorAdapter<GroupCursorAdapter.Gro
|
||||
}
|
||||
|
||||
inputHolder.mCardCount.setText(cardCountText);
|
||||
inputHolder.mName.setTextSize(mSettings.getFontSizeMax(mSettings.getMediumFont()));
|
||||
inputHolder.mCardCount.setTextSize(mSettings.getFontSizeMax(mSettings.getSmallFont()));
|
||||
|
||||
applyClickEvents(inputHolder);
|
||||
}
|
||||
@@ -81,16 +85,16 @@ public class GroupCursorAdapter extends BaseCursorAdapter<GroupCursorAdapter.Gro
|
||||
|
||||
public static class GroupListItemViewHolder extends RecyclerView.ViewHolder {
|
||||
public TextView mName, mCardCount;
|
||||
public AppCompatImageButton mMoveUp, mMoveDown, mEdit, mDelete;
|
||||
public Button mMoveUp, mMoveDown, mEdit, mDelete;
|
||||
|
||||
public GroupListItemViewHolder(View inputView) {
|
||||
super(inputView);
|
||||
mName = inputView.findViewById(R.id.name);
|
||||
mCardCount = inputView.findViewById(R.id.cardCount);
|
||||
mMoveUp = inputView.findViewById(R.id.moveUp);
|
||||
mMoveDown = inputView.findViewById(R.id.moveDown);
|
||||
mEdit = inputView.findViewById(R.id.edit);
|
||||
mDelete = inputView.findViewById(R.id.delete);
|
||||
public GroupListItemViewHolder(GroupLayoutBinding groupLayoutBinding) {
|
||||
super(groupLayoutBinding.getRoot());
|
||||
mName = groupLayoutBinding.name;
|
||||
mCardCount = groupLayoutBinding.cardCount;
|
||||
mMoveUp = groupLayoutBinding.moveUp;
|
||||
mMoveDown = groupLayoutBinding.moveDown;
|
||||
mEdit = groupLayoutBinding.edit;
|
||||
mDelete = groupLayoutBinding.delete;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,21 +24,25 @@ import java.util.List;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import protect.card_locker.async.TaskHandler;
|
||||
import protect.card_locker.databinding.ImportExportActivityBinding;
|
||||
import protect.card_locker.importexport.DataFormat;
|
||||
import protect.card_locker.importexport.ImportExportResult;
|
||||
import protect.card_locker.importexport.ImportExportResultType;
|
||||
|
||||
public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
private ImportExportActivityBinding binding;
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
private static final int PERMISSIONS_EXTERNAL_STORAGE = 1;
|
||||
|
||||
private ImportExportTask importExporter;
|
||||
|
||||
private String importAlertTitle;
|
||||
@@ -55,26 +59,16 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ImportExportActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.importExport);
|
||||
setContentView(R.layout.import_export_activity);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setContentView(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
enableToolbarBackButton();
|
||||
|
||||
// If the application does not have permissions to external
|
||||
// storage, ask for it now
|
||||
|
||||
if (ContextCompat.checkSelfPermission(ImportExportActivity.this,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED ||
|
||||
ContextCompat.checkSelfPermission(ImportExportActivity.this,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(ImportExportActivity.this,
|
||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||
PERMISSIONS_EXTERNAL_STORAGE);
|
||||
Intent fileIntent = getIntent();
|
||||
if (fileIntent != null && fileIntent.getType() != null) {
|
||||
chooseImportType(false, fileIntent.getData());
|
||||
}
|
||||
|
||||
// would use ActivityResultContracts.CreateDocument() but mime type cannot be set
|
||||
@@ -126,9 +120,9 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
intentCreateDocumentAction.setType("application/zip");
|
||||
intentCreateDocumentAction.putExtra(Intent.EXTRA_TITLE, "catima.zip");
|
||||
|
||||
Button exportButton = findViewById(R.id.exportButton);
|
||||
Button exportButton = binding.exportButton;
|
||||
exportButton.setOnClickListener(v -> {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(ImportExportActivity.this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(ImportExportActivity.this);
|
||||
builder.setTitle(R.string.exportPassword);
|
||||
|
||||
FrameLayout container = new FrameLayout(ImportExportActivity.this);
|
||||
@@ -158,12 +152,12 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
});
|
||||
|
||||
// Check that there is a file manager available
|
||||
Button importFilesystem = findViewById(R.id.importOptionFilesystemButton);
|
||||
importFilesystem.setOnClickListener(v -> chooseImportType(false));
|
||||
Button importFilesystem = binding.importOptionFilesystemButton;
|
||||
importFilesystem.setOnClickListener(v -> chooseImportType(false, null));
|
||||
|
||||
// Check that there is an app that data can be imported from
|
||||
Button importApplication = findViewById(R.id.importOptionApplicationButton);
|
||||
importApplication.setOnClickListener(v -> chooseImportType(true));
|
||||
Button importApplication = binding.importOptionApplicationButton;
|
||||
importApplication.setOnClickListener(v -> chooseImportType(true, null));
|
||||
}
|
||||
|
||||
private void openFileForImport(Uri uri, char[] password) {
|
||||
@@ -177,7 +171,9 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void chooseImportType(boolean choosePicker) {
|
||||
private void chooseImportType(boolean choosePicker,
|
||||
@Nullable Uri fileData) {
|
||||
|
||||
List<CharSequence> betaImportOptions = new ArrayList<>();
|
||||
betaImportOptions.add("Fidme");
|
||||
betaImportOptions.add("Stocard");
|
||||
@@ -191,7 +187,7 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
importOptions.add(importOption);
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setTitle(R.string.chooseImportType)
|
||||
.setItems(importOptions.toArray(new CharSequence[importOptions.size()]), (dialog, which) -> {
|
||||
switch (which) {
|
||||
@@ -229,7 +225,12 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
throw new IllegalArgumentException("Unknown DataFormat");
|
||||
}
|
||||
|
||||
new AlertDialog.Builder(this)
|
||||
if (fileData != null) {
|
||||
openFileForImport(fileData, null);
|
||||
return;
|
||||
}
|
||||
|
||||
new MaterialAlertDialogBuilder(this)
|
||||
.setTitle(importAlertTitle)
|
||||
.setMessage(importAlertMessage)
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@@ -296,30 +297,6 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
mTasks.executeTask(TaskHandler.TYPE.EXPORT, importExporter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
if (requestCode == PERMISSIONS_EXTERNAL_STORAGE) {
|
||||
// If request is cancelled, the result arrays are empty.
|
||||
boolean success = grantResults.length > 0;
|
||||
|
||||
for (int grant : grantResults) {
|
||||
if (grant != PackageManager.PERMISSION_GRANTED) {
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
// External storage permission rejected, inform user that
|
||||
// import/export is prevented
|
||||
Toast.makeText(getApplicationContext(), R.string.noExternalStoragePermissionError,
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
mTasks.flushTaskList(TaskHandler.TYPE.IMPORT, true, false, false);
|
||||
@@ -340,7 +317,7 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
|
||||
private void retryWithPassword(DataFormat dataFormat, Uri uri) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setTitle(R.string.passwordRequired);
|
||||
|
||||
final EditText input = new EditText(this);
|
||||
@@ -383,7 +360,7 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setTitle(resultType == ImportExportResultType.Success ? R.string.importSuccessfulTitle : R.string.importFailedTitle);
|
||||
builder.setMessage(buildResultDialogMessage(result, true));
|
||||
builder.setNeutralButton(R.string.ok, (dialog, which) -> dialog.dismiss());
|
||||
@@ -394,7 +371,7 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
private void onExportComplete(ImportExportResult result, final Uri path) {
|
||||
ImportExportResultType resultType = result.resultType();
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setTitle(resultType == ImportExportResultType.Success ? R.string.exportSuccessfulTitle : R.string.exportFailedTitle);
|
||||
builder.setMessage(buildResultDialogMessage(result, false));
|
||||
builder.setNeutralButton(R.string.ok, (dialog, which) -> dialog.dismiss());
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.List;
|
||||
public class ImportURIHelper {
|
||||
private static final String STORE = DBHelper.LoyaltyCardDbIds.STORE;
|
||||
private static final String NOTE = DBHelper.LoyaltyCardDbIds.NOTE;
|
||||
private static final String VALID_FROM = DBHelper.LoyaltyCardDbIds.VALID_FROM;
|
||||
private static final String EXPIRY = DBHelper.LoyaltyCardDbIds.EXPIRY;
|
||||
private static final String BALANCE = DBHelper.LoyaltyCardDbIds.BALANCE;
|
||||
private static final String BALANCE_TYPE = DBHelper.LoyaltyCardDbIds.BALANCE_TYPE;
|
||||
@@ -45,8 +46,11 @@ public class ImportURIHelper {
|
||||
}
|
||||
|
||||
private boolean isImportUri(Uri uri) {
|
||||
// Remove trailing slash added by some browsers (if it exists)
|
||||
final String uriPath = uri.getPath().replaceAll("/$", "");
|
||||
|
||||
for (int i = 0; i < hosts.length; i++) {
|
||||
if (uri.getHost().equals(hosts[i]) && uri.getPath().equals(paths[i])) {
|
||||
if (uri.getHost().equals(hosts[i]) && uriPath.equals(paths[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -62,6 +66,7 @@ public class ImportURIHelper {
|
||||
try {
|
||||
// These values are allowed to be null
|
||||
CatimaBarcode barcodeType = null;
|
||||
Date validFrom = null;
|
||||
Date expiry = null;
|
||||
BigDecimal balance = new BigDecimal("0");
|
||||
Currency balanceType = null;
|
||||
@@ -106,6 +111,10 @@ public class ImportURIHelper {
|
||||
if (unparsedBalanceType != null && !unparsedBalanceType.equals("")) {
|
||||
balanceType = Currency.getInstance(unparsedBalanceType);
|
||||
}
|
||||
String unparsedValidFrom = kv.get(VALID_FROM);
|
||||
if (unparsedValidFrom != null && !unparsedValidFrom.equals("")) {
|
||||
validFrom = new Date(Long.parseLong(unparsedValidFrom));
|
||||
}
|
||||
String unparsedExpiry = kv.get(EXPIRY);
|
||||
if (unparsedExpiry != null && !unparsedExpiry.equals("")) {
|
||||
expiry = new Date(Long.parseLong(unparsedExpiry));
|
||||
@@ -116,8 +125,8 @@ public class ImportURIHelper {
|
||||
headerColor = Integer.parseInt(unparsedHeaderColor);
|
||||
}
|
||||
|
||||
return new LoyaltyCard(-1, store, note, expiry, balance, balanceType, cardId, barcodeId, barcodeType, headerColor, 0, Utils.getUnixTime(), 100,0);
|
||||
} catch (NullPointerException | NumberFormatException | UnsupportedEncodingException ex) {
|
||||
return new LoyaltyCard(-1, store, note, validFrom, expiry, balance, balanceType, cardId, barcodeId, barcodeType, headerColor, 0, Utils.getUnixTime(), 100, 0);
|
||||
} catch (NumberFormatException | UnsupportedEncodingException | ArrayIndexOutOfBoundsException ex) {
|
||||
throw new InvalidObjectException("Not a valid import URI");
|
||||
}
|
||||
}
|
||||
@@ -149,6 +158,9 @@ public class ImportURIHelper {
|
||||
if (loyaltyCard.balanceType != null) {
|
||||
fragment = appendFragment(fragment, BALANCE_TYPE, loyaltyCard.balanceType.getCurrencyCode());
|
||||
}
|
||||
if (loyaltyCard.validFrom != null) {
|
||||
fragment = appendFragment(fragment, VALID_FROM, String.valueOf(loyaltyCard.validFrom.getTime()));
|
||||
}
|
||||
if (loyaltyCard.expiry != null) {
|
||||
fragment = appendFragment(fragment, EXPIRY, String.valueOf(loyaltyCard.expiry.getTime()));
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ public class LoyaltyCard implements Parcelable {
|
||||
public final int id;
|
||||
public final String store;
|
||||
public final String note;
|
||||
public final Date validFrom;
|
||||
public final Date expiry;
|
||||
public final BigDecimal balance;
|
||||
public final Currency balanceType;
|
||||
@@ -33,14 +34,16 @@ public class LoyaltyCard implements Parcelable {
|
||||
public final long lastUsed;
|
||||
public int zoomLevel;
|
||||
|
||||
public LoyaltyCard(final int id, final String store, final String note, final Date expiry,
|
||||
final BigDecimal balance, final Currency balanceType, final String cardId,
|
||||
@Nullable final String barcodeId, @Nullable final CatimaBarcode barcodeType,
|
||||
public LoyaltyCard(final int id, final String store, final String note, final Date validFrom,
|
||||
final Date expiry, final BigDecimal balance, final Currency balanceType,
|
||||
final String cardId, @Nullable final String barcodeId,
|
||||
@Nullable final CatimaBarcode barcodeType,
|
||||
@Nullable final Integer headerColor, final int starStatus,
|
||||
final long lastUsed, final int zoomLevel, final int archiveStatus) {
|
||||
this.id = id;
|
||||
this.store = store;
|
||||
this.note = note;
|
||||
this.validFrom = validFrom;
|
||||
this.expiry = expiry;
|
||||
this.balance = balance;
|
||||
this.balanceType = balanceType;
|
||||
@@ -58,6 +61,8 @@ public class LoyaltyCard implements Parcelable {
|
||||
id = in.readInt();
|
||||
store = in.readString();
|
||||
note = in.readString();
|
||||
long tmpValidFrom = in.readLong();
|
||||
validFrom = tmpValidFrom != -1 ? new Date(tmpValidFrom) : null;
|
||||
long tmpExpiry = in.readLong();
|
||||
expiry = tmpExpiry != -1 ? new Date(tmpExpiry) : null;
|
||||
balance = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||
@@ -79,6 +84,7 @@ public class LoyaltyCard implements Parcelable {
|
||||
parcel.writeInt(id);
|
||||
parcel.writeString(store);
|
||||
parcel.writeString(note);
|
||||
parcel.writeLong(validFrom != null ? validFrom.getTime() : -1);
|
||||
parcel.writeLong(expiry != null ? expiry.getTime() : -1);
|
||||
parcel.writeValue(balance);
|
||||
parcel.writeValue(balanceType);
|
||||
@@ -96,6 +102,7 @@ public class LoyaltyCard implements Parcelable {
|
||||
int id = cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.ID));
|
||||
String store = cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.STORE));
|
||||
String note = cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.NOTE));
|
||||
long validFromLong = cursor.getLong(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.VALID_FROM));
|
||||
long expiryLong = cursor.getLong(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.EXPIRY));
|
||||
BigDecimal balance = new BigDecimal(cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.BALANCE)));
|
||||
String cardId = cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.CARD_ID));
|
||||
@@ -111,6 +118,7 @@ public class LoyaltyCard implements Parcelable {
|
||||
|
||||
CatimaBarcode barcodeType = null;
|
||||
Currency balanceType = null;
|
||||
Date validFrom = null;
|
||||
Date expiry = null;
|
||||
Integer headerColor = null;
|
||||
|
||||
@@ -122,6 +130,10 @@ public class LoyaltyCard implements Parcelable {
|
||||
balanceType = Currency.getInstance(cursor.getString(balanceTypeColumn));
|
||||
}
|
||||
|
||||
if (validFromLong > 0) {
|
||||
validFrom = new Date(validFromLong);
|
||||
}
|
||||
|
||||
if (expiryLong > 0) {
|
||||
expiry = new Date(expiryLong);
|
||||
}
|
||||
@@ -130,7 +142,7 @@ public class LoyaltyCard implements Parcelable {
|
||||
headerColor = cursor.getInt(headerColorColumn);
|
||||
}
|
||||
|
||||
return new LoyaltyCard(id, store, note, expiry, balance, balanceType, cardId, barcodeId, barcodeType, headerColor, starred, lastUsed, zoomLevel,archived);
|
||||
return new LoyaltyCard(id, store, note, validFrom, expiry, balance, balanceType, cardId, barcodeId, barcodeType, headerColor, starred, lastUsed, zoomLevel, archived);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,34 +17,39 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.card.MaterialCardView;
|
||||
import com.google.android.material.color.MaterialColors;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Currency;
|
||||
import java.util.Date;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.BlendModeColorFilterCompat;
|
||||
import androidx.core.graphics.BlendModeCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
|
||||
import protect.card_locker.databinding.LoyaltyCardLayoutBinding;
|
||||
|
||||
public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCursorAdapter.LoyaltyCardListItemViewHolder> {
|
||||
private int mCurrentSelectedIndex = -1;
|
||||
Settings mSettings;
|
||||
boolean mDarkModeEnabled;
|
||||
public final Context mContext;
|
||||
private final CardAdapterListener mListener;
|
||||
protected SparseBooleanArray mSelectedItems;
|
||||
protected SparseBooleanArray mAnimationItemsIndex;
|
||||
private boolean mReverseAllAnimations = false;
|
||||
private boolean mShowDetails;
|
||||
private boolean mShowNameBelowThumbnail;
|
||||
private boolean mShowNote;
|
||||
private boolean mShowBalance;
|
||||
private boolean mShowValidity;
|
||||
|
||||
public LoyaltyCardCursorAdapter(Context inputContext, Cursor inputCursor, CardAdapterListener inputListener) {
|
||||
super(inputCursor, DBHelper.LoyaltyCardDbIds.ID);
|
||||
setHasStableIds(true);
|
||||
mSettings = new Settings(inputContext);
|
||||
mContext = inputContext;
|
||||
mListener = inputListener;
|
||||
mSelectedItems = new SparseBooleanArray();
|
||||
@@ -57,35 +62,111 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
swapCursor(inputCursor);
|
||||
}
|
||||
|
||||
private void saveDetailState(int stateId, boolean value) {
|
||||
SharedPreferences cardDetailsPref = mContext.getSharedPreferences(
|
||||
mContext.getString(R.string.sharedpreference_card_details),
|
||||
Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor cardDetailsPrefEditor = cardDetailsPref.edit();
|
||||
cardDetailsPrefEditor.putBoolean(mContext.getString(stateId), value);
|
||||
cardDetailsPrefEditor.apply();
|
||||
}
|
||||
|
||||
public void refreshState() {
|
||||
// Retrieve user details preference
|
||||
SharedPreferences cardDetailsPref = mContext.getSharedPreferences(
|
||||
mContext.getString(R.string.sharedpreference_card_details),
|
||||
Context.MODE_PRIVATE);
|
||||
mShowDetails = cardDetailsPref.getBoolean(mContext.getString(R.string.sharedpreference_card_details_show), true);
|
||||
mShowNameBelowThumbnail = cardDetailsPref.getBoolean(mContext.getString(R.string.sharedpreference_card_details_show_name_below_thumbnail), false);
|
||||
mShowNote = cardDetailsPref.getBoolean(mContext.getString(R.string.sharedpreference_card_details_show_note), true);
|
||||
mShowBalance = cardDetailsPref.getBoolean(mContext.getString(R.string.sharedpreference_card_details_show_balance), true);
|
||||
mShowValidity = cardDetailsPref.getBoolean(mContext.getString(R.string.sharedpreference_card_details_show_validity), true);
|
||||
}
|
||||
|
||||
public void showDetails(boolean show) {
|
||||
mShowDetails = show;
|
||||
public void showNameBelowThumbnail(boolean show) {
|
||||
mShowNameBelowThumbnail = show;
|
||||
notifyDataSetChanged();
|
||||
|
||||
// Store in Shared Preference to restore next adapter launch
|
||||
SharedPreferences cardDetailsPref = mContext.getSharedPreferences(
|
||||
mContext.getString(R.string.sharedpreference_card_details),
|
||||
Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor cardDetailsPrefEditor = cardDetailsPref.edit();
|
||||
cardDetailsPrefEditor.putBoolean(mContext.getString(R.string.sharedpreference_card_details_show), show);
|
||||
cardDetailsPrefEditor.apply();
|
||||
saveDetailState(R.string.sharedpreference_card_details_show_name_below_thumbnail, show);
|
||||
}
|
||||
|
||||
public boolean showingDetails() {
|
||||
return mShowDetails;
|
||||
public boolean showingNameBelowThumbnail() {
|
||||
return mShowNameBelowThumbnail;
|
||||
}
|
||||
|
||||
public void showNote(boolean show) {
|
||||
mShowNote = show;
|
||||
notifyDataSetChanged();
|
||||
|
||||
saveDetailState(R.string.sharedpreference_card_details_show_note, show);
|
||||
}
|
||||
|
||||
public boolean showingNote() {
|
||||
return mShowNote;
|
||||
}
|
||||
|
||||
public void showBalance(boolean show) {
|
||||
mShowBalance = show;
|
||||
notifyDataSetChanged();
|
||||
|
||||
saveDetailState(R.string.sharedpreference_card_details_show_balance, show);
|
||||
}
|
||||
|
||||
public boolean showingBalance() {
|
||||
return mShowBalance;
|
||||
}
|
||||
|
||||
public void showValidity(boolean show) {
|
||||
mShowValidity = show;
|
||||
notifyDataSetChanged();
|
||||
|
||||
saveDetailState(R.string.sharedpreference_card_details_show_validity, show);
|
||||
}
|
||||
|
||||
public boolean showingValidity() {
|
||||
return mShowValidity;
|
||||
}
|
||||
|
||||
public void showSelectDetailDisplayDialog() {
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(mContext);
|
||||
builder.setTitle(R.string.action_show_details);
|
||||
builder.setMultiChoiceItems(
|
||||
new String[]{
|
||||
mContext.getString(R.string.show_name_below_image_thumbnail),
|
||||
mContext.getString(R.string.show_note),
|
||||
mContext.getString(R.string.show_balance),
|
||||
mContext.getString(R.string.show_validity)
|
||||
},
|
||||
new boolean[]{
|
||||
showingNameBelowThumbnail(),
|
||||
showingNote(),
|
||||
showingBalance(),
|
||||
showingValidity()
|
||||
},
|
||||
(dialogInterface, i, b) -> {
|
||||
switch (i) {
|
||||
case 0: showNameBelowThumbnail(b); break;
|
||||
case 1: showNote(b); break;
|
||||
case 2: showBalance(b); break;
|
||||
case 3: showValidity(b); break;
|
||||
default: throw new IndexOutOfBoundsException("No such index exists in LoyaltyCardCursorAdapter show details view");
|
||||
}
|
||||
}
|
||||
);
|
||||
builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss());
|
||||
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public LoyaltyCardListItemViewHolder onCreateViewHolder(ViewGroup inputParent, int inputViewType) {
|
||||
View itemView = LayoutInflater.from(inputParent.getContext()).inflate(R.layout.loyalty_card_layout, inputParent, false);
|
||||
return new LoyaltyCardListItemViewHolder(itemView, mListener);
|
||||
public LoyaltyCardListItemViewHolder onCreateViewHolder(@NonNull ViewGroup inputParent, int inputViewType) {
|
||||
LoyaltyCardLayoutBinding loyaltyCardLayoutBinding = LoyaltyCardLayoutBinding.inflate(
|
||||
LayoutInflater.from(inputParent.getContext()),
|
||||
inputParent,
|
||||
false
|
||||
);
|
||||
return new LoyaltyCardListItemViewHolder(loyaltyCardLayoutBinding, mListener);
|
||||
}
|
||||
|
||||
public LoyaltyCard getCard(int position) {
|
||||
@@ -98,36 +179,41 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
inputHolder.mDivider.setVisibility(View.GONE);
|
||||
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.toLoyaltyCard(inputCursor);
|
||||
Bitmap icon = Utils.retrieveCardImage(mContext, loyaltyCard.id, ImageLocationType.icon);
|
||||
|
||||
inputHolder.setStoreField(loyaltyCard.store);
|
||||
if (mShowDetails && !loyaltyCard.note.isEmpty()) {
|
||||
if (mShowNameBelowThumbnail && icon != null) {
|
||||
inputHolder.setStoreField(loyaltyCard.store);
|
||||
} else {
|
||||
inputHolder.setStoreField(null);
|
||||
}
|
||||
|
||||
if (mShowNote && !loyaltyCard.note.isEmpty()) {
|
||||
inputHolder.setNoteField(loyaltyCard.note);
|
||||
} else {
|
||||
inputHolder.setNoteField(null);
|
||||
}
|
||||
|
||||
if (mShowDetails && !loyaltyCard.balance.equals(new BigDecimal("0"))) {
|
||||
inputHolder.setBalanceField(loyaltyCard.balance, loyaltyCard.balanceType);
|
||||
if (mShowBalance && !loyaltyCard.balance.equals(new BigDecimal("0"))) {
|
||||
inputHolder.setExtraField(inputHolder.mBalanceField, Utils.formatBalance(mContext, loyaltyCard.balance, loyaltyCard.balanceType), null);
|
||||
} else {
|
||||
inputHolder.setBalanceField(null, null);
|
||||
inputHolder.setExtraField(inputHolder.mBalanceField, null, null);
|
||||
}
|
||||
|
||||
if (mShowDetails && loyaltyCard.expiry != null) {
|
||||
inputHolder.setExpiryField(loyaltyCard.expiry);
|
||||
if (mShowValidity && loyaltyCard.validFrom != null) {
|
||||
inputHolder.setExtraField(inputHolder.mValidFromField, DateFormat.getDateInstance(DateFormat.LONG).format(loyaltyCard.validFrom), Utils.isNotYetValid(loyaltyCard.validFrom) ? Color.RED : null);
|
||||
} else {
|
||||
inputHolder.setExpiryField(null);
|
||||
inputHolder.setExtraField(inputHolder.mValidFromField, null, null);
|
||||
}
|
||||
|
||||
setHeaderHeight(inputHolder, mShowDetails);
|
||||
Bitmap cardIcon = Utils.retrieveCardImage(mContext, loyaltyCard.id, ImageLocationType.icon);
|
||||
if (cardIcon != null) {
|
||||
inputHolder.mCardIcon.setImageBitmap(cardIcon);
|
||||
inputHolder.mCardIcon.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
if (mShowValidity && loyaltyCard.expiry != null) {
|
||||
inputHolder.setExtraField(inputHolder.mExpiryField, DateFormat.getDateInstance(DateFormat.LONG).format(loyaltyCard.expiry), Utils.hasExpired(loyaltyCard.expiry) ? Color.RED : null);
|
||||
} else {
|
||||
inputHolder.mCardIcon.setImageBitmap(Utils.generateIcon(mContext, loyaltyCard.store, loyaltyCard.headerColor).getLetterTile());
|
||||
inputHolder.mCardIcon.setScaleType(ImageView.ScaleType.FIT_CENTER);
|
||||
inputHolder.setExtraField(inputHolder.mExpiryField, null, null);
|
||||
}
|
||||
inputHolder.setIconBackgroundColor(loyaltyCard.headerColor != null ? loyaltyCard.headerColor : R.attr.colorPrimary);
|
||||
|
||||
inputHolder.mCardIcon.setContentDescription(loyaltyCard.store);
|
||||
Utils.setIconOrTextWithBackground(mContext, loyaltyCard, icon, inputHolder.mCardIcon, inputHolder.mCardText);
|
||||
inputHolder.setIconBackgroundColor(Utils.getHeaderColor(mContext, loyaltyCard));
|
||||
|
||||
inputHolder.toggleCardStateIcon(loyaltyCard.starStatus != 0, loyaltyCard.archiveStatus != 0, itemSelected(inputCursor.getPosition()));
|
||||
|
||||
@@ -139,19 +225,6 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
inputHolder.mRow.requestLayout();
|
||||
}
|
||||
|
||||
private void setHeaderHeight(LoyaltyCardListItemViewHolder inputHolder, boolean expanded) {
|
||||
int iconHeight;
|
||||
if (expanded) {
|
||||
iconHeight = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
} else {
|
||||
iconHeight = (int) mContext.getResources().getDimension(R.dimen.cardThumbnailSize);
|
||||
}
|
||||
|
||||
inputHolder.mIconLayout.getLayoutParams().height = expanded ? 0 : iconHeight;
|
||||
inputHolder.mCardIcon.getLayoutParams().height = iconHeight;
|
||||
inputHolder.mTickIcon.getLayoutParams().height = iconHeight;
|
||||
}
|
||||
|
||||
private void applyClickEvents(LoyaltyCardListItemViewHolder inputHolder, final int inputPosition) {
|
||||
inputHolder.mRow.setOnClickListener(inputView -> mListener.onRowClicked(inputPosition));
|
||||
|
||||
@@ -227,32 +300,32 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
|
||||
public class LoyaltyCardListItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public TextView mStoreField, mNoteField, mBalanceField, mExpiryField;
|
||||
public TextView mCardText, mStoreField, mNoteField, mBalanceField, mValidFromField, mExpiryField;
|
||||
public ImageView mCardIcon, mStarBackground, mStarBorder, mTickIcon, mArchivedBackground;
|
||||
public MaterialCardView mRow, mIconLayout;
|
||||
public MaterialCardView mRow;
|
||||
public ConstraintLayout mStar, mArchived;
|
||||
public View mDivider;
|
||||
|
||||
private int mIconBackgroundColor;
|
||||
|
||||
|
||||
|
||||
protected LoyaltyCardListItemViewHolder(View inputView, CardAdapterListener inputListener) {
|
||||
super(inputView);
|
||||
mRow = inputView.findViewById(R.id.row);
|
||||
mDivider = inputView.findViewById(R.id.info_divider);
|
||||
mStoreField = inputView.findViewById(R.id.store);
|
||||
mNoteField = inputView.findViewById(R.id.note);
|
||||
mBalanceField = inputView.findViewById(R.id.balance);
|
||||
mExpiryField = inputView.findViewById(R.id.expiry);
|
||||
mIconLayout = inputView.findViewById(R.id.icon_layout);
|
||||
mCardIcon = inputView.findViewById(R.id.thumbnail);
|
||||
mStar = inputView.findViewById(R.id.star);
|
||||
mStarBackground = inputView.findViewById(R.id.star_background);
|
||||
mStarBorder = inputView.findViewById(R.id.star_border);
|
||||
mArchived = inputView.findViewById(R.id.archivedIcon);
|
||||
mArchivedBackground = inputView.findViewById(R.id.archive_background);
|
||||
mTickIcon = inputView.findViewById(R.id.selected_thumbnail);
|
||||
protected LoyaltyCardListItemViewHolder(LoyaltyCardLayoutBinding loyaltyCardLayoutBinding, CardAdapterListener inputListener) {
|
||||
super(loyaltyCardLayoutBinding.getRoot());
|
||||
View inputView = loyaltyCardLayoutBinding.getRoot();
|
||||
mRow = loyaltyCardLayoutBinding.row;
|
||||
mDivider = loyaltyCardLayoutBinding.infoDivider;
|
||||
mStoreField = loyaltyCardLayoutBinding.store;
|
||||
mNoteField = loyaltyCardLayoutBinding.note;
|
||||
mBalanceField = loyaltyCardLayoutBinding.balance;
|
||||
mValidFromField = loyaltyCardLayoutBinding.validFrom;
|
||||
mExpiryField = loyaltyCardLayoutBinding.expiry;
|
||||
mCardIcon = loyaltyCardLayoutBinding.thumbnail;
|
||||
mCardText = loyaltyCardLayoutBinding.thumbnailText;
|
||||
mStar = loyaltyCardLayoutBinding.star;
|
||||
mStarBackground = loyaltyCardLayoutBinding.starBackground;
|
||||
mStarBorder = loyaltyCardLayoutBinding.starBorder;
|
||||
mArchived = loyaltyCardLayoutBinding.archivedIcon;
|
||||
mArchivedBackground = loyaltyCardLayoutBinding.archiveBackground;
|
||||
mTickIcon = loyaltyCardLayoutBinding.selectedThumbnail;
|
||||
inputView.setOnLongClickListener(view -> {
|
||||
inputListener.onRowClicked(getAdapterPosition());
|
||||
inputView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
|
||||
@@ -260,9 +333,43 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
});
|
||||
}
|
||||
|
||||
private void setExtraField(TextView field, String text, Integer color) {
|
||||
// If text is null, hide the field
|
||||
// If iconColor is null, use the default text and icon color based on theme
|
||||
if (text == null) {
|
||||
field.setVisibility(View.GONE);
|
||||
field.requestLayout();
|
||||
return;
|
||||
}
|
||||
|
||||
field.setVisibility(View.VISIBLE);
|
||||
field.setText(text);
|
||||
field.setTextColor(color != null ? color : MaterialColors.getColor(mContext, com.google.android.material.R.attr.colorSecondary, ContextCompat.getColor(mContext, mDarkModeEnabled ? R.color.md_theme_dark_secondary : R.color.md_theme_light_secondary)));
|
||||
|
||||
mDivider.setVisibility(View.VISIBLE);
|
||||
field.setVisibility(View.VISIBLE);
|
||||
Drawable icon = field.getCompoundDrawables()[0];
|
||||
if (icon != null) {
|
||||
icon.mutate();
|
||||
field.setCompoundDrawablesRelative(icon, null, null, null);
|
||||
|
||||
if (color != null) {
|
||||
icon.setColorFilter(BlendModeColorFilterCompat.createBlendModeColorFilterCompat(color, BlendModeCompat.SRC_ATOP));
|
||||
} else {
|
||||
icon.setColorFilter(BlendModeColorFilterCompat.createBlendModeColorFilterCompat(mDarkModeEnabled ? Color.WHITE : Color.BLACK, BlendModeCompat.SRC_ATOP));
|
||||
}
|
||||
}
|
||||
|
||||
field.requestLayout();
|
||||
}
|
||||
|
||||
public void setStoreField(String text) {
|
||||
mStoreField.setText(text);
|
||||
mStoreField.setTextSize(mSettings.getFontSizeMax(mSettings.getMediumFont()));
|
||||
if (text == null) {
|
||||
mStoreField.setVisibility(View.GONE);
|
||||
} else {
|
||||
mStoreField.setVisibility(View.VISIBLE);
|
||||
mStoreField.setText(text);
|
||||
}
|
||||
mStoreField.requestLayout();
|
||||
}
|
||||
|
||||
@@ -272,60 +379,10 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
} else {
|
||||
mNoteField.setVisibility(View.VISIBLE);
|
||||
mNoteField.setText(text);
|
||||
mNoteField.setTextSize(mSettings.getFontSizeMax(mSettings.getSmallFont()));
|
||||
}
|
||||
mNoteField.requestLayout();
|
||||
}
|
||||
|
||||
public void setBalanceField(BigDecimal balance, Currency balanceType) {
|
||||
if (balance == null) {
|
||||
mBalanceField.setVisibility(View.GONE);
|
||||
} else {
|
||||
int size = mSettings.getFontSizeMax(mSettings.getSmallFont());
|
||||
int drawableSize = dpToPx((size * 24) / 14, mContext);
|
||||
mDivider.setVisibility(View.VISIBLE);
|
||||
mBalanceField.setVisibility(View.VISIBLE);
|
||||
Drawable balanceIcon = mBalanceField.getCompoundDrawables()[0];
|
||||
if (balanceIcon != null) {
|
||||
balanceIcon.setBounds(0, 0, drawableSize, drawableSize);
|
||||
mBalanceField.setCompoundDrawablesRelative(balanceIcon, null, null, null);
|
||||
if (mDarkModeEnabled) {
|
||||
balanceIcon.setColorFilter(BlendModeColorFilterCompat.createBlendModeColorFilterCompat(Color.WHITE, BlendModeCompat.SRC_ATOP));
|
||||
}
|
||||
}
|
||||
mBalanceField.setText(Utils.formatBalance(mContext, balance, balanceType));
|
||||
mBalanceField.setTextSize(size);
|
||||
}
|
||||
mBalanceField.requestLayout();
|
||||
}
|
||||
|
||||
public void setExpiryField(Date expiry) {
|
||||
if (expiry == null) {
|
||||
mExpiryField.setVisibility(View.GONE);
|
||||
} else {
|
||||
int size = mSettings.getFontSizeMax(mSettings.getSmallFont());
|
||||
int drawableSize = dpToPx((size * 24) / 14, mContext);
|
||||
mDivider.setVisibility(View.VISIBLE);
|
||||
mExpiryField.setVisibility(View.VISIBLE);
|
||||
Drawable expiryIcon = mExpiryField.getCompoundDrawables()[0];
|
||||
if (expiryIcon != null) {
|
||||
expiryIcon.setBounds(0, 0, drawableSize, drawableSize);
|
||||
mExpiryField.setCompoundDrawablesRelative(expiryIcon, null, null, null);
|
||||
if (Utils.hasExpired(expiry)) {
|
||||
expiryIcon.setColorFilter(BlendModeColorFilterCompat.createBlendModeColorFilterCompat(Color.RED, BlendModeCompat.SRC_ATOP));
|
||||
} else if (mDarkModeEnabled) {
|
||||
expiryIcon.setColorFilter(BlendModeColorFilterCompat.createBlendModeColorFilterCompat(Color.WHITE, BlendModeCompat.SRC_ATOP));
|
||||
}
|
||||
}
|
||||
mExpiryField.setText(DateFormat.getDateInstance(DateFormat.LONG).format(expiry));
|
||||
if (Utils.hasExpired(expiry)) {
|
||||
mExpiryField.setTextColor(Color.RED);
|
||||
}
|
||||
mExpiryField.setTextSize(size);
|
||||
}
|
||||
mExpiryField.requestLayout();
|
||||
}
|
||||
|
||||
public void toggleCardStateIcon(boolean enableStar, boolean enableArchive, boolean colorByTheme) {
|
||||
/* the below code does not work in android 5! hence the change of drawable instead
|
||||
boolean needDarkForeground = Utils.needsDarkForeground(mIconBackgroundColor);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.DatePickerDialog;
|
||||
@@ -20,9 +19,11 @@ import android.os.LocaleList;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ArrayAdapter;
|
||||
@@ -30,6 +31,7 @@ import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
@@ -37,6 +39,7 @@ import android.widget.Toast;
|
||||
import com.google.android.material.chip.Chip;
|
||||
import com.google.android.material.chip.ChipGroup;
|
||||
import com.google.android.material.color.MaterialColors;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
@@ -57,6 +60,7 @@ import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Currency;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -68,7 +72,8 @@ import java.util.concurrent.Callable;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
@@ -77,8 +82,11 @@ import androidx.core.content.FileProvider;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import protect.card_locker.async.TaskHandler;
|
||||
import protect.card_locker.databinding.LayoutChipChoiceBinding;
|
||||
import protect.card_locker.databinding.LoyaltyCardEditActivityBinding;
|
||||
|
||||
public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
public class LoyaltyCardEditActivity extends CatimaAppCompatActivity implements BarcodeImageWriterResultCallback {
|
||||
private LoyaltyCardEditActivityBinding binding;
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
private final String STATE_TAB_INDEX = "savedTab";
|
||||
@@ -92,6 +100,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
private final String STATE_FRONT_IMAGE_REMOVED = "frontImageRemoved";
|
||||
private final String STATE_BACK_IMAGE_REMOVED = "backImageRemoved";
|
||||
private final String STATE_ICON_REMOVED = "iconRemoved";
|
||||
private final String STATE_OPEN_SET_ICON_MENU = "openSetIconMenu";
|
||||
|
||||
private final String TEMP_CAMERA_IMAGE_NAME = LoyaltyCardEditActivity.class.getSimpleName() + "_camera_image.jpg";
|
||||
private final String TEMP_CROP_IMAGE_NAME = LoyaltyCardEditActivity.class.getSimpleName() + "_crop_image.png";
|
||||
@@ -105,10 +114,14 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
private static final int PERMISSION_REQUEST_CAMERA_IMAGE_FRONT = 100;
|
||||
private static final int PERMISSION_REQUEST_CAMERA_IMAGE_BACK = 101;
|
||||
private static final int PERMISSION_REQUEST_CAMERA_IMAGE_ICON = 102;
|
||||
private static final int PERMISSION_REQUEST_STORAGE_IMAGE_FRONT = 103;
|
||||
private static final int PERMISSION_REQUEST_STORAGE_IMAGE_BACK = 104;
|
||||
private static final int PERMISSION_REQUEST_STORAGE_IMAGE_ICON = 105;
|
||||
|
||||
public static final String BUNDLE_ID = "id";
|
||||
public static final String BUNDLE_DUPLICATE_ID = "duplicateId";
|
||||
public static final String BUNDLE_UPDATE = "update";
|
||||
public static final String BUNDLE_OPEN_SET_ICON_MENU = "openSetIconMenu";
|
||||
public static final String BUNDLE_CARDID = "cardId";
|
||||
public static final String BUNDLE_BARCODEID = "barcodeId";
|
||||
public static final String BUNDLE_BARCODETYPE = "barcodeType";
|
||||
@@ -121,6 +134,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
EditText storeFieldEdit;
|
||||
EditText noteFieldEdit;
|
||||
ChipGroup groupsChips;
|
||||
AutoCompleteTextView validFromField;
|
||||
AutoCompleteTextView expiryField;
|
||||
EditText balanceField;
|
||||
AutoCompleteTextView balanceCurrencyField;
|
||||
@@ -142,6 +156,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
int loyaltyCardId;
|
||||
boolean updateLoyaltyCard;
|
||||
boolean duplicateFromLoyaltyCardId;
|
||||
boolean openSetIconMenu;
|
||||
String cardId;
|
||||
String barcodeId;
|
||||
String barcodeType;
|
||||
@@ -159,9 +174,8 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
AlertDialog confirmExitDialog = null;
|
||||
|
||||
boolean validBalance = true;
|
||||
Runnable barcodeImageGenerationFinishedCallback;
|
||||
|
||||
HashMap<String, Currency> currencies = new HashMap<>();
|
||||
HashMap<String, String> currencySymbols = new HashMap<>();
|
||||
|
||||
LoyaltyCard tempLoyaltyCard;
|
||||
|
||||
@@ -199,6 +213,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
(int) (fieldName == LoyaltyCardField.id ? value : loyaltyCard.id),
|
||||
(String) (fieldName == LoyaltyCardField.store ? value : loyaltyCard.store),
|
||||
(String) (fieldName == LoyaltyCardField.note ? value : loyaltyCard.note),
|
||||
(Date) (fieldName == LoyaltyCardField.validFrom ? value : loyaltyCard.validFrom),
|
||||
(Date) (fieldName == LoyaltyCardField.expiry ? value : loyaltyCard.expiry),
|
||||
(BigDecimal) (fieldName == LoyaltyCardField.balance ? value : loyaltyCard.balance),
|
||||
(Currency) (fieldName == LoyaltyCardField.balanceType ? value : loyaltyCard.balanceType),
|
||||
@@ -229,6 +244,8 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
updateLoyaltyCard = b != null && b.getBoolean(BUNDLE_UPDATE, false);
|
||||
duplicateFromLoyaltyCardId = b != null && b.getBoolean(BUNDLE_DUPLICATE_ID, false);
|
||||
|
||||
openSetIconMenu = b != null && b.getBoolean(BUNDLE_OPEN_SET_ICON_MENU, false);
|
||||
|
||||
cardId = b != null ? b.getString(BUNDLE_CARDID) : null;
|
||||
barcodeId = b != null ? b.getString(BUNDLE_BARCODEID) : null;
|
||||
barcodeType = b != null ? b.getString(BUNDLE_BARCODETYPE) : null;
|
||||
@@ -244,7 +261,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle savedInstanceState) {
|
||||
super.onSaveInstanceState(savedInstanceState);
|
||||
tabs = findViewById(R.id.tabs);
|
||||
tabs = binding.tabs;
|
||||
savedInstanceState.putInt(STATE_TAB_INDEX, tabs.getSelectedTabPosition());
|
||||
savedInstanceState.putParcelable(STATE_TEMP_CARD, tempLoyaltyCard);
|
||||
savedInstanceState.putInt(STATE_REQUESTED_IMAGE, mRequestedImage);
|
||||
@@ -275,13 +292,14 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
savedInstanceState.putInt(STATE_FRONT_IMAGE_REMOVED, mFrontImageRemoved ? 1 : 0);
|
||||
savedInstanceState.putInt(STATE_BACK_IMAGE_REMOVED, mBackImageRemoved ? 1 : 0);
|
||||
savedInstanceState.putInt(STATE_ICON_REMOVED, mIconRemoved ? 1 : 0);
|
||||
savedInstanceState.putInt(STATE_OPEN_SET_ICON_MENU, openSetIconMenu ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
|
||||
tempLoyaltyCard = savedInstanceState.getParcelable(STATE_TEMP_CARD);
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
tabs = findViewById(R.id.tabs);
|
||||
tabs = binding.tabs;
|
||||
tabs.selectTab(tabs.getTabAt(savedInstanceState.getInt(STATE_TAB_INDEX)));
|
||||
mRequestedImage = savedInstanceState.getInt(STATE_REQUESTED_IMAGE);
|
||||
mFrontImageUnsaved = savedInstanceState.getInt(STATE_FRONT_IMAGE_UNSAVED) == 1;
|
||||
@@ -292,19 +310,17 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
mFrontImageRemoved = savedInstanceState.getInt(STATE_FRONT_IMAGE_REMOVED) == 1;
|
||||
mBackImageRemoved = savedInstanceState.getInt(STATE_BACK_IMAGE_REMOVED) == 1;
|
||||
mIconRemoved = savedInstanceState.getInt(STATE_ICON_REMOVED) == 1;
|
||||
openSetIconMenu = savedInstanceState.getInt(STATE_OPEN_SET_ICON_MENU) == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.loyalty_card_edit_activity);
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
binding = LoyaltyCardEditActivityBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
enableToolbarBackButton();
|
||||
|
||||
mDatabase = new DBHelper(this).getWritableDatabase();
|
||||
|
||||
@@ -314,37 +330,32 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
|
||||
for (Currency currency : Currency.getAvailableCurrencies()) {
|
||||
currencies.put(currency.getSymbol(), currency);
|
||||
currencySymbols.put(currency.getCurrencyCode(), currency.getSymbol());
|
||||
}
|
||||
|
||||
tabs = findViewById(R.id.tabs);
|
||||
thumbnail = findViewById(R.id.thumbnail);
|
||||
thumbnailEditIcon = findViewById(R.id.thumbnailEditIcon);
|
||||
storeFieldEdit = findViewById(R.id.storeNameEdit);
|
||||
noteFieldEdit = findViewById(R.id.noteEdit);
|
||||
groupsChips = findViewById(R.id.groupChips);
|
||||
expiryField = findViewById(R.id.expiryField);
|
||||
balanceField = findViewById(R.id.balanceField);
|
||||
balanceCurrencyField = findViewById(R.id.balanceCurrencyField);
|
||||
cardIdFieldView = findViewById(R.id.cardIdView);
|
||||
barcodeIdField = findViewById(R.id.barcodeIdField);
|
||||
barcodeTypeField = findViewById(R.id.barcodeTypeField);
|
||||
barcodeImage = findViewById(R.id.barcode);
|
||||
tabs = binding.tabs;
|
||||
thumbnail = binding.thumbnail;
|
||||
thumbnailEditIcon = binding.thumbnailEditIcon;
|
||||
storeFieldEdit = binding.storeNameEdit;
|
||||
noteFieldEdit = binding.noteEdit;
|
||||
groupsChips = binding.groupChips;
|
||||
validFromField = binding.validFromField;
|
||||
expiryField = binding.expiryField;
|
||||
balanceField = binding.balanceField;
|
||||
balanceCurrencyField = binding.balanceCurrencyField;
|
||||
cardIdFieldView = binding.cardIdView;
|
||||
barcodeIdField = binding.barcodeIdField;
|
||||
barcodeTypeField = binding.barcodeTypeField;
|
||||
barcodeImage = binding.barcode;
|
||||
barcodeImage.setClipToOutline(true);
|
||||
barcodeImageLayout = findViewById(R.id.barcodeLayout);
|
||||
barcodeCaptureLayout = findViewById(R.id.barcodeCaptureLayout);
|
||||
cardImageFrontHolder = findViewById(R.id.frontImageHolder);
|
||||
cardImageBackHolder = findViewById(R.id.backImageHolder);
|
||||
cardImageFront = findViewById(R.id.frontImage);
|
||||
cardImageBack = findViewById(R.id.backImage);
|
||||
barcodeImageLayout = binding.barcodeLayout;
|
||||
barcodeCaptureLayout = binding.barcodeCaptureLayout;
|
||||
cardImageFrontHolder = binding.frontImageHolder;
|
||||
cardImageBackHolder = binding.backImageHolder;
|
||||
cardImageFront = binding.frontImage;
|
||||
cardImageBack = binding.backImage;
|
||||
|
||||
enterButton = findViewById(R.id.enterButton);
|
||||
|
||||
barcodeImageGenerationFinishedCallback = () -> {
|
||||
if (!(boolean) barcodeImage.getTag()) {
|
||||
barcodeImageLayout.setVisibility(View.GONE);
|
||||
Toast.makeText(LoyaltyCardEditActivity.this, getString(R.string.wrongValueForBarcodeType), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
};
|
||||
enterButton = binding.enterButton;
|
||||
|
||||
storeFieldEdit.addTextChangedListener(new SimpleTextWatcher() {
|
||||
@Override
|
||||
@@ -361,38 +372,9 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
expiryField.addTextChangedListener(new SimpleTextWatcher() {
|
||||
CharSequence lastValue;
|
||||
addDateFieldTextChangedListener(validFromField, R.string.anyDate, R.string.chooseValidFromDate, LoyaltyCardField.validFrom);
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
lastValue = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (s.toString().equals(getString(R.string.never))) {
|
||||
expiryField.setTag(null);
|
||||
} else if (s.toString().equals(getString(R.string.chooseExpiryDate))) {
|
||||
if (!lastValue.toString().equals(getString(R.string.chooseExpiryDate))) {
|
||||
expiryField.setText(lastValue);
|
||||
}
|
||||
DialogFragment datePickerFragment = new DatePickerFragment(LoyaltyCardEditActivity.this, expiryField);
|
||||
datePickerFragment.show(getSupportFragmentManager(), "datePicker");
|
||||
}
|
||||
|
||||
updateTempState(LoyaltyCardField.expiry, expiryField.getTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
ArrayList<String> expiryList = new ArrayList<>();
|
||||
expiryList.add(0, getString(R.string.never));
|
||||
expiryList.add(1, getString(R.string.chooseExpiryDate));
|
||||
ArrayAdapter<String> expiryAdapter = new ArrayAdapter<>(LoyaltyCardEditActivity.this, android.R.layout.select_dialog_item, expiryList);
|
||||
expiryField.setAdapter(expiryAdapter);
|
||||
}
|
||||
});
|
||||
addDateFieldTextChangedListener(expiryField, R.string.never, R.string.chooseExpiryDate, LoyaltyCardField.expiry);
|
||||
|
||||
balanceField.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (!hasFocus) {
|
||||
@@ -509,14 +491,24 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
barcodeIdField.setText(lastValue);
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(LoyaltyCardEditActivity.this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(LoyaltyCardEditActivity.this);
|
||||
builder.setTitle(R.string.setBarcodeId);
|
||||
final EditText input = new EditText(LoyaltyCardEditActivity.this);
|
||||
input.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
|
||||
FrameLayout container = new FrameLayout(LoyaltyCardEditActivity.this);
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
int contentPadding = getResources().getDimensionPixelSize(R.dimen.alert_dialog_content_padding);
|
||||
params.leftMargin = contentPadding;
|
||||
params.topMargin = contentPadding / 2;
|
||||
params.rightMargin = contentPadding;
|
||||
|
||||
input.setLayoutParams(params);
|
||||
container.addView(input);
|
||||
if (tempLoyaltyCard.barcodeId != null) {
|
||||
input.setText(tempLoyaltyCard.barcodeId);
|
||||
}
|
||||
builder.setView(input);
|
||||
builder.setView(container);
|
||||
|
||||
builder.setPositiveButton(getString(R.string.ok), (dialog, which) -> {
|
||||
// If the user manually changes the barcode again make sure we disable the
|
||||
@@ -690,16 +682,16 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
mCropperOptions.setAspectRatioOptions(selectedByDefault,
|
||||
new AspectRatio(null, 1, 1),
|
||||
new AspectRatio(getResources().getString(R.string.ucrop_label_original).toUpperCase(), sourceWidth, sourceHeight),
|
||||
new AspectRatio(getResources().getString(com.yalantis.ucrop.R.string.ucrop_label_original).toUpperCase(), sourceWidth, sourceHeight),
|
||||
new AspectRatio(getResources().getString(R.string.card).toUpperCase(), 85.6f, 53.98f)
|
||||
);
|
||||
|
||||
// Fix theming
|
||||
|
||||
int colorPrimary = MaterialColors.getColor(this, R.attr.colorPrimary, ContextCompat.getColor(this, R.color.md_theme_light_primary));
|
||||
int colorOnPrimary = MaterialColors.getColor(this, R.attr.colorOnPrimary, ContextCompat.getColor(this, R.color.md_theme_light_onPrimary));
|
||||
int colorSurface = MaterialColors.getColor(this, R.attr.colorSurface, ContextCompat.getColor(this, R.color.md_theme_light_surface));
|
||||
int colorOnSurface = MaterialColors.getColor(this, R.attr.colorOnSurface, ContextCompat.getColor(this, R.color.md_theme_light_onSurface));
|
||||
int colorPrimary = MaterialColors.getColor(this, androidx.appcompat.R.attr.colorPrimary, ContextCompat.getColor(this, R.color.md_theme_light_primary));
|
||||
int colorOnPrimary = MaterialColors.getColor(this, com.google.android.material.R.attr.colorOnPrimary, ContextCompat.getColor(this, R.color.md_theme_light_onPrimary));
|
||||
int colorSurface = MaterialColors.getColor(this, com.google.android.material.R.attr.colorSurface, ContextCompat.getColor(this, R.color.md_theme_light_surface));
|
||||
int colorOnSurface = MaterialColors.getColor(this, com.google.android.material.R.attr.colorOnSurface, ContextCompat.getColor(this, R.color.md_theme_light_onSurface));
|
||||
int colorBackground = MaterialColors.getColor(this, android.R.attr.colorBackground, ContextCompat.getColor(this, R.color.md_theme_light_onSurface));
|
||||
mCropperOptions.setToolbarColor(colorSurface);
|
||||
mCropperOptions.setStatusBarColor(colorSurface);
|
||||
@@ -773,7 +765,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
} else {
|
||||
// New card, use default values
|
||||
tempLoyaltyCard = new LoyaltyCard(-1, "", "", null, new BigDecimal("0"), null, "", null, null, null, 0, Utils.getUnixTime(), 100,0);
|
||||
tempLoyaltyCard = new LoyaltyCard(-1, "", "", null, null, new BigDecimal("0"), null, "", null, null, null, 0, Utils.getUnixTime(), 100,0);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -816,7 +808,8 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
|
||||
storeFieldEdit.setText(tempLoyaltyCard.store);
|
||||
noteFieldEdit.setText(tempLoyaltyCard.note);
|
||||
formatExpiryField(this, expiryField, tempLoyaltyCard.expiry);
|
||||
formatDateField(this, validFromField, tempLoyaltyCard.validFrom);
|
||||
formatDateField(this, expiryField, tempLoyaltyCard.expiry);
|
||||
formatBalanceCurrencyField(tempLoyaltyCard.balanceType);
|
||||
cardIdFieldView.setText(tempLoyaltyCard.cardId);
|
||||
barcodeIdField.setText(tempLoyaltyCard.barcodeId != null ? tempLoyaltyCard.barcodeId : getString(R.string.sameAsCardId));
|
||||
@@ -834,7 +827,9 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
|
||||
for (Group group : DBHelper.getGroups(mDatabase)) {
|
||||
Chip chip = (Chip) getLayoutInflater().inflate(R.layout.layout_chip_choice, groupsChips, false);
|
||||
LayoutChipChoiceBinding chipChoiceBinding = LayoutChipChoiceBinding
|
||||
.inflate(LayoutInflater.from(groupsChips.getContext()), groupsChips, false);
|
||||
Chip chip = chipChoiceBinding.getRoot();
|
||||
chip.setText(group._id);
|
||||
chip.setTag(group);
|
||||
|
||||
@@ -860,10 +855,9 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
// Generate random header color
|
||||
if (tempLoyaltyCard.headerColor == null) {
|
||||
// Select a random color to start out with.
|
||||
updateTempState(LoyaltyCardField.headerColor, Utils.getRandomHeaderColor(this));
|
||||
// If name is set, pick colour relevant for name. Otherwise pick randomly
|
||||
updateTempState(LoyaltyCardField.headerColor, tempLoyaltyCard.store.isEmpty() ? Utils.getRandomHeaderColor(this) : Utils.getHeaderColor(this, tempLoyaltyCard));
|
||||
}
|
||||
|
||||
// Update from intent
|
||||
@@ -906,7 +900,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
cardImageFrontHolder.setOnClickListener(new ChooseCardImage());
|
||||
cardImageBackHolder.setOnClickListener(new ChooseCardImage());
|
||||
|
||||
FloatingActionButton saveButton = findViewById(R.id.fabSave);
|
||||
FloatingActionButton saveButton = binding.fabSave;
|
||||
saveButton.setOnClickListener(v -> doSave());
|
||||
saveButton.bringToFront();
|
||||
|
||||
@@ -923,12 +917,19 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
|
||||
onResuming = false;
|
||||
|
||||
// Fake click on the edit icon to cause the set icon option to pop up if the icon was
|
||||
// long-pressed in the view activity
|
||||
if (openSetIconMenu) {
|
||||
openSetIconMenu = false;
|
||||
thumbnail.callOnClick();
|
||||
}
|
||||
}
|
||||
|
||||
protected void setColorFromIcon() {
|
||||
Object icon = thumbnail.getTag();
|
||||
if (icon != null && (icon instanceof Bitmap)) {
|
||||
int headerColor = Utils.getHeaderColorFromImage((Bitmap) icon, tempLoyaltyCard.headerColor != null ? tempLoyaltyCard.headerColor : R.attr.colorPrimary);
|
||||
int headerColor = Utils.getHeaderColorFromImage((Bitmap) icon, Utils.getHeaderColor(this, tempLoyaltyCard));
|
||||
|
||||
updateTempState(LoyaltyCardField.headerColor, headerColor);
|
||||
|
||||
@@ -949,13 +950,62 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
protected static void formatExpiryField(Context context, EditText expiryField, Date expiry) {
|
||||
expiryField.setTag(expiry);
|
||||
protected void addDateFieldTextChangedListener(AutoCompleteTextView dateField, @StringRes int defaultOptionStringId, @StringRes int chooseDateOptionStringId, LoyaltyCardField loyaltyCardField) {
|
||||
dateField.addTextChangedListener(new SimpleTextWatcher() {
|
||||
CharSequence lastValue;
|
||||
|
||||
if (expiry == null) {
|
||||
expiryField.setText(context.getString(R.string.never));
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
lastValue = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (s.toString().equals(getString(defaultOptionStringId))) {
|
||||
dateField.setTag(null);
|
||||
} else if (s.toString().equals(getString(chooseDateOptionStringId))) {
|
||||
if (!lastValue.toString().equals(getString(chooseDateOptionStringId))) {
|
||||
dateField.setText(lastValue);
|
||||
}
|
||||
DialogFragment datePickerFragment = new DatePickerFragment(
|
||||
LoyaltyCardEditActivity.this,
|
||||
dateField,
|
||||
// if the expiry date is being set, set date picker's minDate to the 'valid from' date
|
||||
loyaltyCardField == LoyaltyCardField.expiry ? (Date) validFromField.getTag() : null,
|
||||
// if the 'valid from' date is being set, set date picker's maxDate to the expiry date
|
||||
loyaltyCardField == LoyaltyCardField.validFrom ? (Date) expiryField.getTag() : null);
|
||||
datePickerFragment.show(getSupportFragmentManager(), "datePicker");
|
||||
}
|
||||
|
||||
updateTempState(loyaltyCardField, dateField.getTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
ArrayList<String> dropdownOptions = new ArrayList<>();
|
||||
dropdownOptions.add(0, getString(defaultOptionStringId));
|
||||
dropdownOptions.add(1, getString(chooseDateOptionStringId));
|
||||
ArrayAdapter<String> dropdownOptionsAdapter = new ArrayAdapter<>(LoyaltyCardEditActivity.this, android.R.layout.select_dialog_item, dropdownOptions);
|
||||
dateField.setAdapter(dropdownOptionsAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected static void formatDateField(Context context, EditText textField, Date date) {
|
||||
textField.setTag(date);
|
||||
|
||||
if (date == null) {
|
||||
String text;
|
||||
if (textField.getId() == R.id.validFromField) {
|
||||
text = context.getString(R.string.anyDate);
|
||||
} else if (textField.getId() == R.id.expiryField) {
|
||||
text = context.getString(R.string.never);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown textField Id " + textField.getId());
|
||||
}
|
||||
textField.setText(text);
|
||||
} else {
|
||||
expiryField.setText(DateFormat.getDateInstance(DateFormat.LONG).format(expiry));
|
||||
textField.setText(DateFormat.getDateInstance(DateFormat.LONG).format(date));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -963,7 +1013,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
if (balanceType == null) {
|
||||
balanceCurrencyField.setText(getString(R.string.points));
|
||||
} else {
|
||||
balanceCurrencyField.setText(balanceType.getSymbol());
|
||||
balanceCurrencyField.setText(getCurrencySymbol(balanceType));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -976,14 +1026,59 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
if (requestCode == PERMISSION_REQUEST_CAMERA_IMAGE_FRONT) {
|
||||
onMockedRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
public void onMockedRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
boolean granted = grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED;
|
||||
Integer failureReason = null;
|
||||
|
||||
if (requestCode == PERMISSION_REQUEST_CAMERA_IMAGE_FRONT) {
|
||||
if (granted) {
|
||||
takePhotoForCard(Utils.CARD_IMAGE_FROM_CAMERA_FRONT);
|
||||
} else if (requestCode == PERMISSION_REQUEST_CAMERA_IMAGE_BACK) {
|
||||
takePhotoForCard(Utils.CARD_IMAGE_FROM_CAMERA_BACK);
|
||||
} else if (requestCode == PERMISSION_REQUEST_CAMERA_IMAGE_ICON) {
|
||||
takePhotoForCard(Utils.CARD_IMAGE_FROM_CAMERA_ICON);
|
||||
return;
|
||||
}
|
||||
|
||||
failureReason = R.string.cameraPermissionRequired;
|
||||
} else if (requestCode == PERMISSION_REQUEST_CAMERA_IMAGE_BACK) {
|
||||
if (granted) {
|
||||
takePhotoForCard(Utils.CARD_IMAGE_FROM_CAMERA_BACK);
|
||||
return;
|
||||
}
|
||||
|
||||
failureReason = R.string.cameraPermissionRequired;
|
||||
} else if (requestCode == PERMISSION_REQUEST_CAMERA_IMAGE_ICON) {
|
||||
if (granted) {
|
||||
takePhotoForCard(Utils.CARD_IMAGE_FROM_CAMERA_ICON);
|
||||
return;
|
||||
}
|
||||
|
||||
failureReason = R.string.cameraPermissionRequired;
|
||||
} else if (requestCode == PERMISSION_REQUEST_STORAGE_IMAGE_FRONT) {
|
||||
if (granted) {
|
||||
selectImageFromGallery(Utils.CARD_IMAGE_FROM_FILE_FRONT);
|
||||
return;
|
||||
}
|
||||
|
||||
failureReason = R.string.storageReadPermissionRequired;
|
||||
} else if (requestCode == PERMISSION_REQUEST_STORAGE_IMAGE_BACK) {
|
||||
if (granted) {
|
||||
selectImageFromGallery(Utils.CARD_IMAGE_FROM_FILE_BACK);
|
||||
return;
|
||||
}
|
||||
|
||||
failureReason = R.string.storageReadPermissionRequired;
|
||||
} else if (requestCode == PERMISSION_REQUEST_STORAGE_IMAGE_ICON) {
|
||||
if (granted) {
|
||||
selectImageFromGallery(Utils.CARD_IMAGE_FROM_FILE_ICON);
|
||||
return;
|
||||
}
|
||||
|
||||
failureReason = R.string.storageReadPermissionRequired;
|
||||
}
|
||||
|
||||
if (failureReason != null) {
|
||||
Toast.makeText(this, failureReason, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1000,7 +1095,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
new AlertDialog.Builder(this)
|
||||
new MaterialAlertDialogBuilder(this)
|
||||
.setTitle(R.string.updateBarcodeQuestionTitle)
|
||||
.setMessage(R.string.updateBarcodeQuestionText)
|
||||
.setPositiveButton(R.string.yes, (dialog, which) -> {
|
||||
@@ -1034,7 +1129,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
|
||||
if (confirmExitDialog == null) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setTitle(R.string.leaveWithoutSaveTitle);
|
||||
builder.setMessage(R.string.leaveWithoutSaveConfirmation);
|
||||
builder.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
||||
@@ -1052,7 +1147,38 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
Uri photoURI = FileProvider.getUriForFile(LoyaltyCardEditActivity.this, BuildConfig.APPLICATION_ID, Utils.createTempFile(this, TEMP_CAMERA_IMAGE_NAME));
|
||||
mRequestedImage = type;
|
||||
|
||||
mPhotoTakerLauncher.launch(photoURI);
|
||||
try {
|
||||
mPhotoTakerLauncher.launch(photoURI);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(getApplicationContext(), R.string.cameraPermissionDeniedTitle, Toast.LENGTH_LONG).show();
|
||||
Log.e(TAG, "No activity found to handle intent", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void selectImageFromGallery(int type) {
|
||||
mRequestedImage = type;
|
||||
|
||||
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
|
||||
photoPickerIntent.setType("image/*");
|
||||
Intent contentIntent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
contentIntent.setType("image/*");
|
||||
Intent chooserIntent = Intent.createChooser(photoPickerIntent, getString(R.string.addFromImage));
|
||||
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { contentIntent });
|
||||
|
||||
try {
|
||||
mPhotoPickerLauncher.launch(chooserIntent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(getApplicationContext(), R.string.failedLaunchingPhotoPicker, Toast.LENGTH_LONG).show();
|
||||
Log.e(TAG, "No activity found to handle intent", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBarcodeImageWriterResult(boolean success) {
|
||||
if (!success) {
|
||||
barcodeImageLayout.setVisibility(View.GONE);
|
||||
Toast.makeText(LoyaltyCardEditActivity.this, getString(R.string.wrongValueForBarcodeType), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
class EditCardIdAndBarcode implements View.OnClickListener {
|
||||
@@ -1136,59 +1262,38 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
|
||||
cardOptions.put(getString(R.string.takePhoto), () -> {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
int permissionRequestType;
|
||||
int permissionRequestType;
|
||||
|
||||
if (v.getId() == R.id.frontImageHolder) {
|
||||
permissionRequestType = PERMISSION_REQUEST_CAMERA_IMAGE_FRONT;
|
||||
} else if (v.getId() == R.id.backImageHolder) {
|
||||
permissionRequestType = PERMISSION_REQUEST_CAMERA_IMAGE_BACK;
|
||||
} else if (v.getId() == R.id.thumbnail) {
|
||||
permissionRequestType = PERMISSION_REQUEST_CAMERA_IMAGE_ICON;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown ID type " + v.getId());
|
||||
}
|
||||
|
||||
requestPermissions(new String[]{Manifest.permission.CAMERA}, permissionRequestType);
|
||||
} else {
|
||||
int cardImageType;
|
||||
|
||||
if (v.getId() == R.id.frontImageHolder) {
|
||||
cardImageType = Utils.CARD_IMAGE_FROM_CAMERA_FRONT;
|
||||
} else if (v.getId() == R.id.backImageHolder) {
|
||||
cardImageType = Utils.CARD_IMAGE_FROM_CAMERA_BACK;
|
||||
} else if (v.getId() == R.id.thumbnail) {
|
||||
cardImageType = Utils.CARD_IMAGE_FROM_CAMERA_ICON;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown ID type " + v.getId());
|
||||
}
|
||||
|
||||
takePhotoForCard(cardImageType);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
cardOptions.put(getString(R.string.addFromImage), () -> {
|
||||
if (v.getId() == R.id.frontImageHolder) {
|
||||
mRequestedImage = Utils.CARD_IMAGE_FROM_FILE_FRONT;
|
||||
permissionRequestType = PERMISSION_REQUEST_CAMERA_IMAGE_FRONT;
|
||||
} else if (v.getId() == R.id.backImageHolder) {
|
||||
mRequestedImage = Utils.CARD_IMAGE_FROM_FILE_BACK;
|
||||
permissionRequestType = PERMISSION_REQUEST_CAMERA_IMAGE_BACK;
|
||||
} else if (v.getId() == R.id.thumbnail) {
|
||||
mRequestedImage = Utils.CARD_IMAGE_FROM_FILE_ICON;
|
||||
permissionRequestType = PERMISSION_REQUEST_CAMERA_IMAGE_ICON;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown ID type " + v.getId());
|
||||
}
|
||||
|
||||
Intent i = new Intent(Intent.ACTION_PICK);
|
||||
i.setType("image/*");
|
||||
PermissionUtils.requestCameraPermission(LoyaltyCardEditActivity.this, permissionRequestType);
|
||||
|
||||
try {
|
||||
mPhotoPickerLauncher.launch(i);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(getApplicationContext(), R.string.failedLaunchingPhotoPicker, Toast.LENGTH_LONG).show();
|
||||
Log.e(TAG, "No activity found to handle intent", e);
|
||||
return null;
|
||||
});
|
||||
|
||||
cardOptions.put(getString(R.string.addFromImage), () -> {
|
||||
int permissionRequestType;
|
||||
|
||||
if (v.getId() == R.id.frontImageHolder) {
|
||||
permissionRequestType = PERMISSION_REQUEST_STORAGE_IMAGE_FRONT;
|
||||
} else if (v.getId() == R.id.backImageHolder) {
|
||||
permissionRequestType = PERMISSION_REQUEST_STORAGE_IMAGE_BACK;
|
||||
} else if (v.getId() == R.id.thumbnail) {
|
||||
permissionRequestType = PERMISSION_REQUEST_STORAGE_IMAGE_ICON;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown ID type " + v.getId());
|
||||
}
|
||||
|
||||
PermissionUtils.requestStorageReadPermission(LoyaltyCardEditActivity.this, permissionRequestType);
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -1204,7 +1309,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
throw new IllegalArgumentException("Unknown ID type " + v.getId());
|
||||
}
|
||||
|
||||
new AlertDialog.Builder(LoyaltyCardEditActivity.this)
|
||||
new MaterialAlertDialogBuilder(LoyaltyCardEditActivity.this)
|
||||
.setTitle(getString(titleResource))
|
||||
.setItems(cardOptions.keySet().toArray(new CharSequence[cardOptions.size()]), (dialog, which) -> {
|
||||
Iterator<Callable<Void>> callables = cardOptions.values().iterator();
|
||||
@@ -1232,11 +1337,17 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
implements DatePickerDialog.OnDateSetListener {
|
||||
|
||||
final Context context;
|
||||
final EditText expiryFieldEdit;
|
||||
final EditText textFieldEdit;
|
||||
@Nullable
|
||||
final Date minDate;
|
||||
@Nullable
|
||||
final Date maxDate;
|
||||
|
||||
DatePickerFragment(Context context, EditText expiryFieldEdit) {
|
||||
DatePickerFragment(Context context, EditText textFieldEdit, @Nullable Date minDate, @Nullable Date maxDate) {
|
||||
this.context = context;
|
||||
this.expiryFieldEdit = expiryFieldEdit;
|
||||
this.textFieldEdit = textFieldEdit;
|
||||
this.minDate = minDate;
|
||||
this.maxDate = maxDate;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -1245,7 +1356,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
// Use the current date as the default date in the picker
|
||||
final Calendar c = Calendar.getInstance();
|
||||
|
||||
Date date = (Date) expiryFieldEdit.getTag();
|
||||
Date date = (Date) textFieldEdit.getTag();
|
||||
if (date != null) {
|
||||
c.setTime(date);
|
||||
}
|
||||
@@ -1256,23 +1367,29 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
|
||||
// Create a new instance of DatePickerDialog and return it
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(getActivity(), this, year, month, day);
|
||||
datePickerDialog.getDatePicker().setMinDate(getMinDateOfDatePicker());
|
||||
datePickerDialog.getDatePicker().setMinDate(minDate != null ? minDate.getTime() : getDefaultMinDateOfDatePicker());
|
||||
datePickerDialog.getDatePicker().setMaxDate(maxDate != null ? maxDate.getTime() : getDefaultMaxDateOfDatePicker());
|
||||
return datePickerDialog;
|
||||
}
|
||||
|
||||
private long getMinDateOfDatePicker()
|
||||
{
|
||||
private long getDefaultMinDateOfDatePicker() {
|
||||
Calendar minDateCalendar = Calendar.getInstance();
|
||||
minDateCalendar.set(1970, 0, 1);
|
||||
return minDateCalendar.getTimeInMillis();
|
||||
}
|
||||
|
||||
private long getDefaultMaxDateOfDatePicker() {
|
||||
Calendar maxDateCalendar = Calendar.getInstance();
|
||||
maxDateCalendar.set(2100, 11, 31);
|
||||
return maxDateCalendar.getTimeInMillis();
|
||||
}
|
||||
|
||||
public void onDateSet(DatePicker view, int year, int month, int day) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
Calendar c = new GregorianCalendar();
|
||||
c.set(Calendar.YEAR, year);
|
||||
c.set(Calendar.MONTH, month);
|
||||
c.set(Calendar.DAY_OF_MONTH, day);
|
||||
c.set(Calendar.HOUR, 0);
|
||||
c.set(Calendar.HOUR_OF_DAY, 0);
|
||||
c.set(Calendar.MINUTE, 0);
|
||||
c.set(Calendar.SECOND, 0);
|
||||
c.set(Calendar.MILLISECOND, 0);
|
||||
@@ -1281,7 +1398,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
|
||||
Date date = new Date(unixTime);
|
||||
|
||||
formatExpiryField(context, expiryFieldEdit, date);
|
||||
formatDateField(context, textFieldEdit, date);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1322,9 +1439,9 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
// This makes the DBHelper set it to the current date
|
||||
// So that new and edited card are always on top when sorting by recently used
|
||||
if (updateLoyaltyCard) {
|
||||
DBHelper.updateLoyaltyCard(mDatabase, loyaltyCardId, tempLoyaltyCard.store, tempLoyaltyCard.note, tempLoyaltyCard.expiry, tempLoyaltyCard.balance, tempLoyaltyCard.balanceType, tempLoyaltyCard.cardId, tempLoyaltyCard.barcodeId, tempLoyaltyCard.barcodeType, tempLoyaltyCard.headerColor, tempLoyaltyCard.starStatus, null, tempLoyaltyCard.archiveStatus);
|
||||
DBHelper.updateLoyaltyCard(mDatabase, loyaltyCardId, tempLoyaltyCard.store, tempLoyaltyCard.note, tempLoyaltyCard.validFrom, tempLoyaltyCard.expiry, tempLoyaltyCard.balance, tempLoyaltyCard.balanceType, tempLoyaltyCard.cardId, tempLoyaltyCard.barcodeId, tempLoyaltyCard.barcodeType, tempLoyaltyCard.headerColor, tempLoyaltyCard.starStatus, null, tempLoyaltyCard.archiveStatus);
|
||||
} else {
|
||||
loyaltyCardId = (int) DBHelper.insertLoyaltyCard(mDatabase, tempLoyaltyCard.store, tempLoyaltyCard.note, tempLoyaltyCard.expiry, tempLoyaltyCard.balance, tempLoyaltyCard.balanceType, tempLoyaltyCard.cardId, tempLoyaltyCard.barcodeId, tempLoyaltyCard.barcodeType, tempLoyaltyCard.headerColor, 0, null, 0);
|
||||
loyaltyCardId = (int) DBHelper.insertLoyaltyCard(mDatabase, tempLoyaltyCard.store, tempLoyaltyCard.note, tempLoyaltyCard.validFrom, tempLoyaltyCard.expiry, tempLoyaltyCard.balance, tempLoyaltyCard.balanceType, tempLoyaltyCard.cardId, tempLoyaltyCard.barcodeId, tempLoyaltyCard.barcodeType, tempLoyaltyCard.headerColor, 0, null, 0);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -1461,13 +1578,13 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
barcodeImage.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
|
||||
Log.d(TAG, "ImageView size now known");
|
||||
BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getApplicationContext(), barcodeImage, cardIdString, barcodeFormat, null, false, barcodeImageGenerationFinishedCallback, true);
|
||||
BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getApplicationContext(), barcodeImage, cardIdString, barcodeFormat, null, false, LoyaltyCardEditActivity.this, true);
|
||||
mTasks.executeTask(TaskHandler.TYPE.BARCODE, barcodeWriter);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Log.d(TAG, "ImageView size known known, creating barcode");
|
||||
BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getApplicationContext(), barcodeImage, cardIdString, barcodeFormat, null, false, barcodeImageGenerationFinishedCallback, true);
|
||||
BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getApplicationContext(), barcodeImage, cardIdString, barcodeFormat, null, false, this, true);
|
||||
mTasks.executeTask(TaskHandler.TYPE.BARCODE, barcodeWriter);
|
||||
}
|
||||
}
|
||||
@@ -1498,9 +1615,9 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
View cardPart = findViewById(R.id.cardPart);
|
||||
View optionsPart = findViewById(R.id.optionsPart);
|
||||
View picturesPart = findViewById(R.id.picturesPart);
|
||||
View cardPart = binding.cardPart;
|
||||
View optionsPart = binding.optionsPart;
|
||||
View picturesPart = binding.picturesPart;
|
||||
|
||||
if (getString(R.string.card).equals(part)) {
|
||||
cardPart.setVisibility(View.VISIBLE);
|
||||
@@ -1524,11 +1641,16 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
|
||||
private void currencyPrioritizeLocaleSymbols(ArrayList<String> currencyList, Locale locale) {
|
||||
try {
|
||||
String currencySymbol = Currency.getInstance(locale).getSymbol();
|
||||
String currencySymbol = getCurrencySymbol(Currency.getInstance(locale));
|
||||
currencyList.remove(currencySymbol);
|
||||
currencyList.add(0, currencySymbol);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.d(TAG, "Could not get currency data for locale info: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
private String getCurrencySymbol(final Currency currency) {
|
||||
// Workaround for Android bug where the output of Currency.getSymbol() changes.
|
||||
return currencySymbols.get(currency.getCurrencyCode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ public enum LoyaltyCardField {
|
||||
id,
|
||||
store,
|
||||
note,
|
||||
validFrom,
|
||||
expiry,
|
||||
balance,
|
||||
balanceType,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,55 +9,57 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.CursorIndexOutOfBoundsException;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.GestureDetector;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.splashscreen.SplashScreen;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import protect.card_locker.databinding.ArchiveActivityBinding;
|
||||
import protect.card_locker.databinding.ContentMainBinding;
|
||||
import protect.card_locker.databinding.MainActivityBinding;
|
||||
import protect.card_locker.databinding.SortingOptionBinding;
|
||||
import protect.card_locker.preferences.SettingsActivity;
|
||||
|
||||
public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCardCursorAdapter.CardAdapterListener, GestureDetector.OnGestureListener {
|
||||
public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCardCursorAdapter.CardAdapterListener {
|
||||
private MainActivityBinding binding;
|
||||
private ArchiveActivityBinding archiveActivityBinding;
|
||||
private ContentMainBinding contentMainBinding;
|
||||
private static final String TAG = "Catima";
|
||||
public static final String RESTART_ACTIVITY_INTENT = "restart_activity_intent";
|
||||
|
||||
private static final int MEDIUM_SCALE_FACTOR_DIP = 460;
|
||||
|
||||
private SQLiteDatabase mDatabase;
|
||||
private LoyaltyCardCursorAdapter mAdapter;
|
||||
private ActionMode mCurrentActionMode;
|
||||
private SearchView mSearchView;
|
||||
private GestureDetector mGestureDetector;
|
||||
private int mLoyaltyCardCount = 0;
|
||||
protected String mFilter = "";
|
||||
protected Object mGroup = null;
|
||||
@@ -68,6 +70,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
private View mHelpSection;
|
||||
private View mNoMatchingCardsText;
|
||||
private View mNoGroupCardsText;
|
||||
private TabLayout groupsTabLayout;
|
||||
|
||||
private boolean mArchiveMode;
|
||||
public static final String BUNDLE_ARCHIVE_MODE = "archiveMode";
|
||||
@@ -141,7 +144,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
inputMode.finish();
|
||||
return true;
|
||||
} else if (inputItem.getItemId() == R.id.action_delete) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(MainActivity.this);
|
||||
// The following may seem weird, but it is necessary to give translators enough flexibility.
|
||||
// For example, in Russian, Android's plural quantity "one" actually refers to "any number ending on 1 but not ending in 11".
|
||||
// So while in English the extra non-plural form seems unnecessary duplication, it is necessary to give translators enough flexibility.
|
||||
@@ -163,7 +166,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
ShortcutHelper.removeShortcut(MainActivity.this, loyaltyCard.id);
|
||||
}
|
||||
|
||||
TabLayout.Tab tab = ((TabLayout) findViewById(R.id.groups)).getTabAt(selectedTab);
|
||||
TabLayout.Tab tab = groupsTabLayout.getTabAt(selectedTab);
|
||||
mGroup = tab != null ? tab.getTag() : null;
|
||||
|
||||
updateLoyaltyCardList(true);
|
||||
@@ -175,28 +178,25 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
dialog.show();
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(inputItem.getItemId() == R.id.action_archive){
|
||||
} else if (inputItem.getItemId() == R.id.action_archive) {
|
||||
for (LoyaltyCard loyaltyCard : mAdapter.getSelectedItems()) {
|
||||
Log.d(TAG, "Archiving card: " + loyaltyCard.id);
|
||||
DBHelper.updateLoyaltyCardArchiveStatus(mDatabase, loyaltyCard.id,1);
|
||||
DBHelper.updateLoyaltyCardArchiveStatus(mDatabase, loyaltyCard.id, 1);
|
||||
updateLoyaltyCardList(false);
|
||||
inputMode.finish();
|
||||
invalidateOptionsMenu();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if(inputItem.getItemId() == R.id.action_unarchive){
|
||||
} else if (inputItem.getItemId() == R.id.action_unarchive) {
|
||||
for (LoyaltyCard loyaltyCard : mAdapter.getSelectedItems()) {
|
||||
Log.d(TAG, "Unarchiving card: " + loyaltyCard.id);
|
||||
DBHelper.updateLoyaltyCardArchiveStatus(mDatabase, loyaltyCard.id,0);
|
||||
DBHelper.updateLoyaltyCardArchiveStatus(mDatabase, loyaltyCard.id, 0);
|
||||
updateLoyaltyCardList(false);
|
||||
inputMode.finish();
|
||||
invalidateOptionsMenu();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if(inputItem.getItemId() == R.id.action_star){
|
||||
} else if (inputItem.getItemId() == R.id.action_star) {
|
||||
for (LoyaltyCard loyaltyCard : mAdapter.getSelectedItems()) {
|
||||
Log.d(TAG, "Starring card: " + loyaltyCard.id);
|
||||
DBHelper.updateLoyaltyCardStarStatus(mDatabase, loyaltyCard.id, 1);
|
||||
@@ -204,8 +204,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
inputMode.finish();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if(inputItem.getItemId() == R.id.action_unstar){
|
||||
} else if (inputItem.getItemId() == R.id.action_unstar) {
|
||||
for (LoyaltyCard loyaltyCard : mAdapter.getSelectedItems()) {
|
||||
Log.d(TAG, "Unstarring card: " + loyaltyCard.id);
|
||||
DBHelper.updateLoyaltyCardStarStatus(mDatabase, loyaltyCard.id, 0);
|
||||
@@ -230,28 +229,28 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
extractIntentFields(getIntent());
|
||||
SplashScreen.installSplashScreen(this);
|
||||
super.onCreate(inputSavedInstanceState);
|
||||
if(!mArchiveMode) {
|
||||
if (!mArchiveMode) {
|
||||
binding = MainActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.app_name);
|
||||
setContentView(R.layout.main_activity);
|
||||
}
|
||||
else{
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
groupsTabLayout = binding.groups;
|
||||
contentMainBinding = ContentMainBinding.bind(binding.include.getRoot());
|
||||
} else {
|
||||
archiveActivityBinding = ArchiveActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.archiveList);
|
||||
setContentView(R.layout.archive_activity);
|
||||
setContentView(archiveActivityBinding.getRoot());
|
||||
setSupportActionBar(archiveActivityBinding.toolbar);
|
||||
groupsTabLayout = archiveActivityBinding.groups;
|
||||
contentMainBinding = ContentMainBinding.bind(archiveActivityBinding.include.getRoot());
|
||||
}
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
if(mArchiveMode){
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
if(mArchiveMode) {
|
||||
enableToolbarBackButton();
|
||||
}
|
||||
|
||||
mDatabase = new DBHelper(this).getWritableDatabase();
|
||||
|
||||
TabLayout groupsTabLayout = findViewById(R.id.groups);
|
||||
groupsTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
@@ -279,18 +278,10 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
}
|
||||
});
|
||||
|
||||
mGestureDetector = new GestureDetector(this, this);
|
||||
|
||||
View.OnTouchListener gestureTouchListener = (v, event) -> mGestureDetector.onTouchEvent(event);
|
||||
|
||||
mHelpSection = findViewById(R.id.helpSection);
|
||||
mNoMatchingCardsText = findViewById(R.id.noMatchingCardsText);
|
||||
mNoGroupCardsText = findViewById(R.id.noGroupCardsText);
|
||||
mCardList = findViewById(R.id.list);
|
||||
|
||||
mNoMatchingCardsText.setOnTouchListener(gestureTouchListener);
|
||||
mCardList.setOnTouchListener(gestureTouchListener);
|
||||
mNoGroupCardsText.setOnTouchListener(gestureTouchListener);
|
||||
mHelpSection = contentMainBinding.helpSection;
|
||||
mNoMatchingCardsText = contentMainBinding.noMatchingCardsText;
|
||||
mNoGroupCardsText = contentMainBinding.noGroupCardsText;
|
||||
mCardList = contentMainBinding.list;
|
||||
|
||||
mAdapter = new LoyaltyCardCursorAdapter(this, null, this);
|
||||
mCardList.setAdapter(mAdapter);
|
||||
@@ -331,21 +322,17 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
*/
|
||||
|
||||
mBarcodeScannerLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
// Exit early if the user cancelled the scan (pressed back/home)
|
||||
if (result.getResultCode() != RESULT_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = result.getData();
|
||||
BarcodeValues barcodeValues = Utils.parseSetBarcodeActivityResult(Utils.BARCODE_SCAN, result.getResultCode(), intent, this);
|
||||
|
||||
if (!barcodeValues.isEmpty()) {
|
||||
Intent newIntent = new Intent(getApplicationContext(), LoyaltyCardEditActivity.class);
|
||||
Bundle newBundle = new Bundle();
|
||||
newBundle.putString(LoyaltyCardEditActivity.BUNDLE_BARCODETYPE, barcodeValues.format());
|
||||
newBundle.putString(LoyaltyCardEditActivity.BUNDLE_CARDID, barcodeValues.content());
|
||||
Bundle inputBundle = intent.getExtras();
|
||||
if (inputBundle != null && inputBundle.getString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP) != null) {
|
||||
newBundle.putString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP, inputBundle.getString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP));
|
||||
}
|
||||
newIntent.putExtras(newBundle);
|
||||
startActivity(newIntent);
|
||||
}
|
||||
Bundle inputBundle = intent.getExtras();
|
||||
String group = inputBundle != null ? inputBundle.getString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP) : null;
|
||||
processBarcodeValues(barcodeValues, group);
|
||||
});
|
||||
|
||||
mSettingsLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
@@ -374,21 +361,30 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
}
|
||||
|
||||
// Start of active tab logic
|
||||
TabLayout groupsTabLayout = findViewById(R.id.groups);
|
||||
updateTabGroups(groupsTabLayout);
|
||||
|
||||
// Restore settings from Shared Preference
|
||||
// Restore selected tab from Shared Preference
|
||||
SharedPreferences activeTabPref = getApplicationContext().getSharedPreferences(
|
||||
getString(R.string.sharedpreference_active_tab),
|
||||
Context.MODE_PRIVATE);
|
||||
selectedTab = activeTabPref.getInt(getString(R.string.sharedpreference_active_tab), 0);
|
||||
|
||||
// Restore sort preferences from Shared Preferences
|
||||
// If one of the sorting prefererences has never been set or is set to an invalid value,
|
||||
// stick to the defaults.
|
||||
SharedPreferences sortPref = getApplicationContext().getSharedPreferences(
|
||||
getString(R.string.sharedpreference_sort),
|
||||
Context.MODE_PRIVATE);
|
||||
try {
|
||||
mOrder = DBHelper.LoyaltyCardOrder.valueOf(sortPref.getString(getString(R.string.sharedpreference_sort_order), null));
|
||||
mOrderDirection = DBHelper.LoyaltyCardOrderDirection.valueOf(sortPref.getString(getString(R.string.sharedpreference_sort_direction), null));
|
||||
} catch (IllegalArgumentException | NullPointerException ignored) {
|
||||
|
||||
String orderString = sortPref.getString(getString(R.string.sharedpreference_sort_order), null);
|
||||
String orderDirectionString = sortPref.getString(getString(R.string.sharedpreference_sort_direction), null);
|
||||
|
||||
if (orderString != null && orderDirectionString != null) {
|
||||
try {
|
||||
mOrder = DBHelper.LoyaltyCardOrder.valueOf(orderString);
|
||||
mOrderDirection = DBHelper.LoyaltyCardOrderDirection.valueOf(orderDirectionString);
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
mGroup = null;
|
||||
@@ -402,12 +398,15 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
groupsTabLayout.selectTab(tab);
|
||||
assert tab != null;
|
||||
mGroup = tab.getTag();
|
||||
} else if (!mArchiveMode) {
|
||||
scaleScreen();
|
||||
}
|
||||
|
||||
updateLoyaltyCardList(true);
|
||||
// End of active tab logic
|
||||
|
||||
if (!mArchiveMode) {
|
||||
FloatingActionButton addButton = findViewById(R.id.fabAdd);
|
||||
FloatingActionButton addButton = binding.fabAdd;
|
||||
|
||||
addButton.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(getApplicationContext(), ScanActivity.class);
|
||||
@@ -424,8 +423,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
|
||||
if (!mSearchView.isIconified()) {
|
||||
if (mSearchView != null && !mSearchView.isIconified()) {
|
||||
mSearchView.setIconified(true);
|
||||
return;
|
||||
}
|
||||
@@ -434,7 +432,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
}
|
||||
|
||||
private void displayCardSetupOptions(Menu menu, boolean shouldShow) {
|
||||
for (int id : new int[]{R.id.action_search, R.id.action_unfold, R.id.action_sort}) {
|
||||
for (int id : new int[]{R.id.action_search, R.id.action_shown_details, R.id.action_sort}) {
|
||||
menu.findItem(id).setVisible(shouldShow);
|
||||
}
|
||||
}
|
||||
@@ -498,9 +496,70 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
}
|
||||
}
|
||||
|
||||
private void processBarcodeValues(BarcodeValues barcodeValues, String group) {
|
||||
if (barcodeValues.isEmpty()) {
|
||||
throw new IllegalArgumentException("barcodesValues may not be empty");
|
||||
}
|
||||
|
||||
Intent newIntent = new Intent(getApplicationContext(), LoyaltyCardEditActivity.class);
|
||||
Bundle newBundle = new Bundle();
|
||||
newBundle.putString(LoyaltyCardEditActivity.BUNDLE_BARCODETYPE, barcodeValues.format());
|
||||
newBundle.putString(LoyaltyCardEditActivity.BUNDLE_CARDID, barcodeValues.content());
|
||||
if (group != null) {
|
||||
newBundle.putString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP, group);
|
||||
}
|
||||
newIntent.putExtras(newBundle);
|
||||
startActivity(newIntent);
|
||||
}
|
||||
|
||||
private void onSharedIntent(Intent intent) {
|
||||
String receivedAction = intent.getAction();
|
||||
String receivedType = intent.getType();
|
||||
|
||||
// Check if an image was shared to us
|
||||
if (Intent.ACTION_SEND.equals(receivedAction)) {
|
||||
if (!receivedType.startsWith("image/")) {
|
||||
Log.e(TAG, "Wrong mime-type");
|
||||
return;
|
||||
}
|
||||
|
||||
BarcodeValues barcodeValues;
|
||||
Bitmap bitmap;
|
||||
|
||||
Uri data = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
if (data == null) {
|
||||
Toast.makeText(this, R.string.errorReadingImage, Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
bitmap = Utils.retrieveImageFromUri(this, data);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "Error getting data from image file");
|
||||
e.printStackTrace();
|
||||
Toast.makeText(this, R.string.errorReadingImage, Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
barcodeValues = Utils.getBarcodeFromBitmap(bitmap);
|
||||
|
||||
if (barcodeValues.isEmpty()) {
|
||||
Log.i(TAG, "No barcode found in image file");
|
||||
Toast.makeText(this, R.string.noBarcodeFound, Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
processBarcodeValues(barcodeValues, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void extractIntentFields(Intent intent) {
|
||||
final Bundle b = intent.getExtras();
|
||||
mArchiveMode = b != null && b.getBoolean(BUNDLE_ARCHIVE_MODE, false);
|
||||
onSharedIntent(intent);
|
||||
}
|
||||
|
||||
public void updateTabGroups(TabLayout groupsTabLayout) {
|
||||
@@ -532,13 +591,12 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu inputMenu) {
|
||||
if(!mArchiveMode)
|
||||
if (!mArchiveMode) {
|
||||
getMenuInflater().inflate(R.menu.main_menu, inputMenu);
|
||||
else{
|
||||
} else {
|
||||
getMenuInflater().inflate(R.menu.archive_menu, inputMenu);
|
||||
}
|
||||
|
||||
Utils.updateMenuCardDetailsButtonState(inputMenu.findItem(R.id.action_unfold), mAdapter.showingDetails());
|
||||
displayCardSetupOptions(inputMenu, mLoyaltyCardCount > 0);
|
||||
|
||||
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
|
||||
@@ -562,7 +620,6 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
mFilter = newText;
|
||||
|
||||
TabLayout groupsTabLayout = findViewById(R.id.groups);
|
||||
TabLayout.Tab currentTab = groupsTabLayout.getTabAt(groupsTabLayout.getSelectedTabPosition());
|
||||
mGroup = currentTab != null ? currentTab.getTag() : null;
|
||||
|
||||
@@ -573,7 +630,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
});
|
||||
}
|
||||
|
||||
if(!mArchiveMode) {
|
||||
if (!mArchiveMode) {
|
||||
if (DBHelper.getArchivedCardsCount(mDatabase) == 0) {
|
||||
inputMenu.findItem(R.id.action_archived).setVisible(false);
|
||||
} else {
|
||||
@@ -592,8 +649,8 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
if (id == R.id.action_unfold) {
|
||||
mAdapter.showDetails(!mAdapter.showingDetails());
|
||||
if (id == R.id.action_shown_details) {
|
||||
mAdapter.showSelectDetailDisplayDialog();
|
||||
invalidateOptionsMenu();
|
||||
|
||||
return true;
|
||||
@@ -609,13 +666,15 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
}
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(MainActivity.this);
|
||||
builder.setTitle(R.string.sort_by);
|
||||
|
||||
final View customLayout = getLayoutInflater().inflate(R.layout.sorting_option, null);
|
||||
SortingOptionBinding sortingOptionBinding = SortingOptionBinding
|
||||
.inflate(LayoutInflater.from(MainActivity.this), null, false);
|
||||
final View customLayout = sortingOptionBinding.getRoot();
|
||||
builder.setView(customLayout);
|
||||
|
||||
CheckBox showReversed = (CheckBox) customLayout.findViewById(R.id.checkBox_reverse);
|
||||
CheckBox showReversed = sortingOptionBinding.checkBoxReverse;
|
||||
|
||||
|
||||
showReversed.setChecked(mOrderDirection == DBHelper.LoyaltyCardOrderDirection.Descending);
|
||||
@@ -696,84 +755,6 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
updateLoyaltyCardList(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDown(MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowPress(MotionEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSingleTapUp(MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLongPress(MotionEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
mGestureDetector.onTouchEvent(ev);
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
||||
Log.d(TAG, "On fling");
|
||||
|
||||
// Don't swipe if we have too much vertical movement
|
||||
if (Math.abs(velocityY) > (0.75 * Math.abs(velocityX))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TabLayout groupsTabLayout = findViewById(R.id.groups);
|
||||
if (groupsTabLayout.getTabCount() < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Integer currentTab = groupsTabLayout.getSelectedTabPosition();
|
||||
Log.d("onFling", "Current Tab " + currentTab);
|
||||
// Swipe right
|
||||
if (velocityX < -150) {
|
||||
Log.d("onFling", "Right Swipe detected " + velocityX);
|
||||
Integer nextTab = currentTab + 1;
|
||||
|
||||
if (nextTab == groupsTabLayout.getTabCount()) {
|
||||
groupsTabLayout.selectTab(groupsTabLayout.getTabAt(0));
|
||||
} else {
|
||||
groupsTabLayout.selectTab(groupsTabLayout.getTabAt(nextTab));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Swipe left
|
||||
if (velocityX > 150) {
|
||||
Log.d("onFling", "Left Swipe detected " + velocityX);
|
||||
Integer nextTab = currentTab - 1;
|
||||
|
||||
if (nextTab < 0) {
|
||||
groupsTabLayout.selectTab(groupsTabLayout.getTabAt(groupsTabLayout.getTabCount() - 1));
|
||||
} else {
|
||||
groupsTabLayout.selectTab(groupsTabLayout.getTabAt(nextTab));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowLongClicked(int inputPosition) {
|
||||
enableActionMode(inputPosition);
|
||||
@@ -786,6 +767,16 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
toggleSelection(inputPosition);
|
||||
}
|
||||
|
||||
private void scaleScreen() {
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
int screenHeight = displayMetrics.heightPixels;
|
||||
float mediumSizePx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,MEDIUM_SCALE_FACTOR_DIP,getResources().getDisplayMetrics());
|
||||
boolean shouldScaleSmaller = screenHeight < mediumSizePx;
|
||||
|
||||
binding.include.welcomeIcon.setVisibility(shouldScaleSmaller ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
private void toggleSelection(int inputPosition) {
|
||||
mAdapter.toggleSelection(inputPosition);
|
||||
int count = mAdapter.getSelectedItemCount();
|
||||
@@ -804,11 +795,10 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
boolean hasStarred = false;
|
||||
boolean hasUnstarred = false;
|
||||
|
||||
if(!mArchiveMode) {
|
||||
if (!mArchiveMode) {
|
||||
unarchiveItem.setVisible(false);
|
||||
archiveItem.setVisible(true);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
unarchiveItem.setVisible(true);
|
||||
archiveItem.setVisible(false);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -20,13 +21,15 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import protect.card_locker.databinding.ActivityManageGroupBinding;
|
||||
|
||||
public class ManageGroupActivity extends CatimaAppCompatActivity implements ManageGroupCursorAdapter.CardAdapterListener {
|
||||
|
||||
private ActivityManageGroupBinding binding;
|
||||
private SQLiteDatabase mDatabase;
|
||||
private ManageGroupCursorAdapter mAdapter;
|
||||
|
||||
@@ -43,17 +46,18 @@ public class ManageGroupActivity extends CatimaAppCompatActivity implements Mana
|
||||
@Override
|
||||
protected void onCreate(Bundle inputSavedInstanceState) {
|
||||
super.onCreate(inputSavedInstanceState);
|
||||
setContentView(R.layout.activity_manage_group);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
binding = ActivityManageGroupBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
mDatabase = new DBHelper(this).getWritableDatabase();
|
||||
|
||||
noGroupCardsText = findViewById(R.id.noGroupCardsText);
|
||||
mCardList = findViewById(R.id.list);
|
||||
FloatingActionButton saveButton = findViewById(R.id.fabSave);
|
||||
noGroupCardsText = binding.include.noGroupCardsText;
|
||||
mCardList = binding.include.list;
|
||||
FloatingActionButton saveButton = binding.fabSave;
|
||||
|
||||
mGroupNameText = findViewById(R.id.editTextGroupName);
|
||||
mGroupNameText = binding.editTextGroupName;
|
||||
|
||||
mGroupNameText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
@@ -105,12 +109,7 @@ public class ManageGroupActivity extends CatimaAppCompatActivity implements Mana
|
||||
mGroupNameText.setText(inputSavedInstanceState.getString(SAVE_INSTANCE_CURRENT_GROUP_NAME));
|
||||
}
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar == null) {
|
||||
throw (new RuntimeException("mActionBar is not expected to be null here"));
|
||||
}
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
actionBar.setDisplayShowHomeEnabled(true);
|
||||
enableToolbarBackButton();
|
||||
|
||||
saveButton.setOnClickListener(v -> {
|
||||
String currentGroupName = mGroupNameText.getText().toString().trim();
|
||||
@@ -160,7 +159,7 @@ public class ManageGroupActivity extends CatimaAppCompatActivity implements Mana
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu inputMenu) {
|
||||
getMenuInflater().inflate(R.menu.card_details_menu, inputMenu);
|
||||
Utils.updateMenuCardDetailsButtonState(inputMenu.findItem(R.id.action_unfold), mAdapter.showingDetails());
|
||||
|
||||
return super.onCreateOptionsMenu(inputMenu);
|
||||
}
|
||||
|
||||
@@ -168,8 +167,8 @@ public class ManageGroupActivity extends CatimaAppCompatActivity implements Mana
|
||||
public boolean onOptionsItemSelected(MenuItem inputItem) {
|
||||
int id = inputItem.getItemId();
|
||||
|
||||
if (id == R.id.action_unfold) {
|
||||
mAdapter.showDetails(!mAdapter.showingDetails());
|
||||
if (id == R.id.action_shown_details) {
|
||||
mAdapter.showSelectDetailDisplayDialog();
|
||||
invalidateOptionsMenu();
|
||||
|
||||
return true;
|
||||
@@ -200,7 +199,7 @@ public class ManageGroupActivity extends CatimaAppCompatActivity implements Mana
|
||||
|
||||
private void leaveWithoutSaving() {
|
||||
if (hasChanged()) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(ManageGroupActivity.this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(ManageGroupActivity.this);
|
||||
builder.setTitle(R.string.leaveWithoutSaveTitle);
|
||||
builder.setMessage(R.string.leaveWithoutSaveConfirmation);
|
||||
builder.setPositiveButton(R.string.confirm, (dialog, which) -> finish());
|
||||
|
||||
@@ -8,11 +8,14 @@ import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.util.List;
|
||||
@@ -24,7 +27,10 @@ import androidx.recyclerview.widget.DefaultItemAnimator;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import protect.card_locker.databinding.ManageGroupsActivityBinding;
|
||||
|
||||
public class ManageGroupsActivity extends CatimaAppCompatActivity implements GroupCursorAdapter.GroupAdapterListener {
|
||||
private ManageGroupsActivityBinding binding;
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
private SQLiteDatabase mDatabase;
|
||||
@@ -35,14 +41,12 @@ public class ManageGroupsActivity extends CatimaAppCompatActivity implements Gro
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ManageGroupsActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.groups);
|
||||
setContentView(R.layout.manage_groups_activity);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setContentView(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
enableToolbarBackButton();
|
||||
|
||||
mDatabase = new DBHelper(this).getWritableDatabase();
|
||||
}
|
||||
@@ -51,12 +55,12 @@ public class ManageGroupsActivity extends CatimaAppCompatActivity implements Gro
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
FloatingActionButton addButton = findViewById(R.id.fabAdd);
|
||||
FloatingActionButton addButton = binding.fabAdd;
|
||||
addButton.setOnClickListener(v -> createGroup());
|
||||
addButton.bringToFront();
|
||||
|
||||
mGroupList = findViewById(R.id.list);
|
||||
mHelpText = findViewById(R.id.helpText);
|
||||
mGroupList = binding.include.list;
|
||||
mHelpText = binding.include.helpText;
|
||||
|
||||
// Init group list
|
||||
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
|
||||
@@ -108,24 +112,62 @@ public class ManageGroupsActivity extends CatimaAppCompatActivity implements Gro
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void setGroupNameError(EditText input) {
|
||||
String string = sanitizeAddGroupNameField(input.getText());
|
||||
|
||||
if (string.length() == 0) {
|
||||
input.setError(getString(R.string.group_name_is_empty));
|
||||
return;
|
||||
}
|
||||
|
||||
if (DBHelper.getGroup(mDatabase, string) != null) {
|
||||
input.setError(getString(R.string.group_name_already_in_use));
|
||||
return;
|
||||
}
|
||||
|
||||
input.setError(null);
|
||||
}
|
||||
|
||||
private String sanitizeAddGroupNameField(CharSequence s) {
|
||||
return s.toString().trim();
|
||||
}
|
||||
|
||||
private void createGroup() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setTitle(R.string.enter_group_name);
|
||||
final EditText input = new EditText(this);
|
||||
input.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
builder.setView(input);
|
||||
input.addTextChangedListener(new SimpleTextWatcher() {
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
setGroupNameError(input);
|
||||
}
|
||||
});
|
||||
setGroupNameError(input);
|
||||
|
||||
// Add spacing to EditText
|
||||
FrameLayout container = new FrameLayout(this);
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
int contentPadding = getResources().getDimensionPixelSize(R.dimen.alert_dialog_content_padding);
|
||||
params.leftMargin = contentPadding;
|
||||
params.topMargin = contentPadding / 2;
|
||||
params.rightMargin = contentPadding;
|
||||
input.setLayoutParams(params);
|
||||
container.addView(input);
|
||||
|
||||
builder.setView(container);
|
||||
|
||||
builder.setPositiveButton(getString(R.string.ok), (dialog, which) -> {
|
||||
String inputString = input.getText().toString().trim();
|
||||
if (inputString.length() == 0) {
|
||||
Toast.makeText(getApplicationContext(), R.string.group_name_is_empty, Toast.LENGTH_SHORT).show();
|
||||
CharSequence error = input.getError();
|
||||
|
||||
if (error != null) {
|
||||
Toast.makeText(getApplicationContext(), error.toString(), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (DBHelper.getGroup(mDatabase, inputString) != null) {
|
||||
Toast.makeText(getApplicationContext(), R.string.group_name_already_in_use, Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
DBHelper.insertGroup(mDatabase, inputString);
|
||||
|
||||
DBHelper.insertGroup(mDatabase, sanitizeAddGroupNameField(input.getText()));
|
||||
updateGroupList();
|
||||
});
|
||||
builder.setNegativeButton(getString(R.string.cancel), (dialog, which) -> dialog.cancel());
|
||||
@@ -193,7 +235,7 @@ public class ManageGroupsActivity extends CatimaAppCompatActivity implements Gro
|
||||
public void onDeleteButtonClicked(View view) {
|
||||
final String groupName = getGroupName(view);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setTitle(R.string.deleteConfirmationGroup);
|
||||
builder.setMessage(groupName);
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class OpenWebLinkHandler {
|
||||
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
public void openBrowser(AppCompatActivity activity, String url) {
|
||||
if (url == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(url));
|
||||
try {
|
||||
activity.startActivity(intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(activity, R.string.failedToOpenUrl, Toast.LENGTH_LONG).show();
|
||||
Log.e(TAG, "No activity found to handle intent", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
94
app/src/main/java/protect/card_locker/PermissionUtils.java
Normal file
94
app/src/main/java/protect/card_locker/PermissionUtils.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
public class PermissionUtils {
|
||||
/**
|
||||
* Check if storage read permission is needed.
|
||||
*
|
||||
* This is only necessary on Android 6.0 (Marshmallow) and below. See
|
||||
* https://github.com/CatimaLoyalty/Android/issues/979 for more info.
|
||||
*
|
||||
* @param activity
|
||||
* @return
|
||||
*/
|
||||
private static boolean needsStorageReadPermission(Activity activity) {
|
||||
// Testing showed this permission wasn't needed for anything Catima did past Marshmallow
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ContextCompat.checkSelfPermission(activity, android.Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if camera permission is needed.
|
||||
*
|
||||
* @param activity
|
||||
* @return
|
||||
*/
|
||||
public static boolean needsCameraPermission(Activity activity) {
|
||||
// Android only introduced the runtime permission system in Marshmallow (Android 6.0)
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ContextCompat.checkSelfPermission(activity, android.Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call onRequestPermissionsResult after storage read permission was granted.
|
||||
* Mocks a successful grant if a grant is not necessary.
|
||||
*
|
||||
* @param activity
|
||||
* @param requestCode
|
||||
*/
|
||||
public static void requestStorageReadPermission(CatimaAppCompatActivity activity, int requestCode) {
|
||||
String[] permissions = new String[]{ android.Manifest.permission.READ_EXTERNAL_STORAGE };
|
||||
int[] mockedResults = new int[]{ PackageManager.PERMISSION_GRANTED };
|
||||
|
||||
if (needsStorageReadPermission(activity)) {
|
||||
ActivityCompat.requestPermissions(activity, permissions, requestCode);
|
||||
} else {
|
||||
// FIXME: This points to onMockedRequestPermissionResult instead of to
|
||||
// onRequestPermissionResult because onRequestPermissionResult was only introduced in
|
||||
// Android 6.0 (SDK 23) and we and to support Android 5.0 (SDK 21) too.
|
||||
//
|
||||
// When minSdk becomes 23, this should point to onRequestPermissionResult directly and
|
||||
// the activity input variable should be changed from CatimaAppCompatActivity to
|
||||
// Activity.
|
||||
activity.onMockedRequestPermissionsResult(requestCode, permissions, mockedResults);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call onRequestPermissionsResult after camera permission was granted.
|
||||
* Mocks a successful grant if a grant is not necessary.
|
||||
*
|
||||
* @param activity
|
||||
* @param requestCode
|
||||
*/
|
||||
public static void requestCameraPermission(CatimaAppCompatActivity activity, int requestCode) {
|
||||
String[] permissions = new String[]{ Manifest.permission.CAMERA };
|
||||
int[] mockedResults = new int[]{ PackageManager.PERMISSION_GRANTED };
|
||||
|
||||
if (needsCameraPermission(activity)) {
|
||||
ActivityCompat.requestPermissions(activity, permissions, requestCode);
|
||||
} else {
|
||||
// FIXME: This points to onMockedRequestPermissionResult instead of to
|
||||
// onRequestPermissionResult because onRequestPermissionResult was only introduced in
|
||||
// Android 6.0 (SDK 23) and we and to support Android 5.0 (SDK 21) too.
|
||||
//
|
||||
// When minSdk becomes 23, this should point to onRequestPermissionResult directly and
|
||||
// the activity input variable should be changed from CatimaAppCompatActivity to
|
||||
// Activity.
|
||||
activity.onMockedRequestPermissionsResult(requestCode, permissions, mockedResults);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,30 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.google.zxing.client.android.Intents;
|
||||
import com.journeyapps.barcodescanner.BarcodeCallback;
|
||||
@@ -21,10 +34,8 @@ import com.journeyapps.barcodescanner.DecoratedBarcodeView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import protect.card_locker.databinding.CustomBarcodeScannerBinding;
|
||||
import protect.card_locker.databinding.ScanActivityBinding;
|
||||
|
||||
/**
|
||||
* Custom Scannner Activity extending from Activity to display a custom layout form scanner view.
|
||||
@@ -33,8 +44,16 @@ import androidx.appcompat.widget.Toolbar;
|
||||
* originally licensed under Apache 2.0
|
||||
*/
|
||||
public class ScanActivity extends CatimaAppCompatActivity {
|
||||
|
||||
private ScanActivityBinding binding;
|
||||
private CustomBarcodeScannerBinding customBarcodeScannerBinding;
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
private static final int MEDIUM_SCALE_FACTOR_DIP = 460;
|
||||
private static final int COMPAT_SCALE_FACTOR_DIP = 320;
|
||||
|
||||
private static final int PERMISSION_SCAN_ADD_FROM_IMAGE = 100;
|
||||
|
||||
private CaptureManager capture;
|
||||
private DecoratedBarcodeView barcodeScannerView;
|
||||
|
||||
@@ -56,23 +75,22 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ScanActivityBinding.inflate(getLayoutInflater());
|
||||
customBarcodeScannerBinding = CustomBarcodeScannerBinding.bind(binding.zxingBarcodeScanner);
|
||||
setTitle(R.string.scanCardBarcode);
|
||||
setContentView(R.layout.scan_activity);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setContentView(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
enableToolbarBackButton();
|
||||
|
||||
extractIntentFields(getIntent());
|
||||
|
||||
manualAddLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> handleActivityResult(Utils.SELECT_BARCODE_REQUEST, result.getResultCode(), result.getData()));
|
||||
photoPickerLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> handleActivityResult(Utils.BARCODE_IMPORT_FROM_IMAGE_FILE, result.getResultCode(), result.getData()));
|
||||
findViewById(R.id.add_from_image).setOnClickListener(this::addFromImage);
|
||||
findViewById(R.id.add_manually).setOnClickListener(this::addManually);
|
||||
customBarcodeScannerBinding.addFromImage.setOnClickListener(this::addFromImage);
|
||||
customBarcodeScannerBinding.addManually.setOnClickListener(this::addManually);
|
||||
|
||||
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
|
||||
barcodeScannerView = binding.zxingBarcodeScanner;
|
||||
|
||||
// Even though we do the actual decoding with the barcodeScannerView
|
||||
// CaptureManager needs to be running to show the camera and scanning bar
|
||||
@@ -109,6 +127,10 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
capture.onResume();
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {
|
||||
showCameraPermissionMissingText(false);
|
||||
}
|
||||
scaleScreen();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -171,27 +193,22 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
private void handleActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||
super.onActivityResult(requestCode, resultCode, intent);
|
||||
|
||||
BarcodeValues barcodeValues;
|
||||
BarcodeValues barcodeValues = Utils.parseSetBarcodeActivityResult(requestCode, resultCode, intent, this);
|
||||
|
||||
try {
|
||||
barcodeValues = Utils.parseSetBarcodeActivityResult(requestCode, resultCode, intent, this);
|
||||
} catch (NullPointerException e) {
|
||||
Toast.makeText(this, R.string.errorReadingImage, Toast.LENGTH_LONG).show();
|
||||
if (barcodeValues.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!barcodeValues.isEmpty()) {
|
||||
Intent manualResult = new Intent();
|
||||
Bundle manualResultBundle = new Bundle();
|
||||
manualResultBundle.putString(BarcodeSelectorActivity.BARCODE_CONTENTS, barcodeValues.content());
|
||||
manualResultBundle.putString(BarcodeSelectorActivity.BARCODE_FORMAT, barcodeValues.format());
|
||||
if (addGroup != null) {
|
||||
manualResultBundle.putString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP, addGroup);
|
||||
}
|
||||
manualResult.putExtras(manualResultBundle);
|
||||
ScanActivity.this.setResult(RESULT_OK, manualResult);
|
||||
finish();
|
||||
Intent manualResult = new Intent();
|
||||
Bundle manualResultBundle = new Bundle();
|
||||
manualResultBundle.putString(BarcodeSelectorActivity.BARCODE_CONTENTS, barcodeValues.content());
|
||||
manualResultBundle.putString(BarcodeSelectorActivity.BARCODE_FORMAT, barcodeValues.format());
|
||||
if (addGroup != null) {
|
||||
manualResultBundle.putString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP, addGroup);
|
||||
}
|
||||
manualResult.putExtras(manualResultBundle);
|
||||
ScanActivity.this.setResult(RESULT_OK, manualResult);
|
||||
finish();
|
||||
}
|
||||
|
||||
public void addManually(View view) {
|
||||
@@ -205,13 +222,74 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
|
||||
public void addFromImage(View view) {
|
||||
PermissionUtils.requestStorageReadPermission(this, PERMISSION_SCAN_ADD_FROM_IMAGE);
|
||||
}
|
||||
|
||||
private void addFromImageAfterPermission() {
|
||||
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
|
||||
photoPickerIntent.setType("image/*");
|
||||
Intent contentIntent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
contentIntent.setType("image/*");
|
||||
|
||||
Intent chooserIntent = Intent.createChooser(photoPickerIntent, getString(R.string.addFromImage));
|
||||
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { contentIntent });
|
||||
try {
|
||||
photoPickerLauncher.launch(photoPickerIntent);
|
||||
photoPickerLauncher.launch(chooserIntent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(getApplicationContext(), R.string.failedLaunchingPhotoPicker, Toast.LENGTH_LONG).show();
|
||||
Log.e(TAG, "No activity found to handle intent", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void showCameraPermissionMissingText(boolean show) {
|
||||
customBarcodeScannerBinding.cameraPermissionDeniedLayout.cameraPermissionDeniedClickableArea.setOnClickListener(show ? v -> {
|
||||
navigateToSystemPermissionSetting();
|
||||
} : null);
|
||||
customBarcodeScannerBinding.cardInputContainer.setBackgroundColor(show ? obtainThemeAttribute(com.google.android.material.R.attr.colorSurface) : Color.TRANSPARENT);
|
||||
customBarcodeScannerBinding.cameraPermissionDeniedLayout.getRoot().setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
private void scaleScreen() {
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
int screenHeight = displayMetrics.heightPixels;
|
||||
float mediumSizePx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,MEDIUM_SCALE_FACTOR_DIP,getResources().getDisplayMetrics());
|
||||
boolean shouldScaleSmaller = screenHeight < mediumSizePx;
|
||||
|
||||
customBarcodeScannerBinding.cameraPermissionDeniedLayout.cameraPermissionDeniedIcon.setVisibility(shouldScaleSmaller ? View.GONE : View.VISIBLE);
|
||||
customBarcodeScannerBinding.cameraPermissionDeniedLayout.cameraPermissionDeniedTitle.setVisibility(shouldScaleSmaller ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
private int obtainThemeAttribute(int attribute) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
getTheme().resolveAttribute(attribute, typedValue, true);
|
||||
return typedValue.data;
|
||||
}
|
||||
|
||||
private void navigateToSystemPermissionSetting() {
|
||||
Intent permissionIntent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts("package", getPackageName(), null));
|
||||
permissionIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(permissionIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
onMockedRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
public void onMockedRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
boolean granted = grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED;
|
||||
|
||||
if (requestCode == CaptureManager.getCameraPermissionReqCode()) {
|
||||
showCameraPermissionMissingText(!granted);
|
||||
} else if (requestCode == PERMISSION_SCAN_ADD_FROM_IMAGE) {
|
||||
if (granted) {
|
||||
addFromImageAfterPermission();
|
||||
} else {
|
||||
Toast.makeText(this, R.string.storageReadPermissionRequired, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ class ShortcutHelper {
|
||||
private static final int ADAPTIVE_BITMAP_SIZE = 108 * ADAPTIVE_BITMAP_SCALE;
|
||||
private static final int ADAPTIVE_BITMAP_VISIBLE_SIZE = 72 * ADAPTIVE_BITMAP_SCALE;
|
||||
private static final int ADAPTIVE_BITMAP_IMAGE_SIZE = ADAPTIVE_BITMAP_VISIBLE_SIZE + 5 * ADAPTIVE_BITMAP_SCALE;
|
||||
private static final int PADDING_COLOR = Color.argb(255, 255, 255, 255);
|
||||
private static final int PADDING_COLOR_OVERLAY = Color.argb(127, 0, 0, 0);
|
||||
|
||||
/**
|
||||
@@ -71,19 +70,13 @@ class ShortcutHelper {
|
||||
ShortcutInfoCompat found = list.remove(foundIndex.intValue());
|
||||
list.addFirst(found);
|
||||
} else {
|
||||
// The item is new to the list. First, we need to trim the list
|
||||
// until it is able to accept a new item, then the item is
|
||||
// inserted.
|
||||
while (list.size() >= MAX_SHORTCUTS) {
|
||||
list.pollLast();
|
||||
}
|
||||
|
||||
// The item is new to the list. We add it and trim the list later.
|
||||
ShortcutInfoCompat shortcut = createShortcutBuilder(context, card).build();
|
||||
|
||||
list.addFirst(shortcut);
|
||||
}
|
||||
|
||||
LinkedList<ShortcutInfoCompat> finalList = new LinkedList<>();
|
||||
int rank = 0;
|
||||
|
||||
// The ranks are now updated; the order in the list is the rank.
|
||||
for (int index = 0; index < list.size(); index++) {
|
||||
@@ -91,11 +84,20 @@ class ShortcutHelper {
|
||||
|
||||
LoyaltyCard loyaltyCard = DBHelper.getLoyaltyCard(database, Integer.parseInt(prevShortcut.getId()));
|
||||
|
||||
ShortcutInfoCompat updatedShortcut = createShortcutBuilder(context, loyaltyCard)
|
||||
.setRank(index)
|
||||
.build();
|
||||
// skip outdated cards that no longer exist
|
||||
if (loyaltyCard != null) {
|
||||
ShortcutInfoCompat updatedShortcut = createShortcutBuilder(context, loyaltyCard)
|
||||
.setRank(rank)
|
||||
.build();
|
||||
|
||||
finalList.addLast(updatedShortcut);
|
||||
finalList.addLast(updatedShortcut);
|
||||
rank++;
|
||||
|
||||
// trim the list
|
||||
if (rank >= MAX_SHORTCUTS) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ShortcutManagerCompat.setDynamicShortcuts(context, finalList);
|
||||
@@ -145,7 +147,7 @@ class ShortcutHelper {
|
||||
if (iconBitmap == null) {
|
||||
iconBitmap = Utils.generateIcon(context, loyaltyCard, true).getLetterTile();
|
||||
} else {
|
||||
iconBitmap = createAdaptiveBitmap(iconBitmap, loyaltyCard.headerColor == null ? PADDING_COLOR : loyaltyCard.headerColor);
|
||||
iconBitmap = createAdaptiveBitmap(iconBitmap, Utils.getHeaderColor(context, loyaltyCard));
|
||||
}
|
||||
|
||||
IconCompat icon = IconCompat.createWithAdaptiveBitmap(iconBitmap);
|
||||
|
||||
@@ -22,4 +22,8 @@ public class ThirdPartyInfo {
|
||||
public String license() {
|
||||
return mLicense;
|
||||
}
|
||||
|
||||
public String toHtml() {
|
||||
return String.format("<a href=\"%s\">%s</a> (%s)", url(), name(), license());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.view.WindowInsetsControllerCompat;
|
||||
|
||||
public class UCropWrapper extends UCropActivity {
|
||||
public static final String UCROP_TOOLBAR_TYPEFACE_STYLE = "ucop_toolbar_typeface_style";
|
||||
@@ -28,7 +29,9 @@ public class UCropWrapper extends UCropActivity {
|
||||
boolean darkMode = Utils.isDarkModeEnabled(this);
|
||||
// setup status bar to look like the rest of the app
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
getWindow().getDecorView().setSystemUiVisibility(darkMode ? 0 : View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
||||
View decorView = getWindow().getDecorView();
|
||||
WindowInsetsControllerCompat wic = new WindowInsetsControllerCompat(getWindow(), decorView);
|
||||
wic.setAppearanceLightStatusBars(!darkMode);
|
||||
} else {
|
||||
// icons are always white back then
|
||||
if (!darkMode) {
|
||||
@@ -50,8 +53,8 @@ public class UCropWrapper extends UCropActivity {
|
||||
AppCompatImageView controlsBackgroundImage = (AppCompatImageView) check;
|
||||
// everything gathered and are as expected, now perform color patching
|
||||
Utils.patchColors(this);
|
||||
int colorSurface = MaterialColors.getColor(this, R.attr.colorSurface, ContextCompat.getColor(this, R.color.md_theme_light_surface));
|
||||
int colorOnSurface = MaterialColors.getColor(this, R.attr.colorOnSurface, ContextCompat.getColor(this, R.color.md_theme_light_onSurface));
|
||||
int colorSurface = MaterialColors.getColor(this, com.google.android.material.R.attr.colorSurface, ContextCompat.getColor(this, R.color.md_theme_light_surface));
|
||||
int colorOnSurface = MaterialColors.getColor(this, com.google.android.material.R.attr.colorOnSurface, ContextCompat.getColor(this, R.color.md_theme_light_onSurface));
|
||||
|
||||
Drawable controlsBackgroundImageDrawable = controlsBackgroundImage.getBackground();
|
||||
controlsBackgroundImageDrawable.mutate();
|
||||
|
||||
@@ -11,14 +11,25 @@ import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ImageDecoder;
|
||||
import android.graphics.Matrix;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.LocaleList;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.RawRes;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
import androidx.palette.graphics.Palette;
|
||||
|
||||
import com.google.android.material.color.DynamicColors;
|
||||
import com.google.zxing.BinaryBitmap;
|
||||
import com.google.zxing.LuminanceSource;
|
||||
@@ -28,13 +39,17 @@ import com.google.zxing.RGBLuminanceSource;
|
||||
import com.google.zxing.Result;
|
||||
import com.google.zxing.common.HybridBinarizer;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.Calendar;
|
||||
@@ -44,11 +59,6 @@ import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
import androidx.palette.graphics.Palette;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
|
||||
public class Utils {
|
||||
@@ -105,6 +115,17 @@ public class Utils {
|
||||
return ColorUtils.calculateLuminance(backgroundColor) > LUMINANCE_MIDPOINT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Barcode format and content based on the result of an activity.
|
||||
* It shows toasts to notify the end-user as needed itself and will return an empty
|
||||
* BarcodeValues object if the activity was cancelled or nothing could be found.
|
||||
*
|
||||
* @param requestCode
|
||||
* @param resultCode
|
||||
* @param intent
|
||||
* @param context
|
||||
* @return BarcodeValues
|
||||
*/
|
||||
static public BarcodeValues parseSetBarcodeActivityResult(int requestCode, int resultCode, Intent intent, Context context) {
|
||||
String contents;
|
||||
String format;
|
||||
@@ -116,14 +137,16 @@ public class Utils {
|
||||
if (requestCode == Utils.BARCODE_IMPORT_FROM_IMAGE_FILE) {
|
||||
Log.i(TAG, "Received image file with possible barcode");
|
||||
|
||||
Uri data = intent.getData();
|
||||
if (data == null) {
|
||||
Log.e(TAG, "Intent did not contain any data");
|
||||
Toast.makeText(context, R.string.errorReadingImage, Toast.LENGTH_LONG).show();
|
||||
return new BarcodeValues(null, null);
|
||||
}
|
||||
|
||||
Bitmap bitmap;
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
ImageDecoder.Source image_source = ImageDecoder.createSource(context.getContentResolver(), intent.getData());
|
||||
bitmap = ImageDecoder.decodeBitmap(image_source, (decoder, info, source) -> decoder.setMutableRequired(true));
|
||||
} else {
|
||||
bitmap = MediaStore.Images.Media.getBitmap(context.getContentResolver(), intent.getData());
|
||||
}
|
||||
bitmap = retrieveImageFromUri(context, data);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "Error getting data from image file");
|
||||
e.printStackTrace();
|
||||
@@ -163,6 +186,20 @@ public class Utils {
|
||||
throw new UnsupportedOperationException("Unknown request code for parseSetBarcodeActivityResult");
|
||||
}
|
||||
|
||||
static public Bitmap retrieveImageFromUri(Context context, Uri data) throws IOException {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
ImageDecoder.Source image_source = ImageDecoder.createSource(context.getContentResolver(), data);
|
||||
return ImageDecoder.decodeBitmap(image_source, (decoder, info, source) -> decoder.setMutableRequired(true));
|
||||
} else {
|
||||
return getBitmapSdkLessThan29(data, context);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static Bitmap getBitmapSdkLessThan29(Uri data, Context context) throws IOException {
|
||||
return MediaStore.Images.Media.getBitmap(context.getContentResolver(), data);
|
||||
}
|
||||
|
||||
static public BarcodeValues getBarcodeFromBitmap(Bitmap bitmap) {
|
||||
// This function is vulnerable to OOM, so we try again with a smaller bitmap is we get OOM
|
||||
for (int i = 0; i < 10; i++) {
|
||||
@@ -196,7 +233,21 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
static public Boolean isNotYetValid(Date validFromDate) {
|
||||
// The note in `hasExpired` does not apply here, since the bug was fixed before this feature was added.
|
||||
return validFromDate.after(getStartOfToday().getTime());
|
||||
}
|
||||
|
||||
static public Boolean hasExpired(Date expiryDate) {
|
||||
// Note: In #1083 it was discovered that `DatePickerFragment` may sometimes store the expiryDate
|
||||
// at 12:00 PM instead of 12:00 AM in the DB. While this has been fixed and the 12-hour difference
|
||||
// is not a problem for the way the comparison currently works, it's good to keep in mind such
|
||||
// dates may exist in the DB in case the comparison changes in the future and the new one relies
|
||||
// on both dates being set at 12:00 AM.
|
||||
return expiryDate.before(getStartOfToday().getTime());
|
||||
}
|
||||
|
||||
static private Calendar getStartOfToday() {
|
||||
// today
|
||||
Calendar date = new GregorianCalendar();
|
||||
// reset hour, minutes, seconds and millis
|
||||
@@ -204,8 +255,7 @@ public class Utils {
|
||||
date.set(Calendar.MINUTE, 0);
|
||||
date.set(Calendar.SECOND, 0);
|
||||
date.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
return expiryDate.before(date.getTime());
|
||||
return date;
|
||||
}
|
||||
|
||||
static public String formatBalance(Context context, BigDecimal value, Currency currency) {
|
||||
@@ -396,8 +446,7 @@ public class Utils {
|
||||
Resources res = context.getResources();
|
||||
Configuration configuration = res.getConfiguration();
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
|
||||
configuration.locale = chosenLocale != null ? chosenLocale : Locale.getDefault();
|
||||
res.updateConfiguration(configuration, res.getDisplayMetrics());
|
||||
setLocalesSdkLessThan24(chosenLocale, configuration, res);
|
||||
return context;
|
||||
}
|
||||
|
||||
@@ -407,6 +456,12 @@ public class Utils {
|
||||
return context.createConfigurationContext(configuration);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static void setLocalesSdkLessThan24(Locale chosenLocale, Configuration configuration, Resources res) {
|
||||
configuration.locale = chosenLocale != null ? chosenLocale : Locale.getDefault();
|
||||
res.updateConfiguration(configuration, res.getDisplayMetrics());
|
||||
}
|
||||
|
||||
static public long getUnixTime() {
|
||||
return System.currentTimeMillis() / 1000;
|
||||
}
|
||||
@@ -488,7 +543,7 @@ public class Utils {
|
||||
} else {
|
||||
// final catch all in case of invalid theme value from older versions
|
||||
// also handles R.string.settings_key_system_theme
|
||||
DynamicColors.applyIfAvailable(activity);
|
||||
DynamicColors.applyToActivityIfAvailable(activity);
|
||||
}
|
||||
|
||||
if (isDarkModeEnabled(activity) && settings.getOledDark()) {
|
||||
@@ -505,22 +560,12 @@ public class Utils {
|
||||
activity.findViewById(android.R.id.content).setBackgroundColor(typedValue.data);
|
||||
}
|
||||
|
||||
public static void updateMenuCardDetailsButtonState(MenuItem item, boolean currentlyExpanded) {
|
||||
if (currentlyExpanded) {
|
||||
item.setIcon(R.drawable.ic_baseline_unfold_less_24);
|
||||
item.setTitle(R.string.action_hide_details);
|
||||
} else {
|
||||
item.setIcon(R.drawable.ic_baseline_unfold_more_24);
|
||||
item.setTitle(R.string.action_show_details);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getHeaderColorFromImage(Bitmap image, int fallback) {
|
||||
if (image == null) {
|
||||
return fallback;
|
||||
}
|
||||
|
||||
return new Palette.Builder(image).generate().getDominantColor(R.attr.colorPrimary);
|
||||
return new Palette.Builder(image).generate().getDominantColor(androidx.appcompat.R.attr.colorPrimary);
|
||||
}
|
||||
|
||||
public static int getRandomHeaderColor(Context context) {
|
||||
@@ -528,4 +573,61 @@ public class Utils {
|
||||
final int color = (int) (Math.random() * colors.length());
|
||||
return colors.getColor(color, Color.BLACK);
|
||||
}
|
||||
|
||||
public static String readTextFile(Context context, @RawRes int resourceId) throws IOException {
|
||||
InputStream input = context.getResources().openRawResource(resourceId);
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
|
||||
StringBuilder result = new StringBuilder();
|
||||
while (true) {
|
||||
String nextLine = reader.readLine();
|
||||
|
||||
if (nextLine == null || nextLine.isEmpty()) {
|
||||
reader.close();
|
||||
break;
|
||||
}
|
||||
|
||||
result.append("\n");
|
||||
result.append(nextLine);
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static void setIconOrTextWithBackground(Context context, LoyaltyCard loyaltyCard, Bitmap icon, ImageView backgroundOrIcon, TextView textWhenNoImage) {
|
||||
if (icon != null) {
|
||||
Log.d("onResume", "setting icon image");
|
||||
textWhenNoImage.setVisibility(View.GONE);
|
||||
|
||||
backgroundOrIcon.setImageBitmap(icon);
|
||||
backgroundOrIcon.setBackgroundColor(Color.TRANSPARENT);
|
||||
} else {
|
||||
textWhenNoImage.setVisibility(View.VISIBLE);
|
||||
|
||||
int headerColor = getHeaderColor(context, loyaltyCard);
|
||||
|
||||
backgroundOrIcon.setImageBitmap(null);
|
||||
backgroundOrIcon.setBackgroundColor(headerColor);
|
||||
textWhenNoImage.setText(loyaltyCard.store);
|
||||
textWhenNoImage.setTextColor(Utils.needsDarkForeground(headerColor) ? Color.BLACK : Color.WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean installedFromGooglePlay(Context context) {
|
||||
try {
|
||||
String packageName = context.getPackageName();
|
||||
String installer;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
installer = context.getPackageManager().getInstallSourceInfo(packageName).getInstallingPackageName();
|
||||
} else {
|
||||
installer = context.getPackageManager().getInstallerPackageName(packageName);
|
||||
}
|
||||
return installer.equals("com.android.vending");
|
||||
} catch (Throwable ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static int getHeaderColor(Context context, LoyaltyCard loyaltyCard) {
|
||||
return loyaltyCard.headerColor != null ? loyaltyCard.headerColor : LetterBitmap.getDefaultColor(context, loyaltyCard.store);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,15 @@ import java.io.Reader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class ZipUtils {
|
||||
static public String read(ZipInputStream zipInputStream) throws IOException {
|
||||
public static Bitmap readImage(ZipInputStream zipInputStream) {
|
||||
return BitmapFactory.decodeStream(zipInputStream);
|
||||
}
|
||||
|
||||
public static JSONObject readJSON(ZipInputStream zipInputStream) throws IOException, JSONException {
|
||||
return new JSONObject(read(zipInputStream));
|
||||
}
|
||||
|
||||
private static String read(ZipInputStream zipInputStream) throws IOException {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
Reader reader = new BufferedReader(new InputStreamReader(zipInputStream, StandardCharsets.UTF_8));
|
||||
int c;
|
||||
@@ -24,12 +32,4 @@ public class ZipUtils {
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
static public Bitmap readImage(ZipInputStream zipInputStream) {
|
||||
return BitmapFactory.decodeStream(zipInputStream);
|
||||
}
|
||||
|
||||
static public JSONObject readJSON(ZipInputStream zipInputStream) throws IOException, JSONException {
|
||||
return new JSONObject(read(zipInputStream));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
package protect.card_locker.contentprovider;
|
||||
|
||||
import static protect.card_locker.DBHelper.LoyaltyCardDbIds;
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.content.UriMatcher;
|
||||
import android.database.Cursor;
|
||||
import android.database.MatrixCursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import protect.card_locker.BuildConfig;
|
||||
import protect.card_locker.DBHelper;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
|
||||
public class CardsContentProvider extends ContentProvider {
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".contentprovider.cards";
|
||||
|
||||
public static class Version {
|
||||
public static final String MAJOR_COLUMN = "major";
|
||||
public static final String MINOR_COLUMN = "minor";
|
||||
public static final int MAJOR = 1;
|
||||
public static final int MINOR = 0;
|
||||
}
|
||||
|
||||
private static final int URI_VERSION = 0;
|
||||
private static final int URI_CARDS = 1;
|
||||
private static final int URI_GROUPS = 2;
|
||||
private static final int URI_CARD_GROUPS = 3;
|
||||
|
||||
private static final String[] CARDS_DEFAULT_PROJECTION = new String[]{
|
||||
LoyaltyCardDbIds.ID,
|
||||
LoyaltyCardDbIds.STORE,
|
||||
LoyaltyCardDbIds.VALID_FROM,
|
||||
LoyaltyCardDbIds.EXPIRY,
|
||||
LoyaltyCardDbIds.BALANCE,
|
||||
LoyaltyCardDbIds.BALANCE_TYPE,
|
||||
LoyaltyCardDbIds.NOTE,
|
||||
LoyaltyCardDbIds.HEADER_COLOR,
|
||||
LoyaltyCardDbIds.CARD_ID,
|
||||
LoyaltyCardDbIds.BARCODE_ID,
|
||||
LoyaltyCardDbIds.BARCODE_TYPE,
|
||||
LoyaltyCardDbIds.STAR_STATUS,
|
||||
LoyaltyCardDbIds.LAST_USED,
|
||||
LoyaltyCardDbIds.ARCHIVE_STATUS,
|
||||
};
|
||||
|
||||
private static final UriMatcher uriMatcher = new UriMatcher(UriMatcher.NO_MATCH) {{
|
||||
addURI(AUTHORITY, "version", URI_VERSION);
|
||||
addURI(AUTHORITY, "cards", URI_CARDS);
|
||||
addURI(AUTHORITY, "groups", URI_GROUPS);
|
||||
addURI(AUTHORITY, "card_groups", URI_CARD_GROUPS);
|
||||
}};
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Cursor query(@NonNull final Uri uri,
|
||||
@Nullable final String[] projection,
|
||||
@Nullable final String selection,
|
||||
@Nullable final String[] selectionArgs,
|
||||
@Nullable final String sortOrder) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
// Disable the content provider on SDK < 23 since it grants dangerous
|
||||
// permissions at install-time
|
||||
Log.w(TAG, "Content provider read is only available for SDK >= 23");
|
||||
return null;
|
||||
}
|
||||
|
||||
final Settings settings = new Settings(getContext());
|
||||
if (!settings.getAllowContentProviderRead()) {
|
||||
Log.w(TAG, "Content provider read is disabled");
|
||||
return null;
|
||||
}
|
||||
|
||||
final String table;
|
||||
String[] updatedProjection = projection;
|
||||
|
||||
switch (uriMatcher.match(uri)) {
|
||||
case URI_VERSION:
|
||||
return queryVersion();
|
||||
case URI_CARDS:
|
||||
table = DBHelper.LoyaltyCardDbIds.TABLE;
|
||||
// Restrict columns to the default projection (omit internal columns such as zoom level)
|
||||
if (projection == null) {
|
||||
updatedProjection = CARDS_DEFAULT_PROJECTION;
|
||||
} else {
|
||||
final Set<String> defaultProjection = new HashSet<>(Arrays.asList(CARDS_DEFAULT_PROJECTION));
|
||||
updatedProjection = Arrays.stream(projection).filter(defaultProjection::contains).toArray(String[]::new);
|
||||
}
|
||||
break;
|
||||
case URI_GROUPS:
|
||||
table = DBHelper.LoyaltyCardDbGroups.TABLE;
|
||||
break;
|
||||
case URI_CARD_GROUPS:
|
||||
table = DBHelper.LoyaltyCardDbIdsGroups.TABLE;
|
||||
break;
|
||||
default:
|
||||
Log.w(TAG, "Unrecognized URI " + uri);
|
||||
return null;
|
||||
}
|
||||
|
||||
final DBHelper dbHelper = new DBHelper(getContext());
|
||||
final SQLiteDatabase database = dbHelper.getReadableDatabase();
|
||||
|
||||
return database.query(
|
||||
table,
|
||||
updatedProjection,
|
||||
selection,
|
||||
selectionArgs,
|
||||
null,
|
||||
null,
|
||||
sortOrder
|
||||
);
|
||||
}
|
||||
|
||||
private Cursor queryVersion() {
|
||||
final String[] columns = new String[]{Version.MAJOR_COLUMN, Version.MINOR_COLUMN};
|
||||
final MatrixCursor matrixCursor = new MatrixCursor(columns);
|
||||
matrixCursor.addRow(new Object[]{Version.MAJOR, Version.MINOR});
|
||||
|
||||
return matrixCursor;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getType(@NonNull final Uri uri) {
|
||||
// MIME types are not relevant (for now at least)
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Uri insert(@NonNull final Uri uri,
|
||||
@Nullable final ContentValues values) {
|
||||
// This content provider is read-only for now, so we always return null
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(@NonNull final Uri uri,
|
||||
@Nullable final String selection,
|
||||
@Nullable final String[] selectionArgs) {
|
||||
// This content provider is read-only for now, so we always return 0
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(@NonNull final Uri uri,
|
||||
@Nullable final ContentValues values,
|
||||
@Nullable final String selection,
|
||||
@Nullable final String[] selectionArgs) {
|
||||
// This content provider is read-only for now, so we always return 0
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -8,22 +8,14 @@ public class CSVHelpers {
|
||||
/**
|
||||
* Extract a string from the items array. The index into the array
|
||||
* is determined by looking up the index in the fields map using the
|
||||
* "key" as the key. If no such key exists, defaultValue is returned
|
||||
* if it is not null. Otherwise, a FormatException is thrown.
|
||||
* "key" as the key. If no such key exists, defaultValue is returned.
|
||||
*/
|
||||
static String extractString(String key, CSVRecord record, String defaultValue)
|
||||
throws FormatException {
|
||||
String toReturn = defaultValue;
|
||||
|
||||
static String extractString(String key, CSVRecord record, String defaultValue) {
|
||||
if (record.isMapped(key)) {
|
||||
toReturn = record.get(key);
|
||||
} else {
|
||||
if (defaultValue == null) {
|
||||
throw new FormatException("Field not used but expected: " + key);
|
||||
}
|
||||
return record.get(key);
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,15 +24,15 @@ public class CSVHelpers {
|
||||
* "key" as the key. If no such key exists, or the data is not a valid
|
||||
* int, a FormatException is thrown.
|
||||
*/
|
||||
static Integer extractInt(String key, CSVRecord record, boolean nullIsOk)
|
||||
static Integer extractInt(String key, CSVRecord record)
|
||||
throws FormatException {
|
||||
if (record.isMapped(key) == false) {
|
||||
if (!record.isMapped(key)) {
|
||||
throw new FormatException("Field not used but expected: " + key);
|
||||
}
|
||||
|
||||
String value = record.get(key);
|
||||
if (value.isEmpty() && nullIsOk) {
|
||||
return null;
|
||||
if (value.isEmpty()) {
|
||||
throw new FormatException("Field is empty: " + key);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -56,15 +48,15 @@ public class CSVHelpers {
|
||||
* "key" as the key. If no such key exists, or the data is not a valid
|
||||
* int, a FormatException is thrown.
|
||||
*/
|
||||
static Long extractLong(String key, CSVRecord record, boolean nullIsOk)
|
||||
static Long extractLong(String key, CSVRecord record)
|
||||
throws FormatException {
|
||||
if (record.isMapped(key) == false) {
|
||||
if (!record.isMapped(key)) {
|
||||
throw new FormatException("Field not used but expected: " + key);
|
||||
}
|
||||
|
||||
String value = record.get(key);
|
||||
if (value.isEmpty() && nullIsOk) {
|
||||
return null;
|
||||
if (value.isEmpty()) {
|
||||
throw new FormatException("Field is empty: " + key);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -127,6 +127,7 @@ public class CatimaExporter implements Exporter {
|
||||
printer.printRecord(DBHelper.LoyaltyCardDbIds.ID,
|
||||
DBHelper.LoyaltyCardDbIds.STORE,
|
||||
DBHelper.LoyaltyCardDbIds.NOTE,
|
||||
DBHelper.LoyaltyCardDbIds.VALID_FROM,
|
||||
DBHelper.LoyaltyCardDbIds.EXPIRY,
|
||||
DBHelper.LoyaltyCardDbIds.BALANCE,
|
||||
DBHelper.LoyaltyCardDbIds.BALANCE_TYPE,
|
||||
@@ -146,6 +147,7 @@ public class CatimaExporter implements Exporter {
|
||||
printer.printRecord(card.id,
|
||||
card.store,
|
||||
card.note,
|
||||
card.validFrom != null ? card.validFrom.getTime() : "",
|
||||
card.expiry != null ? card.expiry.getTime() : "",
|
||||
card.balance,
|
||||
card.balanceType,
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.apache.commons.csv.CSVRecord;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
@@ -55,7 +54,7 @@ public class CatimaImporter implements Importer {
|
||||
|
||||
String fileName = Uri.parse(localFileHeader.getFileName()).getLastPathSegment();
|
||||
if (fileName.equals("catima.csv")) {
|
||||
importCSV(context, database, new ByteArrayInputStream(ZipUtils.read(zipInputStream).getBytes(StandardCharsets.UTF_8)));
|
||||
importCSV(context, database, zipInputStream);
|
||||
} else if (fileName.endsWith(".png")) {
|
||||
Utils.saveCardImage(context, ZipUtils.readImage(zipInputStream), fileName);
|
||||
} else {
|
||||
@@ -68,26 +67,17 @@ public class CatimaImporter implements Importer {
|
||||
bufferedInputStream.reset();
|
||||
importCSV(context, database, bufferedInputStream);
|
||||
}
|
||||
|
||||
input.close();
|
||||
}
|
||||
|
||||
public void importCSV(Context context, SQLiteDatabase database, InputStream input) throws IOException, FormatException, InterruptedException {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
|
||||
|
||||
bufferedReader.mark(100);
|
||||
|
||||
Integer version = 1;
|
||||
|
||||
try {
|
||||
version = Integer.parseInt(bufferedReader.readLine());
|
||||
} catch (NumberFormatException _e) {
|
||||
// Assume version 1
|
||||
}
|
||||
|
||||
bufferedReader.reset();
|
||||
|
||||
int version = parseVersion(bufferedReader);
|
||||
switch (version) {
|
||||
case 1:
|
||||
parseV1(context, database, bufferedReader);
|
||||
parseV1(database, bufferedReader);
|
||||
break;
|
||||
case 2:
|
||||
parseV2(context, database, bufferedReader);
|
||||
@@ -95,16 +85,14 @@ public class CatimaImporter implements Importer {
|
||||
default:
|
||||
throw new FormatException(String.format("No code to parse version %s", version));
|
||||
}
|
||||
|
||||
bufferedReader.close();
|
||||
}
|
||||
|
||||
public void parseV1(Context context, SQLiteDatabase database, BufferedReader input) throws IOException, FormatException, InterruptedException {
|
||||
public void parseV1(SQLiteDatabase database, BufferedReader input) throws IOException, FormatException, InterruptedException {
|
||||
final CSVParser parser = new CSVParser(input, CSVFormat.RFC4180.builder().setHeader().build());
|
||||
|
||||
try {
|
||||
for (CSVRecord record : parser) {
|
||||
importLoyaltyCard(context, database, record);
|
||||
importLoyaltyCard(database, record);
|
||||
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
throw new InterruptedException();
|
||||
@@ -118,8 +106,8 @@ public class CatimaImporter implements Importer {
|
||||
}
|
||||
|
||||
public void parseV2(Context context, SQLiteDatabase database, BufferedReader input) throws IOException, FormatException, InterruptedException {
|
||||
Integer part = 0;
|
||||
String stringPart = "";
|
||||
int part = 0;
|
||||
StringBuilder stringPart = new StringBuilder();
|
||||
|
||||
try {
|
||||
while (true) {
|
||||
@@ -135,7 +123,7 @@ public class CatimaImporter implements Importer {
|
||||
break;
|
||||
case 1:
|
||||
try {
|
||||
parseV2Groups(database, stringPart);
|
||||
parseV2Groups(database, stringPart.toString());
|
||||
sectionParsed = true;
|
||||
} catch (FormatException e) {
|
||||
// We may have a multiline field, try again
|
||||
@@ -143,7 +131,7 @@ public class CatimaImporter implements Importer {
|
||||
break;
|
||||
case 2:
|
||||
try {
|
||||
parseV2Cards(context, database, stringPart);
|
||||
parseV2Cards(context, database, stringPart.toString());
|
||||
sectionParsed = true;
|
||||
} catch (FormatException e) {
|
||||
// We may have a multiline field, try again
|
||||
@@ -151,7 +139,7 @@ public class CatimaImporter implements Importer {
|
||||
break;
|
||||
case 3:
|
||||
try {
|
||||
parseV2CardGroups(database, stringPart);
|
||||
parseV2CardGroups(database, stringPart.toString());
|
||||
sectionParsed = true;
|
||||
} catch (FormatException e) {
|
||||
// We may have a multiline field, try again
|
||||
@@ -167,12 +155,12 @@ public class CatimaImporter implements Importer {
|
||||
|
||||
if (sectionParsed) {
|
||||
part += 1;
|
||||
stringPart = "";
|
||||
stringPart = new StringBuilder();
|
||||
} else {
|
||||
stringPart += tmp + "\n";
|
||||
stringPart.append(tmp).append('\n');
|
||||
}
|
||||
} else {
|
||||
stringPart += tmp + "\n";
|
||||
stringPart.append(tmp).append('\n');
|
||||
}
|
||||
}
|
||||
} catch (FormatException e) {
|
||||
@@ -226,7 +214,7 @@ public class CatimaImporter implements Importer {
|
||||
}
|
||||
|
||||
for (CSVRecord record : records) {
|
||||
importLoyaltyCard(context, database, record);
|
||||
importLoyaltyCard(database, record);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,13 +243,42 @@ public class CatimaImporter implements Importer {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the version number of the import file
|
||||
*
|
||||
* @param reader the reader containing the import file
|
||||
* @return the parsed version number, defaulting to 1 if none is found
|
||||
* @throws IOException there was a problem reading the file
|
||||
*/
|
||||
private int parseVersion(BufferedReader reader) throws IOException {
|
||||
reader.mark(10); // slightly over the search limit just to be sure
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int searchLimit = 5; // gives you version numbers up to 99999
|
||||
int codePoint;
|
||||
// search until the next whitespace, indicating the end of the version
|
||||
while (!Character.isWhitespace(codePoint = reader.read())) {
|
||||
// we found something that isn't a digit, or we ran out of chars
|
||||
if (!Character.isDigit(codePoint) || searchLimit <= 0) {
|
||||
reader.reset();
|
||||
return 1; // default value
|
||||
}
|
||||
sb.append((char) codePoint);
|
||||
searchLimit--;
|
||||
}
|
||||
reader.reset();
|
||||
if (sb.length() == 0) {
|
||||
return 1;
|
||||
}
|
||||
return Integer.parseInt(sb.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a single loyalty card into the database using the given
|
||||
* session.
|
||||
*/
|
||||
private void importLoyaltyCard(Context context, SQLiteDatabase database, CSVRecord record)
|
||||
throws IOException, FormatException {
|
||||
int id = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIds.ID, record, false);
|
||||
private void importLoyaltyCard(SQLiteDatabase database, CSVRecord record)
|
||||
throws FormatException {
|
||||
int id = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIds.ID, record);
|
||||
|
||||
String store = CSVHelpers.extractString(DBHelper.LoyaltyCardDbIds.STORE, record, "");
|
||||
if (store.isEmpty()) {
|
||||
@@ -269,19 +286,38 @@ public class CatimaImporter implements Importer {
|
||||
}
|
||||
|
||||
String note = CSVHelpers.extractString(DBHelper.LoyaltyCardDbIds.NOTE, record, "");
|
||||
Date expiry = null;
|
||||
|
||||
Date validFrom = null;
|
||||
Long validFromLong;
|
||||
try {
|
||||
expiry = new Date(CSVHelpers.extractLong(DBHelper.LoyaltyCardDbIds.EXPIRY, record, true));
|
||||
} catch (NullPointerException | FormatException e) {
|
||||
validFromLong = CSVHelpers.extractLong(DBHelper.LoyaltyCardDbIds.VALID_FROM, record);
|
||||
} catch (FormatException ignored) {
|
||||
validFromLong = null;
|
||||
}
|
||||
if (validFromLong != null) {
|
||||
validFrom = new Date(validFromLong);
|
||||
}
|
||||
|
||||
BigDecimal balance;
|
||||
Date expiry = null;
|
||||
Long expiryLong;
|
||||
try {
|
||||
balance = new BigDecimal(CSVHelpers.extractString(DBHelper.LoyaltyCardDbIds.BALANCE, record, null));
|
||||
} catch (FormatException _e) {
|
||||
// These fields did not exist in versions 1.8.1 and before
|
||||
// We catch this exception so we can still import old backups
|
||||
balance = new BigDecimal("0");
|
||||
expiryLong = CSVHelpers.extractLong(DBHelper.LoyaltyCardDbIds.EXPIRY, record);
|
||||
} catch (FormatException ignored) {
|
||||
expiryLong = null;
|
||||
}
|
||||
if (expiryLong != null) {
|
||||
expiry = new Date(expiryLong);
|
||||
}
|
||||
|
||||
// These fields did not exist in versions 1.8.1 and before
|
||||
// We default to 0 so we can still import old backups
|
||||
BigDecimal balance = new BigDecimal("0");
|
||||
String balanceString = CSVHelpers.extractString(DBHelper.LoyaltyCardDbIds.BALANCE, record, null);
|
||||
if (balanceString != null) {
|
||||
try {
|
||||
balance = new BigDecimal(CSVHelpers.extractString(DBHelper.LoyaltyCardDbIds.BALANCE, record, null));
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
Currency balanceType = null;
|
||||
@@ -307,14 +343,14 @@ public class CatimaImporter implements Importer {
|
||||
}
|
||||
|
||||
Integer headerColor = null;
|
||||
|
||||
if (record.isMapped(DBHelper.LoyaltyCardDbIds.HEADER_COLOR)) {
|
||||
headerColor = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIds.HEADER_COLOR, record, true);
|
||||
try {
|
||||
headerColor = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIds.HEADER_COLOR, record);
|
||||
} catch (FormatException ignored) {
|
||||
}
|
||||
|
||||
int starStatus = 0;
|
||||
try {
|
||||
starStatus = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIds.STAR_STATUS, record, false);
|
||||
starStatus = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIds.STAR_STATUS, record);
|
||||
} catch (FormatException _e) {
|
||||
// This field did not exist in versions 0.28 and before
|
||||
// We catch this exception so we can still import old backups
|
||||
@@ -323,7 +359,7 @@ public class CatimaImporter implements Importer {
|
||||
|
||||
int archiveStatus = 0;
|
||||
try {
|
||||
archiveStatus = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIds.ARCHIVE_STATUS, record, false);
|
||||
archiveStatus = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIds.ARCHIVE_STATUS, record);
|
||||
} catch (FormatException _e) {
|
||||
// This field did not exist in versions 2.16.3 and before
|
||||
// We catch this exception so we can still import old backups
|
||||
@@ -332,13 +368,13 @@ public class CatimaImporter implements Importer {
|
||||
|
||||
Long lastUsed = 0L;
|
||||
try {
|
||||
lastUsed = CSVHelpers.extractLong(DBHelper.LoyaltyCardDbIds.LAST_USED, record, false);
|
||||
lastUsed = CSVHelpers.extractLong(DBHelper.LoyaltyCardDbIds.LAST_USED, record);
|
||||
} catch (FormatException _e) {
|
||||
// This field did not exist in versions 2.5.0 and before
|
||||
// We catch this exception so we can still import old backups
|
||||
}
|
||||
|
||||
DBHelper.insertLoyaltyCard(database, id, store, note, expiry, balance, balanceType, cardId, barcodeId, barcodeType, headerColor, starStatus, lastUsed,archiveStatus);
|
||||
DBHelper.insertLoyaltyCard(database, id, store, note, validFrom, expiry, balance, balanceType, cardId, barcodeId, barcodeType, headerColor, starStatus, lastUsed, archiveStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -348,6 +384,10 @@ public class CatimaImporter implements Importer {
|
||||
private void importGroup(SQLiteDatabase database, CSVRecord record) throws FormatException {
|
||||
String id = CSVHelpers.extractString(DBHelper.LoyaltyCardDbGroups.ID, record, null);
|
||||
|
||||
if (id == null) {
|
||||
throw new FormatException("Group has no ID: " + record);
|
||||
}
|
||||
|
||||
DBHelper.insertGroup(database, id);
|
||||
}
|
||||
|
||||
@@ -356,11 +396,15 @@ public class CatimaImporter implements Importer {
|
||||
* session.
|
||||
*/
|
||||
private void importCardGroupMapping(SQLiteDatabase database, CSVRecord record) throws FormatException {
|
||||
Integer cardId = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIdsGroups.cardID, record, false);
|
||||
int cardId = CSVHelpers.extractInt(DBHelper.LoyaltyCardDbIdsGroups.cardID, record);
|
||||
String groupId = CSVHelpers.extractString(DBHelper.LoyaltyCardDbIdsGroups.groupID, record, null);
|
||||
|
||||
if (groupId == null) {
|
||||
throw new FormatException("Group has no ID: " + record);
|
||||
}
|
||||
|
||||
List<Group> cardGroups = DBHelper.getLoyaltyCardGroups(database, cardId);
|
||||
cardGroups.add(DBHelper.getGroup(database, groupId));
|
||||
DBHelper.setLoyaltyCardGroups(database, cardId, cardGroups);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,6 @@ public class FidmeImporter implements Importer {
|
||||
|
||||
// TODO: Front and back image
|
||||
|
||||
DBHelper.insertLoyaltyCard(database, store, note, null, BigDecimal.valueOf(0), null, cardId, null, barcodeType, headerColor, starStatus, null,archiveStatus);
|
||||
DBHelper.insertLoyaltyCard(database, store, note, null, null, BigDecimal.valueOf(0), null, cardId, null, barcodeType, headerColor, starStatus, null,archiveStatus);
|
||||
}
|
||||
}
|
||||
@@ -74,29 +74,31 @@ public class StocardImporter implements Importer {
|
||||
String fileName = localFileHeader.getFileName();
|
||||
String[] nameParts = fileName.split("/");
|
||||
|
||||
if (nameParts.length < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (providersFileName == null) {
|
||||
providersFileName = new String[]{
|
||||
nameParts[0],
|
||||
"sync",
|
||||
"data",
|
||||
"extracts",
|
||||
nameParts[1],
|
||||
"users",
|
||||
nameParts[0],
|
||||
"analytics-properties.json"
|
||||
nameParts[1],
|
||||
"analytics-properties",
|
||||
"content.json"
|
||||
};
|
||||
customProvidersBaseName = new String[]{
|
||||
nameParts[0],
|
||||
"sync",
|
||||
"data",
|
||||
"extracts",
|
||||
nameParts[1],
|
||||
"users",
|
||||
nameParts[0],
|
||||
nameParts[1],
|
||||
"loyalty-card-custom-providers"
|
||||
};
|
||||
cardBaseName = new String[]{
|
||||
nameParts[0],
|
||||
"sync",
|
||||
"data",
|
||||
"extracts",
|
||||
nameParts[1],
|
||||
"users",
|
||||
nameParts[0],
|
||||
nameParts[1],
|
||||
"loyalty-cards"
|
||||
};
|
||||
}
|
||||
@@ -106,18 +108,15 @@ public class StocardImporter implements Importer {
|
||||
customProviderId = nameParts[customProvidersBaseName.length].split("\\.", 2)[0];
|
||||
|
||||
// Name file
|
||||
if (nameParts.length == customProvidersBaseName.length + 1) {
|
||||
// Ignore the .txt file
|
||||
if (fileName.endsWith(".json")) {
|
||||
JSONObject jsonObject = ZipUtils.readJSON(zipInputStream);
|
||||
if (fileName.endsWith(customProviderId + "/content.json")) {
|
||||
JSONObject jsonObject = ZipUtils.readJSON(zipInputStream);
|
||||
|
||||
providers = appendToHashMap(
|
||||
providers,
|
||||
customProviderId,
|
||||
"name",
|
||||
jsonObject.getString("name")
|
||||
);
|
||||
}
|
||||
providers = appendToHashMap(
|
||||
providers,
|
||||
customProviderId,
|
||||
"name",
|
||||
jsonObject.getString("name")
|
||||
);
|
||||
} else if (fileName.endsWith("logo.png")) {
|
||||
providers = appendToHashMap(
|
||||
providers,
|
||||
@@ -133,46 +132,43 @@ public class StocardImporter implements Importer {
|
||||
cardName = nameParts[cardBaseName.length].split("\\.", 2)[0];
|
||||
|
||||
// This is the card itself
|
||||
if (nameParts.length == cardBaseName.length + 1) {
|
||||
// Ignore the .txt file
|
||||
if (fileName.endsWith(".json")) {
|
||||
JSONObject jsonObject = ZipUtils.readJSON(zipInputStream);
|
||||
if (fileName.endsWith(cardName + "/content.json")) {
|
||||
JSONObject jsonObject = ZipUtils.readJSON(zipInputStream);
|
||||
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"cardId",
|
||||
jsonObject.getString("input_id")
|
||||
);
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"cardId",
|
||||
jsonObject.getString("input_id")
|
||||
);
|
||||
|
||||
// Provider ID can be either custom or not, extract whatever version is relevant
|
||||
String customProviderPrefix = "/users/" + nameParts[0] + "/loyalty-card-custom-providers/";
|
||||
String providerId = jsonObject
|
||||
.getJSONObject("input_provider_reference")
|
||||
.getString("identifier");
|
||||
if (providerId.startsWith(customProviderPrefix)) {
|
||||
providerId = providerId.substring(customProviderPrefix.length());
|
||||
} else {
|
||||
providerId = providerId.substring("/loyalty-card-providers/".length());
|
||||
}
|
||||
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"_providerId",
|
||||
providerId
|
||||
);
|
||||
|
||||
if (jsonObject.has("input_barcode_format")) {
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"barcodeType",
|
||||
jsonObject.getString("input_barcode_format")
|
||||
);
|
||||
}
|
||||
// Provider ID can be either custom or not, extract whatever version is relevant
|
||||
String customProviderPrefix = "/users/" + nameParts[1] + "/loyalty-card-custom-providers/";
|
||||
String providerId = jsonObject
|
||||
.getJSONObject("input_provider_reference")
|
||||
.getString("identifier");
|
||||
if (providerId.startsWith(customProviderPrefix)) {
|
||||
providerId = providerId.substring(customProviderPrefix.length());
|
||||
} else {
|
||||
providerId = providerId.substring("/loyalty-card-providers/".length());
|
||||
}
|
||||
} else if (fileName.endsWith("notes/default.json")) {
|
||||
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"_providerId",
|
||||
providerId
|
||||
);
|
||||
|
||||
if (jsonObject.has("input_barcode_format")) {
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"barcodeType",
|
||||
jsonObject.getString("input_barcode_format")
|
||||
);
|
||||
}
|
||||
} else if (fileName.endsWith("notes/default/content.json")) {
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
@@ -234,7 +230,7 @@ public class StocardImporter implements Importer {
|
||||
headerColor = Utils.getHeaderColorFromImage(cardIcon, headerColor);
|
||||
}
|
||||
|
||||
long loyaltyCardInternalId = DBHelper.insertLoyaltyCard(database, store, note, null, BigDecimal.valueOf(0), null, cardId, null, barcodeType, headerColor, 0, null,0);
|
||||
long loyaltyCardInternalId = DBHelper.insertLoyaltyCard(database, store, note, null, null, BigDecimal.valueOf(0), null, cardId, null, barcodeType, headerColor, 0, null,0);
|
||||
|
||||
if (cardIcon != null) {
|
||||
Utils.saveCardImage(context, cardIcon, (int) loyaltyCardInternalId, ImageLocationType.icon);
|
||||
|
||||
@@ -126,7 +126,7 @@ public class VoucherVaultImporter implements Importer {
|
||||
throw new FormatException("Unknown colour type found: " + colorFromJSON);
|
||||
}
|
||||
|
||||
DBHelper.insertLoyaltyCard(database, store, "", expiry, balance, balanceType, cardId, null, barcodeType, headerColor, 0, Utils.getUnixTime(),0);
|
||||
DBHelper.insertLoyaltyCard(database, store, "", null, expiry, balance, balanceType, cardId, null, barcodeType, headerColor, 0, Utils.getUnixTime(),0);
|
||||
}
|
||||
|
||||
bufferedReader.close();
|
||||
|
||||
@@ -63,30 +63,6 @@ public class Settings {
|
||||
return AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
|
||||
}
|
||||
|
||||
public double getFontSizeScale() {
|
||||
return getInt(R.string.settings_key_max_font_size_scale, R.integer.settings_max_font_size_scale_pct) / 100.0;
|
||||
}
|
||||
|
||||
public int getSmallFont() {
|
||||
return 14;
|
||||
}
|
||||
|
||||
public int getMediumFont() {
|
||||
return 28;
|
||||
}
|
||||
|
||||
public int getLargeFont() {
|
||||
return 40;
|
||||
}
|
||||
|
||||
public int getFontSizeMin(int fontSize) {
|
||||
return (int) (Math.round(fontSize / 2.0) - 1);
|
||||
}
|
||||
|
||||
public int getFontSizeMax(int fontSize) {
|
||||
return (int) Math.round(fontSize * getFontSizeScale());
|
||||
}
|
||||
|
||||
public boolean useMaxBrightnessDisplayingBarcode() {
|
||||
return getBoolean(R.string.settings_key_display_barcode_max_brightness, true);
|
||||
}
|
||||
@@ -103,6 +79,10 @@ public class Settings {
|
||||
return getBoolean(R.string.settings_key_disable_lockscreen_while_viewing_card, true);
|
||||
}
|
||||
|
||||
public boolean getAllowContentProviderRead() {
|
||||
return getBoolean(R.string.settings_key_allow_content_provider_read, true);
|
||||
}
|
||||
|
||||
public boolean getOledDark() {
|
||||
return getBoolean(R.string.settings_key_oled_dark, false);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package protect.card_locker.preferences;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
|
||||
@@ -13,36 +14,33 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import nl.invissvenska.numberpickerpreference.NumberDialogPreference;
|
||||
import nl.invissvenska.numberpickerpreference.NumberPickerPreferenceDialogFragment;
|
||||
|
||||
import protect.card_locker.CatimaAppCompatActivity;
|
||||
import protect.card_locker.MainActivity;
|
||||
import protect.card_locker.R;
|
||||
import protect.card_locker.Utils;
|
||||
import protect.card_locker.databinding.SettingsActivityBinding;
|
||||
|
||||
public class SettingsActivity extends CatimaAppCompatActivity {
|
||||
|
||||
private SettingsActivityBinding binding;
|
||||
private final static String RELOAD_MAIN_STATE = "mReloadMain";
|
||||
private SettingsFragment fragment;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = SettingsActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.settings);
|
||||
setContentView(R.layout.settings_activity);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setContentView(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
enableToolbarBackButton();
|
||||
|
||||
// Display the fragment as the main content.
|
||||
fragment = new SettingsFragment();
|
||||
@@ -100,23 +98,8 @@ public class SettingsActivity extends CatimaAppCompatActivity {
|
||||
// Load the preferences from an XML resource
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
|
||||
// Show pretty names
|
||||
ListPreference localePreference = findPreference(getResources().getString(R.string.settings_key_locale));
|
||||
assert localePreference != null;
|
||||
CharSequence[] entryValues = localePreference.getEntryValues();
|
||||
List<CharSequence> entries = new ArrayList<>();
|
||||
for (CharSequence entry : entryValues) {
|
||||
if (entry.length() == 0) {
|
||||
entries.add(getResources().getString(R.string.settings_system_locale));
|
||||
} else {
|
||||
Locale entryLocale = Utils.stringToLocale(entry.toString());
|
||||
entries.add(entryLocale.getDisplayName(entryLocale));
|
||||
}
|
||||
}
|
||||
|
||||
localePreference.setEntries(entries.toArray(new CharSequence[entryValues.length]));
|
||||
|
||||
Preference themePreference = findPreference(getResources().getString(R.string.settings_key_theme));
|
||||
// Show pretty names and summaries
|
||||
ListPreference themePreference = findPreference(getResources().getString(R.string.settings_key_theme));
|
||||
assert themePreference != null;
|
||||
themePreference.setOnPreferenceChangeListener((preference, o) -> {
|
||||
if (o.toString().equals(getResources().getString(R.string.settings_key_light_theme))) {
|
||||
@@ -130,10 +113,16 @@ public class SettingsActivity extends CatimaAppCompatActivity {
|
||||
return true;
|
||||
});
|
||||
|
||||
localePreference.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
ListPreference themeColorPreference = findPreference(getResources().getString(R.string.setting_key_theme_color));
|
||||
assert themeColorPreference != null;
|
||||
themeColorPreference.setOnPreferenceChangeListener((preference, o) -> {
|
||||
refreshActivity(true);
|
||||
return true;
|
||||
});
|
||||
if (!DynamicColors.isDynamicColorAvailable()) {
|
||||
themeColorPreference.setEntryValues(R.array.color_values_no_dynamic);
|
||||
themeColorPreference.setEntries(R.array.color_value_strings_no_dynamic);
|
||||
}
|
||||
|
||||
Preference oledDarkPreference = findPreference(getResources().getString(R.string.settings_key_oled_dark));
|
||||
assert oledDarkPreference != null;
|
||||
@@ -142,16 +131,29 @@ public class SettingsActivity extends CatimaAppCompatActivity {
|
||||
return true;
|
||||
});
|
||||
|
||||
ListPreference colorPreference = findPreference(getResources().getString(R.string.setting_key_theme_color));
|
||||
assert colorPreference != null;
|
||||
colorPreference.setOnPreferenceChangeListener((preference, o) -> {
|
||||
ListPreference localePreference = findPreference(getResources().getString(R.string.settings_key_locale));
|
||||
assert localePreference != null;
|
||||
CharSequence[] entryValues = localePreference.getEntryValues();
|
||||
List<CharSequence> entries = new ArrayList<>();
|
||||
for (CharSequence entry : entryValues) {
|
||||
if (entry.length() == 0) {
|
||||
entries.add(getResources().getString(R.string.settings_system_locale));
|
||||
} else {
|
||||
Locale entryLocale = Utils.stringToLocale(entry.toString());
|
||||
entries.add(entryLocale.getDisplayName(entryLocale));
|
||||
}
|
||||
}
|
||||
localePreference.setEntries(entries.toArray(new CharSequence[entryValues.length]));
|
||||
localePreference.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
refreshActivity(true);
|
||||
return true;
|
||||
});
|
||||
if (!DynamicColors.isDynamicColorAvailable()) {
|
||||
colorPreference.setEntryValues(R.array.color_values_no_dynamic);
|
||||
colorPreference.setEntries(R.array.color_value_strings_no_dynamic);
|
||||
}
|
||||
|
||||
// Disable content provider on SDK < 23 since dangerous permissions
|
||||
// are granted at install-time
|
||||
Preference contentProviderReadPreference = findPreference(getResources().getString(R.string.settings_key_allow_content_provider_read));
|
||||
assert contentProviderReadPreference != null;
|
||||
contentProviderReadPreference.setVisible(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M);
|
||||
}
|
||||
|
||||
private void refreshActivity(boolean reloadMain) {
|
||||
@@ -161,25 +163,5 @@ public class SettingsActivity extends CatimaAppCompatActivity {
|
||||
activity.recreate();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayPreferenceDialog(Preference preference) {
|
||||
if (preference instanceof NumberDialogPreference) {
|
||||
NumberDialogPreference dialogPreference = (NumberDialogPreference) preference;
|
||||
DialogFragment dialogFragment = NumberPickerPreferenceDialogFragment
|
||||
.newInstance(
|
||||
dialogPreference.getKey(),
|
||||
dialogPreference.getMinValue(),
|
||||
dialogPreference.getMaxValue(),
|
||||
dialogPreference.getStepValue(),
|
||||
dialogPreference.getUnitText()
|
||||
);
|
||||
dialogFragment.setTargetFragment(this, 0);
|
||||
dialogFragment.show(getParentFragmentManager(), DIALOG_FRAGMENT_TAG);
|
||||
} else {
|
||||
super.onDisplayPreferenceDialog(preference);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval" android:useLevel="true"
|
||||
android:dither="true">
|
||||
|
||||
<size android:height="12dip" android:width="12dip"/>
|
||||
|
||||
<solid android:color="@android:color/white"/>
|
||||
</shape>
|
||||
@@ -1,5 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/camera_permission_denied.xml
Normal file
5
app/src/main/res/drawable/camera_permission_denied.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#BD0000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M10.94,8.12L7.48,4.66L9,3h6l1.83,2H20c1.1,0 2,0.9 2,2v12c0,0.05 -0.01,0.1 -0.02,0.16l-5.1,-5.1C16.96,13.71 17,13.36 17,13c0,-2.76 -2.24,-5 -5,-5C11.64,8 11.29,8.04 10.94,8.12zM20.49,23.31L18.17,21H4c-1.1,0 -2,-0.9 -2,-2V7c0,-0.59 0.27,-1.12 0.68,-1.49l-2,-2L2.1,2.1l19.8,19.8L20.49,23.31zM14.49,17.32l-1.5,-1.5C12.67,15.92 12.35,16 12,16c-1.66,0 -3,-1.34 -3,-3c0,-0.35 0.08,-0.67 0.19,-0.98l-1.5,-1.5C7.25,11.24 7,12.09 7,13c0,2.76 2.24,5 5,5C12.91,18 13.76,17.75 14.49,17.32z"/>
|
||||
</vector>
|
||||
24
app/src/main/res/drawable/dialog_bg_monet.xml
Normal file
24
app/src/main/res/drawable/dialog_bg_monet.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<layer-list xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="?attr/colorSurface" />
|
||||
<corners
|
||||
android:bottomLeftRadius="28dp"
|
||||
android:bottomRightRadius="28dp"
|
||||
android:topLeftRadius="28dp"
|
||||
android:topRightRadius="28dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/m3_popupmenu_overlay_color"
|
||||
tools:ignore="PrivateResource" />
|
||||
<corners
|
||||
android:bottomLeftRadius="28dp"
|
||||
android:bottomRightRadius="28dp"
|
||||
android:topLeftRadius="28dp"
|
||||
android:topRightRadius="28dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1,4 +1,4 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M15.41,7.41L14,6l-6,6 6,6 1.41,-1.41L10.83,12z"/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
|
||||
|
||||
10
app/src/main/res/drawable/ic_baseline_expand_more_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_expand_more_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M16.59,8.59L12,13.17 7.41,8.59 6,10l6,6 6,-6z"/>
|
||||
</vector>
|
||||
@@ -1,5 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M7,10l5,5 5,-5z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M7.41,8.59L12,13.17l4.59,-4.58L18,10l-6,6 -6,-6 1.41,-1.41z"/>
|
||||
</vector>
|
||||
@@ -1,5 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M7,14l5,-5 5,5z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M7.41,15.41L12,10.83l4.59,4.58L18,14l-6,-6 -6,6z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M7,18c-1.1,0 -1.99,0.9 -1.99,2S5.9,22 7,22s2,-0.9 2,-2 -0.9,-2 -2,-2zM1,2v2h2l3.6,7.59 -1.35,2.45c-0.16,0.28 -0.25,0.61 -0.25,0.96 0,1.1 0.9,2 2,2h12v-2L7.42,15c-0.14,0 -0.25,-0.11 -0.25,-0.25l0.03,-0.12 0.9,-1.63h7.45c0.75,0 1.41,-0.41 1.75,-1.03l3.58,-6.49c0.08,-0.14 0.12,-0.31 0.12,-0.48 0,-0.55 -0.45,-1 -1,-1L5.21,4l-0.94,-2L1,2zM17,18c-1.1,0 -1.99,0.9 -1.99,2s0.89,2 1.99,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
|
||||
</vector>
|
||||
@@ -1,10 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
|
||||
</vector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
|
||||
</vector>
|
||||
@@ -1,5 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
|
||||
</vector>
|
||||
@@ -1,5 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6h1.9c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM18,20L6,20L6,10h12v10z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M22,9.24l-7.19,-0.62L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27 18.18,21l-1.63,-7.03L22,9.24zM12,15.4l-3.76,2.27 1,-4.28 -3.32,-2.88 4.38,-0.38L12,6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z"/>
|
||||
</vector>
|
||||
16
app/src/main/res/drawable/ic_valid_from_24dp.xml
Normal file
16
app/src/main/res/drawable/ic_valid_from_24dp.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z" />
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M18,15.782V22l4.886,-3.109z" />
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12C2,17.52 6.47,22 11.99,22C13.417,22 14.772,21.699 16,21.162L16,18.928C14.823,19.608 13.458,20 12,20C7.58,20 4,16.42 4,12C4,7.58 7.58,4 12,4C16.42,4 20,7.58 20,12C20,13.061 19.791,14.073 19.416,15L21.541,15C21.839,14.053 22,13.045 22,12C22,6.48 17.52,2 11.99,2zM11,7L11,13L16,16L16,15L16.951,15L17,14.92L12.5,12.25L12.5,7L11,7z" />
|
||||
</vector>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval" android:useLevel="true"
|
||||
android:dither="true">
|
||||
|
||||
<size android:height="8dip" android:width="8dip"/>
|
||||
|
||||
<solid android:color="@android:color/white"/>
|
||||
</shape>
|
||||
@@ -128,11 +128,10 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/translate_sub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="2dp"
|
||||
android:text="@string/translate_platform"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/translate_main"/>
|
||||
@@ -169,11 +168,10 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/license_sub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="2dp"
|
||||
android:text="@string/app_license"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/license_main"/>
|
||||
@@ -271,6 +269,36 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/donate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donate_main"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:padding="2dp"
|
||||
android:text="@string/donate"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:importantForAccessibility="no"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="@string/arrow"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/rate"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_main"/>
|
||||
<include
|
||||
android:id="@+id/include"
|
||||
layout="@layout/content_main" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
41
app/src/main/res/layout/camera_permission_failed_layout.xml
Normal file
41
app/src/main/res/layout/camera_permission_failed_layout.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context="protect.card_locker.MainActivity"
|
||||
tools:showIn="@layout/custom_barcode_scanner">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/camera_permission_denied_clickable_area"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/camera_permission_denied_icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="84dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/camera_permission_denied" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/camera_permission_denied_title"
|
||||
style="@style/TextAppearance.Material3.HeadlineLarge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/cameraPermissionDeniedTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/camera_permission_denied_message"
|
||||
style="@style/AppTheme.TextView.NoData"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/noCameraPermissionDirectToSystemSetting" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -10,19 +9,21 @@
|
||||
tools:showIn="@layout/main_activity">
|
||||
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/helpSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/welcome_icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="184dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_launcher_foreground" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/welcome_text"
|
||||
style="@style/TextAppearance.Material3.HeadlineLarge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -30,40 +31,40 @@
|
||||
android:text="@string/welcome" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/add_card_instruction"
|
||||
style="@style/AppTheme.TextView.NoData"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/noGiftCards"/>
|
||||
android:text="@string/noGiftCards" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
style="@style/AppTheme.TextView.NoData"
|
||||
android:id="@+id/noMatchingCardsText"
|
||||
style="@style/AppTheme.TextView.NoData"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/noMatchingGiftCards"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
style="@style/AppTheme.TextView.NoData"
|
||||
android:id="@+id/noGroupCardsText"
|
||||
style="@style/AppTheme.TextView.NoData"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/noGroupCards"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="@integer/main_view_card_columns"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="80dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="80dp"
|
||||
android:scrollbars="vertical"
|
||||
android:visibility="gone"/>
|
||||
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="@integer/main_view_card_columns" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -1,41 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Based on https://github.com/journeyapps/zxing-android-embedded/blob/0fdfbce9fb3285e985bad9971c5f7c0a7a334e7b/sample/src/main/res/layout/custom_barcode_scanner.xml originally released under Apache 2.0 -->
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Based on https://github.com/journeyapps/zxing-android-embedded/blob/0fdfbce9fb3285e985bad9971c5f7c0a7a334e7b/sample/src/main/res/layout/custom_barcode_scanner.xml originally released under Apache 2.0 -->
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.journeyapps.barcodescanner.BarcodeView
|
||||
android:id="@+id/zxing_barcode_surface"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/zxing_barcode_surface"
|
||||
app:zxing_framing_rect_width="250dp"
|
||||
app:zxing_framing_rect_height="250dp"/>
|
||||
app:zxing_framing_rect_height="250dp"
|
||||
app:zxing_framing_rect_width="250dp" />
|
||||
|
||||
<com.journeyapps.barcodescanner.ViewfinderView
|
||||
android:id="@+id/zxing_viewfinder_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/zxing_viewfinder_view"
|
||||
app:zxing_possible_result_points="@color/zxing_custom_possible_result_points"
|
||||
app:zxing_result_view="@color/zxing_custom_result_view"
|
||||
app:zxing_viewfinder_laser="@color/zxing_custom_viewfinder_laser"
|
||||
app:zxing_viewfinder_mask="@color/zxing_custom_viewfinder_mask"/>
|
||||
app:zxing_viewfinder_mask="@color/zxing_custom_viewfinder_mask" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/card_input_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/activity_scanner_padding">
|
||||
|
||||
<include
|
||||
android:id="@+id/camera_permission_denied_layout"
|
||||
layout="@layout/camera_permission_failed_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_from_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/addFromImage" />
|
||||
android:text="@string/addFromImage"
|
||||
app:layout_constraintBottom_toTopOf="@+id/add_manually"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/camera_permission_denied_layout"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_manually"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/addManually" />
|
||||
</LinearLayout>
|
||||
android:text="@string/addManually"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</merge>
|
||||
@@ -37,36 +37,48 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageButton
|
||||
<Button
|
||||
android:id="@+id/moveUp"
|
||||
android:layout_width="@dimen/cardThumbnailSize"
|
||||
android:layout_height="@dimen/cardThumbnailSize"
|
||||
style="?attr/materialIconButtonFilledStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@drawable/ic_baseline_arrow_drop_up_24"
|
||||
app:icon="@drawable/ic_baseline_keyboard_arrow_up_24"
|
||||
app:iconGravity="textStart"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
android:contentDescription="@string/moveUp"/>
|
||||
|
||||
<ImageButton
|
||||
<Button
|
||||
android:id="@+id/moveDown"
|
||||
android:layout_width="@dimen/cardThumbnailSize"
|
||||
android:layout_height="@dimen/cardThumbnailSize"
|
||||
style="?attr/materialIconButtonFilledStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@drawable/ic_baseline_arrow_drop_down_24"
|
||||
app:icon="@drawable/ic_baseline_keyboard_arrow_down_24"
|
||||
app:iconGravity="textStart"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
android:contentDescription="@string/moveDown"/>
|
||||
|
||||
<ImageButton
|
||||
<Button
|
||||
android:id="@+id/edit"
|
||||
android:layout_width="@dimen/cardThumbnailSize"
|
||||
android:layout_height="@dimen/cardThumbnailSize"
|
||||
style="?attr/materialIconButtonFilledStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@drawable/ic_mode_edit_white_24dp"
|
||||
app:icon="@drawable/ic_mode_edit_white_24dp"
|
||||
app:iconGravity="textStart"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
android:contentDescription="@string/edit"/>
|
||||
|
||||
<ImageButton
|
||||
<Button
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="@dimen/cardThumbnailSize"
|
||||
android:layout_height="@dimen/cardThumbnailSize"
|
||||
style="?attr/materialIconButtonFilledStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@drawable/ic_delete_white_24dp"
|
||||
app:icon="@drawable/ic_delete_white_24dp"
|
||||
app:iconGravity="textStart"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
android:contentDescription="@string/delete"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="numberDecimal"
|
||||
android:digits="0123456789.,$" />
|
||||
android:digits="0123456789,." />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@@ -311,6 +311,32 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Valid from -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/inputPadding"
|
||||
android:paddingTop="@dimen/inputPadding"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- Valid from -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/validFromView"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.0"
|
||||
android:hint="@string/validFromDate"
|
||||
android:labelFor="@+id/validFromField">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/validFromField"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Expiration -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/icon_layout"
|
||||
@@ -24,7 +23,6 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:importantForAccessibility="no"
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -36,6 +34,20 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/thumbnail_text"
|
||||
android:importantForAccessibility="no"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textStyle="bold"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="12sp"
|
||||
app:autoSizeMaxTextSize="100sp"
|
||||
app:autoSizeStepGranularity="2sp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:layout_margin="20dp" />
|
||||
|
||||
<ImageView
|
||||
android:importantForAccessibility="no"
|
||||
android:id="@+id/selected_thumbnail"
|
||||
@@ -124,7 +136,10 @@
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:textAppearance="?attr/textAppearanceHeadline1"
|
||||
android:textAppearance="?attr/textAppearanceHeadlineSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/icon_layout"
|
||||
app:layout_constraintBottom_toTopOf="@+id/note"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -167,6 +182,7 @@
|
||||
android:id="@+id/balance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
@@ -176,16 +192,37 @@
|
||||
android:drawablePadding="4dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@+id/info_divider"
|
||||
app:layout_constraintBottom_toTopOf="@+id/expiry"
|
||||
app:layout_constraintBottom_toTopOf="@+id/validFrom"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible"
|
||||
tools:text="525 points"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/validFrom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:textAppearance="?attr/textAppearanceBody2"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
app:drawableLeftCompat="@drawable/ic_valid_from_24dp"
|
||||
android:drawablePadding="4dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@+id/balance"
|
||||
app:layout_constraintBottom_toTopOf="@+id/expiry"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible"
|
||||
tools:text="Today"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/expiry"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
@@ -194,7 +231,7 @@
|
||||
app:drawableLeftCompat="@drawable/ic_baseline_access_time_24"
|
||||
android:drawablePadding="4dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@+id/balance"
|
||||
app:layout_constraintTop_toBottomOf="@+id/validFrom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -6,214 +6,200 @@
|
||||
android:id="@+id/coordinator_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
android:fitsSystemWindows="false">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:fitsSystemWindows="true"
|
||||
android:weightSum="1.0">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar_landscape"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:background="@android:color/transparent"
|
||||
android:fitsSystemWindows="false"
|
||||
android:paddingTop="0dp"
|
||||
android:visibility="gone"
|
||||
app:contentInsetStart="72.0dip"
|
||||
app:layout_collapseMode="pin" />
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
style="?attr/toolbarStyle" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsingToolbarLayout"
|
||||
android:layout_width="fill_parent"
|
||||
<LinearLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
android:layout_marginBottom="100dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/icon_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:minHeight="56.0dip"
|
||||
app:contentScrim="?colorPrimary"
|
||||
app:expandedTitleGravity="top"
|
||||
app:expandedTitleMarginEnd="64dp"
|
||||
app:expandedTitleMarginStart="48dp">
|
||||
android:layout_marginBottom="20dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/storeName"
|
||||
<Space
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/icon_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="85.6f:53.98f">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/icon_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textStyle="bold"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="12sp"
|
||||
app:autoSizeMaxTextSize="100sp"
|
||||
app:autoSizeStepGranularity="2sp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:layout_margin="20dp" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="0dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layoutDirection="ltr">
|
||||
|
||||
<!-- We don't use these buttons for Talkback -->
|
||||
<ImageButton
|
||||
android:importantForAccessibility="no"
|
||||
android:id="@+id/main_left_button"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
app:srcCompat="@drawable/ic_baseline_chevron_left_24"
|
||||
android:background="@android:color/transparent"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/card_holder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/main_card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="8dp"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/main_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/card_id_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:gravity="center"/>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- We don't use these buttons for Talkback -->
|
||||
<ImageButton
|
||||
android:importantForAccessibility="no"
|
||||
android:id="@+id/main_right_button"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
app:srcCompat="@drawable/ic_baseline_chevron_right_24"
|
||||
android:background="@android:color/transparent"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/fullscreen_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:importantForAccessibility="no"
|
||||
android:id="@+id/fullscreen_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scaler_guideline"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/scaler_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@+id/fullscreen_button_minimize"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip">
|
||||
|
||||
<TextView
|
||||
android:importantForAccessibility="no"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/height"/>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/barcode_scaler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="?actionBarSize"
|
||||
android:layout_marginBottom="?actionBarSize"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="40sp"
|
||||
app:layout_collapseMode="parallax" />
|
||||
android:contentDescription="@string/setBarcodeHeight"
|
||||
android:max="100" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@id/toolbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:background="@android:color/transparent"
|
||||
app:contentInsetStart="72.0dip"
|
||||
app:layout_collapseMode="pin" />
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:srcCompat="@drawable/ic_launcher_foreground"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<FrameLayout
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/mainLayout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/centerGuideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/scalerGuideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.75"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/maximizeButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:contentDescription="@string/moveBarcodeToTopOfScreen"
|
||||
android:padding="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/mainImage"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_baseline_arrow_drop_up_24"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mainImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
app:layout_constraintBottom_toTopOf="@+id/centerGuideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/maximizeButton"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/minimizeButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:contentDescription="@string/moveBarcodeToCenterOfScreen"
|
||||
android:padding="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/mainImage"
|
||||
app:srcCompat="@drawable/ic_baseline_arrow_drop_down_24"
|
||||
app:tint="?attr/colorOnPrimary"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dotIndicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/minimizeButton"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/barcodeScaler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/inputPadding"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
android:contentDescription="@string/set_scale"
|
||||
android:max="100"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/scalerGuideline" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cardIdView"
|
||||
android:enabled="true"
|
||||
android:textIsSelectable="true"
|
||||
android:focusable="true"
|
||||
android:longClickable="true"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="10.0dip"
|
||||
android:layout_marginRight="10.0dip"
|
||||
android:paddingBottom="80dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dotIndicator"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:textAlignment="center"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="@dimen/singleCardCardIdTextSizeMin"
|
||||
app:autoSizeMaxTextSize="@dimen/singleCardCardIdTextSizeMax"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/drop_shadow_actionbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="5.0dip"
|
||||
android:layout_gravity="top"/>
|
||||
</FrameLayout>
|
||||
<ImageButton
|
||||
android:id="@+id/fullscreen_button_minimize"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_baseline_expand_more_24"
|
||||
android:tooltipText="@string/moveDown"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:background="@android:color/transparent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.bottomappbar.BottomAppBar
|
||||
android:id="@+id/bottom_app_bar"
|
||||
@@ -228,41 +214,70 @@
|
||||
app:contentInsetEnd="0dp"
|
||||
app:fabAlignmentMode="center">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_previous"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="left"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_chevron_left_24"
|
||||
android:tooltipText="@string/previousCard"
|
||||
android:visibility="gone" />
|
||||
android:layoutDirection="ltr">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_show_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_info_24"
|
||||
android:tooltipText="@string/showMoreInfo"
|
||||
android:visibility="gone" />
|
||||
<ImageButton
|
||||
android:id="@+id/bottom_app_bar_previous_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_chevron_left_24"
|
||||
android:tooltipText="@string/previousCard"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_chevron_right_24"
|
||||
android:tooltipText="@string/nextCard"
|
||||
android:visibility="gone" />
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
android:layoutDirection="locale">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/bottom_app_bar_info_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_info_24"
|
||||
android:tooltipText="@string/showMoreInfo"
|
||||
android:visibility="gone" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/bottom_app_bar_update_balance_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_shopping_cart_24"
|
||||
android:tooltipText="@string/updateBalance"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/bottom_app_bar_next_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_baseline_chevron_right_24"
|
||||
android:tooltipText="@string/nextCard"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.bottomappbar.BottomAppBar>
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_main"/>
|
||||
<include
|
||||
android:id="@+id/include"
|
||||
layout="@layout/content_main" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<include layout="@layout/group_main"/>
|
||||
<include
|
||||
android:id="@+id/include"
|
||||
layout="@layout/group_main" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
8
app/src/main/res/layout/preference_material_switch.xml
Normal file
8
app/src/main/res/layout/preference_material_switch.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.materialswitch.MaterialSwitch xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/switchWidget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:focusable="false" />
|
||||
@@ -10,12 +10,13 @@
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkBox_reverse"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:paddingStart="20dp"
|
||||
android:text="@string/reverse"
|
||||
android:textSize="19sp"/>
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/colorOnSurfaceVariant"/>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
app:showAsAction="always|collapseActionView"
|
||||
android:visible="false"/>
|
||||
<item
|
||||
android:id="@+id/action_unfold"
|
||||
android:title="@string/action_hide_details"
|
||||
android:icon="@drawable/ic_baseline_unfold_less_24"
|
||||
android:id="@+id/action_shown_details"
|
||||
android:title="@string/action_show_details"
|
||||
android:icon="@drawable/baseline_visibility_24"
|
||||
app:showAsAction="always"
|
||||
android:visible="false"/>
|
||||
<item
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_unfold"
|
||||
android:title="@string/action_hide_details"
|
||||
android:icon="@drawable/ic_baseline_unfold_less_24"
|
||||
android:id="@+id/action_shown_details"
|
||||
android:title="@string/action_show_details"
|
||||
android:icon="@drawable/baseline_visibility_24"
|
||||
app:showAsAction="always"
|
||||
android:visible="true"/>
|
||||
</menu>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_delete"
|
||||
android:icon="@drawable/ic_delete_white_24dp"
|
||||
android:title="@string/delete"
|
||||
app:showAsAction="always"/>
|
||||
</menu>
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/action_share"
|
||||
android:icon="@drawable/ic_share_white"
|
||||
android:icon="@drawable/ic_share"
|
||||
android:title="@string/share"
|
||||
app:showAsAction="always"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_star_unstar"
|
||||
android:icon="@drawable/ic_unstarred_white"
|
||||
android:icon="@drawable/ic_unstarred"
|
||||
android:title="@string/star"
|
||||
app:showAsAction="always" />
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
app:showAsAction="always|collapseActionView"
|
||||
android:visible="false"/>
|
||||
<item
|
||||
android:id="@+id/action_unfold"
|
||||
android:title="@string/action_hide_details"
|
||||
android:icon="@drawable/ic_baseline_unfold_less_24"
|
||||
android:id="@+id/action_shown_details"
|
||||
android:title="@string/action_show_details"
|
||||
android:icon="@drawable/baseline_visibility_24"
|
||||
app:showAsAction="always"
|
||||
android:visible="false"/>
|
||||
<item
|
||||
|
||||
@@ -7,42 +7,69 @@ Heimen Stoffels
|
||||
Oğuz Ersen
|
||||
Katharine Chui
|
||||
mondstern
|
||||
SlavekB
|
||||
StoyanDimitrov
|
||||
IllusiveMan196
|
||||
Altonss
|
||||
StoyanDimitrov
|
||||
Michael Moroni
|
||||
Gediminas Murauskas
|
||||
Petr Novák
|
||||
Joel A
|
||||
Michael Moroni
|
||||
Taco
|
||||
SlavekB
|
||||
Gediminas Murauskas
|
||||
Nyatsuki
|
||||
Samantaz Fox
|
||||
laralem
|
||||
FC Stegerman
|
||||
Taco
|
||||
pfaffenrodt
|
||||
gallegonovato
|
||||
Nyatsuki
|
||||
HudobniVolk
|
||||
Samantaz Fox
|
||||
arno-github
|
||||
Ankit Tiwari
|
||||
Sergio Paredes
|
||||
Clxff H3r4ld0
|
||||
Eric
|
||||
Aayush Gupta
|
||||
huuhaa
|
||||
arshbeerSingh
|
||||
Balázs Meskó
|
||||
Quentin PAGÈS
|
||||
Miha Frangež
|
||||
sr093906
|
||||
Giovanni Donisi
|
||||
Projjal Moitra
|
||||
Alexander Ivanov
|
||||
arshbeerSingh
|
||||
Denis Shilin
|
||||
Freddo espresso
|
||||
Silvério Santos
|
||||
Miha Frangež
|
||||
Eryk Michalak
|
||||
Arnis Jaundžeikars
|
||||
Dan
|
||||
sr093906
|
||||
mdvhimself
|
||||
Maciej Błędkowski
|
||||
Katarzyna
|
||||
echo r"0xX4H" | rev
|
||||
Magnitudee
|
||||
Olivia (Zoe)
|
||||
betsythefc
|
||||
Silvério Santos
|
||||
waffshappen
|
||||
Robin
|
||||
ati3
|
||||
Giovanni
|
||||
enolp
|
||||
Evgeniy Khramov
|
||||
Jane Kong
|
||||
Jean Mareilles
|
||||
Jiri Grönroos
|
||||
José Rebelo
|
||||
K. Herbert
|
||||
Magnitudee
|
||||
Lisa A.
|
||||
Mawuena M. KODZO A.
|
||||
Max
|
||||
Still Hsu
|
||||
String E. Fighter
|
||||
Tapu
|
||||
Yurical
|
||||
rr-vesp
|
||||
yangyangdaji
|
||||
丛林意志
|
||||
alajemba-vik
|
||||
/usr/local/ΕΨΗΕΛΩΝ
|
||||
Adolfo Jayme-Barrientos
|
||||
@@ -50,87 +77,180 @@ Alessandro Mandelli
|
||||
KovalevArtem
|
||||
Artem M.
|
||||
Astrohops1
|
||||
BMN
|
||||
balaraz
|
||||
BootVirtual
|
||||
Bottan Hermawan
|
||||
Clonewayx
|
||||
D. Domig
|
||||
Diego
|
||||
Eudes-alencar
|
||||
Fede Pujol
|
||||
FineFindus
|
||||
francescbassas
|
||||
Jason Li
|
||||
Jean-Luc Tibaux
|
||||
Jesse Davids
|
||||
Kis Dominik
|
||||
Lukas Grassauer
|
||||
Luna Jernberg
|
||||
Marnick L'Eau
|
||||
Michalis
|
||||
Michał
|
||||
Neko Nekowazarashi
|
||||
Milo Ivir
|
||||
Mohamed A. Salah
|
||||
the7thNightmare
|
||||
Rishi Agarwal
|
||||
Rosdyana Kusuma
|
||||
Sabri Ünal
|
||||
umoenks
|
||||
Simon Rusinov
|
||||
Siriusmart
|
||||
Mritunjay
|
||||
Tarik Dzambic
|
||||
Thomas Bertels
|
||||
Thomas Cruveilher
|
||||
Tian Jiale
|
||||
Tong Liu
|
||||
Tymofii Lytvynenko
|
||||
Wanath
|
||||
Runner
|
||||
ce i moa
|
||||
enescan201
|
||||
Frablock
|
||||
inesre
|
||||
lgasp
|
||||
notlin4
|
||||
phlostically
|
||||
pokeghost
|
||||
sal0max
|
||||
Ágata Leuck
|
||||
BmBKun
|
||||
NamHyeonjeong
|
||||
Aditya Das
|
||||
Asier
|
||||
asier123123131
|
||||
Kevin Sicong Jiang
|
||||
Tomer Ben-Rachel
|
||||
Tom Sawyer
|
||||
tfuxu
|
||||
Ahmed Saleh
|
||||
Airat
|
||||
Alexander Ivanov
|
||||
Alexander
|
||||
sNiXx
|
||||
Angela Enogieru
|
||||
Animesh Chatterjee
|
||||
Artūras Kalenda
|
||||
Ashish Yadav
|
||||
BMN
|
||||
Aya Elsaadany
|
||||
Biren
|
||||
Booc Sylvan
|
||||
Brage Nesteby Reitan
|
||||
Cap Amr Karam
|
||||
Carlo Maria Cuoghi Barbagli
|
||||
CherryMonster222
|
||||
Colgrave
|
||||
Csaba
|
||||
Mylou53
|
||||
danieluhrinyi
|
||||
Daniele Tricoli
|
||||
Kasina Dheeraj
|
||||
Donno
|
||||
Eric
|
||||
Evgeniy Khramov
|
||||
Erik Spjelkavik
|
||||
Flav
|
||||
Franciszek Stefan
|
||||
Gael Caraballo
|
||||
Giacomo Alessandroni
|
||||
Grzegorz
|
||||
gneiss15
|
||||
Hamustra Scans
|
||||
helzubair
|
||||
HowITsDone
|
||||
Hubert Maciejewicz
|
||||
Izzy
|
||||
Jacek
|
||||
Jacopo Gennaro Esposito
|
||||
Jean-Baptiste
|
||||
Jean-Luc Tibaux
|
||||
Kung-chih
|
||||
Karvjorm
|
||||
polar
|
||||
Kamborio
|
||||
krkk
|
||||
Lisa
|
||||
bittin
|
||||
Laura Ferraz
|
||||
Lucas da Costa
|
||||
almir992
|
||||
Manan Jhaveri
|
||||
Marco
|
||||
BRBsoup
|
||||
Mateo Gomez
|
||||
Mattia
|
||||
Md. Al-Amin
|
||||
Michael Gangolf
|
||||
3DN1M
|
||||
Minecraft boom
|
||||
Mobashir Raihan
|
||||
Moi Toi
|
||||
OPADILOP
|
||||
DivideEtImpera
|
||||
Nicolas
|
||||
Nosnahc
|
||||
pa4k
|
||||
pbeckmann
|
||||
Peer Beckmann
|
||||
vandman
|
||||
Piotr Strebski
|
||||
Piotr Zet
|
||||
Poorva Patidar
|
||||
Quang Nguyen
|
||||
Ratnesh
|
||||
Reza
|
||||
Rohan Babbar
|
||||
Ronak Upadhyay
|
||||
Rose Liverman
|
||||
SKULD
|
||||
Salem Malus
|
||||
Samarth Asthan
|
||||
Shailendra Maurya
|
||||
SilverFS
|
||||
Simone Dotto
|
||||
Subhashish Anand
|
||||
Subhradeep Bera
|
||||
Swayam Khare
|
||||
SziaTomi
|
||||
Mehedi Hasan
|
||||
Titas Pažereckas
|
||||
Tom Sawyer
|
||||
Tomer Ben-Rachel
|
||||
atakujonc
|
||||
tkraljevic
|
||||
Tony C
|
||||
Tymofii Lytvynenko
|
||||
Vancha March
|
||||
tyap-lyap-ivprod
|
||||
Waldemar Stoczkowski
|
||||
Yevgeny M
|
||||
Yusril A
|
||||
Ziad OUALHADJ
|
||||
ahmed-awad26
|
||||
Avik Kundu
|
||||
ayuyydev
|
||||
diksha-2911
|
||||
gbonaspetti
|
||||
gittyboy-cell
|
||||
huang ivan
|
||||
liva
|
||||
lucafont2
|
||||
mtrmirez
|
||||
opsik
|
||||
polarhun
|
||||
pooyanazari
|
||||
psa-jforestier
|
||||
Robin
|
||||
sergio
|
||||
080502
|
||||
Marcus
|
||||
techwebpd
|
||||
tjw123hh
|
||||
Truestorybaby
|
||||
tygyh
|
||||
unstartdev
|
||||
wmilan 17
|
||||
يوسف لطفي
|
||||
元气
|
||||
JaeBeom An
|
||||
JungHee Lee
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
stocard_stores.csv was created by extracting /data/data/de.stocard/de.stocard.stocard/databases/stores on a rooted devices and running the following command over it:
|
||||
|
||||
sqlite3 -header -csv stores "select _id,name,barcodeFormat from stores" > stocard_stores.csv
|
||||
```
|
||||
sqlite3 -header -csv sync_db "select id,content from synced_resources where collection = '/loyalty-card-providers/'" > stocard_providers.csv
|
||||
while IFS= read -r line; do
|
||||
if [ "$line" = "id,content" ]; then
|
||||
echo "_id,name,barcodeFormat" > stocard_stores.csv
|
||||
else
|
||||
id="$(echo "$line" | cut -d ',' -f1)"
|
||||
name="$(echo "$line" | cut -d ',' -f2- | sed 's/""/"/g' | sed 's/^"//g' | sed 's/"$//g' | jq -r .name)"
|
||||
barcodeFormat="$(echo "$line" | cut -d ',' -f2- | sed 's/""/"/g' | sed 's/^"//g' | sed 's/"$//g' | jq -r .default_barcode_format)"
|
||||
echo "$id,\"$name\",$barcodeFormat" >> stocard_stores.csv
|
||||
fi
|
||||
done < stocard_providers.csv
|
||||
```
|
||||
|
||||
Only used for data portability reasons (ensuring importing works). Do NOT copy this anywhere else or use it for any purpose other than ensuring we can import a GDPR-provided export. We want to make sure this stays under fair use.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,8 @@
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="action_search">بحث</string>
|
||||
<string name="action_add">اضف</string>
|
||||
<string name="noGiftCards">اضغط علي زر + لاضافة بطاقة, او استورد بعض منهم من قائمة ال ⋮.</string>
|
||||
<string name="noMatchingGiftCards">لا نتائج. حاول تغيير بحثك.</string>
|
||||
<string name="noGiftCards">اضغط على + الزر الإضافي لاضافة بطاقة, او استورد من ⋮ القائمة.</string>
|
||||
<string name="noMatchingGiftCards">لا نتائج. حاول تغيير كلمات البحث.</string>
|
||||
<string name="storeName">اسم</string>
|
||||
<string name="note">مذكرة</string>
|
||||
<string name="cardId">بطاقة شخصية</string>
|
||||
@@ -12,17 +12,17 @@
|
||||
<string name="noBarcode">لا يوجد باركود</string>
|
||||
<string name="star">اضف الي المفضلة</string>
|
||||
<string name="unstar">حذف من المفضلة</string>
|
||||
<string name="cancel">الغاء</string>
|
||||
<string name="cancel">إلغاء</string>
|
||||
<string name="save">حفظ</string>
|
||||
<string name="edit">تعديل</string>
|
||||
<string name="delete">مسح</string>
|
||||
<string name="confirm">تأكيد</string>
|
||||
<string name="deleteConfirmation">مسح هذة البطاقة نهائيا؟</string>
|
||||
<string name="ok">حسنا</string>
|
||||
<string name="copy_to_clipboard">نسخ البطاقة الشخصية الي الحافظة</string>
|
||||
<string name="copy_to_clipboard">نسخ البطاقة الشخصية الى الحافظة</string>
|
||||
<string name="share">شارك</string>
|
||||
<string name="sendLabel">ارسل…</string>
|
||||
<string name="editCardTitle">عدل بطاقة</string>
|
||||
<string name="editCardTitle">عدل البطاقة</string>
|
||||
<string name="addCardTitle">اضف بطاقة</string>
|
||||
<string name="scanCardBarcode">مسح باركود</string>
|
||||
<string name="cardShortcut">اختصار البطاقة</string>
|
||||
@@ -31,15 +31,14 @@
|
||||
<string name="barcodeImageDescriptionWithType">صورة <xliff:g>%s</xliff:g> باركود</string>
|
||||
<string name="noStoreError">لا يوجد اسم مدخل</string>
|
||||
<string name="noCardIdError">لا يوجد بطاقة شخصية مدخلة</string>
|
||||
<string name="noCardExistsError">لا يمكن العثور علي هذه البطاقة</string>
|
||||
<string name="noCardExistsError">لا يمكن العثور على هذه البطاقة</string>
|
||||
<string name="failedParsingImportUriError">لا يمكن تحليل الرابط المستورد</string>
|
||||
<string name="importExport">استيراد/تصدير</string>
|
||||
<string name="importExportHelp">عمل نسخ احتطياتي لبياناتك يسمح نقلها لجهاز اخر.</string>
|
||||
<string name="importFailed">لا يمكن عمل الاستيراد</string>
|
||||
<string name="importExportHelp">دعم بياناتك يسمح بنقلها إلى جهاز آخر.</string>
|
||||
<string name="importFailed">تعذر إجراء الاستيراد</string>
|
||||
<string name="exportSuccessfulTitle">متصدر</string>
|
||||
<string name="exportFailedTitle">فشل التصدير</string>
|
||||
<string name="exportFailed">لا يمكن عمل التصدير</string>
|
||||
<string name="noExternalStoragePermissionError">امنح التخزين الخارجي اذن لاستيراد وتصدير البيانات</string>
|
||||
<string name="exportOptionExplanation">ستتم كتابة البيانات في الموقع الذي تختاره.</string>
|
||||
<string name="importOptionFilesystemButton">من نظام الملفات</string>
|
||||
<string name="importOptionApplicationTitle">استخدم تطبيقًا آخر</string>
|
||||
@@ -49,7 +48,6 @@
|
||||
<string name="app_copyright_old">بناء على Loyalty Card Keychain
|
||||
\nحقوق النشر © 2016-2020 Branden Archer</string>
|
||||
<string name="app_license">البرمجيات الحرة متروكة الحقوق, ترخيص +GPLv3</string>
|
||||
<string name="app_revision_fmt">معلومات المراجعة: <xliff:g id="app_revision_url">%s</xliff:g></string>
|
||||
<string name="app_libraries">مكتبات الطرف الثالث الحرة: <xliff:g id="app_libraries_list">%s</xliff:g></string>
|
||||
<string name="selectBarcodeTitle">اختار الباركود</string>
|
||||
<string name="enterBarcodeInstructions">أدخل بطاقة هوية ، واختر نوع الباركود أدناه ، أو \"لا يوجد باركود\".</string>
|
||||
@@ -57,14 +55,12 @@
|
||||
<string name="thumbnailDescription">صورة مصغرة</string>
|
||||
<string name="starImage">نجم مفضل</string>
|
||||
<string name="settings">اعدادات</string>
|
||||
<string name="settings_category_title_ui">واجهة المستخدم</string>
|
||||
<string name="settings_light_theme">فاتح</string>
|
||||
<string name="settings_dark_theme">داكن</string>
|
||||
<string name="settings_card_orientation">اتجاه الباركود</string>
|
||||
<string name="settings_portrait_orientation">الوضع الرأسي</string>
|
||||
<string name="settings_landscape_orientation">الوضع الأفقي</string>
|
||||
<string name="settings_theme">مظهر</string>
|
||||
<string name="settings_max_font_size_scale">اقصي. حجم الخط</string>
|
||||
<string name="settings_display_barcode_max_brightness">عرض مشرق علي الباركود</string>
|
||||
<string name="importSuccessful">تم استيراد البيانات</string>
|
||||
<string name="exportSuccessful">تم تصدير البيانات</string>
|
||||
@@ -85,7 +81,7 @@
|
||||
<string name="points">نقاط</string>
|
||||
<string name="parsingBalanceFailed"><xliff:g>%s</xliff:g> لا يبدو أنه رصيد صالح.</string>
|
||||
<string name="chooseImportType">استيراد البيانات من</string>
|
||||
<string name="app_loyalty_card_keychain">Loyalty Card Keychain</string>
|
||||
<string name="app_loyalty_card_keychain">سلسلة مفاتيح بطاقة الولاء</string>
|
||||
<string name="privacy_policy">سياسة الخصوصية</string>
|
||||
<string name="accept">قبول</string>
|
||||
<string name="importCatima">الاستيراد من Catima</string>
|
||||
@@ -94,7 +90,7 @@
|
||||
<string name="importFidme">الاستيراد من FidMe</string>
|
||||
<string name="importFidmeMessage">حدد ملفك <i>fidme-export-request-xxxxxx.zip</i> تصدير من FidMe للاستيراد ، ثم حدد أنواع الباركود يدويًا بعد ذلك.
|
||||
\nقم بإنشائه من ملف تعريف FidMe الخاص بك عن طريق اختيار حماية البيانات ثم الضغط على استخراج بياناتي أولاً.</string>
|
||||
<string name="importStocardMessage">حدد ملفك <i>***-sync.zip</i> تصدير من Stocard للاستيراد.
|
||||
<string name="importStocardMessage">حدد ملفك <i>***.zip</i> تصدير من Stocard للاستيراد.
|
||||
\nاحصل عليه عن طريق إرسال بريد إلكتروني إلى support@stocardapp.com لطلب تصدير بياناتك.</string>
|
||||
<string name="importVoucherVault">الاستيراد من Voucher Vault</string>
|
||||
<string name="importVoucherVaultMessage">حدد ملفك <i>vouchervault.json</i> تصدير من Voucher Vault للاستيراد.
|
||||
@@ -137,9 +133,6 @@
|
||||
<string name="app_contributors">أصبح ممكنًا بواسطة: <xliff:g id="app_contributors">%s</xliff:g></string>
|
||||
<string name="sort">فرز</string>
|
||||
<string name="showMoreInfo">اظهر المعلومات</string>
|
||||
<string name="hideMoreInfo">إخفاء المعلومات</string>
|
||||
<string name="swipeToSwitchImages">اسحب أو اضغط لفترة طويلة لتبديل الصور</string>
|
||||
<string name="sort_by_balance">الرصيد</string>
|
||||
<string name="reverse">... بترتيب معكوس</string>
|
||||
<string name="sort_by">صنف حسب</string>
|
||||
<string name="settings_oled_dark">خلفية سوداء نقية لمظهر داكن</string>
|
||||
@@ -151,7 +144,6 @@
|
||||
<string name="shortcutSelectCard">اختر بطاقة</string>
|
||||
<string name="options">خيارات</string>
|
||||
<string name="starred">مميز بنجمة</string>
|
||||
<string name="set_scale">ضبط النطاق</string>
|
||||
<string name="include_if_asking_support">إذا كنت ترغب في طلب الدعم ، فقم بتضمين المعلومات التالية:</string>
|
||||
<string name="duplicateCard">كرر</string>
|
||||
<string name="archive">ضع الي الأرشيف</string>
|
||||
@@ -160,7 +152,7 @@
|
||||
<string name="unarchived">البطاقة غير مؤرشفة</string>
|
||||
<string name="archiveList">أرشيف</string>
|
||||
<string name="failedLaunchingPhotoPicker">تعذر العثور على تطبيق معرض مدعوم</string>
|
||||
<string name="noGiftCardsGroup">انشئ بعض من البطاقات, و عيينهم لهذة المجموعة.</string>
|
||||
<string name="noGiftCardsGroup">انشئ بعض من البطاقات, و عيينهم لهذه المجموعة.</string>
|
||||
<string name="deleteTitle">مسح بطاقة</string>
|
||||
<plurals name="selectedCardCount">
|
||||
<item quantity="zero"><xliff:g>%d</xliff:g> محدد</item>
|
||||
@@ -174,7 +166,7 @@
|
||||
<string name="exportName">تصدير</string>
|
||||
<string name="exporting">جار التصدير…</string>
|
||||
<string name="importSuccessfulTitle">مستورد</string>
|
||||
<string name="importFailedTitle">فشل الاستيراد</string>
|
||||
<string name="importFailedTitle">فشل بالاستيراد</string>
|
||||
<string name="sort_by_most_recently_used">الأكثر أستعمالا مؤخرا</string>
|
||||
<string name="license">رخصة</string>
|
||||
<string name="sort_by_name">اسم</string>
|
||||
@@ -191,18 +183,18 @@
|
||||
<plurals name="deleteCardsTitle">
|
||||
<item quantity="zero">مسح <xliff:g>%d</xliff:g> بطاقة</item>
|
||||
<item quantity="one">مسح <xliff:g>%d</xliff:g> بطاقة</item>
|
||||
<item quantity="two">مسح <xliff:g>%d</xliff:g> بطاقة</item>
|
||||
<item quantity="two">مسح <xliff:g>%d</xliff:g> بطاقتين</item>
|
||||
<item quantity="few">مسح <xliff:g>%d</xliff:g> بطاقات</item>
|
||||
<item quantity="many">مسح <xliff:g>%d</xliff:g> بطاقات</item>
|
||||
<item quantity="other">مسح <xliff:g>%d</xliff:g> بطاقات</item>
|
||||
</plurals>
|
||||
<plurals name="deleteCardsConfirmation">
|
||||
<item quantity="zero">مسح هذه <xliff:g>%d</xliff:g> بطاقة نهائيا؟</item>
|
||||
<item quantity="one">مسح هذه <xliff:g>%d</xliff:g> بطاقة نهائيا؟</item>
|
||||
<item quantity="two">مسح هذه <xliff:g>%d</xliff:g> بطاقة نهائيا؟</item>
|
||||
<item quantity="few">مسح هذه <xliff:g>%d</xliff:g> بطاقات نهائيا؟</item>
|
||||
<item quantity="many">مسح هذه <xliff:g>%d</xliff:g> بطاقات نهائيا؟</item>
|
||||
<item quantity="other">مسح هذه <xliff:g>%d</xliff:g> بطاقات نهائيا؟</item>
|
||||
<item quantity="zero">مسح هذه <xliff:g>%d</xliff:g> البطاقة نهائيا؟</item>
|
||||
<item quantity="one">مسح هذه <xliff:g>%d</xliff:g> البطاقة نهائيا؟</item>
|
||||
<item quantity="two">مسح هذه <xliff:g>%d</xliff:g> البطاقتين نهائيا؟</item>
|
||||
<item quantity="few">مسح هذه <xliff:g>%d</xliff:g> البطاقات نهائيا؟</item>
|
||||
<item quantity="many">مسح هذه <xliff:g>%d</xliff:g> البطاقات نهائيا؟</item>
|
||||
<item quantity="other">مسح هذه <xliff:g>%d</xliff:g> البطاقات نهائيا؟</item>
|
||||
</plurals>
|
||||
<string name="importOptionFilesystemTitle">الاستيراد من نظام الملفات</string>
|
||||
<string name="importOptionFilesystemExplanation">اختر ملفًا محددًا من نظام الملفات.</string>
|
||||
@@ -213,7 +205,6 @@
|
||||
<string name="app_resources">موارد الطرف الثالث الحرة: <xliff:g id="app_resources_list">%s</xliff:g></string>
|
||||
<string name="settings_follow_system_orientation">نظام المتابعة</string>
|
||||
<string name="groups">مجموعات</string>
|
||||
<string name="barcode">باركود</string>
|
||||
<string name="settings_keep_screen_on">حافظ على الشاشة قيد التشغيل</string>
|
||||
<string name="intent_import_card_from_url_share_text">اريد مشاركة بطاقة معك</string>
|
||||
<string name="groupsList">مجموعات: <xliff:g>%s</xliff:g></string>
|
||||
@@ -235,7 +226,6 @@
|
||||
<string name="balanceSentence">الرصيد: <xliff:g>%s</xliff:g></string>
|
||||
<string name="expiryStateSentence">تنتهي: <xliff:g>%s</xliff:g></string>
|
||||
<string name="expiryStateSentenceExpired">منتهي الصلاحية: <xliff:g>%s</xliff:g></string>
|
||||
<string name="moveBarcodeToCenterOfScreen">قم بتوسيط الرمز الشريطي على الشاشة</string>
|
||||
<plurals name="balancePoints">
|
||||
<item quantity="zero"><xliff:g>%s</xliff:g> نقطة</item>
|
||||
<item quantity="one"><xliff:g>%s</xliff:g> نقطة</item>
|
||||
@@ -271,4 +261,31 @@
|
||||
<string name="settings_theme_color">لون المظهر</string>
|
||||
<string name="previousCard">السابق</string>
|
||||
<string name="nextCard">التالي</string>
|
||||
</resources>
|
||||
<string name="failedToRetrieveImageFile">فشل في استخراج ملف الصورة</string>
|
||||
<string name="barcodeLongPressMessage">يمكن فتح صور فقط في تطبيق معرض الصور</string>
|
||||
<string name="failedToOpenUrl">ثبت متصفح ويب أولاً</string>
|
||||
<string name="welcome">مرحبا بك في كاتيما</string>
|
||||
<string name="updateBalanceTitle">كم أنفقت؟</string>
|
||||
<string name="currentBalanceSentence">الرصيد الحالي: <xliff:g> %s </xliff:g></string>
|
||||
<plurals name="viewArchivedCardsWithCount">
|
||||
<item quantity="zero">عرض الأرشيف (<xliff:g>%1$d</xliff:g> بطاقة)</item>
|
||||
<item quantity="one">عرض الأرشيف (<xliff:g>%1$d</xliff:g> بطاقة)</item>
|
||||
<item quantity="two">عرض الأرشيف (<xliff:g>%1$d</xliff:g> بطاقتين)</item>
|
||||
<item quantity="few">عرض الأرشيف (<xliff:g>%1$d</xliff:g> بطاقات)</item>
|
||||
<item quantity="many">عرض الأرشيف (<xliff:g>%1$d</xliff:g> بطاقات)</item>
|
||||
<item quantity="other">عرض الأرشيف (<xliff:g>%1$d</xliff:g> بطاقات)</item>
|
||||
</plurals>
|
||||
<string name="importCards">استيراد البطاقات</string>
|
||||
<string name="newBalanceSentence">الرصيد الجديد: <xliff:g>%s</xliff:g></string>
|
||||
<string name="cameraPermissionDeniedTitle">تعذر الوصول إلى الكاميرا</string>
|
||||
<string name="noCameraPermissionDirectToSystemSetting">لمسح الباركود، ستحتاج Catima إلى الوصول إلى الكاميرا. اضغط هنا لتغيير إعدادات الأذونات.</string>
|
||||
<string name="updateBalance">تحديث الرصيد</string>
|
||||
<string name="updateBalanceHint">أدخل المبلغ</string>
|
||||
<string name="storageReadPermissionRequired">الصلاحيه للوصل للتخزين مطلوبة لهذا الاجراء</string>
|
||||
<string name="validFromDate">عربيه</string>
|
||||
<string name="cameraPermissionRequired">إذن للوصول إلى الكاميرا اللازمة لهذا الإجراء…</string>
|
||||
<string name="anyDate">أي تاريخ</string>
|
||||
<string name="chooseValidFromDate">اختر صالح من التاريخ</string>
|
||||
<string name="validFromSentence">صالح من:<xliff:g>%s</xliff:g></string>
|
||||
<string name="height">الطول:</string>
|
||||
</resources>
|
||||
|
||||
2
app/src/main/res/values-ars/strings.xml
Normal file
2
app/src/main/res/values-ars/strings.xml
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
56
app/src/main/res/values-ast/strings.xml
Normal file
56
app/src/main/res/values-ast/strings.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="storeName">Nome</string>
|
||||
<string name="note">Nota</string>
|
||||
<string name="noMatchingGiftCards">Nun hai nengún resultáu. Prueba a camudar la busca.</string>
|
||||
<string name="barcodeType">Tipu de códigu de barres</string>
|
||||
<string name="noBarcode">Ensin códigu de barres</string>
|
||||
<string name="star">Meter en Favoritos</string>
|
||||
<string name="confirm">Confirmar</string>
|
||||
<string name="deleteConfirmation">¿Quies desaniciar esta tarxeta permanentemente\?</string>
|
||||
<string name="importExport">Importar/Esportar</string>
|
||||
<string name="noCardIdError">Nun s\'introduxo nenguna ID</string>
|
||||
<string name="exportFailed">Num se pudo facer la esportación</string>
|
||||
<string name="importFailedTitle">La importación falló</string>
|
||||
<string name="exportOptionExplanation">Los datos escríbense nel llugar qu\'escueyas.</string>
|
||||
<string name="app_license">Software llibre llicenciao cola GPLv3+</string>
|
||||
<string name="action_search">Buscar</string>
|
||||
<string name="action_add">Amestar</string>
|
||||
<plurals name="selectedCardCount">
|
||||
<item quantity="one"><xliff:g>%d</xliff:g> na seleición</item>
|
||||
<item quantity="other"><xliff:g>%d</xliff:g> na seleición</item>
|
||||
</plurals>
|
||||
<string name="noGiftCards">Calca\'l botón «+» p\'amestar una tarxeta o impórtales dende\'l menú «⋮».</string>
|
||||
<string name="cardId">ID</string>
|
||||
<string name="barcodeNoBarcode">Nun hai nengún códigu de barres</string>
|
||||
<string name="save">Guardar</string>
|
||||
<string name="edit">Editar</string>
|
||||
<string name="delete">Desaniciar</string>
|
||||
<plurals name="deleteCardsTitle">
|
||||
<item quantity="one"></item>
|
||||
<item quantity="other"></item>
|
||||
</plurals>
|
||||
<string name="unstar">Quitar de Favoritos</string>
|
||||
<string name="cancel">Encaboxar</string>
|
||||
<string name="importFailed">Nun se pudo facer la importación</string>
|
||||
<string name="noCardExistsError">Nun se pudo atopar esa tarxeta</string>
|
||||
<string name="all">Too</string>
|
||||
<string name="noStoreError">Nun s\'introduxo nengún nome</string>
|
||||
<string name="sendLabel">Unviar…</string>
|
||||
<string name="editCardTitle">Editar la tarxeta</string>
|
||||
<string name="ok">D\'acuerdu</string>
|
||||
<string name="exportFailedTitle">La esportación falló</string>
|
||||
<string name="noCameraPermissionDirectToSystemSetting">Pa escaniar códigos de barres, Catima tien d\'acceder a la cámara. Toca equí pa camudar la configuración de los permisos.</string>
|
||||
<string name="debug_version_fmt">Versión: <xliff:g id="version">%s</xliff:g></string>
|
||||
<string name="importing">Importando…</string>
|
||||
<string name="exporting">Esportando…</string>
|
||||
<string name="storageReadPermissionRequired">Esta aición precisa\'l permisu pa lleer l\'almacenamientu…</string>
|
||||
<string name="cameraPermissionRequired">Esta aición precisa l\'accesu a la cámara…</string>
|
||||
<string name="cameraPermissionDeniedTitle">Nun se pudo acceder a la cámara</string>
|
||||
<string name="app_copyright_fmt" tools:ignore="PluralsCandidate">Copyright © 2019–<xliff:g>%d</xliff:g> Sylvia van Os</string>
|
||||
<string name="app_copyright_old">Básase en Loyalty Card Keychain
|
||||
\ncopyright © 2016–2020 Branden Archer</string>
|
||||
<string name="thumbnailDescription">Miniatura</string>
|
||||
<string name="settings">Configuración</string>
|
||||
<string name="settings_theme">Estilu</string>
|
||||
</resources>
|
||||
@@ -12,8 +12,8 @@
|
||||
<string name="star">Добавя към любими</string>
|
||||
<string name="noBarcode">Липсва щрихкод</string>
|
||||
<string name="barcodeNoBarcode">Липсва щрихкод</string>
|
||||
<string name="barcodeType">Вид на щрихкод</string>
|
||||
<string name="cardId">Идентификатор на карта</string>
|
||||
<string name="barcodeType">Вид на щрихкода</string>
|
||||
<string name="cardId">Номер на карта</string>
|
||||
<string name="note">Бележка</string>
|
||||
<string name="storeName">Наименование</string>
|
||||
<string name="noMatchingGiftCards">Няма резултати. Променете критериите за търсене.</string>
|
||||
@@ -34,21 +34,20 @@
|
||||
<string name="setFrontImage">Снимка на предната страна</string>
|
||||
<string name="photos">Снимки</string>
|
||||
<string name="importOptionApplicationExplanation">Изберете файл на друго приложение.</string>
|
||||
<string name="noExternalStoragePermissionError">Разрешете достъп до хранилището, за да работи внасянето и изнасянето</string>
|
||||
<string name="noCardExistsError">Картата не е намерена</string>
|
||||
<string name="updateBarcodeQuestionText">Идентификаторът е променен. Желаете ли с неговата стойност да бъде променен и щрихкодът\?</string>
|
||||
<string name="updateBarcodeQuestionText">Номерът е променен. Желаете ли същата стойност да бъде приложена и към щрихкода\?</string>
|
||||
<string name="updateBarcodeQuestionTitle">Обновяване на щрихкода\?</string>
|
||||
<string name="noCardIdError">Не е въведен идентификатор</string>
|
||||
<string name="noCardIdError">Не е въведен номер</string>
|
||||
<string name="noCardsMessage">Добавете карта</string>
|
||||
<string name="cardShortcut">Пряк път до карта</string>
|
||||
<string name="addCardTitle">Добавяне на карта</string>
|
||||
<string name="removeImage">Премахване на изображение</string>
|
||||
<string name="takePhoto">Снимане</string>
|
||||
<string name="copy_to_clipboard_multiple_toast">Идентификаторите са копирани в междинната памет</string>
|
||||
<string name="copy_to_clipboard_multiple_toast">Номерата са копирани в междинната памет</string>
|
||||
<string name="intent_import_card_from_url_share_multiple_text">Искам да споделя тези карти с вас</string>
|
||||
<string name="wrongValueForBarcodeType">Стойността е невалидна за избрания вид щрихкод</string>
|
||||
<string name="wrongValueForBarcodeType">Неприемлива стойност за избрания вид щрихкод</string>
|
||||
<string name="setBarcodeId">Задаване на стойност</string>
|
||||
<string name="sameAsCardId">Същата като идентификатора</string>
|
||||
<string name="sameAsCardId">Като номера</string>
|
||||
<string name="barcodeId">Стойност на щрихкода</string>
|
||||
<string name="importLoyaltyCardKeychain">Внасяне от Loyalty Card Keychain</string>
|
||||
<string name="importFidmeMessage">Изберете файла <i>fidme-export-request-xxxxxx.zip</i>, предварително изнесен от FidMe и ръчно изберете вида на щрихкодовете.
|
||||
@@ -64,21 +63,19 @@
|
||||
<string name="turn_flashlight_off">Изключва светкавицата</string>
|
||||
<string name="turn_flashlight_on">Включва светкавицата</string>
|
||||
<string name="passwordRequired">Въведете паролата</string>
|
||||
<string name="points">Точки</string>
|
||||
<string name="points">точки</string>
|
||||
<string name="currency">Валута</string>
|
||||
<string name="balance">Наличност</string>
|
||||
<string name="errorReadingImage">Изображението е нечетимо</string>
|
||||
<string name="noBarcodeFound">Не е намерен щрихкод</string>
|
||||
<string name="moveBarcodeToCenterOfScreen">Премества щрихкода в центъра на екрана</string>
|
||||
<string name="moveBarcodeToTopOfScreen">Премества щрихкода най-горе на екрана</string>
|
||||
<string name="never">Не изтича</string>
|
||||
<string name="chooseExpiryDate">Дата на изтичане</string>
|
||||
<string name="expiryDate">Валидност</string>
|
||||
<string name="chooseExpiryDate">Определена дата</string>
|
||||
<string name="expiryDate">Валидност до</string>
|
||||
<string name="editBarcode">Редактиране на щрихкод</string>
|
||||
<string name="barcode">Щрихкод</string>
|
||||
<string name="card">Карта</string>
|
||||
<string name="groupsList">Списъци: <xliff:g>%s</xliff:g></string>
|
||||
<string name="expiryStateSentence">Валидност: <xliff:g>%s</xliff:g></string>
|
||||
<string name="expiryStateSentence">Валидност до: <xliff:g>%s</xliff:g></string>
|
||||
<string name="expiryStateSentenceExpired">Изтекла: <xliff:g>%s</xliff:g></string>
|
||||
<string name="balanceSentence">Наличност: <xliff:g>%s</xliff:g></string>
|
||||
<string name="noGroups">Докоснете бутона +, за да добавите списък.</string>
|
||||
@@ -86,20 +83,18 @@
|
||||
<string name="groups">Списъци</string>
|
||||
<string name="enter_group_name">Въведете име на списъка</string>
|
||||
<string name="intent_import_card_from_url_share_text">Искам да споделя тази карта с вас</string>
|
||||
<string name="settings_display_barcode_max_brightness">Увеличаване на яркостта при видим щрихкод</string>
|
||||
<string name="settings_keep_screen_on">Поддържане на екрана включен</string>
|
||||
<string name="settings_disable_lockscreen_while_viewing_card">Предотвратяване на заключване на екрана</string>
|
||||
<string name="settings_max_font_size_scale">Максимален размер на шрифта</string>
|
||||
<string name="settings_display_barcode_max_brightness">Максимална яркост при видим щрихкод</string>
|
||||
<string name="settings_keep_screen_on">Без изключване на екрана</string>
|
||||
<string name="settings_disable_lockscreen_while_viewing_card">Без заключване на екрана</string>
|
||||
<string name="settings_dark_theme">Тъмна</string>
|
||||
<string name="settings_light_theme">Светла</string>
|
||||
<string name="settings_system_theme">Системна</string>
|
||||
<string name="settings_theme">Тема</string>
|
||||
<string name="settings_category_title_ui">Потребителски интерфейс</string>
|
||||
<string name="settings">Настройки</string>
|
||||
<string name="starImage">Звезда за любимо</string>
|
||||
<string name="thumbnailDescription">Миниатюра</string>
|
||||
<string name="copy_to_clipboard_toast">Идентификаторът е копиран в междинната памет</string>
|
||||
<string name="enterBarcodeInstructions">Въведете идентификатор и или изберете вида на щрихкода, или докоснете бутона „Липсва щрихкод“.</string>
|
||||
<string name="copy_to_clipboard_toast">Номерът е копиран в междинната памет</string>
|
||||
<string name="enterBarcodeInstructions">Въведете номер и после или изберете вида на щрихкода, или докоснете бутона „Липсва щрихкод“.</string>
|
||||
<string name="selectBarcodeTitle">Избиране на щрихкод</string>
|
||||
<string name="importOptionApplicationButton">Избиране чрез приложение</string>
|
||||
<string name="importing">Внасяне…</string>
|
||||
@@ -117,7 +112,7 @@
|
||||
<string name="scanCardBarcode">Снемане на щрихкод</string>
|
||||
<string name="editCardTitle">Редактиране на карта</string>
|
||||
<string name="share">Споделя</string>
|
||||
<string name="copy_to_clipboard">Копира идентификатора в междинната памет</string>
|
||||
<string name="copy_to_clipboard">Копира номера в междинната памет</string>
|
||||
<string name="ok">Добре</string>
|
||||
<string name="importSuccessful">Данните са внесени</string>
|
||||
<string name="chooseImportType">Внасяне на данни на</string>
|
||||
@@ -128,7 +123,6 @@
|
||||
<string name="importOptionFilesystemExplanation">Изберете определен файл от файловата система.</string>
|
||||
<string name="app_resources">Свободни ресурси: <xliff:g id="app_resources_list">%s</xliff:g></string>
|
||||
<string name="app_libraries">Свободни библиотеки: <xliff:g id="app_libraries_list">%s</xliff:g></string>
|
||||
<string name="app_revision_fmt">Компилация: <xliff:g id="app_revision_url">%s</xliff:g></string>
|
||||
<string name="debug_version_fmt">Издание: <xliff:g id="version">%s</xliff:g></string>
|
||||
<string name="about_title_fmt">Относно <xliff:g id="app_name">%s</xliff:g></string>
|
||||
<string name="app_copyright_fmt" tools:ignore="PluralsCandidate">Всички права запазени © 2019–<xliff:g>%d</xliff:g> Sylvia van Os</string>
|
||||
@@ -153,7 +147,7 @@
|
||||
<string name="importVoucherVault">Внасяне от Voucher Vault</string>
|
||||
<string name="importVoucherVaultMessage">Изберете файла <i>vouchervault.json</i>, предварително изнесен от Voucher Vault.
|
||||
\nСъздайте такъв файл от меню „Export“ във Voucher Vault.</string>
|
||||
<string name="importStocardMessage">Изберете файла <i>***-sync.zip</i>, предварително изнесен от Stocard.
|
||||
<string name="importStocardMessage">Изберете файла <i>***.zip</i>, предварително изнесен от Stocard.
|
||||
\nПолучете го като изпратите писмо на support@stocardapp.com с искане за изнасяне вашите данни.</string>
|
||||
<string name="importLoyaltyCardKeychainMessage">Изберете файла <i>LoyaltyCardKeychain.csv</i>, предварително изнесен от Loyalty Card Keychain.
|
||||
\nСъздайте такъв файл от меню Внасяне/изнасяне от друго устройство с Loyalty Card Keychain като изберете Изнасяне.</string>
|
||||
@@ -184,10 +178,8 @@
|
||||
<string name="settings_locale">Език</string>
|
||||
<string name="noGroupCards">Групата е празна</string>
|
||||
<string name="barcodeImageDescriptionWithType">Изображение на щрихкод от вид <xliff:g>%s</xliff:g></string>
|
||||
<string name="swipeToSwitchImages">Плъзване или задържане за смяна на изображения</string>
|
||||
<string name="sort_by">Сортиране по</string>
|
||||
<string name="reverse">…в обратен ред</string>
|
||||
<string name="sort_by_balance">Наличност</string>
|
||||
<string name="sort_by_expiry">Валидност</string>
|
||||
<string name="sort_by_most_recently_used">Последно използване</string>
|
||||
<string name="sort_by_name">Наименование</string>
|
||||
@@ -203,36 +195,34 @@
|
||||
<string name="and_data_usage">и използване на данни</string>
|
||||
<string name="help_translate_this_app">Помогнете за превода на приложението</string>
|
||||
<string name="exportPasswordHint">Въведете парола</string>
|
||||
<string name="exportPassword">Задаване на парола за защита на изнесеното (по избор)</string>
|
||||
<string name="setIcon">Задаване на пиктограма</string>
|
||||
<string name="exportPassword">Защитете архива с парола (по желание)</string>
|
||||
<string name="setIcon">Задаване на миниатюра</string>
|
||||
<string name="editGroup">Променяне на списъка: <xliff:g>%s</xliff:g></string>
|
||||
<string name="group_name_already_in_use">Има списък с това име</string>
|
||||
<string name="group_updated">Промените са запазени</string>
|
||||
<string name="selectColor">Избиране на цвят</string>
|
||||
<string name="group_name_is_empty">Името на списъка не може да е празно</string>
|
||||
<string name="group_edit">Редактиране на списък</string>
|
||||
<string name="action_show_details">Повече детайли</string>
|
||||
<string name="action_show_details">Подробности под картата</string>
|
||||
<string name="action_hide_details">По-малко детайли</string>
|
||||
<string name="noGiftCardsGroup">Създайте карти и ги зачислите към списък от тук.</string>
|
||||
<string name="translate_platform">в Weblate</string>
|
||||
<string name="shortcutSelectCard">Избор на карта</string>
|
||||
<string name="starred">Със звезда</string>
|
||||
<string name="set_scale">Мащаб</string>
|
||||
<string name="showMoreInfo">Показване на информация</string>
|
||||
<string name="hideMoreInfo">Скриване на информация</string>
|
||||
<string name="options">Настройки</string>
|
||||
<string name="card_ids_copied">Идентификаторите са копирани</string>
|
||||
<string name="card_ids_copied">Номерата са копирани</string>
|
||||
<plurals name="balancePoints">
|
||||
<item quantity="one"><xliff:g>%s</xliff:g> точка</item>
|
||||
<item quantity="other"><xliff:g>%s</xliff:g> точки</item>
|
||||
</plurals>
|
||||
<string name="settings_oled_dark">Чисто черен фон за тъмната тема</string>
|
||||
<string name="settings_oled_dark">Черен фон за тъмната тема</string>
|
||||
<string name="include_if_asking_support">Ако искате да потърсите поддръжка, включете следната информация:</string>
|
||||
<string name="settings_card_orientation">Положение на щрихкода</string>
|
||||
<string name="settings_card_orientation">Завъртане на щрихкода</string>
|
||||
<string name="settings_follow_system_orientation">Според системата</string>
|
||||
<string name="settings_portrait_orientation">Портретно</string>
|
||||
<string name="settings_landscape_orientation">Пейзажно</string>
|
||||
<string name="settings_lock_on_opening_orientation">Използване на положението, използвано при отваряне на картата</string>
|
||||
<string name="settings_portrait_orientation">Портрет</string>
|
||||
<string name="settings_landscape_orientation">Пейзаж</string>
|
||||
<string name="settings_lock_on_opening_orientation">Като при отваряне на картата</string>
|
||||
<string name="duplicateCard">Дублиране</string>
|
||||
<string name="archive">Архивиране</string>
|
||||
<string name="unarchive">Изваждане от архива</string>
|
||||
@@ -240,7 +230,7 @@
|
||||
<string name="unarchived">Карта е извадена от архива</string>
|
||||
<string name="archiveList">Архив</string>
|
||||
<string name="noUnarchivedCardsMessage">Няма карти извън архива</string>
|
||||
<string name="failedLaunchingPhotoPicker">Не е намерено поддържано приложение за галерия.</string>
|
||||
<string name="failedLaunchingPhotoPicker">Не е намерено поддържано приложение за галерия</string>
|
||||
<plurals name="groupCardCountWithArchived">
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> карта (<xliff:g id="archivedCount">%2$d</xliff:g> архивирана)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> карти (<xliff:g id="archivedCount">%2$d</xliff:g> архивирани)</item>
|
||||
@@ -253,4 +243,44 @@
|
||||
<item quantity="one">Преглед на архива (<xliff:g>%1$d</xliff:g> карта)</item>
|
||||
<item quantity="other">Преглед на архива (<xliff:g>%1$d</xliff:g> карти)</item>
|
||||
</plurals>
|
||||
<string name="barcodeLongPressMessage">В приложението галерия могат да бъдат отваряни само изображения</string>
|
||||
<string name="failedToRetrieveImageFile">Не е възможно извличане на изображение</string>
|
||||
<string name="noCameraPermissionDirectToSystemSetting">За да сканирате щрихкодове с Catima е необходим достъп до камерата. За да промените разрешението докоснете тук.</string>
|
||||
<string name="updateBalanceTitle">Каква е промяната\?</string>
|
||||
<string name="updateBalanceHint">Въведете стойност</string>
|
||||
<string name="newBalanceSentence">Нов баланс: <xliff:g>%s</xliff:g></string>
|
||||
<string name="cameraPermissionDeniedTitle">Камерата е недостъпна</string>
|
||||
<string name="currentBalanceSentence">Текущ баланс: <xliff:g>%s</xliff:g></string>
|
||||
<string name="updateBalance">Обновяване на баланса</string>
|
||||
<string name="importCards">Внасяне на карти</string>
|
||||
<string name="storageReadPermissionRequired">За това действие е необходимо разрешение за четене на хранилището…</string>
|
||||
<string name="cameraPermissionRequired">За това действие е необходимо разрешение за достъп до камерата…</string>
|
||||
<string name="validFromDate">Валидност от</string>
|
||||
<string name="anyDate">Без значение от датата</string>
|
||||
<string name="validFromSentence">Валидност от: <xliff:g>%s</xliff:g></string>
|
||||
<string name="chooseValidFromDate">Определена дата</string>
|
||||
<string name="height">Височина:</string>
|
||||
<string name="switchToFrontImage">Показване на предната страна</string>
|
||||
<string name="switchToBackImage">Показване на задната страна</string>
|
||||
<string name="switchToBarcode">Показване на щрихкода</string>
|
||||
<string name="openFrontImageInGalleryApp">Отваряне на изображението на предната страна в приложението галерия</string>
|
||||
<string name="openBackImageInGalleryApp">Отваряне на изображението на задната страна в приложението галерия</string>
|
||||
<string name="setBarcodeHeight">Задаване на височина на щрихкода</string>
|
||||
<string name="donate">Даряване</string>
|
||||
<string name="icon_header_click_text">Задръжте, за да промените миниатюрата</string>
|
||||
<string name="show_note">Бележка</string>
|
||||
<string name="show_balance">Баланс</string>
|
||||
<string name="show_validity">Валидност</string>
|
||||
<string name="show_name_below_image_thumbnail">Наименование</string>
|
||||
<string name="permissionReadCardsLabel">Четене на карти на Catima</string>
|
||||
<string name="permissionReadCardsDescription">Четене на картите с всички подробности, включително бележки и изображения</string>
|
||||
<string name="settings_allow_content_provider_read_title">Разрешаване на достъп на други приложения до данните</string>
|
||||
<string name="settings_display_barcode_max_brightness_summary">Необходимо за работата на някои скенери</string>
|
||||
<string name="settings_disable_lockscreen_while_viewing_card_summary">Без заключване на екрана при преглед на карта</string>
|
||||
<string name="settings_allow_content_provider_read_summary">Приложенията ще искат разрешение, за да получат достъп</string>
|
||||
<string name="settings_oled_dark_summary">Намалява разхода на батерия от OLED дисплеи</string>
|
||||
<string name="settings_category_title_cards">Карти</string>
|
||||
<string name="settings_category_title_general">Общи</string>
|
||||
<string name="settings_category_title_privacy">Поверителност</string>
|
||||
<string name="settings_keep_screen_on_summary">Спира автоматичното заключване на екрана при преглед на карти</string>
|
||||
</resources>
|
||||
@@ -1,56 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="save">সংরক্ষণ</string>
|
||||
<string name="cancel">বাতিল</string>
|
||||
<string name="unstar">তারা মুক্ত</string>
|
||||
<string name="star">তারা</string>
|
||||
<string name="barcodeNoBarcode">বারকোড না বারকোড</string>
|
||||
<string name="barcodeNoBarcode">কোনো বারকোড নেই</string>
|
||||
<string name="barcodeType">বারকোড ধরন</string>
|
||||
<string name="note">বিঃদ্রঃ</string>
|
||||
<string name="storeName">দোকানের নাম</string>
|
||||
<string name="noMatchingGiftCards">কোন ম্যাচিং উপহার কার্ড নেই</string>
|
||||
<string name="noGiftCards">উপহার কার্ড নেই</string>
|
||||
<string name="noMatchingGiftCards">কোনো ফলাফল পাওয়া যায়নি। অনুসন্ধানের বাক্যটি বদলে দেখুন।</string>
|
||||
<string name="noGiftCards">প্লাস বোতামটি টিপে একটি কার্ড যোগ করুন বা ⋮ মেনু থেকে কিছু নিয়ে আসুন।</string>
|
||||
<string name="action_add">কর্ম যোগ</string>
|
||||
<string name="all">সব</string>
|
||||
<string name="noGroupCards">গোষ্ঠী কার্ড নেই</string>
|
||||
<string name="noGroups">গোষ্ঠীগুলি নেই</string>
|
||||
<string name="noGroupCards">এই গ্রুপটি খালি</string>
|
||||
<string name="noGroups">+ যোগ বোতামটি টিপে গ্রুপ যোগ করুন যাতে তাদের শ্রেণীকরণ করা যায়।</string>
|
||||
<string name="groups">গোষ্ঠীগুলি</string>
|
||||
<string name="enter_group_name">গোষ্ঠী নাম লিখুন </string>
|
||||
<string name="exportSuccessful">রপ্তানি সফল</string>
|
||||
<string name="importSuccessful">আগম সফল</string>
|
||||
<string name="exportSuccessful">তথ্য রপ্তানি করা শেষ</string>
|
||||
<string name="importSuccessful">তথ্য আনা শেষ</string>
|
||||
<string name="intent_import_card_from_url_share_text">url শেয়ার টেক্সট থেকে ইন্টেন্ট ইম্পোর্ট কার্ড</string>
|
||||
<string name="settings_disable_lockscreen_while_viewing_card"> কার্ড দেখা কালিন লকস্ক্রিন নিষ্ক্রিয়</string>
|
||||
<string name="settings_disable_lockscreen_while_viewing_card">স্ক্রীন লক হতে দেবেন না</string>
|
||||
<string name="settings_keep_screen_on">সেটিংস পর্দা খোলা রাখুন</string>
|
||||
<string name="settings_max_font_size_scale">সর্বোচ্চ হরফ আকার</string>
|
||||
<string name="settings_light_theme">সাদাটে থিম</string>
|
||||
<string name="settings_system_theme">যন্ত্রর থিম</string>
|
||||
<string name="settings_theme">থিম</string>
|
||||
<string name="settings_category_title_ui">বিভাগ শিরোনাম</string>
|
||||
<string name="starImage">তারা ছবি</string>
|
||||
<string name="importCatima">ক্যাতিনা আগম</string>
|
||||
<string name="importLoyaltyCardKeychain">আমদানি লয়্যালটি কার্ড কীচেন</string>
|
||||
<string name="importStocard">স্টো কার্ড আমদানি করুন</string>
|
||||
<string name="importVoucherVault">আমদানি ভাউচার ভল্ট</string>
|
||||
<string name="barcodeId">বারকোড আইডি</string>
|
||||
<string name="sameAsCardId">কার্ড আইডির মতো</string>
|
||||
<string name="sameAsCardId">আইডি আর এটা এক</string>
|
||||
<string name="setBarcodeId">বারকোড আইডি সেট করুন</string>
|
||||
<string name="unsupportedBarcodeType">অসমর্থিত বারকোড টাইপ</string>
|
||||
<string name="unsupportedBarcodeType">এই বারকোডের টাইপটি এখন দেখানো যাচ্ছে না। অ্যাপের পরের সংস্করণে হয়ত এটি সমর্থন করা যেতে পারে।</string>
|
||||
<string name="wrongValueForBarcodeType">বারকোড টাইপের জন্য ভুল মান</string>
|
||||
<string name="copy_to_clipboard_multiple_toast">ক্লিপবোর্ড একাধিক টোস্টে অনুলিপি করুন</string>
|
||||
<string name="copy_to_clipboard_multiple_toast">আইডিগুলি ক্লিপবোর্ডে কপি হল</string>
|
||||
<string name="intent_import_card_from_url_share_multiple_text">url থেকে ইন্টেন্ট ইম্পোর্ট কার্ড একাধিক টেক্সট শেয়ার করে</string>
|
||||
<string name="frontImageDescription">সামনের চিত্রের বর্ণনা</string>
|
||||
<string name="backImageDescription">পিছনের চিত্রের বর্ণনা</string>
|
||||
<string name="frontImageDescription">সামনের চিত্র</string>
|
||||
<string name="backImageDescription">পিছনের চিত্র</string>
|
||||
<string name="photos">ছবি</string>
|
||||
<string name="setFrontImage">সদর ছবি স্থাপন</string>
|
||||
<string name="setBackImage">পিছনের ছবি স্থাপন</string>
|
||||
<string name="removeImage">ছবি অপসারণ</string>
|
||||
<string name="takePhoto">ছবি নেত্তয়া</string>
|
||||
<string name="updateBarcodeQuestionTitle">হালনাগাদ বারকোড প্রশ্ন শিরোনাম</string>
|
||||
<string name="updateBarcodeQuestionText">হালনাগাদ বারকোড প্রশ্ন টেক্সট </string>
|
||||
<string name="updateBarcodeQuestionTitle">বারকোডের মানটি আপডেট করবেন\?</string>
|
||||
<string name="updateBarcodeQuestionText">আপনি আইডিটি পাল্টেছেন, এটির কোনো বারকোড দিয়ে কি এখনের বারকোডটি আপডেট করে দেবেন\?</string>
|
||||
<string name="yes">হাঁ</string>
|
||||
<string name="no">না</string>
|
||||
<string name="passwordRequired">পাসওয়ার্ড প্রয়োজন</string>
|
||||
<string name="failedGeneratingShareURL">শেয়ার ইউআরএল তৈরি করতে ব্যর্থ হয়েছে</string>
|
||||
<string name="failedGeneratingShareURL">শেয়ার করার ইউআরএল তৈরি করা গেল না। অনুগ্রহ করে এটিকে রিপোর্ট করে দিন।</string>
|
||||
<string name="turn_flashlight_on">টর্চলাইট চালু করুন</string>
|
||||
<string name="turn_flashlight_off">টর্চলাইট বন্ধ করুন</string>
|
||||
<string name="settings_locale">লোকেল</string>
|
||||
@@ -65,23 +63,213 @@
|
||||
<string name="settings_green_theme">সবুজ থিম</string>
|
||||
<string name="settings_brown_theme">বাদামী থিম</string>
|
||||
<string name="sort">সাজান</string>
|
||||
<string name="swipeToSwitchImages">ছবি পরিবর্তন করতে সোয়াইপ করুন</string>
|
||||
<string name="sort_by_name">নামের দ্বারা সাজান</string>
|
||||
<string name="sort_by_most_recently_used">সর্বাধিক সম্প্রতি ব্যবহৃত দ্বারা সাজান</string>
|
||||
<string name="sort_by_expiry">মেয়াদ শেষ করে সাজান</string>
|
||||
<string name="reverse">বিপরীত</string>
|
||||
<string name="reverse">...উল্টো ক্রমে</string>
|
||||
<string name="sort_by">ক্রমানুসার</string>
|
||||
<string name="noCardExistsError">কোন কার্ড নেই ত্রুটি</string>
|
||||
<string name="noCardExistsError">কার্ডটি খুঁজে পাওয়া গেল না</string>
|
||||
<string name="noStoreError">স্টোরেজ ত্রুটি নেই</string>
|
||||
<string name="card_ids_copied">কার্ড আইডি কপি করা হয়েছে</string>
|
||||
<string name="card_ids_copied">আইডি কপি করা হয়েছে</string>
|
||||
<string name="noCardsMessage">কোন কার্ড বার্তা নেই</string>
|
||||
<string name="addCardTitle">কার্ডের শিরোনাম যোগ করুন</string>
|
||||
<string name="editCardTitle">কার্ডের শিরোনাম সম্পাদনা করুন</string>
|
||||
<string name="sendLabel">লেবেল পাঠান</string>
|
||||
<string name="sendLabel">পাঠান…</string>
|
||||
<string name="share">ভাগ</string>
|
||||
<string name="copy_to_clipboard">নকল করুন ক্লিপবোর্ড এ</string>
|
||||
<string name="deleteConfirmation">নিশ্চিতকরণ মুছে দিন</string>
|
||||
<string name="deleteConfirmation">এই কার্ডটি চিরকালের জন্য মুছে দেবো\?</string>
|
||||
<string name="confirm">নিশ্চিত করুন</string>
|
||||
<string name="delete">মুছে ফেলুন</string>
|
||||
<string name="edit">সম্পাদনা</string>
|
||||
<string name="action_search">খুঁজুন</string>
|
||||
<string name="card">কার্ড</string>
|
||||
<string name="currency">মুদ্রা</string>
|
||||
<string name="cardId">কার্ড আইডি</string>
|
||||
<string name="noBarcode">বারকোড নেই</string>
|
||||
<string name="deleteTitle">কার্ড ডিলিট করুন</string>
|
||||
<string name="ok">ঠিক আছে</string>
|
||||
<string name="about">সম্পর্কিত</string>
|
||||
<string name="debug_version_fmt">সংস্করণ: <xliff:g id="version">%s</xliff:g></string>
|
||||
<string name="importOptionApplicationButton">অন্য অ্যাপ ব্যাবহার করুন</string>
|
||||
<string name="moveUp">উপরে উঠান</string>
|
||||
<string name="moveDown">নিচে নামান</string>
|
||||
<string name="expiryDate">মেয়াদোত্তীর্ণ তারিখ</string>
|
||||
<string name="noBarcodeFound">কোনো বারকোড পাওয়া যায়নি</string>
|
||||
<string name="cameraPermissionRequired">এই কাজটির জন্য ক্যামেরা ব্যবহার করার অনুমতি লাগবে…</string>
|
||||
<string name="noCameraPermissionDirectToSystemSetting">বারকোড স্ক্যান করার জন্য, Catima কে ক্যামেরাটি ব্যবহার করার অনুমতি দিতে হবে। এইখানে টাচ করে আপনার অনুমতি সেটিংস পালটে নিন।</string>
|
||||
<string name="importOptionApplicationExplanation">একটি ফাইল খোলার জন্য যেকোনো অ্যাপ বা আপনার প্রিয় ফাইল ম্যানেজারটি ব্যবহার করুন।</string>
|
||||
<string name="app_copyright_fmt" tools:ignore="PluralsCandidate">মেধাস্বত্ব © 2019–<xliff:g>%d</xliff:g> Sylvia van Os</string>
|
||||
<string name="app_license">কপিলেফট দ্বারা রক্ষা করা মুক্ত সফটওয়্যার, লাইসেন্স করা GPLv3+ এর অধীনে</string>
|
||||
<string name="enterBarcodeInstructions">আইডিটি লিখুন আর নয় নিচ থেকে একটি বারকোডের প্রকার বা \"কোনো বারকোড নেই\", নির্বাচন করুন।</string>
|
||||
<plurals name="deleteCardsConfirmation">
|
||||
<item quantity="one">এই <xliff:g>%d</xliff:g>টি কার্ড কি চিরকালের জন্য মুছে দেবো\?</item>
|
||||
<item quantity="other">এই <xliff:g>%d</xliff:g>টি কার্ড কি চিরকালের জন্য মুছে দেবো\?</item>
|
||||
</plurals>
|
||||
<plurals name="selectedCardCount">
|
||||
<item quantity="one"><xliff:g>%d</xliff:g> একটি নির্বাচিত</item>
|
||||
<item quantity="other"><xliff:g>%d</xliff:g> টি নির্বাচিত</item>
|
||||
</plurals>
|
||||
<plurals name="deleteCardsTitle">
|
||||
<item quantity="one"><xliff:g>%d</xliff:g>টি কার্ড মুছে ফেলুন</item>
|
||||
<item quantity="other"><xliff:g>%d</xliff:g>টি কার্ড মুছে ফেলুন</item>
|
||||
</plurals>
|
||||
<string name="cameraPermissionDeniedTitle">ক্যামেরাটি ব্যবহার করা যাচ্ছে না</string>
|
||||
<string name="importOptionFilesystemExplanation">স্টোরেজ থেকে নির্দিষ্ট একটি ফাইল বাছুন।</string>
|
||||
<string name="app_libraries">মুক্ত লাইব্রেরি যেগুলি আমার নয়: <xliff:g id="app_libraries_list">%s</xliff:g></string>
|
||||
<string name="about_title_fmt"><xliff:g id="app_name">%s</xliff:g>টির সম্পর্কে</string>
|
||||
<string name="app_resources">মুক্ত সম্পদ যেগুলি আমার নয়: <xliff:g id="app_resources_list">%s</xliff:g></string>
|
||||
<string name="thumbnailDescription">থাম্বনেইল</string>
|
||||
<string name="settings_card_orientation">বারকোড অভিমুখ</string>
|
||||
<string name="settings_follow_system_orientation">সিস্টেমের অনুসারে</string>
|
||||
<string name="settings_portrait_orientation">প্রতিকৃতি</string>
|
||||
<string name="barcodeImageDescriptionWithType">ছবি <xliff:g>%s</xliff:g> বারকোড</string>
|
||||
<string name="exportName">রপ্তানি</string>
|
||||
<string name="failedParsingImportUriError">আমদানির URI-টি বোঝা যাচ্ছে না</string>
|
||||
<string name="importExport">আমদানি/রপ্তানি</string>
|
||||
<string name="cardShortcut">কার্ড শর্টকাট</string>
|
||||
<string name="exportFailed">রপ্তানি করা যাচ্ছে না</string>
|
||||
<string name="copy_to_clipboard_toast">আইডি ক্লিপবোর্ডে নকল করা হল</string>
|
||||
<string name="noCardIdError">কোনো আইডি দওয়া হয়নি</string>
|
||||
<string name="importExportHelp">নিজের ডেটা অন্য কোথাও সংরক্ষণ করে রাখলে পরে সেটা অন্য ডিভাইসে সরিয়ে নিতে পারবেন।</string>
|
||||
<string name="importFailed">আমদানি করা গেল না</string>
|
||||
<string name="noGiftCardsGroup">কিছু কার্ড বানান আর এই গ্রুপে স্থির করুন।</string>
|
||||
<string name="scanCardBarcode">বারকোড স্ক্যান করুন</string>
|
||||
<string name="importSuccessfulTitle">আমদানি শেষ</string>
|
||||
<string name="importFailedTitle">আমদানি ব্যর্থ</string>
|
||||
<string name="exportSuccessfulTitle">রপ্তানি শেষ</string>
|
||||
<string name="exportFailedTitle">রপ্তানি ব্যর্থ</string>
|
||||
<string name="importing">আমদানি করা হচ্ছে…</string>
|
||||
<string name="exporting">রপ্তানি করা হচ্ছে…</string>
|
||||
<string name="storageReadPermissionRequired">এই কাজটির জন্য ফোনের স্টোরেজ দেখার অনুমতি লাগবে…</string>
|
||||
<string name="exportOptionExplanation">ডেটাটি আপনার পছন্দের জায়গায় রাখা হবে।</string>
|
||||
<string name="importOptionFilesystemTitle">স্টোরেজ থেকে আমদানি করুন</string>
|
||||
<string name="importOptionFilesystemButton">স্টোরেজ থেকে</string>
|
||||
<string name="importOptionApplicationTitle">অন্য অ্যাপ ব্যবহার করুন</string>
|
||||
<string name="app_copyright_old">Loyalty Card Keychain এর উপর ভিত্তি করে
|
||||
\nমেধাস্বত্ব © 2016–2020 Branden Archer</string>
|
||||
<string name="selectBarcodeTitle">বারকোড নির্বাচন করুন</string>
|
||||
<string name="settings">সেটিংস</string>
|
||||
<string name="settings_dark_theme">অন্ধকার</string>
|
||||
<string name="settings_landscape_orientation">অনুভূমিক</string>
|
||||
<string name="settings_lock_on_opening_orientation">কার্ড খোলার সময় যে অভিমুখ থাকে সেটিতে লক করে দেবেন</string>
|
||||
<string name="group_name_already_in_use">গ্রুপটির নাম আগে একবার ব্যবহার করে ফেলেছেন</string>
|
||||
<string name="group_edit">গ্রুপ সম্পাদনা করুন</string>
|
||||
<string name="group_updated">গ্রুপটি আপডেট করা হল</string>
|
||||
<string name="group_name_is_empty">গ্রুপের একটি নাম থাকতে হবে</string>
|
||||
<string name="deleteConfirmationGroup">গ্রুপটি মুছে দেবেন\?</string>
|
||||
<string name="failedOpeningFileManager">প্রথমে একটি ফাইল ম্যানেজার ইনস্টল করুন।</string>
|
||||
<string name="leaveWithoutSaveConfirmation">সংরক্ষণ না করেই চলে যাবেন\?</string>
|
||||
<string name="addManually">নিজে হাতে আইডি লিখুন</string>
|
||||
<plurals name="groupCardCount">
|
||||
<item quantity="one"><xliff:g>%d</xliff:g>টি কার্ড</item>
|
||||
<item quantity="other"><xliff:g>%d</xliff:g>টি কার্ড</item>
|
||||
</plurals>
|
||||
<string name="leaveWithoutSaveTitle">প্রস্থান</string>
|
||||
<string name="settings_display_barcode_max_brightness">বারকোড উজ্জ্বল করুন</string>
|
||||
<string name="editGroup">যেই গ্রুপ সম্পাদনা করা হচ্ছে: <xliff:g>%s</xliff:g></string>
|
||||
<string name="expiryStateSentenceExpired">মেয়াদ শেষ হয়ে গিয়েছে: <xliff:g>%s</xliff:g></string>
|
||||
<string name="editBarcode">বারকোড সম্পাদন করুন</string>
|
||||
<string name="never">কখনই না</string>
|
||||
<string name="addFromImage">গ্যালারি থেকে ছবি বাছুন</string>
|
||||
<string name="groupsList">গ্রুপগুলি: <xliff:g>%s</xliff:g></string>
|
||||
<plurals name="balancePoints">
|
||||
<item quantity="one"><xliff:g>%s</xliff:g> পয়েন্ট</item>
|
||||
<item quantity="other"><xliff:g>%s</xliff:g> পয়েন্ট</item>
|
||||
</plurals>
|
||||
<string name="expiryStateSentence">মেয়াদ শেষ হবে: <xliff:g>%s</xliff:g></string>
|
||||
<string name="balanceSentence">ব্যালেন্স: <xliff:g>%s</xliff:g></string>
|
||||
<string name="chooseExpiryDate">মেয়াদ শেষ হওয়ার তারিখ মনোনীত করুন</string>
|
||||
<string name="moveBarcodeToTopOfScreen">বারকোডটি স্ক্রিনের উপরে উঠিয়ে দিন</string>
|
||||
<string name="errorReadingImage">ছবিটি স্ক্যান করা যাচ্ছে না</string>
|
||||
<string name="privacy_policy_popup_text">ব্যক্তিগত তথ্যের গোপনীয়তা নীতি নোটিশ (কিছু অ্যাপ স্টোরের এটি লাগে):
|
||||
\n
|
||||
\nকোন তথ্য একেবারেই সংগ্রহ করা হয় না, যা যে কেউ নিশ্চিত করতে পারবেন কারন আমাদের অ্যাপ মুক্ত সফটওয়্যার।</string>
|
||||
<string name="balance">ব্যালান্স</string>
|
||||
<string name="points">পয়েন্ট</string>
|
||||
<string name="parsingBalanceFailed"><xliff:g>%s</xliff:g> কোনো বৈধ ব্যালান্স মনে হচ্ছে না।</string>
|
||||
<string name="chooseImportType">এখান থেকে তথ্য আমদানি করুন</string>
|
||||
<string name="app_loyalty_card_keychain">আনুগত্য কার্ড কীচেন</string>
|
||||
<string name="privacy_policy">ব্যক্তিগত তথ্যের গোপনীয়তা নীতি</string>
|
||||
<string name="accept">গ্রহণ</string>
|
||||
<string name="failedToRetrieveImageFile">ছবি ফাইল পুনরুদ্ধার করতে ব্যর্থ হয়েছে</string>
|
||||
<string name="on_github">GitHub -এ</string>
|
||||
<string name="importLoyaltyCardKeychainMessage">আমদানি করতে লয়্যালটি কার্ড কীচেন থেকে আপনার <i>LoyaltyCardKeychain.csv</i> এক্সপোর্ট নির্বাচন করুন।
|
||||
\nলয়্যালটি কার্ড কীচেনের আমদানি/রপ্তানি মেনু থেকে প্রথমে সেখানে রপ্তানি টিপে এটি তৈরি করুন।</string>
|
||||
<string name="selectColor">রঙ নির্বাচন করুন</string>
|
||||
<string name="unarchived">কার্ড সংরক্ষণাগারমুক্ত করা হয়েছে</string>
|
||||
<string name="archiveList">সংরক্ষণাগার</string>
|
||||
<string name="report_error">ভুল প্রতিবেদন</string>
|
||||
<string name="failedLaunchingPhotoPicker">একটি সমর্থিত গ্যালারি অ্যাপ খুঁজে পাওয়া যায়নি</string>
|
||||
<plurals name="groupCardCountWithArchived">
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> card (<xliff:g id="archivedCount">%2$d</xliff:g> archived)</item>
|
||||
<item quantity="other"><xliff:g>%1$d</xliff:g> cards (<xliff:g id="archivedCount">%2$d</xliff:g> archived)</item>
|
||||
</plurals>
|
||||
<string name="nextCard">পরবর্তী</string>
|
||||
<plurals name="viewArchivedCardsWithCount">
|
||||
<item quantity="one">সংরক্ষণাগার দেখুন (<xliff:g>%1$d</xliff:g> কার্ড)</item>
|
||||
<item quantity="other">সংরক্ষণাগার দেখুন (<xliff:g>%1$d</xliff:g> কার্ডগুলি)</item>
|
||||
</plurals>
|
||||
<string name="failedToOpenUrl">প্রথমে একটি ওয়েব ব্রাউজার ইন্সটল করুন</string>
|
||||
<string name="newBalanceSentence">নতুন ব্যালেন্স: <xliff:g>%s</xliff:g></string>
|
||||
<string name="chooseValidFromDate">তারিখ থেকে বৈধ নির্বাচন করুন</string>
|
||||
<string name="validFromSentence">এর থেকে বৈধ: <xliff:g>%s</xliff:g></string>
|
||||
<string name="version_history">সংস্করণ ইতিহাস</string>
|
||||
<string name="credits">ক্রেডিট</string>
|
||||
<string name="help_translate_this_app">এই অ্যাপটি অনুবাদ করতে সাহায্য করুন</string>
|
||||
<string name="showMoreInfo">তথ্য দেখান</string>
|
||||
<string name="app_contributors">এর দ্বারা সম্ভব হয়েছে: <xliff:g id="app_contributors">%s</xliff:g></string>
|
||||
<string name="importCards">কার্ড আমদানি করুন</string>
|
||||
<string name="importFidmeMessage">FidMe থেকে আমদানি করতে আপনার <i>fidme-export-request-xxxxxx.zip</i> রপ্তানি নির্বাচন করুন এবং পরে বারকোডের ধরন ম্যানুয়ালি নির্বাচন করুন।
|
||||
\nআপনার FidMe প্রোফাইল থেকে ডেটা সুরক্ষা নির্বাচন করে এবং তারপর প্রথমে আমার ডেটা বের করুন টিপে এটি তৈরি করুন।</string>
|
||||
<string name="importCatimaMessage">ক্যাটিমা থেকে আমদানি করতে আপনার <i>catima.zip</i> রপ্তানি নির্বাচন করুন।
|
||||
\nঅন্য Catima অ্যাপের আমদানি/রপ্তানি মেনু থেকে প্রথমে সেখানে রপ্তানি টিপে এটি তৈরি করুন।</string>
|
||||
<string name="importStocardMessage">আমদানি করতে Stocard থেকে আপনার <i>***.zip</i> এক্সপোর্ট নির্বাচন করুন।
|
||||
\nআপনার ডেটা রপ্তানির জন্য জিজ্ঞাসা করে support@stocardapp.com ই-মেইল করে এটি পান।</string>
|
||||
<string name="importVoucherVaultMessage">আমদানি করতে ভাউচার ভল্ট থেকে আপনার <i>vouchervault.json</i> এক্সপোর্ট নির্বাচন করুন।
|
||||
\nপ্রথমে ভাউচার ভল্টে এক্সপোর্ট টিপে এটি তৈরি করুন।</string>
|
||||
<string name="settings_oled_dark">অন্ধকার থিমের জন্য খাঁটি কালো পটভূমি</string>
|
||||
<string name="setIcon">আইকন সেট করুন</string>
|
||||
<string name="settings_grey_theme">ধূসর</string>
|
||||
<string name="updateBalance">ব্যালেন্স আপডেট করুন</string>
|
||||
<string name="barcodeLongPressMessage">গ্যালারি অ্যাপে শুধুমাত্র ছবি খোলা যাবে</string>
|
||||
<string name="translate_platform">Weblate-এ</string>
|
||||
<string name="on_google_play">Google Play-তে</string>
|
||||
<string name="action_show_details">বিস্তারিত দেখাও</string>
|
||||
<string name="action_hide_details">আড়াল বিস্তারিত</string>
|
||||
<string name="shortcutSelectCard">একটি কার্ড নির্বাচন করুন</string>
|
||||
<string name="options">অপশন</string>
|
||||
<string name="starred">তারকাচিহ্নিত</string>
|
||||
<string name="duplicateCard">নকল</string>
|
||||
<string name="include_if_asking_support">আপনি যদি সমর্থনের জন্য অনুরোধ করতে চান তবে নিম্নলিখিত তথ্যগুলি অন্তর্ভুক্ত করুন:</string>
|
||||
<string name="importFidme">FidMe থেকে আমদানি করুন</string>
|
||||
<string name="validFromDate">বৈধ হবে</string>
|
||||
<string name="anyDate">যেকোনো তারিখ</string>
|
||||
<string name="previousCard">আগে</string>
|
||||
<string name="exportPassword">আপনার রপ্তানি রক্ষা করার জন্য একটি পাসওয়ার্ড সেট করুন (ঐচ্ছিক)</string>
|
||||
<string name="exportPasswordHint">পাসওয়ার্ড লিখুন</string>
|
||||
<string name="license">লাইসেন্স</string>
|
||||
<string name="source_repository">Source Repository</string>
|
||||
<string name="and_data_usage">এবং ডেটা ব্যবহার</string>
|
||||
<string name="rate_this_app">এই অ্যাপ্লিকেশন রেট করুন</string>
|
||||
<string name="archive">সংরক্ষণ করুন</string>
|
||||
<string name="unarchive">সংরক্ষণাগারমুক্ত করুন</string>
|
||||
<string name="archived">কার্ড সংরক্ষণাগারভুক্ত</string>
|
||||
<string name="noUnarchivedCardsMessage">আর্কাইভ করা কোনো কার্ড নেই</string>
|
||||
<string name="welcome">Catima-তে স্বাগতম</string>
|
||||
<string name="updateBalanceTitle">আপনি কত খরচ করেছেন\?</string>
|
||||
<string name="updateBalanceHint">পরিমান লিখুন</string>
|
||||
<string name="currentBalanceSentence">বর্তমান ব্যালেন্স: <xliff:g>%s</xliff:g></string>
|
||||
<string name="show_name_below_image_thumbnail">ছবির থাম্বনেইল এর নিচে নামটি দেখান</string>
|
||||
<string name="show_note">নোট দেখান</string>
|
||||
<string name="show_validity">বৈধতা দেখান</string>
|
||||
<string name="height">উচ্চতা:</string>
|
||||
<string name="switchToBackImage">পিছনের ছবিটিতে সুইচ করুন</string>
|
||||
<string name="switchToFrontImage">সামনের ছবিটিতে সুইচ করুন</string>
|
||||
<string name="switchToBarcode">বারকোডে সুইচ করুন</string>
|
||||
<string name="openFrontImageInGalleryApp">সামনের ছবিটি গ্যালারি অ্যাপে খুলুন</string>
|
||||
<string name="openBackImageInGalleryApp">পিছনের ছবিটি গ্যালারি অ্যাপে খুলুন</string>
|
||||
<string name="setBarcodeHeight">বারকোডের উচ্চতা সেট করুন</string>
|
||||
<string name="icon_header_click_text">দীর্ঘক্ষন টাচ করে থাম্বনেইল এডিট করবেন</string>
|
||||
<string name="show_balance">ব্যালান্স দেখান</string>
|
||||
<string name="donate">দান করুন</string>
|
||||
</resources>
|
||||
58
app/src/main/res/values-bn/strings.xml
Normal file
58
app/src/main/res/values-bn/strings.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="settings_locale">ভাষা</string>
|
||||
<string name="action_search">খুঁজুন</string>
|
||||
<string name="settings_pink_theme">গুলাপি</string>
|
||||
<string name="settings_blue_theme">নীল</string>
|
||||
<string name="settings_green_theme">সবুজ</string>
|
||||
<string name="settings_brown_theme">বাদামি</string>
|
||||
<string name="save">সংরক্ষণ</string>
|
||||
<string name="cardId">কার্ড আইডি</string>
|
||||
<string name="barcodeType">বারকোডের ধরন</string>
|
||||
<string name="about">সম্পর্কিত</string>
|
||||
<string name="card">কার্ড</string>
|
||||
<string name="yes">হ্যাঁ</string>
|
||||
<string name="settings_grey_theme">ধূসর</string>
|
||||
<string name="ok">ঠিক আছে</string>
|
||||
<string name="sendLabel">পাঠান…</string>
|
||||
<string name="sort_by_name">নাম</string>
|
||||
<string name="previousCard">পূর্ববর্তী</string>
|
||||
<string name="all">সকল</string>
|
||||
<string name="never">কখনো না</string>
|
||||
<string name="currency">মুদ্রা</string>
|
||||
<string name="settings_violet_theme">বেগুনি</string>
|
||||
<string name="no">না</string>
|
||||
<string name="nextCard">পরবর্তী</string>
|
||||
<string name="action_add">যুক্ত করুন</string>
|
||||
<string name="noGiftCardsGroup">কিছু কার্ড তৈরি করুন এবং তারপর সেগুলিকে এখানে গ্রুপে বরাদ্দ করুন।</string>
|
||||
<string name="noMatchingGiftCards">কোন ফলাফল নেই. আপনার অনুসন্ধান পরিবর্তন করার চেষ্টা করুন.</string>
|
||||
<string name="storeName">নাম</string>
|
||||
<string name="note">বিঃদ্রঃ</string>
|
||||
<string name="star">ফেভারিটে যোগ করুন</string>
|
||||
<string name="barcodeNoBarcode">কোন বারকোড নেই</string>
|
||||
<string name="noBarcode">বারকোড নেই</string>
|
||||
<string name="unstar">পছন্দের তালিকা থেকে অপসারণ</string>
|
||||
<string name="cancel">বাতিল করুন</string>
|
||||
<string name="edit">সম্পাদনা করুন</string>
|
||||
<string name="delete">মুছে ফেলা</string>
|
||||
<string name="confirm">নিশ্চিত করুন</string>
|
||||
<string name="deleteConfirmation">এই কার্ডটি স্থায়ীভাবে মুছবেন\?</string>
|
||||
<plurals name="deleteCardsConfirmation">
|
||||
<item quantity="one">এই <xliff:g>%d</xliff:g> কার্ডটি স্থায়ীভাবে মুছবেন\?</item>
|
||||
<item quantity="other">এই <xliff:g>%d</xliff:g> কার্ডগুলিকে স্থায়ীভাবে মুছবেন\?</item>
|
||||
</plurals>
|
||||
<string name="copy_to_clipboard">ক্লিপবোর্ডে আইডি কপি করুন</string>
|
||||
<string name="share">শেয়ার করুন</string>
|
||||
<string name="editCardTitle">কার্ড সম্পাদনা করুন</string>
|
||||
<string name="addCardTitle">কার্ড যোগ করুন</string>
|
||||
<string name="scanCardBarcode">বারকোড স্ক্যান করুন</string>
|
||||
<plurals name="deleteCardsTitle">
|
||||
<item quantity="one"><xliff:g>%d</xliff:g> কার্ড মুছুন</item>
|
||||
<item quantity="other"><xliff:g>%d</xliff:g> কার্ডগুলো মুছুন</item>
|
||||
</plurals>
|
||||
<string name="deleteTitle">কার্ড মুছুন</string>
|
||||
<string name="noGiftCards">একটি কার্ড যোগ করতে + প্লাস বোতামে ক্লিক করুন বা ⋮ মেনু থেকে আমদানি করুন।</string>
|
||||
<string name="cardShortcut">কার্ড শর্টকাট</string>
|
||||
<string name="noCardsMessage">প্রথমে একটি কার্ড যোগ করুন</string>
|
||||
<string name="card_ids_copied">আইডি কপি করা হয়েছে</string>
|
||||
</resources>
|
||||
@@ -4,11 +4,11 @@
|
||||
<string name="cancel">Odustani</string>
|
||||
<string name="unstar">Ukloni sve omiljene</string>
|
||||
<string name="star">Omiljene</string>
|
||||
<string name="barcodeNoBarcode">Ova kartica nema barkode</string>
|
||||
<string name="barcodeNoBarcode">Ne postoji barkod</string>
|
||||
<string name="barcodeType">Barcode tip</string>
|
||||
<string name="note">Bilježnica</string>
|
||||
<string name="storeName">Ime</string>
|
||||
<string name="noMatchingGiftCards">Nisam našao ništa. Pokušaj promijeniti pretragu.</string>
|
||||
<string name="noMatchingGiftCards">Nema rezultata. Pokušaj promijeniti pretragu.</string>
|
||||
<string name="noGiftCards">Kliknite + Plus dugme da dodate kartu ili uvozite nešto iz menija prvo.</string>
|
||||
<string name="action_add">Dodaj</string>
|
||||
<string name="all">Sve</string>
|
||||
@@ -21,11 +21,9 @@
|
||||
<string name="intent_import_card_from_url_share_text">Želim podijeliti čestitku s tobom</string>
|
||||
<string name="settings_disable_lockscreen_while_viewing_card">Spriječi zaključavanje ekrana</string>
|
||||
<string name="settings_keep_screen_on">Zadrži ekran</string>
|
||||
<string name="settings_max_font_size_scale">Max. veliäťina fonta</string>
|
||||
<string name="settings_light_theme">Svjetlo</string>
|
||||
<string name="settings_system_theme">Sistem</string>
|
||||
<string name="settings_theme">Tema</string>
|
||||
<string name="settings_category_title_ui">Korisničko okruženje</string>
|
||||
<string name="starImage">Omiljena zvijezda</string>
|
||||
<string name="importCatima">Uvezi iz Catima</string>
|
||||
<string name="importLoyaltyCardKeychain">Uvezi iz Loyalty Card Keychain</string>
|
||||
@@ -65,15 +63,14 @@
|
||||
<string name="settings_green_theme">Zeleno</string>
|
||||
<string name="settings_brown_theme">Braun</string>
|
||||
<string name="sort">Poništi sortiranje</string>
|
||||
<string name="swipeToSwitchImages">Swipe ili long press za prebacivanje slika</string>
|
||||
<string name="sort_by_name">Ime</string>
|
||||
<string name="sort_by_most_recently_used">Nedavno Korišten</string>
|
||||
<string name="sort_by_expiry">Sajam</string>
|
||||
<string name="reverse">Rikverc</string>
|
||||
<string name="sort_by">Sortiraj</string>
|
||||
<string name="noCardExistsError">Nisam mogao pronaći karticu</string>
|
||||
<string name="noCardExistsError">Nisam mogao pronaći tu karticu</string>
|
||||
<string name="noStoreError">Nije uneseno ime</string>
|
||||
<string name="card_ids_copied">Kopiran ID kartice(s)</string>
|
||||
<string name="card_ids_copied">Kopiran ID/ovi</string>
|
||||
<string name="noCardsMessage">Dodaj prvo kartu</string>
|
||||
<string name="addCardTitle">Dodaj Kartu</string>
|
||||
<string name="editCardTitle">Izmijeni Karticu</string>
|
||||
@@ -84,4 +81,33 @@
|
||||
<string name="confirm">Potvrdi</string>
|
||||
<string name="delete">Obriši</string>
|
||||
<string name="edit">Izmijeni</string>
|
||||
</resources>
|
||||
<string name="action_search">Traži</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="cardId">ID kartice</string>
|
||||
<string name="exportFailed">Nisam uspio izvršiti izvoz</string>
|
||||
<string name="app_copyright_old">Bazirano na Loyalty Card privjesku
|
||||
\ncopyright © 2016-2020 Branden Archer</string>
|
||||
<string name="noGiftCardsGroup">Kreirajte kartice, i dodajte ih ovdje u grupu.</string>
|
||||
<string name="importExportHelp">Backupovanje vaših podataka omogućava njihov prenos na drugi uređaj.</string>
|
||||
<string name="importSuccessfulTitle">Uvezeno</string>
|
||||
<string name="exportFailedTitle">Izvoz neuspješan</string>
|
||||
<string name="scanCardBarcode">Skeniraj barkod</string>
|
||||
<string name="cardShortcut">Prečica kartice</string>
|
||||
<string name="noCardIdError">ID nije unesen</string>
|
||||
<string name="failedParsingImportUriError">Nisam uspio parsirati URI za uvoz</string>
|
||||
<string name="importExport">Uvoz/Izvoz</string>
|
||||
<string name="exportName">Izvoz</string>
|
||||
<string name="importFailedTitle">Uvoz neuspješan</string>
|
||||
<string name="importFailed">Nisam uspio odraditi uvoz</string>
|
||||
<string name="exportSuccessfulTitle">Izvezeno</string>
|
||||
<string name="importing">Uvozim…</string>
|
||||
<string name="exporting">Izvozim…</string>
|
||||
<string name="exportOptionExplanation">Ovi podaci će biti zapisani na lokaciju po Vašoj želji.</string>
|
||||
<string name="importOptionFilesystemTitle">Uvoz iz file sistema</string>
|
||||
<string name="importOptionFilesystemExplanation">Izaberite specifični file iz file sistema.</string>
|
||||
<string name="importOptionFilesystemButton">Iz file sistema</string>
|
||||
<string name="importOptionApplicationTitle">Koristi drugu aplikaciju</string>
|
||||
<string name="importOptionApplicationExplanation">Koristi bilo koju aplikaciju ili Vašu omiljenu aplikaciju da bi otvorili file.</string>
|
||||
<string name="importOptionApplicationButton">Koristi drugu aplikaciju</string>
|
||||
<string name="about">O</string>
|
||||
</resources>
|
||||
|
||||
17
app/src/main/res/values-ca/strings.xml
Normal file
17
app/src/main/res/values-ca/strings.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="groups">Grups</string>
|
||||
<string name="action_add">Afegeix</string>
|
||||
<string name="save">Desa</string>
|
||||
<string name="edit">Edita</string>
|
||||
<string name="delete">Elimina</string>
|
||||
<string name="confirm">Confirma</string>
|
||||
<string name="ok">D\'acord</string>
|
||||
<string name="importExport">Importa/Exporta</string>
|
||||
<string name="exportName">Exporta</string>
|
||||
<string name="action_search">Cerca</string>
|
||||
<string name="deleteTitle">Elimina la targeta</string>
|
||||
<string name="welcome">Benvingut a Catima</string>
|
||||
<string name="noGiftCards">Cliqueu el botó + més per afegir una targeta, o importeu-ne des del ⋮ menú.</string>
|
||||
<string name="photos">Fotos</string>
|
||||
</resources>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user