mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2025-12-24 15:47:53 -05:00
Compare commits
786 Commits
create-pul
...
v2.35.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01e198c94b | ||
|
|
6b09656164 | ||
|
|
21b051c422 | ||
|
|
9a8fa4ad1a | ||
|
|
2ac2f07c80 | ||
|
|
e893923164 | ||
|
|
ebacb6fe4c | ||
|
|
fb329f410a | ||
|
|
f95d7d62dd | ||
|
|
482303b775 | ||
|
|
d02a359cc3 | ||
|
|
9b24158acc | ||
|
|
cf65476f16 | ||
|
|
02d04614e0 | ||
|
|
a543d4d4bf | ||
|
|
f4de708e42 | ||
|
|
f1079f4e5d | ||
|
|
4d09077b2f | ||
|
|
f62fc879c5 | ||
|
|
0b24a76b19 | ||
|
|
921773ee59 | ||
|
|
6d012413bc | ||
|
|
caeba57a42 | ||
|
|
e12204771f | ||
|
|
cf9612052a | ||
|
|
b0081919c9 | ||
|
|
7c2959b501 | ||
|
|
6f9ab1ad1d | ||
|
|
42f9a43393 | ||
|
|
955cd8a0d4 | ||
|
|
b1c806a189 | ||
|
|
bea5f5eb82 | ||
|
|
958e0951bc | ||
|
|
26dbf6d53d | ||
|
|
051e49a099 | ||
|
|
083b3d0666 | ||
|
|
b4ab8a0220 | ||
|
|
658205bc49 | ||
|
|
d9ee1950d8 | ||
|
|
601600a036 | ||
|
|
7805e9f323 | ||
|
|
61dd342f17 | ||
|
|
1c91842ad4 | ||
|
|
2f9ef2859b | ||
|
|
9ce27f4fa0 | ||
|
|
3f654d2170 | ||
|
|
88019dcae3 | ||
|
|
b94ea44f42 | ||
|
|
f52b101735 | ||
|
|
02e139f5d2 | ||
|
|
67a3b13209 | ||
|
|
4cd85f3a05 | ||
|
|
35f88ca386 | ||
|
|
0157e76725 | ||
|
|
fceda14f89 | ||
|
|
18a2c3d907 | ||
|
|
8f944329c2 | ||
|
|
24cde962b4 | ||
|
|
cdd78cbfb5 | ||
|
|
a0782f115c | ||
|
|
1d2e7bb8d2 | ||
|
|
272102ed61 | ||
|
|
1baea9ee4b | ||
|
|
3022c8fd75 | ||
|
|
e1cfb15a8b | ||
|
|
ecfa677542 | ||
|
|
810eb97dfc | ||
|
|
40bd33f6af | ||
|
|
19cc6c7573 | ||
|
|
89144ff83e | ||
|
|
5c77bab972 | ||
|
|
e406e69c54 | ||
|
|
52b36b5946 | ||
|
|
06cf71a96a | ||
|
|
00052f68b8 | ||
|
|
70f90bbf8f | ||
|
|
167ce12b57 | ||
|
|
a056841aec | ||
|
|
bb81e22dae | ||
|
|
068a80617d | ||
|
|
22c3e10274 | ||
|
|
4696862745 | ||
|
|
a8930c43ce | ||
|
|
3fac57d023 | ||
|
|
1c9dba92b1 | ||
|
|
833a4b8743 | ||
|
|
aedeb91b1a | ||
|
|
0c191eda05 | ||
|
|
e3e1e0c85b | ||
|
|
32a6fa9e8f | ||
|
|
4f4ffa46e7 | ||
|
|
8f7ab2b4bf | ||
|
|
71c1afc10e | ||
|
|
bdb1f70754 | ||
|
|
e08d95f0f5 | ||
|
|
d487668ad9 | ||
|
|
2660550df1 | ||
|
|
cfed16d2e5 | ||
|
|
9af3ef90a2 | ||
|
|
d7db959dd7 | ||
|
|
b5eff7f9c7 | ||
|
|
8891f5d75d | ||
|
|
f0aab7017e | ||
|
|
b4985bba76 | ||
|
|
0911ec8c9d | ||
|
|
5e171c17be | ||
|
|
7896600863 | ||
|
|
d20a0e8598 | ||
|
|
b871279502 | ||
|
|
fa08f4f797 | ||
|
|
794932812c | ||
|
|
e316fc7309 | ||
|
|
971e861e18 | ||
|
|
3e7cf68425 | ||
|
|
d2137c5f80 | ||
|
|
0f17841fe4 | ||
|
|
663ad8b4b2 | ||
|
|
0609c05864 | ||
|
|
07da8cb492 | ||
|
|
c16da87be8 | ||
|
|
450d359c16 | ||
|
|
c1a1098501 | ||
|
|
4c7aac2f67 | ||
|
|
2bcd6f856a | ||
|
|
d98fb2fe12 | ||
|
|
c549c713a3 | ||
|
|
9388a05eac | ||
|
|
6809153412 | ||
|
|
39556705ab | ||
|
|
d1939b943d | ||
|
|
f2c32202c8 | ||
|
|
7ece032bb3 | ||
|
|
9393c2b8d8 | ||
|
|
f2dd15aaf5 | ||
|
|
f4927d9c8b | ||
|
|
1dddd2cee3 | ||
|
|
1e75da4eaf | ||
|
|
1add77f4fe | ||
|
|
4b77700b97 | ||
|
|
cb547b0a71 | ||
|
|
01ee3568ca | ||
|
|
fcd7c00cc7 | ||
|
|
90a41ccf0f | ||
|
|
6c9748aca4 | ||
|
|
02e3ae4dd6 | ||
|
|
d39fdf400c | ||
|
|
073c6dfed8 | ||
|
|
0fa4a6a4c8 | ||
|
|
07b59f090e | ||
|
|
df807d5548 | ||
|
|
f21264c762 | ||
|
|
8aace7f765 | ||
|
|
531c25add7 | ||
|
|
43add95012 | ||
|
|
6ef892fa41 | ||
|
|
1c832eb899 | ||
|
|
f187fd10a5 | ||
|
|
4cac1b103a | ||
|
|
2c7a759711 | ||
|
|
c490ce6248 | ||
|
|
7e3e1544d2 | ||
|
|
edf18591ca | ||
|
|
8cb08dc980 | ||
|
|
5e925f41fb | ||
|
|
a3a28b38e7 | ||
|
|
87fb81de91 | ||
|
|
76adf47107 | ||
|
|
ecbca16246 | ||
|
|
4bd9b25633 | ||
|
|
dd46a45b21 | ||
|
|
e0875d8e45 | ||
|
|
329ff33dc4 | ||
|
|
4610058c54 | ||
|
|
8ce338c525 | ||
|
|
22e119336b | ||
|
|
981e031697 | ||
|
|
4f934b35ca | ||
|
|
441ce040ff | ||
|
|
39e3a5afa8 | ||
|
|
b281a8b8e4 | ||
|
|
5877508fb7 | ||
|
|
7ff98a9b6d | ||
|
|
e658555c2b | ||
|
|
80a52afd8e | ||
|
|
5963582abf | ||
|
|
b918d51744 | ||
|
|
1a475bc9c5 | ||
|
|
1b86795c20 | ||
|
|
42d1bc452f | ||
|
|
7e0e788689 | ||
|
|
14434e1c55 | ||
|
|
a733b681d8 | ||
|
|
af39b9de25 | ||
|
|
74c988aa67 | ||
|
|
8ff1120a0d | ||
|
|
543787a559 | ||
|
|
3eb7b01a98 | ||
|
|
c66e800a22 | ||
|
|
10ed6be747 | ||
|
|
b99c7f576d | ||
|
|
ac5d15578f | ||
|
|
d5c03f9d36 | ||
|
|
6ed2ff849a | ||
|
|
2945450186 | ||
|
|
8944c6d5dc | ||
|
|
97db8ee025 | ||
|
|
777a3cce28 | ||
|
|
91386df0f7 | ||
|
|
9f95812d32 | ||
|
|
361b011205 | ||
|
|
ac45a5cdfe | ||
|
|
e892f5d57c | ||
|
|
a3d24ebe3b | ||
|
|
29ce8e63b3 | ||
|
|
223d6d1d35 | ||
|
|
e712765f0b | ||
|
|
ad68c43857 | ||
|
|
626c25b781 | ||
|
|
0e9366e0ce | ||
|
|
cccffe9543 | ||
|
|
821e81303c | ||
|
|
d3ba0ff93f | ||
|
|
2bf9f58054 | ||
|
|
07ba380c21 | ||
|
|
6e523dff7e | ||
|
|
702cc17bd5 | ||
|
|
6b9c452de7 | ||
|
|
5d9a670225 | ||
|
|
4cb939ab6b | ||
|
|
f14b2dffcd | ||
|
|
55b0ee7a63 | ||
|
|
4adfb0d292 | ||
|
|
948ee26852 | ||
|
|
a652d3fd9a | ||
|
|
18e530f3a0 | ||
|
|
a55dcd760c | ||
|
|
2bbcad03ef | ||
|
|
cc9c50032c | ||
|
|
06cf3e9288 | ||
|
|
a25e91dede | ||
|
|
57086649f4 | ||
|
|
7d2fc03248 | ||
|
|
b2ad30d1ae | ||
|
|
8970a0a031 | ||
|
|
c9e713cf7f | ||
|
|
64e315f0b0 | ||
|
|
f60cf0e674 | ||
|
|
5d2a1b0263 | ||
|
|
77860441ad | ||
|
|
f46ec1ec51 | ||
|
|
e644c347ec | ||
|
|
0b28df9999 | ||
|
|
dddb3e3a11 | ||
|
|
0518821341 | ||
|
|
2eefcf1270 | ||
|
|
93c3705207 | ||
|
|
9fcf9e4dd9 | ||
|
|
392ce9bc79 | ||
|
|
da3eaf36f1 | ||
|
|
0458c501c8 | ||
|
|
632ef8b3a8 | ||
|
|
40e5014cc6 | ||
|
|
ba09eb4ca3 | ||
|
|
2c77dcadb5 | ||
|
|
99eaaebf1c | ||
|
|
f2e77cdf09 | ||
|
|
8f00b17315 | ||
|
|
3a17756532 | ||
|
|
cff3fff971 | ||
|
|
2763635f17 | ||
|
|
1dd1a1273f | ||
|
|
3f5b953c16 | ||
|
|
1539d88d78 | ||
|
|
91ee846054 | ||
|
|
c5cecee7b1 | ||
|
|
1e0a52d780 | ||
|
|
0792bb1407 | ||
|
|
6e9a05389a | ||
|
|
68833a7ff1 | ||
|
|
cc7553850a | ||
|
|
e66277d665 | ||
|
|
caea63ea32 | ||
|
|
1761465532 | ||
|
|
8218cc63c7 | ||
|
|
c2ff763311 | ||
|
|
813287a657 | ||
|
|
66c3046c4d | ||
|
|
acbdf79d79 | ||
|
|
ade3db0902 | ||
|
|
d66066c195 | ||
|
|
0a222ca16a | ||
|
|
48fa369dc3 | ||
|
|
9e861b1b10 | ||
|
|
6b7926ecde | ||
|
|
ccd6e12547 | ||
|
|
c869104e82 | ||
|
|
f430d3071b | ||
|
|
26460753a6 | ||
|
|
2653c7aea3 | ||
|
|
1a892b2de3 | ||
|
|
a9e9ee511d | ||
|
|
7719a2d3fd | ||
|
|
84a6202db1 | ||
|
|
4d8a4fbd6a | ||
|
|
d556e7e0a2 | ||
|
|
5f039c5c3f | ||
|
|
5bf69db296 | ||
|
|
f20cac5d85 | ||
|
|
69976289ca | ||
|
|
8b30f92dfd | ||
|
|
477c70a8e5 | ||
|
|
2e9d1a41f6 | ||
|
|
ff617036c7 | ||
|
|
2b4e8b1f8b | ||
|
|
7bcbdd8358 | ||
|
|
45c212c5cc | ||
|
|
00d7b5e231 | ||
|
|
0314d49b77 | ||
|
|
6335b731df | ||
|
|
c248d1e84c | ||
|
|
94de9829b9 | ||
|
|
0448efd04c | ||
|
|
21f4b9b5cf | ||
|
|
01a30db52e | ||
|
|
01ed9bd30f | ||
|
|
583edb53d9 | ||
|
|
f51cc70d8e | ||
|
|
539d05a603 | ||
|
|
906162ebb4 | ||
|
|
b06203dc8a | ||
|
|
6aec4b93ff | ||
|
|
3ea6f64021 | ||
|
|
51fb01b190 | ||
|
|
01b23109ae | ||
|
|
4e291b58d3 | ||
|
|
1689cf1026 | ||
|
|
a55ce2c952 | ||
|
|
d2ff17a90e | ||
|
|
70c446e88d | ||
|
|
0d6dc40da5 | ||
|
|
a4f3a81d58 | ||
|
|
c64f75ffe4 | ||
|
|
0fdb6ee567 | ||
|
|
9aa40fc88c | ||
|
|
4f4c0171c0 | ||
|
|
e4644b3eb7 | ||
|
|
999cf241f8 | ||
|
|
42b964a324 | ||
|
|
1262bfd502 | ||
|
|
81fe561678 | ||
|
|
9cb989155d | ||
|
|
59587f4a40 | ||
|
|
4dc0d4cd24 | ||
|
|
89598be72e | ||
|
|
1d2359f295 | ||
|
|
026984920b | ||
|
|
03ed289ef9 | ||
|
|
0ccbeb42dd | ||
|
|
3f9b772a11 | ||
|
|
e97c9de471 | ||
|
|
872db6b966 | ||
|
|
724d036df9 | ||
|
|
fc98e6651a | ||
|
|
a70e4aa7a7 | ||
|
|
d542be322c | ||
|
|
d5a977c5b0 | ||
|
|
bac9199974 | ||
|
|
bb92ec2291 | ||
|
|
b155f45b01 | ||
|
|
b2f79f836b | ||
|
|
9ba7e4a92b | ||
|
|
28088beb72 | ||
|
|
25351f4138 | ||
|
|
1ac4db8641 | ||
|
|
5cee4ef497 | ||
|
|
b323c2e5cd | ||
|
|
66be4a8c18 | ||
|
|
dd2bd294ba | ||
|
|
e4db1e931a | ||
|
|
f8b3e9c65b | ||
|
|
880a596621 | ||
|
|
9903b4d955 | ||
|
|
40bc87c772 | ||
|
|
586642c6f6 | ||
|
|
f3847a4a2b | ||
|
|
63352c310e | ||
|
|
e7aac163c2 | ||
|
|
5a3d61d8f0 | ||
|
|
33ba81d3b0 | ||
|
|
6a0956181d | ||
|
|
aca7d3bd9c | ||
|
|
e3e8378f8e | ||
|
|
61d235b497 | ||
|
|
e069d7a956 | ||
|
|
3d8806e38c | ||
|
|
650da3bd6a | ||
|
|
26b7cece35 | ||
|
|
1d3da4d1d1 | ||
|
|
bc3aeed090 | ||
|
|
6606eeb9a7 | ||
|
|
2401a3f8bf | ||
|
|
b3685c0c7e | ||
|
|
868315948e | ||
|
|
19a68719fe | ||
|
|
92570ec75c | ||
|
|
573817f81d | ||
|
|
21da1fed85 | ||
|
|
c23527eb82 | ||
|
|
926b9e0822 | ||
|
|
d32a0b698d | ||
|
|
47bf18f219 | ||
|
|
91096c5839 | ||
|
|
477c16360e | ||
|
|
9a1d7d2e44 | ||
|
|
be54c50786 | ||
|
|
2624924f53 | ||
|
|
724552eaa3 | ||
|
|
bef0d70d09 | ||
|
|
d7201f62ab | ||
|
|
1f229980b7 | ||
|
|
8f08b1989b | ||
|
|
e3c83c0cb0 | ||
|
|
431e380f5e | ||
|
|
5c7b102e08 | ||
|
|
6dc1a1b196 | ||
|
|
6c01d2ffa9 | ||
|
|
3156fd6daf | ||
|
|
6fa4ab3e3b | ||
|
|
9fa67b59c7 | ||
|
|
0935a17fec | ||
|
|
5fdc575485 | ||
|
|
d6bbd16945 | ||
|
|
1110f7ee99 | ||
|
|
d64860a34e | ||
|
|
9fb0da6954 | ||
|
|
12b0f8806b | ||
|
|
5c5a1df39d | ||
|
|
5b0ac65fbe | ||
|
|
e9b542ee6e | ||
|
|
ae6bf5e8f6 | ||
|
|
4dc564ffcf | ||
|
|
49a9ef2f80 | ||
|
|
1907f482eb | ||
|
|
08aad7ce20 | ||
|
|
f555a160d5 | ||
|
|
2d9b7f358e | ||
|
|
db396b5f21 | ||
|
|
018d36c3fd | ||
|
|
e6621244b8 | ||
|
|
29aef64d97 | ||
|
|
cbe243feb3 | ||
|
|
ff02c59f85 | ||
|
|
3895bc1f73 | ||
|
|
cd0cce532a | ||
|
|
3fdf6693d2 | ||
|
|
d2be344700 | ||
|
|
9bd2898678 | ||
|
|
07f2348a6d | ||
|
|
ddd1c1a516 | ||
|
|
8de76e3c52 | ||
|
|
6ea2645e9d | ||
|
|
ed166b1b33 | ||
|
|
2dd53a5300 | ||
|
|
97f9120acf | ||
|
|
dd29be75f2 | ||
|
|
fa87df2ed8 | ||
|
|
1fb94de809 | ||
|
|
0e18e84c8f | ||
|
|
0ba2261033 | ||
|
|
703ebf9418 | ||
|
|
ff08dbe5d5 | ||
|
|
3003a10550 | ||
|
|
f95be6cc71 | ||
|
|
23bc40e630 | ||
|
|
45c47674fb | ||
|
|
cf1d1a8122 | ||
|
|
45d2629863 | ||
|
|
f6b0736bbf | ||
|
|
83f9a2bcc9 | ||
|
|
1b817222f0 | ||
|
|
50db796a47 | ||
|
|
f2f7fe3151 | ||
|
|
90293b90fb | ||
|
|
f1751eaebf | ||
|
|
19a3aa0b86 | ||
|
|
a3b901e357 | ||
|
|
fbe12cfadc | ||
|
|
3ffbf11902 | ||
|
|
5c3b32a6ee | ||
|
|
36267b8255 | ||
|
|
668c9b0d76 | ||
|
|
eebbe6dec8 | ||
|
|
a84ae51a4f | ||
|
|
bdbb977233 | ||
|
|
ac27cc6a1e | ||
|
|
91551bf4e8 | ||
|
|
e8c11debfd | ||
|
|
e29a1c659f | ||
|
|
d66bf0e3fd | ||
|
|
172b71dd00 | ||
|
|
10ce432c97 | ||
|
|
3299a8dca3 | ||
|
|
5dca8bc5d2 | ||
|
|
1b8f8704f5 | ||
|
|
64e801311b | ||
|
|
da8202b4e1 | ||
|
|
72d70f1265 | ||
|
|
660597e89a | ||
|
|
4a48ac8797 | ||
|
|
4c61c19e4f | ||
|
|
bb3b13364c | ||
|
|
b34bb65f79 | ||
|
|
a7cfb4b68f | ||
|
|
8d58a6192d | ||
|
|
1da34ceda4 | ||
|
|
dc31b7e839 | ||
|
|
5c6ee7b787 | ||
|
|
5620a62cad | ||
|
|
429abb4914 | ||
|
|
f90d33daf7 | ||
|
|
baa67cf9f4 | ||
|
|
4054269db3 | ||
|
|
559b8d00dd | ||
|
|
9b9c19586f | ||
|
|
a3407734a7 | ||
|
|
99c579ee51 | ||
|
|
81bc7db43e | ||
|
|
117e08d957 | ||
|
|
89356dac50 | ||
|
|
c7bf1f5f30 | ||
|
|
1a7a2d31f4 | ||
|
|
8fd4335a98 | ||
|
|
6b4b0e846b | ||
|
|
451fa87990 | ||
|
|
2c50c2b48c | ||
|
|
8b9c26ad5a | ||
|
|
ef7db55d8c | ||
|
|
8f2d39d0ec | ||
|
|
3597e3098f | ||
|
|
0702fc579c | ||
|
|
017cf19d27 | ||
|
|
83a3a5b9e2 | ||
|
|
54828c3c93 | ||
|
|
31e517d7ee | ||
|
|
00957ac576 | ||
|
|
852c38d88d | ||
|
|
67314b09a9 | ||
|
|
944e2ca0c0 | ||
|
|
68564864d5 | ||
|
|
19bccc0c82 | ||
|
|
04905edab4 | ||
|
|
179a9adbe5 | ||
|
|
3925a79158 | ||
|
|
71de6f8c99 | ||
|
|
9d81ca5c9b | ||
|
|
75c393af92 | ||
|
|
3e16515b6c | ||
|
|
3e9857f14f | ||
|
|
20ee7c9324 | ||
|
|
fa6ee155ac | ||
|
|
c186e53eab | ||
|
|
75abd6f80c | ||
|
|
0a98e6154c | ||
|
|
c2b31fad43 | ||
|
|
2043dffc10 | ||
|
|
244aabcc1a | ||
|
|
a1faed8717 | ||
|
|
fcf9176523 | ||
|
|
30db9e3cd6 | ||
|
|
fb3df0ff4d | ||
|
|
9b4b48e6e3 | ||
|
|
9a9cdaff09 | ||
|
|
3a82efcf6f | ||
|
|
7c2d08b06f | ||
|
|
aebe84c2cd | ||
|
|
3768f0ebcf | ||
|
|
8f7d527c21 | ||
|
|
54ec5ee0d0 | ||
|
|
dccb244c8f | ||
|
|
a37084af1a | ||
|
|
af0a7ae89b | ||
|
|
315cbab4be | ||
|
|
bc3830d685 | ||
|
|
4893d28bb0 | ||
|
|
2a7670e19d | ||
|
|
86e6a1bb2d | ||
|
|
d1d3f95dfe | ||
|
|
ebfc90e998 | ||
|
|
704db9eb46 | ||
|
|
3557870d34 | ||
|
|
59354c7251 | ||
|
|
cae25599f8 | ||
|
|
e89eb46f79 | ||
|
|
039b433d0a | ||
|
|
0319d16f2b | ||
|
|
f11c45d169 | ||
|
|
572c0fea4a | ||
|
|
5e9d364e5e | ||
|
|
57d62fdb29 | ||
|
|
0c7332396b | ||
|
|
7bdca36f53 | ||
|
|
f8a8a84f1e | ||
|
|
8009baca26 | ||
|
|
e0786594bc | ||
|
|
7fe67960bf | ||
|
|
83fca93649 | ||
|
|
96a9850d9c | ||
|
|
1cb9ddecac | ||
|
|
f7697ce8bf | ||
|
|
9358348795 | ||
|
|
711ca1e761 | ||
|
|
8eeff0058b | ||
|
|
ea456c6d80 | ||
|
|
3bdc06b5b4 | ||
|
|
2c9fbfcae8 | ||
|
|
e4a28f9fc9 | ||
|
|
630bf14387 | ||
|
|
4dd85f845e | ||
|
|
8382d1975b | ||
|
|
4d4cac6a9e | ||
|
|
5bd276a32d | ||
|
|
e31ad60d32 | ||
|
|
f511b29fcb | ||
|
|
158abdb96c | ||
|
|
959f6770dd | ||
|
|
c429fef56d | ||
|
|
4ce8d293f4 | ||
|
|
ef9b28671b | ||
|
|
e3afaa1d49 | ||
|
|
094e6951d0 | ||
|
|
73f33e238c | ||
|
|
d1b8051771 | ||
|
|
17fd6db65f | ||
|
|
e6345bc2fe | ||
|
|
208b1a2eba | ||
|
|
b796425551 | ||
|
|
425a9f9a57 | ||
|
|
3701c1f2cb | ||
|
|
7a5233ed1a | ||
|
|
5df349c118 | ||
|
|
f97da3afcb | ||
|
|
d997759ccf | ||
|
|
5e710ba424 | ||
|
|
88c1dd1bc6 | ||
|
|
b63fbfa4c6 | ||
|
|
565b441444 | ||
|
|
6900cf3475 | ||
|
|
2c0c63aad4 | ||
|
|
b48e6f2437 | ||
|
|
37b4096713 | ||
|
|
7a0894e4d2 | ||
|
|
e6f8c29078 | ||
|
|
b1672408c3 | ||
|
|
b79f2ae51d | ||
|
|
2a758d2e57 | ||
|
|
07def17334 | ||
|
|
1c3fb47c89 | ||
|
|
d1e4deb7eb | ||
|
|
ad97571ab0 | ||
|
|
4bbf0983c5 | ||
|
|
13e86e5e53 | ||
|
|
454070c346 | ||
|
|
10458d9975 | ||
|
|
823c38c50c | ||
|
|
a593e68ffb | ||
|
|
5ef8cf5381 | ||
|
|
db94d5bc5d | ||
|
|
b6fe1bc2a7 | ||
|
|
78754ca313 | ||
|
|
8e8667b721 | ||
|
|
40731104cb | ||
|
|
879872202a | ||
|
|
0fcf16d9d2 | ||
|
|
23d27ab838 | ||
|
|
0b4df647d1 | ||
|
|
a74c4f822e | ||
|
|
389372e8f3 | ||
|
|
c228d274b5 | ||
|
|
d8e0e03aa5 | ||
|
|
171dd7af59 | ||
|
|
10bf27a246 | ||
|
|
199c243eb0 | ||
|
|
11b0143b1c | ||
|
|
f2e20eaea3 | ||
|
|
c8725a4588 | ||
|
|
f881965485 | ||
|
|
3e16d0daf6 | ||
|
|
7068f57443 | ||
|
|
8b611511f5 | ||
|
|
1c9f0ee724 | ||
|
|
2d816b39f6 | ||
|
|
c0b13bf040 | ||
|
|
e40d98f386 | ||
|
|
8af295a72b | ||
|
|
ac4dde1f8b | ||
|
|
2dc87fd37c | ||
|
|
aebceec1f6 | ||
|
|
95b59a9cc3 | ||
|
|
4ff72b66a8 | ||
|
|
d1162d0272 | ||
|
|
794ac2bab2 | ||
|
|
7b76fe86b2 | ||
|
|
4387c7ed1e | ||
|
|
f819fc7db9 | ||
|
|
fb5a882fdb | ||
|
|
be8c0a6787 | ||
|
|
5dc84fbd77 | ||
|
|
0c37827fb0 | ||
|
|
cee5d39b27 | ||
|
|
9c5603eae6 | ||
|
|
dd42c99ca7 | ||
|
|
403c60ec6c | ||
|
|
7c7e6d3b45 | ||
|
|
316e51efb2 | ||
|
|
9e838e266b | ||
|
|
a56b984c53 | ||
|
|
4040b270a8 | ||
|
|
eab8614bcc | ||
|
|
ef8befe0cd | ||
|
|
860b79fc9b | ||
|
|
93341fc4ec | ||
|
|
51f123bc41 | ||
|
|
f0512fbeca | ||
|
|
71f6fcd2e6 | ||
|
|
d1a244efa0 | ||
|
|
075478db17 | ||
|
|
6f4582eec9 | ||
|
|
91f5f9a8b4 | ||
|
|
f04adc0901 | ||
|
|
f184ee7e58 | ||
|
|
9abeec578e | ||
|
|
8deab5f94f | ||
|
|
50fca74267 | ||
|
|
9e7bf97cc9 | ||
|
|
96be72b4c6 | ||
|
|
5c31ac6d00 | ||
|
|
1675d591dd | ||
|
|
361495dfed | ||
|
|
2b81e861f6 | ||
|
|
657a761c3a | ||
|
|
6d401c4234 | ||
|
|
8a33d2e5ed | ||
|
|
66e994be60 | ||
|
|
4e50ca9340 | ||
|
|
af064d1cda | ||
|
|
585c444f2d | ||
|
|
85683a0b3f | ||
|
|
4c7aa2b26b | ||
|
|
af236e1099 | ||
|
|
79f6014e26 | ||
|
|
0fa3de40ba | ||
|
|
d77f938107 | ||
|
|
e44aaa6618 | ||
|
|
96d88bb08c | ||
|
|
b502f89da6 | ||
|
|
d7b8cd7e03 | ||
|
|
61681bdc2b | ||
|
|
dc65030a63 | ||
|
|
328c110a97 | ||
|
|
0b7cd32209 | ||
|
|
b1c0ab74d7 | ||
|
|
faee01cde2 | ||
|
|
6f456437f7 | ||
|
|
1b0fd94a8c | ||
|
|
268d04841f | ||
|
|
9408ac5d9f | ||
|
|
45d2b6206e | ||
|
|
a943fdcc5a | ||
|
|
06e02f0b0f | ||
|
|
5b29dc66a9 | ||
|
|
5187916fd3 | ||
|
|
d6e444c6e9 | ||
|
|
59f4ef1091 | ||
|
|
bab1b3e9df | ||
|
|
4e8cbdc93b | ||
|
|
d3e5c5b335 | ||
|
|
2b4b38ddc6 | ||
|
|
d3e6d775e8 | ||
|
|
ecf3b57679 | ||
|
|
115981ecc6 | ||
|
|
009f297f59 | ||
|
|
f539fb1acf | ||
|
|
297e1e79c2 | ||
|
|
d8a95d9d48 | ||
|
|
1d8e87981b | ||
|
|
5c97f9c89a |
76
.github/workflows/android.yml
vendored
76
.github/workflows/android.yml
vendored
@@ -24,45 +24,49 @@ permissions:
|
||||
security-events: none
|
||||
statuses: none
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
|
||||
JAVA_HOME: /usr/lib/jvm/java-21-openjdk-amd64
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
api-level: [ 21, 34 ]
|
||||
flavor: [Foss, Gplay]
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- 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/actions/wrapper-validation@v4
|
||||
- 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: timeout 5m ./gradlew testReleaseUnitTest || { ./gradlew --stop && timeout 5m ./gradlew testReleaseUnitTest; }
|
||||
- name: Enable KVM
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
- name: Run instrumented tests
|
||||
uses: ReactiveCircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
arch: x86_64
|
||||
script: ./gradlew connectedCheck
|
||||
- name: SpotBugs
|
||||
run: ./gradlew spotbugsRelease
|
||||
- name: Archive test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: test-results-api${{ matrix.api-level }}
|
||||
path: app/build/reports
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- 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/actions/wrapper-validation@v4
|
||||
- name: set up OpenJDK 21
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y openjdk-21-jdk-headless
|
||||
sudo update-alternatives --auto java
|
||||
- name: Build
|
||||
run: ./gradlew assemble${{ matrix.flavor }}Release
|
||||
- name: Check lint
|
||||
run: ./gradlew lint${{ matrix.flavor }}Release
|
||||
- name: Run unit tests
|
||||
run: timeout 5m ./gradlew test${{ matrix.flavor }}ReleaseUnitTest || { ./gradlew --stop && timeout 5m ./gradlew test${{ matrix.flavor }}ReleaseUnitTest; }
|
||||
- name: Enable KVM
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
- name: Run instrumented tests (API 21)
|
||||
uses: ReactiveCircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: 21
|
||||
arch: x86_64
|
||||
script: ./gradlew connected${{ matrix.flavor }}DebugAndroidTest
|
||||
- name: Run instrumented tests (API 35)
|
||||
uses: ReactiveCircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: 35
|
||||
arch: x86_64
|
||||
script: ./gradlew connected${{ matrix.flavor }}DebugAndroidTest
|
||||
- name: Archive test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: test-results-flavor${{ matrix.flavor }}
|
||||
path: app/build/reports
|
||||
|
||||
4
.github/workflows/changelog-to-fastlane.yml
vendored
4
.github/workflows/changelog-to-fastlane.yml
vendored
@@ -29,13 +29,13 @@ jobs:
|
||||
id: checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5.3.0
|
||||
uses: actions/setup-python@v5.6.0
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Run converter script
|
||||
run: python .scripts/changelog_to_fastlane.py
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7.0.5
|
||||
uses: peter-evans/create-pull-request@v7.0.8
|
||||
with:
|
||||
title: "Update Fastlane changelogs"
|
||||
commit-message: "Update Fastlane changelogs"
|
||||
|
||||
2
.github/workflows/contributors-to-file.yml
vendored
2
.github/workflows/contributors-to-file.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
||||
file_in_repo: app/src/main/res/raw/contributors.txt
|
||||
min_commit_count: 5
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7.0.5
|
||||
uses: peter-evans/create-pull-request@v7.0.8
|
||||
with:
|
||||
title: "Update contributors"
|
||||
commit-message: "Update contributors"
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
- name: Install requirements
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install optipng mat2
|
||||
sudo apt-get install inkscape mat2 optipng xvfb
|
||||
# Install 200 weight versions of relevant Noto (to use for languages not supported by Lexend Deca)
|
||||
sudo apt-get install fonts-noto-extra fonts-noto-cjk-extra
|
||||
# Custom fonts
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
- name: Generate featureGraphic.png for each language
|
||||
run: .scripts/generate_feature_graphic/generate_feature_graphic.sh
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7.0.5
|
||||
uses: peter-evans/create-pull-request@v7.0.8
|
||||
with:
|
||||
title: "Update feature graphic"
|
||||
commit-message: "Update feature graphic"
|
||||
|
||||
2
.github/workflows/gradle-update.yml
vendored
2
.github/workflows/gradle-update.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
id: gradle-update
|
||||
- uses: gradle/actions/wrapper-validation@v4
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7.0.5
|
||||
uses: peter-evans/create-pull-request@v7.0.8
|
||||
with:
|
||||
title: "Update Gradle to ${{ steps.gradle-update.outputs.version }}"
|
||||
commit-message: "Update Gradle to ${{ steps.gradle-update.outputs.version }}"
|
||||
|
||||
2
.github/workflows/update-locales.yml
vendored
2
.github/workflows/update-locales.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
- name: Update locales
|
||||
run: .scripts/locales.py
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7.0.5
|
||||
uses: peter-evans/create-pull-request@v7.0.8
|
||||
with:
|
||||
title: "Update locales"
|
||||
commit-message: "Update locales"
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -25,3 +25,6 @@
|
||||
/.bundle/
|
||||
/vendor/bundle
|
||||
/lib/bundler/man/
|
||||
|
||||
# Catima-specific
|
||||
SHA256SUMS
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<svg width="1024" height="500" viewBox="0 0 1024 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="1024" height="500" fill="#223355"/>
|
||||
<text fill="white" xml:space="preserve" style="" font-family="Yesteryear" font-size="150" letter-spacing="0em"><tspan x="470.082" y="285.511">Catima
|
||||
<text direction="ltr" fill="white" xml:space="preserve" style="" font-family="Yesteryear" font-size="150" letter-spacing="0em"><tspan x="470.082" y="285.511">Catima
|
||||
</tspan></text>
|
||||
<path d="M381.046 147.001L236.3 211.446L276.524 301.79L421.27 237.345L381.046 147.001Z" fill="#F0F0F0" stroke="#C80000" stroke-width="2"/>
|
||||
<path d="M402.077 219.13L240.07 147L191.984 255.004L353.99 327.135L402.077 219.13Z" fill="#F0F0F0" stroke="#C80000" stroke-width="2"/>
|
||||
@@ -11,5 +11,5 @@
|
||||
<path d="M330.301 254.298C329.363 256.875 327.547 259.04 325.171 260.411C322.796 261.783 320.013 262.273 317.312 261.797C314.61 261.321 312.163 259.908 310.4 257.807C308.637 255.706 307.671 253.05 307.671 250.307" stroke="#F0F0F0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M248.345 225.937L266.818 207.465L285.29 225.937" stroke="#F0F0F0" stroke-width="2"/>
|
||||
<path d="M329.625 225.937L348.098 207.465L366.571 225.937" stroke="#F0F0F0" stroke-width="2"/>
|
||||
<text fill="white" xml:space="preserve" style="" font-family="Lexend Deca" font-size="35" font-weight="200" letter-spacing="0em"><tspan x="466" y="340">Loyalty Card Wallet</tspan></text>
|
||||
<text direction="ltr" fill="white" xml:space="preserve" style="" font-family="Lexend Deca" font-size="35" font-weight="200" letter-spacing="0em"><tspan x="466" y="340">Loyalty Card Wallet</tspan></text>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -37,19 +37,20 @@ for lang in "$script_location/../../fastlane/metadata/android/"*; do
|
||||
# We specifically need the Serif version because of the 200 weight
|
||||
case "$(basename "$lang")" in
|
||||
bg|el-GR|ru-RU|uk) sed -i "s/Lexend Deca/Noto Serif/" featureGraphic.svg ;;
|
||||
hi-IN) sed -i -e "s/Yesteryear/Noto Serif Devanagari/" -e "s/Lexend Deca/Noto Serif Devanagari/" featureGraphic.svg ;;
|
||||
fa-IR) sed -i -e 's/svg direction="ltr"/svg direction="rtl"/' -e "s/Yesteryear/Noto Sans Arabic/" -e "s/Lexend Deca/Noto Sans Arabic/" featureGraphic.svg ;;
|
||||
hi-IN) sed -i -e "s/Yesteryear/Noto Sans Devanagari/" -e "s/Lexend Deca/Noto Serif Devanagari/" featureGraphic.svg ;;
|
||||
ja-JP) sed -i "s/Lexend Deca/Noto Serif CJK JP/" featureGraphic.svg ;;
|
||||
kn-IN) sed -i -e 's/font-size="150"/font-size="100"/' -e "s/Yesteryear/Noto Serif Kannada/" featureGraphic.svg ;;
|
||||
ko) sed -i "s/Lexend Deca/Noto Serif CJK KR/" featureGraphic.svg ;;
|
||||
zh-CN) sed -i "s/Lexend Deca/Noto Serif CJK SC/" featureGraphic.svg ;;
|
||||
zh-TW) sed -i "s/Lexend Deca/Noto Serif CJK TC/" featureGraphic.svg ;;
|
||||
zh-TW) sed -i -e "s/Yesteryear/Noto Sans CJK TC/" -e "s/Lexend Deca/Noto Serif CJK TC/" featureGraphic.svg ;;
|
||||
*) ;;
|
||||
esac
|
||||
fi
|
||||
# Ensure images directory exists
|
||||
mkdir -p images
|
||||
# Generate .png
|
||||
convert featureGraphic.svg images/featureGraphic.png
|
||||
# Generate .png (we use Inkscape because ImageMagick ignores RTL)
|
||||
xvfb-run inkscape --export-filename=images/featureGraphic.png featureGraphic.svg
|
||||
# Optimize .png
|
||||
optipng images/featureGraphic.png
|
||||
# Remove metadata (timestamps) from .png
|
||||
|
||||
47
CHANGELOG.md
47
CHANGELOG.md
@@ -1,6 +1,51 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased - 140
|
||||
## v2.35.0 - 148 (2025-05-17)
|
||||
|
||||
- Add ability to choose barcode width in fullscreen view
|
||||
- Remove confusing import from app function
|
||||
- Various scanning fixes
|
||||
- Fix crash when loading a pkpass file without barcode
|
||||
|
||||
## v2.34.5 - 147 (2025-03-22)
|
||||
|
||||
- Target Android 15
|
||||
- Fix crash reading unsupported pkpass files
|
||||
- Improve pkpass support
|
||||
|
||||
## v2.34.4 - 146 (2025-01-17)
|
||||
|
||||
- Ability to sort cards by start of validity
|
||||
- Temporarily revert to targeting Android 14 to fix some UI issues
|
||||
|
||||
## v2.34.3 - 145 (2025-01-15)
|
||||
|
||||
- Target Android 15
|
||||
- Fix keyboard covering save button in edit screen
|
||||
- Fix some pkpass files not being detected as pkpass (application/vnd-com.apple.pkpass mime type support)
|
||||
|
||||
## v2.34.2 - 144 (2024-12-26)
|
||||
|
||||
- Improve archive/starred icon display
|
||||
|
||||
## v2.34.1 - 143 (2024-12-12)
|
||||
|
||||
- Fix crash when opening invalid pkpass files
|
||||
|
||||
## v2.34.0 - 142 (2024-12-10)
|
||||
|
||||
- Add Passbook (.pkpass) support
|
||||
- Fix import of transparent PDF files
|
||||
- Improve display of transparent thumbnails
|
||||
|
||||
## v2.33.0 - 141 (2024-11-19)
|
||||
|
||||
- Change default column on wide screens to 4
|
||||
- Allow overriding column counts for portrait and landscape in settings
|
||||
- Keep main screen search filter when rotating screen or opening a card
|
||||
- Limit max length of note display on main screen
|
||||
|
||||
## v2.32.1 - 140 (2024-10-29)
|
||||
|
||||
- Fix text wrapping on add dialog
|
||||
|
||||
|
||||
128
CODE_OF_CONDUCT.md
Normal file
128
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,128 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
catima.g9ex3@hackerchick.me.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
@@ -36,10 +36,6 @@ These are the Android lint checker, run using:
|
||||
|
||||
# ./gradlew lintRelease
|
||||
|
||||
and SpotBugs, run using:
|
||||
|
||||
# ./gradlew spotbugsRelease
|
||||
|
||||
The final check is by testing the application on a live device and verifying
|
||||
the basic functionality works as expected.
|
||||
|
||||
|
||||
85
Gemfile.lock
85
Gemfile.lock
@@ -9,21 +9,22 @@ GEM
|
||||
public_suffix (>= 2.0.2, < 7.0)
|
||||
artifactory (3.0.17)
|
||||
atomos (0.1.3)
|
||||
aws-eventstream (1.3.0)
|
||||
aws-partitions (1.958.0)
|
||||
aws-sdk-core (3.201.3)
|
||||
aws-eventstream (1.3.2)
|
||||
aws-partitions (1.1072.0)
|
||||
aws-sdk-core (3.220.2)
|
||||
aws-eventstream (~> 1, >= 1.3.0)
|
||||
aws-partitions (~> 1, >= 1.651.0)
|
||||
aws-sigv4 (~> 1.8)
|
||||
aws-partitions (~> 1, >= 1.992.0)
|
||||
aws-sigv4 (~> 1.9)
|
||||
base64
|
||||
jmespath (~> 1, >= 1.6.1)
|
||||
aws-sdk-kms (1.88.0)
|
||||
aws-sdk-core (~> 3, >= 3.201.0)
|
||||
aws-sdk-kms (1.99.0)
|
||||
aws-sdk-core (~> 3, >= 3.216.0)
|
||||
aws-sigv4 (~> 1.5)
|
||||
aws-sdk-s3 (1.156.0)
|
||||
aws-sdk-core (~> 3, >= 3.201.0)
|
||||
aws-sdk-s3 (1.182.0)
|
||||
aws-sdk-core (~> 3, >= 3.216.0)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.5)
|
||||
aws-sigv4 (1.9.0)
|
||||
aws-sigv4 (1.11.0)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
babosa (1.0.4)
|
||||
base64 (0.2.0)
|
||||
@@ -33,13 +34,13 @@ GEM
|
||||
commander (4.6.0)
|
||||
highline (~> 2.0.0)
|
||||
declarative (0.0.20)
|
||||
digest-crc (0.6.5)
|
||||
digest-crc (0.7.0)
|
||||
rake (>= 12.0.0, < 14.0.0)
|
||||
domain_name (0.6.20240107)
|
||||
dotenv (2.8.1)
|
||||
emoji_regex (3.2.3)
|
||||
excon (0.111.0)
|
||||
faraday (1.10.3)
|
||||
excon (0.112.0)
|
||||
faraday (1.10.4)
|
||||
faraday-em_http (~> 1.0)
|
||||
faraday-em_synchrony (~> 1.0)
|
||||
faraday-excon (~> 1.1)
|
||||
@@ -58,17 +59,17 @@ GEM
|
||||
faraday-em_synchrony (1.0.0)
|
||||
faraday-excon (1.1.0)
|
||||
faraday-httpclient (1.0.1)
|
||||
faraday-multipart (1.0.4)
|
||||
multipart-post (~> 2)
|
||||
faraday-multipart (1.1.0)
|
||||
multipart-post (~> 2.0)
|
||||
faraday-net_http (1.0.2)
|
||||
faraday-net_http_persistent (1.2.0)
|
||||
faraday-patron (1.0.0)
|
||||
faraday-rack (1.0.0)
|
||||
faraday-retry (1.0.3)
|
||||
faraday_middleware (1.2.0)
|
||||
faraday_middleware (1.2.1)
|
||||
faraday (~> 1.0)
|
||||
fastimage (2.3.1)
|
||||
fastlane (2.222.0)
|
||||
fastimage (2.4.0)
|
||||
fastlane (2.227.0)
|
||||
CFPropertyList (>= 2.3, < 4.0.0)
|
||||
addressable (>= 2.8, < 3.0.0)
|
||||
artifactory (~> 3.0)
|
||||
@@ -84,6 +85,7 @@ GEM
|
||||
faraday-cookie_jar (~> 0.0.6)
|
||||
faraday_middleware (~> 1.0)
|
||||
fastimage (>= 2.1.0, < 3.0.0)
|
||||
fastlane-sirp (>= 1.0.0)
|
||||
gh_inspector (>= 1.1.2, < 2.0.0)
|
||||
google-apis-androidpublisher_v3 (~> 0.3)
|
||||
google-apis-playcustomapp_v1 (~> 0.1)
|
||||
@@ -107,8 +109,10 @@ GEM
|
||||
tty-spinner (>= 0.8.0, < 1.0.0)
|
||||
word_wrap (~> 1.0.0)
|
||||
xcodeproj (>= 1.13.0, < 2.0.0)
|
||||
xcpretty (~> 0.3.0)
|
||||
xcpretty (~> 0.4.0)
|
||||
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
|
||||
fastlane-sirp (1.0.0)
|
||||
sysrandom (~> 1.0)
|
||||
gh_inspector (1.1.3)
|
||||
google-apis-androidpublisher_v3 (0.54.0)
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
@@ -126,12 +130,12 @@ GEM
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
google-apis-storage_v1 (0.31.0)
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
google-cloud-core (1.7.0)
|
||||
google-cloud-core (1.8.0)
|
||||
google-cloud-env (>= 1.0, < 3.a)
|
||||
google-cloud-errors (~> 1.0)
|
||||
google-cloud-env (1.6.0)
|
||||
faraday (>= 0.17.3, < 3.0)
|
||||
google-cloud-errors (1.4.0)
|
||||
google-cloud-errors (1.5.0)
|
||||
google-cloud-storage (1.47.0)
|
||||
addressable (~> 2.8)
|
||||
digest-crc (~> 0.4)
|
||||
@@ -147,23 +151,25 @@ GEM
|
||||
os (>= 0.9, < 2.0)
|
||||
signet (>= 0.16, < 2.a)
|
||||
highline (2.0.3)
|
||||
http-cookie (1.0.6)
|
||||
http-cookie (1.0.8)
|
||||
domain_name (~> 0.5)
|
||||
httpclient (2.8.3)
|
||||
httpclient (2.9.0)
|
||||
mutex_m
|
||||
jmespath (1.6.2)
|
||||
json (2.7.2)
|
||||
jwt (2.8.2)
|
||||
json (2.10.2)
|
||||
jwt (2.10.1)
|
||||
base64
|
||||
mini_magick (4.13.2)
|
||||
mini_mime (1.1.5)
|
||||
multi_json (1.15.0)
|
||||
multipart-post (2.4.1)
|
||||
nanaimo (0.3.0)
|
||||
mutex_m (0.3.0)
|
||||
nanaimo (0.4.0)
|
||||
naturally (2.2.1)
|
||||
nkf (0.2.0)
|
||||
optparse (0.5.0)
|
||||
optparse (0.6.0)
|
||||
os (1.1.4)
|
||||
plist (3.7.1)
|
||||
plist (3.7.2)
|
||||
public_suffix (6.0.1)
|
||||
rake (13.2.1)
|
||||
representable (3.2.0)
|
||||
@@ -171,11 +177,10 @@ GEM
|
||||
trailblazer-option (>= 0.1.1, < 0.2.0)
|
||||
uber (< 0.2.0)
|
||||
retriable (3.1.2)
|
||||
rexml (3.2.9)
|
||||
strscan
|
||||
rouge (2.0.7)
|
||||
rexml (3.4.1)
|
||||
rouge (3.28.0)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
rubyzip (2.4.1)
|
||||
security (0.1.5)
|
||||
signet (0.19.0)
|
||||
addressable (~> 2.8)
|
||||
@@ -185,7 +190,7 @@ GEM
|
||||
simctl (1.6.10)
|
||||
CFPropertyList
|
||||
naturally
|
||||
strscan (3.1.0)
|
||||
sysrandom (1.0.5)
|
||||
terminal-notifier (2.0.0)
|
||||
terminal-table (3.0.2)
|
||||
unicode-display_width (>= 1.1.1, < 3)
|
||||
@@ -195,17 +200,17 @@ GEM
|
||||
tty-spinner (0.9.3)
|
||||
tty-cursor (~> 0.7)
|
||||
uber (0.1.0)
|
||||
unicode-display_width (2.5.0)
|
||||
unicode-display_width (2.6.0)
|
||||
word_wrap (1.0.0)
|
||||
xcodeproj (1.24.0)
|
||||
xcodeproj (1.27.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
xcpretty (0.3.0)
|
||||
rouge (~> 2.0.7)
|
||||
nanaimo (~> 0.4.0)
|
||||
rexml (>= 3.3.6, < 4.0)
|
||||
xcpretty (0.4.0)
|
||||
rouge (~> 3.28.0)
|
||||
xcpretty-travis-formatter (1.0.1)
|
||||
xcpretty (~> 0.2, >= 0.0.7)
|
||||
|
||||
@@ -216,4 +221,4 @@ DEPENDENCIES
|
||||
fastlane
|
||||
|
||||
BUNDLED WITH
|
||||
2.5.11
|
||||
2.5.22
|
||||
|
||||
@@ -1,35 +1,34 @@
|
||||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||
import com.github.spotbugs.snom.SpotBugsTask
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("com.github.spotbugs")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
}
|
||||
|
||||
spotbugs {
|
||||
ignoreFailures.set(false)
|
||||
setEffort("max")
|
||||
excludeFilter.set(file("./config/spotbugs/exclude.xml"))
|
||||
reportsDir.set(layout.buildDirectory.file("reports/spotbugs/").get().asFile)
|
||||
kotlin {
|
||||
jvmToolchain(21)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "protect.card_locker"
|
||||
compileSdk = 34
|
||||
compileSdk = 35
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "me.hackerchick.catima"
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
versionCode = 139
|
||||
versionName = "2.32.0"
|
||||
targetSdk = 35
|
||||
versionCode = 148
|
||||
versionName = "2.35.0"
|
||||
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
multiDexEnabled = true
|
||||
|
||||
resourceConfigurations += listOf("ar", "bg", "bn", "bn-rIN", "bs", "cs", "da", "de", "el-rGR", "en", "eo", "es", "es-rAR", "et", "fi", "fr", "he-rIL", "hi", "hr", "hu", "in-rID", "is", "it", "ja", "ko", "lt", "lv", "nb-rNO", "nl", "oc", "pl", "pt-rBR", "pt-rPT", "ro-rRO", "ru", "sk", "sl", "sr", "sv", "tr", "uk", "vi", "zh-rCN", "zh-rTW")
|
||||
resourceConfigurations += listOf("ar", "be", "bg", "bn", "bn-rIN", "bs", "cs", "da", "de", "el-rGR", "en", "eo", "es", "es-rAR", "et", "fi", "fr", "gl", "he-rIL", "hi", "hr", "hu", "in-rID", "is", "it", "ja", "ko", "lt", "lv", "nb-rNO", "nl", "oc", "pl", "pt", "pt-rBR", "pt-rPT", "ro-rRO", "ru", "sk", "sl", "sr", "sv", "ta", "tr", "uk", "vi", "zh-rCN", "zh-rTW")
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
buildConfigField("boolean", "showDonate", "true")
|
||||
buildConfigField("boolean", "showRateOnGooglePlay", "false")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@@ -50,6 +49,21 @@ android {
|
||||
viewBinding = true
|
||||
}
|
||||
|
||||
flavorDimensions.add("type")
|
||||
productFlavors {
|
||||
create("foss") {
|
||||
dimension = "type"
|
||||
isDefault = true
|
||||
}
|
||||
create("gplay") {
|
||||
dimension = "type"
|
||||
|
||||
// Google doesn't allow donation links
|
||||
buildConfigField("boolean", "showDonate", "false")
|
||||
buildConfigField("boolean", "showRateOnGooglePlay", "true")
|
||||
}
|
||||
}
|
||||
|
||||
bundle {
|
||||
language {
|
||||
enableSplit = false
|
||||
@@ -62,8 +76,8 @@ android {
|
||||
// Flag to enable support for the new language APIs
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@@ -84,39 +98,41 @@ android {
|
||||
lint {
|
||||
lintConfig = file("lint.xml")
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "21"
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
// AndroidX
|
||||
implementation("androidx.appcompat:appcompat:1.7.0")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||
implementation("androidx.exifinterface:exifinterface:1.3.7")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.2.1")
|
||||
implementation("androidx.core:core-ktx:1.16.0")
|
||||
implementation("androidx.core:core-splashscreen:1.0.1")
|
||||
implementation("androidx.exifinterface:exifinterface:1.4.1")
|
||||
implementation("androidx.palette:palette:1.0.0")
|
||||
implementation("androidx.preference:preference:1.2.1")
|
||||
implementation("com.google.android.material:material:1.12.0")
|
||||
implementation("com.github.yalantis:ucrop:2.2.9")
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.2")
|
||||
|
||||
// Splash Screen
|
||||
implementation("androidx.core:core-splashscreen:1.0.1")
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
|
||||
|
||||
// Third-party
|
||||
implementation("com.journeyapps:zxing-android-embedded:4.3.0@aar")
|
||||
implementation("com.github.yalantis:ucrop:2.2.10")
|
||||
implementation("com.google.zxing:core:3.5.3")
|
||||
implementation("org.apache.commons:commons-csv:1.9.0")
|
||||
implementation("com.jaredrummler:colorpicker:1.1.0")
|
||||
implementation("net.lingala.zip4j:zip4j:2.11.5")
|
||||
|
||||
// SpotBugs
|
||||
implementation("io.wcm.tooling.spotbugs:io.wcm.tooling.spotbugs.annotations:1.0.0")
|
||||
|
||||
// Testing
|
||||
val androidXTestVersion = "1.6.1"
|
||||
val junitVersion = "4.13.2"
|
||||
testImplementation("androidx.test:core:$androidXTestVersion")
|
||||
testImplementation("junit:junit:$junitVersion")
|
||||
testImplementation("org.robolectric:robolectric:4.13")
|
||||
testImplementation("org.robolectric:robolectric:4.14.1")
|
||||
|
||||
androidTestImplementation("androidx.test:core:$androidXTestVersion")
|
||||
androidTestImplementation("junit:junit:$junitVersion")
|
||||
@@ -126,18 +142,6 @@ dependencies {
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
|
||||
}
|
||||
|
||||
tasks.withType<SpotBugsTask>().configureEach {
|
||||
description = "Run spotbugs"
|
||||
group = "verification"
|
||||
|
||||
//classes = fileTree("build/intermediates/javac/debug/compileDebugJavaWithJavac/classes")
|
||||
//source = fileTree("src/main/java")
|
||||
//classpath = files()
|
||||
|
||||
reports.maybeCreate("xml").required.set(false)
|
||||
reports.maybeCreate("html").required.set(true)
|
||||
}
|
||||
|
||||
tasks.register("copyRawResFiles", Copy::class) {
|
||||
from(
|
||||
layout.projectDirectory.file("../CHANGELOG.md"),
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Fehlersuche</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Отстраняване на грешки в Catima</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">ক্যাটিমা ডিবাগ</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">ক্যাটিমা ডিবাগ</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Otklanjanje Grešaka</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Debugar Catima</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Catima Debug</string>
|
||||
</resources>
|
||||
<string name="app_name">Catima Ladění</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Datfygio</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Fejlfinding</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Depuración</string>
|
||||
</resources>
|
||||
|
||||
4
app/src/debug/res/values-fa/strings.xml
Normal file
4
app/src/debug/res/values-fa/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">عیبیابی کاتیما</string>
|
||||
</resources>
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima-vianmääritys</string>
|
||||
</resources>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Débogage de Catima</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
||||
4
app/src/debug/res/values-gl/strings.xml
Normal file
4
app/src/debug/res/values-gl/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Depuración de Catima</string>
|
||||
</resources>
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Villuleit</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catimaデバーグ</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Feelerkorrektur</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Klaidų Taisymas</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima atkļūdošana</string>
|
||||
</resources>
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">കാറ്റിമ ഡീബഗ്</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">कॅटिमा डीबग</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Correcion d\'Errors</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
<resources>
|
||||
<string name="app_name">Catima Odpravljanje Napak</string>
|
||||
</resources>
|
||||
|
||||
2
app/src/debug/res/values-ta/strings.xml
Normal file
2
app/src/debug/res/values-ta/strings.xml
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Catima Hata Ayaklama</string>
|
||||
</resources>
|
||||
<string name="app_name">Catima Hata Ayıklama</string>
|
||||
</resources>
|
||||
|
||||
4
app/src/debug/res/values-tzm/strings.xml
Normal file
4
app/src/debug/res/values-tzm/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">ⴽⴰⵜⵉⵎⴰ ⴰⵙⵔⴰⵡ</string>
|
||||
</resources>
|
||||
@@ -40,12 +40,28 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data android:scheme="content"/>
|
||||
<data android:host="*"/>
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="application/pdf" />
|
||||
<data android:mimeType="application/vnd.apple.pkpass" />
|
||||
<data android:mimeType="application/vnd-com.apple.pkpass" />
|
||||
<data android:mimeType="application/vnd.espass-espass" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data android:mimeType="text/plain" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="application/pdf" />
|
||||
<data android:mimeType="application/vnd.apple.pkpass" />
|
||||
<data android:mimeType="application/vnd-com.apple.pkpass" />
|
||||
<data android:mimeType="application/vnd.espass-espass" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
@@ -63,13 +79,12 @@
|
||||
<activity
|
||||
android:name=".LoyaltyCardViewActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".LoyaltyCardEditActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="stateHidden">
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter
|
||||
android:autoVerify="true"
|
||||
android:label="@string/app_name">
|
||||
@@ -107,8 +122,7 @@
|
||||
<activity
|
||||
android:name=".BarcodeSelectorActivity"
|
||||
android:label="@string/selectBarcodeTitle"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".preferences.SettingsActivity"
|
||||
android:label="@string/settings"
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.Spanned;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import protect.card_locker.databinding.AboutActivityBinding;
|
||||
|
||||
public class AboutActivity extends CatimaAppCompatActivity {
|
||||
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
private AboutActivityBinding binding;
|
||||
private AboutContent content;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = AboutActivityBinding.inflate(getLayoutInflater());
|
||||
content = new AboutContent(this);
|
||||
setTitle(content.getPageTitle());
|
||||
setContentView(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
enableToolbarBackButton();
|
||||
|
||||
TextView copyright = binding.creditsSub;
|
||||
copyright.setText(content.getCopyrightShort());
|
||||
TextView versionHistory = binding.versionHistorySub;
|
||||
versionHistory.setText(content.getVersionHistory());
|
||||
|
||||
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/donate");
|
||||
|
||||
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);
|
||||
|
||||
bindClickListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
content.destroy();
|
||||
clearClickListeners();
|
||||
binding = null;
|
||||
}
|
||||
|
||||
private void bindClickListeners() {
|
||||
binding.versionHistory.setOnClickListener(this::showHistory);
|
||||
binding.translate.setOnClickListener(this::openExternalBrowser);
|
||||
binding.license.setOnClickListener(this::showLicense);
|
||||
binding.repo.setOnClickListener(this::openExternalBrowser);
|
||||
binding.privacy.setOnClickListener(this::showPrivacy);
|
||||
binding.reportError.setOnClickListener(this::openExternalBrowser);
|
||||
binding.rate.setOnClickListener(this::openExternalBrowser);
|
||||
binding.donate.setOnClickListener(this::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() {
|
||||
showHTML(R.string.credits, content.getContributorInfo(), null);
|
||||
}
|
||||
|
||||
private void showHistory(View view) {
|
||||
showHTML(R.string.version_history, content.getHistoryInfo(), view);
|
||||
}
|
||||
|
||||
private void showLicense(View view) {
|
||||
showHTML(R.string.license, content.getLicenseInfo(), view);
|
||||
}
|
||||
|
||||
private void showPrivacy(View view) {
|
||||
showHTML(R.string.privacy_policy, content.getPrivacyInfo(), view);
|
||||
}
|
||||
|
||||
private void showHTML(@StringRes int title, final Spanned text, @Nullable View view) {
|
||||
int dialogContentPadding = getResources().getDimensionPixelSize(R.dimen.alert_dialog_content_padding);
|
||||
TextView textView = new TextView(this);
|
||||
textView.setText(text);
|
||||
Utils.makeTextViewLinksClickable(textView, text);
|
||||
ScrollView scrollView = new ScrollView(this);
|
||||
scrollView.addView(textView);
|
||||
scrollView.setPadding(dialogContentPadding, dialogContentPadding / 2, dialogContentPadding, 0);
|
||||
|
||||
// Create dialog
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilder = new MaterialAlertDialogBuilder(this);
|
||||
materialAlertDialogBuilder
|
||||
.setTitle(title)
|
||||
.setView(scrollView)
|
||||
.setPositiveButton(R.string.ok, null);
|
||||
|
||||
// Add View online button if an URL is linked to this view
|
||||
if (view != null && view.getTag() != null) {
|
||||
materialAlertDialogBuilder.setNeutralButton(R.string.view_online, (dialog, which) -> openExternalBrowser(view));
|
||||
}
|
||||
|
||||
// Show dialog
|
||||
materialAlertDialogBuilder.show();
|
||||
}
|
||||
|
||||
private void openExternalBrowser(View view) {
|
||||
Object tag = view.getTag();
|
||||
if (tag instanceof String && ((String) tag).startsWith("https://")) {
|
||||
(new OpenWebLinkHandler()).openBrowser(this, (String) tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
149
app/src/main/java/protect/card_locker/AboutActivity.kt
Normal file
149
app/src/main/java/protect/card_locker/AboutActivity.kt
Normal file
@@ -0,0 +1,149 @@
|
||||
package protect.card_locker
|
||||
|
||||
import android.os.Bundle
|
||||
import android.text.Spanned
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.ScrollView
|
||||
import android.widget.TextView
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.view.isVisible
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
|
||||
import protect.card_locker.databinding.AboutActivityBinding
|
||||
|
||||
class AboutActivity : CatimaAppCompatActivity() {
|
||||
private companion object {
|
||||
private const val TAG = "Catima"
|
||||
}
|
||||
|
||||
private lateinit var binding: AboutActivityBinding
|
||||
private lateinit var content: AboutContent
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = AboutActivityBinding.inflate(layoutInflater)
|
||||
content = AboutContent(this)
|
||||
title = content.pageTitle
|
||||
setContentView(binding.root)
|
||||
setSupportActionBar(binding.toolbar)
|
||||
enableToolbarBackButton()
|
||||
|
||||
binding.apply {
|
||||
creditsSub.text = content.copyrightShort
|
||||
versionHistorySub.text = content.versionHistory
|
||||
|
||||
versionHistory.tag = "https://catima.app/changelog/"
|
||||
translate.tag = "https://hosted.weblate.org/engage/catima/"
|
||||
license.tag = "https://github.com/CatimaLoyalty/Android/blob/main/LICENSE"
|
||||
repo.tag = "https://github.com/CatimaLoyalty/Android/"
|
||||
privacy.tag = "https://catima.app/privacy-policy/"
|
||||
reportError.tag = "https://github.com/CatimaLoyalty/Android/issues"
|
||||
rate.tag = "https://play.google.com/store/apps/details?id=me.hackerchick.catima"
|
||||
donate.tag = "https://catima.app/donate"
|
||||
|
||||
// Hide Google Play rate button if not on Google Play
|
||||
rate.isVisible = BuildConfig.showRateOnGooglePlay
|
||||
// Hide donate button on Google Play (Google Play doesn't allow donation links)
|
||||
donate.isVisible = BuildConfig.showDonate
|
||||
}
|
||||
|
||||
bindClickListeners()
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
return when (item.itemId) {
|
||||
android.R.id.home -> {
|
||||
finish()
|
||||
true
|
||||
}
|
||||
|
||||
else -> super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
content.destroy()
|
||||
clearClickListeners()
|
||||
}
|
||||
|
||||
private fun bindClickListeners() {
|
||||
binding.apply {
|
||||
versionHistory.setOnClickListener { showHistory(it) }
|
||||
translate.setOnClickListener { openExternalBrowser(it) }
|
||||
license.setOnClickListener { showLicense(it) }
|
||||
repo.setOnClickListener { openExternalBrowser(it) }
|
||||
privacy.setOnClickListener { showPrivacy(it) }
|
||||
reportError.setOnClickListener { openExternalBrowser(it) }
|
||||
rate.setOnClickListener { openExternalBrowser(it) }
|
||||
donate.setOnClickListener { openExternalBrowser(it) }
|
||||
credits.setOnClickListener { showCredits() }
|
||||
}
|
||||
}
|
||||
|
||||
private fun clearClickListeners() {
|
||||
binding.apply {
|
||||
versionHistory.setOnClickListener(null)
|
||||
translate.setOnClickListener(null)
|
||||
license.setOnClickListener(null)
|
||||
repo.setOnClickListener(null)
|
||||
privacy.setOnClickListener(null)
|
||||
reportError.setOnClickListener(null)
|
||||
rate.setOnClickListener(null)
|
||||
donate.setOnClickListener(null)
|
||||
credits.setOnClickListener(null)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showCredits() {
|
||||
showHTML(R.string.credits, content.contributorInfo, null)
|
||||
}
|
||||
|
||||
private fun showHistory(view: View) {
|
||||
showHTML(R.string.version_history, content.historyInfo, view)
|
||||
}
|
||||
|
||||
private fun showLicense(view: View) {
|
||||
showHTML(R.string.license, content.licenseInfo, view)
|
||||
}
|
||||
|
||||
private fun showPrivacy(view: View) {
|
||||
showHTML(R.string.privacy_policy, content.privacyInfo, view)
|
||||
}
|
||||
|
||||
private fun showHTML(@StringRes title: Int, text: Spanned, view: View?) {
|
||||
val dialogContentPadding = resources.getDimensionPixelSize(R.dimen.alert_dialog_content_padding)
|
||||
val textView = TextView(this).apply {
|
||||
setText(text)
|
||||
Utils.makeTextViewLinksClickable(this, text)
|
||||
}
|
||||
|
||||
val scrollView = ScrollView(this).apply {
|
||||
addView(textView)
|
||||
setPadding(dialogContentPadding, dialogContentPadding / 2, dialogContentPadding, 0)
|
||||
}
|
||||
|
||||
MaterialAlertDialogBuilder(this).apply {
|
||||
setTitle(title)
|
||||
setView(scrollView)
|
||||
setPositiveButton(R.string.ok, null)
|
||||
|
||||
// Add View online button if an URL is linked to this view
|
||||
view?.tag?.let {
|
||||
setNeutralButton(R.string.view_online) { _, _ -> openExternalBrowser(view) }
|
||||
}
|
||||
|
||||
show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun openExternalBrowser(view: View) {
|
||||
val tag = view.tag
|
||||
if (tag is String && tag.startsWith("https://")) {
|
||||
OpenWebLinkHandler().openBrowser(this, tag)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class BarcodeImageWriterTask implements CompatCallable<Bitmap> {
|
||||
BarcodeImageWriterTask(
|
||||
Context context, ImageView imageView, String cardIdString,
|
||||
CatimaBarcode barcodeFormat, TextView textView,
|
||||
boolean showFallback, BarcodeImageWriterResultCallback callback, boolean roundCornerPadding
|
||||
boolean showFallback, BarcodeImageWriterResultCallback callback, boolean roundCornerPadding, boolean isFullscreen
|
||||
) {
|
||||
mContext = context;
|
||||
|
||||
@@ -86,13 +86,13 @@ public class BarcodeImageWriterTask implements CompatCallable<Bitmap> {
|
||||
|
||||
if (format.isSquare()) {
|
||||
imageHeight = imageWidth = Math.min(imageViewHeight, Math.min(MAX_WIDTH, imageViewWidth));
|
||||
} else if (imageView.getWidth() < MAX_WIDTH) {
|
||||
} else if (imageView.getWidth() < MAX_WIDTH && !isFullscreen) {
|
||||
imageHeight = imageViewHeight;
|
||||
imageWidth = imageViewWidth;
|
||||
} else {
|
||||
// Scale down the image to reduce the memory needed to produce it
|
||||
imageWidth = MAX_WIDTH;
|
||||
double ratio = (double) MAX_WIDTH / (double) imageViewWidth;
|
||||
imageWidth = Math.min(MAX_WIDTH, this.mContext.getResources().getDisplayMetrics().widthPixels);
|
||||
double ratio = (double) imageWidth / (double) imageViewWidth;
|
||||
imageHeight = (int) (imageViewHeight * ratio);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ public class BarcodeSelectorActivity extends CatimaAppCompatActivity implements
|
||||
binding = BarcodeSelectorActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.selectBarcodeTitle);
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
enableToolbarBackButton();
|
||||
|
||||
@@ -92,13 +92,13 @@ public class BarcodeSelectorAdapter extends ArrayAdapter<CatimaBarcodeWithValue>
|
||||
|
||||
Log.d(TAG, "Generating barcode for type " + formatType);
|
||||
|
||||
BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getContext(), image, cardId, format, text, true, null, true);
|
||||
BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getContext(), image, cardId, format, text, true, null, true, false);
|
||||
mTasks.executeTask(TaskHandler.TYPE.BARCODE, barcodeWriter);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Log.d(TAG, "Generating barcode for type " + formatType);
|
||||
BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getContext(), image, cardId, format, text, true, null, true);
|
||||
BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getContext(), image, cardId, format, text, true, null, true, false);
|
||||
mTasks.executeTask(TaskHandler.TYPE.BARCODE, barcodeWriter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class BarcodeValues {
|
||||
@Nullable
|
||||
private final CatimaBarcode mFormat;
|
||||
private final String mContent;
|
||||
private String mNote;
|
||||
|
||||
public BarcodeValues(@Nullable CatimaBarcode format, String content) {
|
||||
mFormat = format;
|
||||
mContent = content;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
mNote = note;
|
||||
}
|
||||
|
||||
public @Nullable CatimaBarcode format() {
|
||||
return mFormat;
|
||||
}
|
||||
|
||||
public String content() {
|
||||
return mContent;
|
||||
}
|
||||
|
||||
public String note() { return mNote; }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package protect.card_locker;
|
||||
|
||||
public interface BarcodeValuesListDisambiguatorCallback {
|
||||
void onUserChoseBarcode(BarcodeValues barcodeValues);
|
||||
void onUserDismissedSelector();
|
||||
}
|
||||
@@ -12,15 +12,15 @@ import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.pm.ShortcutInfoCompat;
|
||||
import androidx.core.content.pm.ShortcutManagerCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import protect.card_locker.databinding.SimpleToolbarListActivityBinding;
|
||||
import protect.card_locker.databinding.CardShortcutConfigureActivityBinding;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
|
||||
/**
|
||||
* The configuration screen for creating a shortcut.
|
||||
*/
|
||||
public class CardShortcutConfigure extends CatimaAppCompatActivity implements LoyaltyCardCursorAdapter.CardAdapterListener {
|
||||
private SimpleToolbarListActivityBinding binding;
|
||||
private CardShortcutConfigureActivityBinding binding;
|
||||
static final String TAG = "Catima";
|
||||
private SQLiteDatabase mDatabase;
|
||||
private LoyaltyCardCursorAdapter mAdapter;
|
||||
@@ -28,7 +28,7 @@ public class CardShortcutConfigure extends CatimaAppCompatActivity implements Lo
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
binding = SimpleToolbarListActivityBinding.inflate(getLayoutInflater());
|
||||
binding = CardShortcutConfigureActivityBinding.inflate(getLayoutInflater());
|
||||
mDatabase = new DBHelper(this).getReadableDatabase();
|
||||
|
||||
// Set the result to CANCELED. This will cause nothing to happen if the
|
||||
@@ -36,6 +36,7 @@ public class CardShortcutConfigure extends CatimaAppCompatActivity implements Lo
|
||||
setResult(RESULT_CANCELED);
|
||||
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
toolbar.setTitle(R.string.shortcutSelectCard);
|
||||
setSupportActionBar(toolbar);
|
||||
@@ -47,21 +48,26 @@ public class CardShortcutConfigure extends CatimaAppCompatActivity implements Lo
|
||||
finish();
|
||||
}
|
||||
|
||||
final RecyclerView cardList = binding.list;
|
||||
GridLayoutManager layoutManager = (GridLayoutManager) cardList.getLayoutManager();
|
||||
if (layoutManager != null) {
|
||||
layoutManager.setSpanCount(getResources().getInteger(R.integer.main_view_card_columns));
|
||||
}
|
||||
|
||||
Cursor cardCursor = DBHelper.getLoyaltyCardCursor(mDatabase, DBHelper.LoyaltyCardArchiveFilter.All);
|
||||
mAdapter = new LoyaltyCardCursorAdapter(this, cardCursor, this, null);
|
||||
cardList.setAdapter(mAdapter);
|
||||
binding.list.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
var layoutManager = (GridLayoutManager) binding.list.getLayoutManager();
|
||||
if (layoutManager != null) {
|
||||
var settings = new Settings(this);
|
||||
layoutManager.setSpanCount(settings.getPreferredColumnCount());
|
||||
}
|
||||
}
|
||||
|
||||
private void onClickAction(int position) {
|
||||
Cursor selected = DBHelper.getLoyaltyCardCursor(mDatabase, DBHelper.LoyaltyCardArchiveFilter.All);
|
||||
selected.moveToPosition(position);
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.fromCursor(selected);
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.fromCursor(CardShortcutConfigure.this, selected);
|
||||
|
||||
Log.d(TAG, "Creating shortcut for card " + loyaltyCard.store + "," + loyaltyCard.id);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class CardsOnPowerScreenService extends ControlsProviderService {
|
||||
Cursor loyaltyCardCursor = DBHelper.getLoyaltyCardCursor(mDatabase, DBHelper.LoyaltyCardArchiveFilter.Unarchived);
|
||||
return subscriber -> {
|
||||
while (loyaltyCardCursor.moveToNext()) {
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(loyaltyCardCursor);
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(this, loyaltyCardCursor);
|
||||
Intent openIntent = new Intent(this, LoyaltyCardViewActivity.class)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.putExtra(LoyaltyCardViewActivity.BUNDLE_ID, card.id);
|
||||
@@ -69,7 +69,7 @@ public class CardsOnPowerScreenService extends ControlsProviderService {
|
||||
for (String controlId : controlIds) {
|
||||
Control control;
|
||||
Integer cardId = this.controlIdToCardId(controlId);
|
||||
LoyaltyCard card = DBHelper.getLoyaltyCard(mDatabase, cardId);
|
||||
LoyaltyCard card = DBHelper.getLoyaltyCard(this, mDatabase, cardId);
|
||||
if (card != null) {
|
||||
Intent openIntent = new Intent(this, LoyaltyCardViewActivity.class)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
@@ -99,7 +99,7 @@ public class CardsOnPowerScreenService extends ControlsProviderService {
|
||||
}
|
||||
|
||||
private Bitmap getIcon(Context context, LoyaltyCard loyaltyCard) {
|
||||
Bitmap cardIcon = Utils.retrieveCardImage(context, loyaltyCard.id, ImageLocationType.icon);
|
||||
Bitmap cardIcon = loyaltyCard.getImageThumbnail(context);
|
||||
|
||||
if (cardIcon != null) {
|
||||
return cardIcon;
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
@@ -24,6 +25,7 @@ public class CatimaAppCompatActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
EdgeToEdge.enable(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
Utils.patchColors(this);
|
||||
}
|
||||
|
||||
@@ -23,10 +23,11 @@ import java.util.Set;
|
||||
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 = 16;
|
||||
public static final int DATABASE_VERSION = 17;
|
||||
|
||||
// NB: changing this value requires a migration
|
||||
// NB: changing these values requires a migration
|
||||
public static final int DEFAULT_ZOOM_LEVEL = 100;
|
||||
public static final int DEFAULT_ZOOM_LEVEL_WIDTH = 100;
|
||||
|
||||
public static class LoyaltyCardDbGroups {
|
||||
public static final String TABLE = "groups";
|
||||
@@ -51,6 +52,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
public static final String STAR_STATUS = "starstatus";
|
||||
public static final String LAST_USED = "lastused";
|
||||
public static final String ZOOM_LEVEL = "zoomlevel";
|
||||
public static final String ZOOM_LEVEL_WIDTH = "zoomlevelwidth";
|
||||
public static final String ARCHIVE_STATUS = "archive";
|
||||
}
|
||||
|
||||
@@ -70,6 +72,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
public enum LoyaltyCardOrder {
|
||||
Alpha,
|
||||
LastUsed,
|
||||
ValidFrom,
|
||||
Expiry
|
||||
}
|
||||
|
||||
@@ -112,6 +115,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
LoyaltyCardDbIds.STAR_STATUS + " INTEGER DEFAULT '0'," +
|
||||
LoyaltyCardDbIds.LAST_USED + " INTEGER DEFAULT '0', " +
|
||||
LoyaltyCardDbIds.ZOOM_LEVEL + " INTEGER DEFAULT '" + DEFAULT_ZOOM_LEVEL + "', " +
|
||||
LoyaltyCardDbIds.ZOOM_LEVEL_WIDTH + " INTEGER DEFAULT '" + DEFAULT_ZOOM_LEVEL_WIDTH + "', " +
|
||||
LoyaltyCardDbIds.ARCHIVE_STATUS + " INTEGER DEFAULT '0' )");
|
||||
|
||||
// create associative table for cards in groups
|
||||
@@ -326,16 +330,21 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
db.execSQL("ALTER TABLE " + LoyaltyCardDbIds.TABLE
|
||||
+ " ADD COLUMN " + LoyaltyCardDbIds.VALID_FROM + " INTEGER");
|
||||
}
|
||||
|
||||
if (oldVersion < 17 && newVersion >= 17) {
|
||||
db.execSQL("ALTER TABLE " + LoyaltyCardDbIds.TABLE
|
||||
+ " ADD COLUMN " + LoyaltyCardDbIds.ZOOM_LEVEL_WIDTH + " INTEGER DEFAULT '100' ");
|
||||
}
|
||||
}
|
||||
|
||||
public static Set<String> imageFiles(Context context, final SQLiteDatabase database) {
|
||||
Set<String> files = new HashSet<>();
|
||||
Cursor cardCursor = getLoyaltyCardCursor(database);
|
||||
while (cardCursor.moveToNext()) {
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(cardCursor);
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(context, cardCursor);
|
||||
for (ImageLocationType imageLocationType : ImageLocationType.values()) {
|
||||
String name = Utils.getCardImageFileName(card.id, imageLocationType);
|
||||
if (Utils.retrieveCardImageAsFile(context, name).exists()) {
|
||||
if (card.getImageForImageLocationType(context, imageLocationType) != null) {
|
||||
files.add(name);
|
||||
}
|
||||
}
|
||||
@@ -515,15 +524,17 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
return (rowsUpdated == 1);
|
||||
}
|
||||
|
||||
public static boolean updateLoyaltyCardZoomLevel(SQLiteDatabase database, int loyaltyCardId, int zoomLevel) {
|
||||
public static boolean updateLoyaltyCardZoomLevel(SQLiteDatabase database, int loyaltyCardId, int zoomLevel, int zoomLevelWidth) {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(LoyaltyCardDbIds.ZOOM_LEVEL, zoomLevel);
|
||||
contentValues.put(LoyaltyCardDbIds.ZOOM_LEVEL_WIDTH, zoomLevelWidth);
|
||||
Log.d("updateLoyaltyCardZLevel", "Card Id = " + loyaltyCardId + " Zoom level= " + zoomLevel);
|
||||
Log.d("updateLoyaltyCardZoomLW", "Card Id = " + loyaltyCardId + " Zoom level width= " + zoomLevelWidth);
|
||||
int rowsUpdated = database.update(LoyaltyCardDbIds.TABLE, contentValues,
|
||||
whereAttrs(LoyaltyCardDbIds.ID),
|
||||
withArgs(loyaltyCardId));
|
||||
Log.d("updateLoyaltyCardZLevel", "Rows changed = " + rowsUpdated);
|
||||
return (rowsUpdated == 1);
|
||||
Log.d("updateLoyaltyCardZLevel", "Card Id = " + loyaltyCardId + " Zoom level = " + zoomLevel + " Zoom level width = " + zoomLevelWidth);
|
||||
return (rowsUpdated >= 1);
|
||||
}
|
||||
|
||||
public static boolean updateLoyaltyCardBalance(SQLiteDatabase database, final int id, final BigDecimal newBalance) {
|
||||
@@ -535,14 +546,14 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
return (rowsUpdated == 1);
|
||||
}
|
||||
|
||||
public static LoyaltyCard getLoyaltyCard(SQLiteDatabase database, final int id) {
|
||||
public static LoyaltyCard getLoyaltyCard(Context context, SQLiteDatabase database, final int id) {
|
||||
Cursor data = database.query(LoyaltyCardDbIds.TABLE, null, whereAttrs(LoyaltyCardDbIds.ID), withArgs(id), null, null, null);
|
||||
|
||||
LoyaltyCard card = null;
|
||||
|
||||
if (data.getCount() == 1) {
|
||||
data.moveToFirst();
|
||||
card = LoyaltyCard.fromCursor(data);
|
||||
card = LoyaltyCard.fromCursor(context, data);
|
||||
}
|
||||
|
||||
data.close();
|
||||
@@ -916,6 +927,10 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
return LoyaltyCardDbIds.LAST_USED;
|
||||
}
|
||||
|
||||
if (order == LoyaltyCardOrder.ValidFrom) {
|
||||
return LoyaltyCardDbIds.VALID_FROM;
|
||||
}
|
||||
|
||||
if (order == LoyaltyCardOrder.Expiry) {
|
||||
return LoyaltyCardDbIds.EXPIRY;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
|
||||
private ActivityResultLauncher<Intent> fileCreateLauncher;
|
||||
private ActivityResultLauncher<String> fileOpenLauncher;
|
||||
private ActivityResultLauncher<Intent> filePickerLauncher;
|
||||
|
||||
final private TaskHandler mTasks = new TaskHandler();
|
||||
|
||||
@@ -60,13 +59,14 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
binding = ImportExportActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.importExport);
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
enableToolbarBackButton();
|
||||
|
||||
Intent fileIntent = getIntent();
|
||||
if (fileIntent != null && fileIntent.getType() != null) {
|
||||
chooseImportType(false, fileIntent.getData());
|
||||
chooseImportType(fileIntent.getData());
|
||||
}
|
||||
|
||||
// would use ActivityResultContracts.CreateDocument() but mime type cannot be set
|
||||
@@ -104,19 +104,6 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
}
|
||||
openFileForImport(result, null);
|
||||
});
|
||||
filePickerLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
Intent intent = result.getData();
|
||||
if (intent == null) {
|
||||
Log.e(TAG, "Activity returned NULL data");
|
||||
return;
|
||||
}
|
||||
Uri uri = intent.getData();
|
||||
if (uri == null) {
|
||||
Log.e(TAG, "Activity returned NULL uri");
|
||||
return;
|
||||
}
|
||||
openFileForImport(intent.getData(), null);
|
||||
});
|
||||
|
||||
// Check that there is a file manager available
|
||||
final Intent intentCreateDocumentAction = new Intent(Intent.ACTION_CREATE_DOCUMENT);
|
||||
@@ -159,11 +146,7 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
|
||||
// Check that there is a file manager available
|
||||
Button importFilesystem = binding.importOptionFilesystemButton;
|
||||
importFilesystem.setOnClickListener(v -> chooseImportType(false, null));
|
||||
|
||||
// Check that there is an app that data can be imported from
|
||||
Button importApplication = binding.importOptionApplicationButton;
|
||||
importApplication.setOnClickListener(v -> chooseImportType(true, null));
|
||||
importFilesystem.setOnClickListener(v -> chooseImportType(null));
|
||||
|
||||
// FIXME: The importer/exporter is currently quite broken
|
||||
// To prevent the screen from turning off during import/export and some devices killing Catima as it's no longer foregrounded, force the screen to stay on here
|
||||
@@ -188,8 +171,7 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
}.start();
|
||||
}
|
||||
|
||||
private void chooseImportType(boolean choosePicker,
|
||||
@Nullable Uri fileData) {
|
||||
private void chooseImportType(@Nullable Uri fileData) {
|
||||
|
||||
List<CharSequence> betaImportOptions = new ArrayList<>();
|
||||
betaImportOptions.add("Fidme");
|
||||
@@ -250,20 +232,12 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
|
||||
new MaterialAlertDialogBuilder(this)
|
||||
.setTitle(importAlertTitle)
|
||||
.setMessage(importAlertMessage)
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
try {
|
||||
if (choosePicker) {
|
||||
final Intent intentPickAction = new Intent(Intent.ACTION_PICK);
|
||||
filePickerLauncher.launch(intentPickAction);
|
||||
} else {
|
||||
fileOpenLauncher.launch("*/*");
|
||||
}
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(getApplicationContext(), R.string.failedOpeningFileManager, Toast.LENGTH_LONG).show();
|
||||
Log.e(TAG, "No activity found to handle intent", e);
|
||||
}
|
||||
.setPositiveButton(R.string.ok, (dialog1, which1) -> {
|
||||
try {
|
||||
fileOpenLauncher.launch("*/*");
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(getApplicationContext(), R.string.failedOpeningFileManager, Toast.LENGTH_LONG).show();
|
||||
Log.e(TAG, "No activity found to handle intent", e);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
|
||||
@@ -125,7 +125,30 @@ public class ImportURIHelper {
|
||||
headerColor = Integer.parseInt(unparsedHeaderColor);
|
||||
}
|
||||
|
||||
return new LoyaltyCard(-1, store, note, validFrom, expiry, balance, balanceType, cardId, barcodeId, barcodeType, headerColor, 0, Utils.getUnixTime(), 100, 0);
|
||||
return new LoyaltyCard(
|
||||
-1,
|
||||
store,
|
||||
note,
|
||||
validFrom,
|
||||
expiry,
|
||||
balance,
|
||||
balanceType,
|
||||
cardId,
|
||||
barcodeId,
|
||||
barcodeType,
|
||||
headerColor,
|
||||
0,
|
||||
Utils.getUnixTime(),
|
||||
100,
|
||||
100,
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
} catch (NumberFormatException | UnsupportedEncodingException | ArrayIndexOutOfBoundsException ex) {
|
||||
throw new InvalidObjectException("Not a valid import URI");
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -11,11 +11,10 @@ import androidx.annotation.Nullable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Currency;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class LoyaltyCard implements Parcelable {
|
||||
public class LoyaltyCard {
|
||||
public int id;
|
||||
public String store;
|
||||
public String note;
|
||||
@@ -36,8 +35,23 @@ public class LoyaltyCard implements Parcelable {
|
||||
public int starStatus;
|
||||
public long lastUsed;
|
||||
public int zoomLevel;
|
||||
public int zoomLevelWidth;
|
||||
public int archiveStatus;
|
||||
|
||||
|
||||
@Nullable
|
||||
private Bitmap imageThumbnail;
|
||||
@Nullable
|
||||
private String imageThumbnailPath;
|
||||
@Nullable
|
||||
private Bitmap imageFront;
|
||||
@Nullable
|
||||
private String imageFrontPath;
|
||||
@Nullable
|
||||
private Bitmap imageBack;
|
||||
@Nullable
|
||||
private String imageBackPath;
|
||||
|
||||
public static final String BUNDLE_LOYALTY_CARD_ID = "loyaltyCardId";
|
||||
public static final String BUNDLE_LOYALTY_CARD_STORE = "loyaltyCardStore";
|
||||
public static final String BUNDLE_LOYALTY_CARD_NOTE = "loyaltyCardNote";
|
||||
@@ -52,7 +66,15 @@ public class LoyaltyCard implements Parcelable {
|
||||
public static final String BUNDLE_LOYALTY_CARD_STAR_STATUS = "loyaltyCardStarStatus";
|
||||
public static final String BUNDLE_LOYALTY_CARD_LAST_USED = "loyaltyCardLastUsed";
|
||||
public static final String BUNDLE_LOYALTY_CARD_ZOOM_LEVEL = "loyaltyCardZoomLevel";
|
||||
public static final String BUNDLE_LOYALTY_CARD_ZOOM_LEVEL_WIDTH = "loyaltyCardZoomLevelWidth";
|
||||
public static final String BUNDLE_LOYALTY_CARD_ARCHIVE_STATUS = "loyaltyCardArchiveStatus";
|
||||
public static final String BUNDLE_LOYALTY_CARD_IMAGE_THUMBNAIL = "loyaltyCardImageThumbnail";
|
||||
public static final String BUNDLE_LOYALTY_CARD_IMAGE_FRONT = "loyaltyCardImageFront";
|
||||
public static final String BUNDLE_LOYALTY_CARD_IMAGE_BACK = "loyaltyCardImageBack";
|
||||
|
||||
private static final String TEMP_IMAGE_THUMBNAIL_FILE_NAME = "loyaltyCardTempImageThumbnailFileName";
|
||||
private static final String TEMP_IMAGE_FRONT_FILE_NAME = "loyaltyCardTempImageFrontFileName";
|
||||
private static final String TEMP_IMAGE_BACK_FILE_NAME = "loyaltyCardTempImageBackFileName";
|
||||
|
||||
/**
|
||||
* Create a loyalty card object with default values
|
||||
@@ -72,7 +94,11 @@ public class LoyaltyCard implements Parcelable {
|
||||
setStarStatus(0);
|
||||
setLastUsed(Utils.getUnixTime());
|
||||
setZoomLevel(100);
|
||||
setZoomLevelWidth(100);
|
||||
setArchiveStatus(0);
|
||||
setImageThumbnail(null, null);
|
||||
setImageFront(null, null);
|
||||
setImageBack(null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,13 +118,17 @@ public class LoyaltyCard implements Parcelable {
|
||||
* @param starStatus
|
||||
* @param lastUsed
|
||||
* @param zoomLevel
|
||||
* @param zoomLevelWidth
|
||||
* @param archiveStatus
|
||||
*/
|
||||
public LoyaltyCard(final int id, final String store, final String note, @Nullable final Date validFrom,
|
||||
@Nullable final Date expiry, final BigDecimal balance, @Nullable 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) {
|
||||
final long lastUsed, final int zoomLevel, final int zoomLevelWidth, final int archiveStatus,
|
||||
@Nullable Bitmap imageThumbnail, @Nullable String imageThumbnailPath,
|
||||
@Nullable Bitmap imageFront, @Nullable String imageFrontPath,
|
||||
@Nullable Bitmap imageBack, @Nullable String imageBackPath) {
|
||||
setId(id);
|
||||
setStore(store);
|
||||
setNote(note);
|
||||
@@ -113,7 +143,65 @@ public class LoyaltyCard implements Parcelable {
|
||||
setStarStatus(starStatus);
|
||||
setLastUsed(lastUsed);
|
||||
setZoomLevel(zoomLevel);
|
||||
setZoomLevelWidth(zoomLevelWidth);
|
||||
setArchiveStatus(archiveStatus);
|
||||
setImageThumbnail(imageThumbnail, imageThumbnailPath);
|
||||
setImageFront(imageFront, imageFrontPath);
|
||||
setImageBack(imageBack, imageBackPath);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Bitmap getImageThumbnail(Context context) {
|
||||
if (imageThumbnailPath != null) {
|
||||
if (imageThumbnailPath.equals(TEMP_IMAGE_THUMBNAIL_FILE_NAME)) {
|
||||
imageThumbnail = Utils.loadTempImage(context, imageThumbnailPath);
|
||||
} else {
|
||||
imageThumbnail = Utils.retrieveCardImage(context, imageThumbnailPath);
|
||||
}
|
||||
imageThumbnailPath = null;
|
||||
}
|
||||
|
||||
if (imageThumbnail == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return imageThumbnail.copy(imageThumbnail.getConfig(), imageThumbnail.isMutable());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Bitmap getImageFront(Context context) {
|
||||
if (imageFrontPath != null) {
|
||||
if (imageFrontPath.equals(TEMP_IMAGE_FRONT_FILE_NAME)) {
|
||||
imageFront = Utils.loadTempImage(context, imageFrontPath);
|
||||
} else {
|
||||
imageFront = Utils.retrieveCardImage(context, imageFrontPath);
|
||||
}
|
||||
imageFrontPath = null;
|
||||
}
|
||||
|
||||
if (imageFront == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return imageFront.copy(imageFront.getConfig(), imageFront.isMutable());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Bitmap getImageBack(Context context) {
|
||||
if (imageBackPath != null) {
|
||||
if (imageBackPath.equals(TEMP_IMAGE_BACK_FILE_NAME)) {
|
||||
imageBack = Utils.loadTempImage(context, imageBackPath);
|
||||
} else {
|
||||
imageBack = Utils.retrieveCardImage(context, imageBackPath);
|
||||
}
|
||||
imageBackPath = null;
|
||||
}
|
||||
|
||||
if (imageBack == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return imageBack.copy(imageBack.getConfig(), imageBack.isMutable());
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
@@ -180,6 +268,14 @@ public class LoyaltyCard implements Parcelable {
|
||||
this.zoomLevel = zoomLevel;
|
||||
}
|
||||
|
||||
public void setZoomLevelWidth(int zoomLevelWidth) {
|
||||
if (zoomLevelWidth < 0 || zoomLevelWidth > 100) {
|
||||
throw new IllegalArgumentException("zoomLevelWidth must be in range 0-100");
|
||||
}
|
||||
|
||||
this.zoomLevelWidth = zoomLevelWidth;
|
||||
}
|
||||
|
||||
public void setArchiveStatus(int archiveStatus) {
|
||||
if (archiveStatus != 0 && archiveStatus != 1) {
|
||||
throw new IllegalArgumentException("archiveStatus must be 0 or 1");
|
||||
@@ -188,59 +284,47 @@ public class LoyaltyCard implements Parcelable {
|
||||
this.archiveStatus = archiveStatus;
|
||||
}
|
||||
|
||||
protected LoyaltyCard(Parcel in) {
|
||||
setId(in.readInt());
|
||||
setStore(Objects.requireNonNull(in.readString()));
|
||||
setNote(Objects.requireNonNull(in.readString()));
|
||||
long tmpValidFrom = in.readLong();
|
||||
setValidFrom(tmpValidFrom > 0 ? new Date(tmpValidFrom) : null);
|
||||
long tmpExpiry = in.readLong();
|
||||
setExpiry(tmpExpiry > 0 ? new Date(tmpExpiry) : null);
|
||||
setBalance((BigDecimal) in.readValue(BigDecimal.class.getClassLoader()));
|
||||
setBalanceType((Currency) in.readValue(Currency.class.getClassLoader()));
|
||||
setCardId(Objects.requireNonNull(in.readString()));
|
||||
setBarcodeId(in.readString());
|
||||
String tmpBarcodeType = in.readString();
|
||||
setBarcodeType((tmpBarcodeType != null && !tmpBarcodeType.isEmpty()) ? CatimaBarcode.fromName(tmpBarcodeType) : null);
|
||||
int tmpHeaderColor = in.readInt();
|
||||
setHeaderColor(tmpHeaderColor != -1 ? tmpHeaderColor : null);
|
||||
setStarStatus(in.readInt());
|
||||
setLastUsed(in.readLong());
|
||||
setZoomLevel(in.readInt());
|
||||
setArchiveStatus(in.readInt());
|
||||
public void setImageThumbnail(@Nullable Bitmap imageThumbnail, @Nullable String imageThumbnailPath) {
|
||||
if (imageThumbnail != null && imageThumbnailPath != null) {
|
||||
throw new IllegalArgumentException("Cannot set both thumbnail and path");
|
||||
}
|
||||
|
||||
this.imageThumbnailPath = imageThumbnailPath;
|
||||
this.imageThumbnail = imageThumbnail != null ? imageThumbnail.copy(imageThumbnail.getConfig(), imageThumbnail.isMutable()) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
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);
|
||||
parcel.writeString(cardId);
|
||||
parcel.writeString(barcodeId);
|
||||
parcel.writeString(barcodeType != null ? barcodeType.name() : "");
|
||||
parcel.writeInt(headerColor != null ? headerColor : -1);
|
||||
parcel.writeInt(starStatus);
|
||||
parcel.writeLong(lastUsed);
|
||||
parcel.writeInt(zoomLevel);
|
||||
parcel.writeInt(archiveStatus);
|
||||
public void setImageFront(@Nullable Bitmap imageFront, @Nullable String imageFrontPath) {
|
||||
if (imageFront != null && imageFrontPath != null) {
|
||||
throw new IllegalArgumentException("Cannot set both thumbnail and path");
|
||||
}
|
||||
|
||||
this.imageFrontPath = imageFrontPath;
|
||||
this.imageFront = imageFront != null ? imageFront.copy(imageFront.getConfig(), imageFront.isMutable()) : null;
|
||||
}
|
||||
|
||||
public static LoyaltyCard fromBundle(Bundle bundle, boolean requireFull) {
|
||||
// Grab default card
|
||||
LoyaltyCard loyaltyCard = new LoyaltyCard();
|
||||
public void setImageBack(@Nullable Bitmap imageBack, @Nullable String imageBackPath) {
|
||||
if (imageBack != null && imageBackPath != null) {
|
||||
throw new IllegalArgumentException("Cannot set both thumbnail and path");
|
||||
}
|
||||
|
||||
// Update from bundle
|
||||
loyaltyCard.updateFromBundle(bundle, requireFull);
|
||||
|
||||
// Return updated version
|
||||
return loyaltyCard;
|
||||
this.imageBackPath = imageBackPath;
|
||||
this.imageBack = imageBack != null ? imageBack.copy(imageBack.getConfig(), imageBack.isMutable()) : null;
|
||||
}
|
||||
|
||||
public void updateFromBundle(Bundle bundle, boolean requireFull) {
|
||||
@Nullable
|
||||
public Bitmap getImageForImageLocationType(Context context, ImageLocationType imageLocationType) {
|
||||
if (imageLocationType == ImageLocationType.icon) {
|
||||
return getImageThumbnail(context);
|
||||
} else if (imageLocationType == ImageLocationType.front) {
|
||||
return getImageFront(context);
|
||||
} else if (imageLocationType == ImageLocationType.back) {
|
||||
return getImageBack(context);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Unknown image location type");
|
||||
}
|
||||
|
||||
public void updateFromBundle(@NonNull Bundle bundle, boolean requireFull) {
|
||||
if (bundle.containsKey(BUNDLE_LOYALTY_CARD_ID)) {
|
||||
setId(bundle.getInt(BUNDLE_LOYALTY_CARD_ID));
|
||||
} else if (requireFull) {
|
||||
@@ -316,46 +400,120 @@ public class LoyaltyCard implements Parcelable {
|
||||
} else if (requireFull) {
|
||||
throw new IllegalArgumentException("Missing key " + BUNDLE_LOYALTY_CARD_ZOOM_LEVEL);
|
||||
}
|
||||
if (bundle.containsKey(BUNDLE_LOYALTY_CARD_ZOOM_LEVEL_WIDTH)) {
|
||||
setZoomLevelWidth(bundle.getInt(BUNDLE_LOYALTY_CARD_ZOOM_LEVEL_WIDTH));
|
||||
} else if (requireFull) {
|
||||
throw new IllegalArgumentException("Missing key " + BUNDLE_LOYALTY_CARD_ZOOM_LEVEL_WIDTH);
|
||||
}
|
||||
if (bundle.containsKey(BUNDLE_LOYALTY_CARD_ARCHIVE_STATUS)) {
|
||||
setArchiveStatus(bundle.getInt(BUNDLE_LOYALTY_CARD_ARCHIVE_STATUS));
|
||||
} else if (requireFull) {
|
||||
throw new IllegalArgumentException("Missing key " + BUNDLE_LOYALTY_CARD_ARCHIVE_STATUS);
|
||||
}
|
||||
if (bundle.containsKey(BUNDLE_LOYALTY_CARD_IMAGE_THUMBNAIL)) {
|
||||
setImageThumbnail(null, bundle.getString(BUNDLE_LOYALTY_CARD_IMAGE_THUMBNAIL));
|
||||
} else if (requireFull) {
|
||||
throw new IllegalArgumentException("Missing key " + BUNDLE_LOYALTY_CARD_IMAGE_THUMBNAIL);
|
||||
}
|
||||
if (bundle.containsKey(BUNDLE_LOYALTY_CARD_IMAGE_FRONT)) {
|
||||
setImageFront(null, bundle.getString(BUNDLE_LOYALTY_CARD_IMAGE_FRONT));
|
||||
} else if (requireFull) {
|
||||
throw new IllegalArgumentException("Missing key " + BUNDLE_LOYALTY_CARD_IMAGE_FRONT);
|
||||
}
|
||||
if (bundle.containsKey(BUNDLE_LOYALTY_CARD_IMAGE_BACK)) {
|
||||
setImageBack(null, bundle.getString(BUNDLE_LOYALTY_CARD_IMAGE_BACK));
|
||||
} else if (requireFull) {
|
||||
throw new IllegalArgumentException("Missing key " + BUNDLE_LOYALTY_CARD_IMAGE_BACK);
|
||||
}
|
||||
}
|
||||
|
||||
public Bundle toBundle() {
|
||||
public Bundle toBundle(Context context, List<String> exportLimit) {
|
||||
boolean exportIsLimited = !exportLimit.isEmpty();
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_ID, id);
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_STORE, store);
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_NOTE, note);
|
||||
if (validFrom != null) {
|
||||
bundle.putLong(BUNDLE_LOYALTY_CARD_VALID_FROM, validFrom.getTime());
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_ID)) {
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_ID, id);
|
||||
}
|
||||
if (expiry != null) {
|
||||
bundle.putLong(BUNDLE_LOYALTY_CARD_EXPIRY, expiry.getTime());
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_STORE)) {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_STORE, store);
|
||||
}
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_BALANCE, balance.toString());
|
||||
if (balanceType != null) {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_BALANCE_TYPE, balanceType.toString());
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_NOTE)) {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_NOTE, note);
|
||||
}
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_CARD_ID, cardId);
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_BARCODE_ID, barcodeId);
|
||||
if (barcodeType != null) {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_BARCODE_TYPE, barcodeType.name());
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_VALID_FROM)) {
|
||||
bundle.putLong(BUNDLE_LOYALTY_CARD_VALID_FROM, validFrom != null ? validFrom.getTime() : -1);
|
||||
}
|
||||
if (headerColor != null) {
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_HEADER_COLOR, headerColor);
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_EXPIRY)) {
|
||||
bundle.putLong(BUNDLE_LOYALTY_CARD_EXPIRY, expiry != null ? expiry.getTime() : -1);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_BALANCE)) {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_BALANCE, balance.toString());
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_BALANCE_TYPE)) {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_BALANCE_TYPE, balanceType != null ? balanceType.toString() : null);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_CARD_ID)) {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_CARD_ID, cardId);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_BARCODE_ID)) {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_BARCODE_ID, barcodeId);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_BARCODE_TYPE)) {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_BARCODE_TYPE, barcodeType != null ? barcodeType.name() : null);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_HEADER_COLOR)) {
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_HEADER_COLOR, headerColor != null ? headerColor : -1);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_STAR_STATUS)) {
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_STAR_STATUS, starStatus);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_LAST_USED)) {
|
||||
bundle.putLong(BUNDLE_LOYALTY_CARD_LAST_USED, lastUsed);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_ZOOM_LEVEL)) {
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_ZOOM_LEVEL, zoomLevel);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_ZOOM_LEVEL_WIDTH)) {
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_ZOOM_LEVEL_WIDTH, zoomLevelWidth);
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_ARCHIVE_STATUS)) {
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_ARCHIVE_STATUS, archiveStatus);
|
||||
}
|
||||
// There is an (undocumented) size limit to bundles of around 2MB(?), when going over it you will experience a random crash
|
||||
// So, instead of storing the bitmaps directly, we write the bitmap to a temp file and store the path
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_IMAGE_THUMBNAIL)) {
|
||||
Bitmap thumbnail = getImageThumbnail(context);
|
||||
if (thumbnail != null) {
|
||||
Utils.saveTempImage(context, thumbnail, TEMP_IMAGE_THUMBNAIL_FILE_NAME, Bitmap.CompressFormat.PNG);
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_IMAGE_THUMBNAIL, TEMP_IMAGE_THUMBNAIL_FILE_NAME);
|
||||
} else {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_IMAGE_THUMBNAIL, null);
|
||||
}
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_IMAGE_FRONT)) {
|
||||
Bitmap front = getImageFront(context);
|
||||
if (front != null) {
|
||||
Utils.saveTempImage(context, front, TEMP_IMAGE_FRONT_FILE_NAME, Bitmap.CompressFormat.PNG);
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_IMAGE_FRONT, TEMP_IMAGE_FRONT_FILE_NAME);
|
||||
} else {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_IMAGE_FRONT, null);
|
||||
}
|
||||
}
|
||||
if (!exportIsLimited || exportLimit.contains(BUNDLE_LOYALTY_CARD_IMAGE_BACK)) {
|
||||
Bitmap back = getImageBack(context);
|
||||
if (back != null) {
|
||||
Utils.saveTempImage(context, back, TEMP_IMAGE_BACK_FILE_NAME, Bitmap.CompressFormat.PNG);
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_IMAGE_BACK, TEMP_IMAGE_BACK_FILE_NAME);
|
||||
} else {
|
||||
bundle.putString(BUNDLE_LOYALTY_CARD_IMAGE_BACK, null);
|
||||
}
|
||||
}
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_STAR_STATUS, starStatus);
|
||||
bundle.putLong(BUNDLE_LOYALTY_CARD_LAST_USED, lastUsed);
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_ZOOM_LEVEL, zoomLevel);
|
||||
bundle.putInt(BUNDLE_LOYALTY_CARD_ARCHIVE_STATUS, archiveStatus);
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
||||
public static LoyaltyCard fromCursor(Cursor cursor) {
|
||||
public static LoyaltyCard fromCursor(Context context, Cursor cursor) {
|
||||
// id
|
||||
int id = cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.ID));
|
||||
// store
|
||||
@@ -390,14 +548,40 @@ public class LoyaltyCard implements Parcelable {
|
||||
long lastUsed = cursor.getLong(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.LAST_USED));
|
||||
// zoomLevel
|
||||
int zoomLevel = cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.ZOOM_LEVEL));
|
||||
// zoomLevelWidth
|
||||
int zoomLevelWidth = cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.ZOOM_LEVEL_WIDTH));
|
||||
// archiveStatus
|
||||
int archiveStatus = cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.ARCHIVE_STATUS));
|
||||
|
||||
return new LoyaltyCard(id, store, note, validFrom, expiry, balance, balanceType, cardId, barcodeId, barcodeType, headerColor, starStatus, lastUsed, zoomLevel, archiveStatus);
|
||||
return new LoyaltyCard(
|
||||
id,
|
||||
store,
|
||||
note,
|
||||
validFrom,
|
||||
expiry,
|
||||
balance,
|
||||
balanceType,
|
||||
cardId,
|
||||
barcodeId,
|
||||
barcodeType,
|
||||
headerColor,
|
||||
starStatus,
|
||||
lastUsed,
|
||||
zoomLevel,
|
||||
zoomLevelWidth,
|
||||
archiveStatus,
|
||||
null,
|
||||
Utils.getCardImageFileName(id, ImageLocationType.icon),
|
||||
null,
|
||||
Utils.getCardImageFileName(id, ImageLocationType.front),
|
||||
null,
|
||||
Utils.getCardImageFileName(id, ImageLocationType.back)
|
||||
);
|
||||
}
|
||||
|
||||
public static boolean isDuplicate(final LoyaltyCard a, final LoyaltyCard b) {
|
||||
// Skip lastUsed & zoomLevel
|
||||
public static boolean isDuplicate(Context context, final LoyaltyCard a, final LoyaltyCard b) {
|
||||
// Note: Bitmap comparing is slow, be careful when calling this method
|
||||
// Skip lastUsed & zoomLevel*
|
||||
return a.id == b.id && // non-nullable int
|
||||
a.store.equals(b.store) && // non-nullable String
|
||||
a.note.equals(b.note) && // non-nullable String
|
||||
@@ -411,12 +595,23 @@ public class LoyaltyCard implements Parcelable {
|
||||
b.barcodeType == null ? null : b.barcodeType.format()) && // nullable CatimaBarcode with no overridden .equals(), so we need to check .format()
|
||||
Utils.equals(a.headerColor, b.headerColor) && // nullable Integer
|
||||
a.starStatus == b.starStatus && // non-nullable int
|
||||
a.archiveStatus == b.archiveStatus; // non-nullable int
|
||||
a.archiveStatus == b.archiveStatus && // non-nullable int
|
||||
nullableBitmapsEqual(a.getImageThumbnail(context), b.getImageThumbnail(context)) && // nullable Bitmap
|
||||
nullableBitmapsEqual(a.getImageFront(context), b.getImageFront(context)) && // nullable Bitmap
|
||||
nullableBitmapsEqual(a.getImageBack(context), b.getImageBack(context)); // nullable Bitmap
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
public static boolean nullableBitmapsEqual(@Nullable Bitmap a, @Nullable Bitmap b) {
|
||||
if (a == null && b == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (a != null && b != null) {
|
||||
return a.sameAs(b);
|
||||
}
|
||||
|
||||
// One is null and the other isn't, so it's not equal
|
||||
return false;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -425,7 +620,8 @@ public class LoyaltyCard implements Parcelable {
|
||||
return String.format(
|
||||
"LoyaltyCard{%n id=%s,%n store=%s,%n note=%s,%n validFrom=%s,%n expiry=%s,%n"
|
||||
+ " balance=%s,%n balanceType=%s,%n cardId=%s,%n barcodeId=%s,%n barcodeType=%s,%n"
|
||||
+ " headerColor=%s,%n starStatus=%s,%n lastUsed=%s,%n zoomLevel=%s,%n archiveStatus=%s%n}",
|
||||
+ " headerColor=%s,%n starStatus=%s,%n lastUsed=%s,%n zoomLevel=%s,%n zoomLevelWidth=%s,%n archiveStatus=%s%n"
|
||||
+ " imageThumbnail=%s,%n imageThumbnailPath=%s,%n imageFront=%s,%n imageFrontPath=%s,%n imageBack=%s,%n imageBackPath=%s,%n}",
|
||||
this.id,
|
||||
this.store,
|
||||
this.note,
|
||||
@@ -440,19 +636,14 @@ public class LoyaltyCard implements Parcelable {
|
||||
this.starStatus,
|
||||
this.lastUsed,
|
||||
this.zoomLevel,
|
||||
this.archiveStatus
|
||||
this.zoomLevelWidth,
|
||||
this.archiveStatus,
|
||||
this.imageThumbnail,
|
||||
this.imageThumbnailPath,
|
||||
this.imageFront,
|
||||
this.imageFrontPath,
|
||||
this.imageBack,
|
||||
this.imageBackPath
|
||||
);
|
||||
}
|
||||
|
||||
public static final Creator<LoyaltyCard> CREATOR = new Creator<LoyaltyCard>() {
|
||||
@Override
|
||||
public LoyaltyCard createFromParcel(Parcel in) {
|
||||
return new LoyaltyCard(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoyaltyCard[] newArray(int size) {
|
||||
return new LoyaltyCard[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import protect.card_locker.databinding.LoyaltyCardLayoutBinding;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
|
||||
public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCursorAdapter.LoyaltyCardListItemViewHolder> {
|
||||
private int mCurrentSelectedIndex = -1;
|
||||
@@ -79,7 +80,7 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
|
||||
public LoyaltyCard getCard(int position) {
|
||||
mCursor.moveToPosition(position);
|
||||
return LoyaltyCard.fromCursor(mCursor);
|
||||
return LoyaltyCard.fromCursor(mContext, mCursor);
|
||||
}
|
||||
|
||||
public void onBindViewHolder(LoyaltyCardListItemViewHolder inputHolder, Cursor inputCursor) {
|
||||
@@ -87,8 +88,8 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
boolean showDivider = false;
|
||||
inputHolder.mDivider.setVisibility(View.GONE);
|
||||
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.fromCursor(inputCursor);
|
||||
Bitmap icon = Utils.retrieveCardImage(mContext, loyaltyCard.id, ImageLocationType.icon);
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.fromCursor(mContext, inputCursor);
|
||||
Bitmap icon = loyaltyCard.getImageThumbnail(mContext);
|
||||
|
||||
if (mLoyaltyCardListDisplayOptions.showingNameBelowThumbnail() && icon != null) {
|
||||
showDivider = true;
|
||||
@@ -111,21 +112,21 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
}
|
||||
|
||||
if (mLoyaltyCardListDisplayOptions.showingValidity() && loyaltyCard.validFrom != null) {
|
||||
inputHolder.setExtraField(inputHolder.mValidFromField, DateFormat.getDateInstance(DateFormat.LONG).format(loyaltyCard.validFrom), Utils.isNotYetValid(loyaltyCard.validFrom) ? Color.RED : null, showDivider);
|
||||
inputHolder.setExtraField(inputHolder.mValidFromField, DateFormat.getDateInstance(DateFormat.MEDIUM).format(loyaltyCard.validFrom), Utils.isNotYetValid(loyaltyCard.validFrom) ? Color.RED : null, showDivider);
|
||||
} else {
|
||||
inputHolder.setExtraField(inputHolder.mValidFromField, null, null, false);
|
||||
}
|
||||
|
||||
if (mLoyaltyCardListDisplayOptions.showingValidity() && loyaltyCard.expiry != null) {
|
||||
inputHolder.setExtraField(inputHolder.mExpiryField, DateFormat.getDateInstance(DateFormat.LONG).format(loyaltyCard.expiry), Utils.hasExpired(loyaltyCard.expiry) ? Color.RED : null, showDivider);
|
||||
inputHolder.setExtraField(inputHolder.mExpiryField, DateFormat.getDateInstance(DateFormat.MEDIUM).format(loyaltyCard.expiry), Utils.hasExpired(loyaltyCard.expiry) ? Color.RED : null, showDivider);
|
||||
} else {
|
||||
inputHolder.setExtraField(inputHolder.mExpiryField, null, null, false);
|
||||
}
|
||||
|
||||
inputHolder.mCardIcon.setContentDescription(loyaltyCard.store);
|
||||
inputHolder.mIconBackgroundColor = Utils.setIconOrTextWithBackground(mContext, loyaltyCard, icon, inputHolder.mCardIcon, inputHolder.mCardText);
|
||||
Utils.setIconOrTextWithBackground(mContext, loyaltyCard, icon, inputHolder.mCardIcon, inputHolder.mCardText, new Settings(mContext).getPreferredColumnCount());
|
||||
|
||||
inputHolder.toggleCardStateIcon(loyaltyCard.starStatus != 0, loyaltyCard.archiveStatus != 0, itemSelected(inputCursor.getPosition()));
|
||||
inputHolder.toggleCardStateIcon(loyaltyCard.starStatus != 0, loyaltyCard.archiveStatus != 0);
|
||||
|
||||
inputHolder.itemView.setActivated(mSelectedItems.get(inputCursor.getPosition(), false));
|
||||
applyIconAnimation(inputHolder, inputCursor.getPosition());
|
||||
@@ -192,7 +193,7 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
int i;
|
||||
for (i = 0; i < mSelectedItems.size(); i++) {
|
||||
mCursor.moveToPosition(mSelectedItems.keyAt(i));
|
||||
result.add(LoyaltyCard.fromCursor(mCursor));
|
||||
result.add(LoyaltyCard.fromCursor(mContext, mCursor));
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -211,13 +212,11 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
public class LoyaltyCardListItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public TextView mCardText, mStoreField, mNoteField, mBalanceField, mValidFromField, mExpiryField;
|
||||
public ImageView mCardIcon, mStarBackground, mStarBorder, mTickIcon, mArchivedBackground;
|
||||
public ImageView mCardIcon, mTickIcon;
|
||||
public MaterialCardView mRow;
|
||||
public ConstraintLayout mStar, mArchived;
|
||||
public View mDivider;
|
||||
|
||||
private int mIconBackgroundColor;
|
||||
|
||||
protected LoyaltyCardListItemViewHolder(LoyaltyCardLayoutBinding loyaltyCardLayoutBinding, CardAdapterListener inputListener) {
|
||||
super(loyaltyCardLayoutBinding.getRoot());
|
||||
View inputView = loyaltyCardLayoutBinding.getRoot();
|
||||
@@ -231,10 +230,7 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
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());
|
||||
@@ -296,31 +292,7 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
mNoteField.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);
|
||||
Drawable borderDrawable = mStarBorder.getDrawable().mutate();
|
||||
Drawable backgroundDrawable = mStarBackground.getDrawable().mutate();
|
||||
DrawableCompat.setTint(borderDrawable, needsDarkForeground ? Color.BLACK : Color.WHITE);
|
||||
DrawableCompat.setTint(backgroundDrawable, needsDarkForeground ? Color.BLACK : Color.WHITE);
|
||||
mStarBorder.setImageDrawable(borderDrawable);
|
||||
mStarBackground.setImageDrawable(backgroundDrawable);
|
||||
*/
|
||||
boolean dark = Utils.needsDarkForeground(mIconBackgroundColor);
|
||||
if (colorByTheme) {
|
||||
dark = !mDarkModeEnabled;
|
||||
}
|
||||
|
||||
if (dark) {
|
||||
mStarBorder.setImageResource(R.drawable.ic_unstarred_white);
|
||||
mStarBackground.setImageResource(R.drawable.ic_starred_black);
|
||||
mArchivedBackground.setImageResource(R.drawable.ic_baseline_archive_24_black);
|
||||
} else {
|
||||
mStarBorder.setImageResource(R.drawable.ic_unstarred_black);
|
||||
mStarBackground.setImageResource(R.drawable.ic_starred_white);
|
||||
mArchivedBackground.setImageResource(R.drawable.ic_baseline_archive_24);
|
||||
}
|
||||
|
||||
public void toggleCardStateIcon(boolean enableStar, boolean enableArchive) {
|
||||
if (enableStar) {
|
||||
mStar.setVisibility(View.VISIBLE);
|
||||
} else{
|
||||
@@ -332,17 +304,6 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
} else{
|
||||
mArchived.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
mStarBorder.invalidate();
|
||||
mStarBackground.invalidate();
|
||||
mArchivedBackground.invalidate();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public int dpToPx(int dp, Context mContext) {
|
||||
Resources r = mContext.getResources();
|
||||
int px = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics());
|
||||
return px;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,7 @@ import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
||||
import com.google.android.material.color.MaterialColors;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -139,6 +140,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
// If the barcode is shown, switch to fullscreen layout
|
||||
if (imageType == ImageType.BARCODE) {
|
||||
setFullscreen(true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -221,7 +223,13 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
} else {
|
||||
binding.scalerGuideline.setGuidelinePercent(0.5f * scale);
|
||||
}
|
||||
}
|
||||
|
||||
private void setScalerWidthGuideline(int zoomLevelWidth) {
|
||||
float halfscale = zoomLevelWidth / 200f;
|
||||
|
||||
binding.scalerEndwidthguideline.setGuidelinePercent(0.5f + halfscale);
|
||||
binding.scalerStartwidthguideline.setGuidelinePercent(0.5f - halfscale);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -248,6 +256,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = LoyaltyCardViewLayoutBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
@@ -278,36 +287,8 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
database = new DBHelper(this).getWritableDatabase();
|
||||
importURIHelper = new ImportURIHelper(this);
|
||||
|
||||
binding.barcodeScaler.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
if (!fromUser) {
|
||||
Log.d(TAG, "non user triggered onProgressChanged, ignoring, progress is " + progress);
|
||||
return;
|
||||
}
|
||||
Log.d(TAG, "Progress is " + progress);
|
||||
Log.d(TAG, "Max is " + binding.barcodeScaler.getMax());
|
||||
float scale = (float) progress / (float) binding.barcodeScaler.getMax();
|
||||
Log.d(TAG, "Scaling to " + scale);
|
||||
|
||||
loyaltyCard.zoomLevel = progress;
|
||||
DBHelper.updateLoyaltyCardZoomLevel(database, loyaltyCardId, loyaltyCard.zoomLevel);
|
||||
|
||||
setScalerGuideline(loyaltyCard.zoomLevel);
|
||||
|
||||
drawMainImage(mainImageIndex, true, isFullscreen);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
});
|
||||
binding.barcodeScaler.setOnSeekBarChangeListener(setOnSeekBarChangeListenerUnifiedFunction());
|
||||
binding.barcodeWidthscaler.setOnSeekBarChangeListener(setOnSeekBarChangeListenerUnifiedFunction());
|
||||
|
||||
rotationEnabled = true;
|
||||
|
||||
@@ -329,7 +310,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
binding.bottomAppBarUpdateBalanceButton.setOnClickListener(view -> showBalanceUpdateDialog());
|
||||
|
||||
binding.iconContainer.setOnClickListener(view -> {
|
||||
if (Utils.retrieveCardImage(this, loyaltyCard.id, ImageLocationType.icon) != null) {
|
||||
if (loyaltyCard.getImageThumbnail(this) != null) {
|
||||
openImageInGallery(ImageType.ICON);
|
||||
} else {
|
||||
Toast.makeText(LoyaltyCardViewActivity.this, R.string.icon_header_click_text, Toast.LENGTH_LONG).show();
|
||||
@@ -369,6 +350,46 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
});
|
||||
}
|
||||
|
||||
private SeekBar.OnSeekBarChangeListener setOnSeekBarChangeListenerUnifiedFunction() {
|
||||
return new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
if (!fromUser) {
|
||||
Log.d(TAG, "non user triggered onProgressChanged, ignoring, progress is " + progress);
|
||||
return;
|
||||
}
|
||||
Log.d(TAG, "Progress is " + progress);
|
||||
if (seekBar.getId() == binding.barcodeScaler.getId()) {
|
||||
Log.d(TAG, "Max is " + binding.barcodeScaler.getMax());
|
||||
float scale = (float) progress / (float) binding.barcodeScaler.getMax();
|
||||
Log.d(TAG, "Scaling to " + scale);
|
||||
}
|
||||
else {
|
||||
Log.d(TAG, "Max is " + binding.barcodeWidthscaler.getMax());
|
||||
float scale = (float) progress / (float) binding.barcodeWidthscaler.getMax();
|
||||
Log.d(TAG, "Scaling to " + scale);
|
||||
}
|
||||
if (seekBar.getId() == binding.barcodeScaler.getId()) {
|
||||
loyaltyCard.zoomLevel = progress;
|
||||
setScalerGuideline(loyaltyCard.zoomLevel);
|
||||
}
|
||||
else {
|
||||
loyaltyCard.zoomLevelWidth = progress;
|
||||
setScalerWidthGuideline(loyaltyCard.zoomLevelWidth);
|
||||
}
|
||||
|
||||
DBHelper.updateLoyaltyCardZoomLevel(database, loyaltyCardId, loyaltyCard.zoomLevel, loyaltyCard.zoomLevelWidth);
|
||||
drawMainImage(mainImageIndex, true, isFullscreen);
|
||||
}
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private SpannableStringBuilder padSpannableString(SpannableStringBuilder spannableStringBuilder) {
|
||||
if (spannableStringBuilder.length() > 0) {
|
||||
spannableStringBuilder.append("\n\n");
|
||||
@@ -660,7 +681,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
window.setAttributes(attributes);
|
||||
}
|
||||
|
||||
loyaltyCard = DBHelper.getLoyaltyCard(database, loyaltyCardId);
|
||||
loyaltyCard = DBHelper.getLoyaltyCard(this, database, loyaltyCardId);
|
||||
if (loyaltyCard == null) {
|
||||
Log.w(TAG, "Could not lookup loyalty card " + loyaltyCardId);
|
||||
Toast.makeText(this, R.string.noCardExistsError, Toast.LENGTH_LONG).show();
|
||||
@@ -707,6 +728,8 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
int darkenedColor = ColorUtils.blendARGB(backgroundHeaderColor, Color.BLACK, 0.1f);
|
||||
binding.barcodeScaler.setProgressTintList(ColorStateList.valueOf(darkenedColor));
|
||||
binding.barcodeScaler.setThumbTintList(ColorStateList.valueOf(darkenedColor));
|
||||
binding.barcodeWidthscaler.setProgressTintList(ColorStateList.valueOf(darkenedColor));
|
||||
binding.barcodeWidthscaler.setThumbTintList(ColorStateList.valueOf(darkenedColor));
|
||||
|
||||
// Set bottomAppBar and system navigation bar color
|
||||
binding.bottomAppBar.setBackgroundColor(darkenedColor);
|
||||
@@ -719,8 +742,8 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
editButtonIcon.setTint(Utils.needsDarkForeground(complementaryColor) ? Color.BLACK : Color.WHITE);
|
||||
binding.fabEdit.setImageDrawable(editButtonIcon);
|
||||
|
||||
Bitmap icon = Utils.retrieveCardImage(this, loyaltyCard.id, ImageLocationType.icon);
|
||||
Utils.setIconOrTextWithBackground(this, loyaltyCard, icon, binding.iconImage, binding.iconText);
|
||||
Bitmap icon = loyaltyCard.getImageThumbnail(this);
|
||||
Utils.setIconOrTextWithBackground(this, loyaltyCard, icon, binding.iconImage, binding.iconText, 1);
|
||||
|
||||
// If the background is very bright, we should use dark icons
|
||||
backgroundNeedsDarkIcons = Utils.needsDarkForeground(backgroundHeaderColor);
|
||||
@@ -748,12 +771,12 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
imageTypes.add(ImageType.BARCODE);
|
||||
}
|
||||
|
||||
frontImageBitmap = Utils.retrieveCardImage(this, loyaltyCard.id, ImageLocationType.front);
|
||||
frontImageBitmap = loyaltyCard.getImageFront(this);
|
||||
if (frontImageBitmap != null) {
|
||||
imageTypes.add(ImageType.IMAGE_FRONT);
|
||||
}
|
||||
|
||||
backImageBitmap = Utils.retrieveCardImage(this, loyaltyCard.id, ImageLocationType.back);
|
||||
backImageBitmap = loyaltyCard.getImageBack(this);
|
||||
if (backImageBitmap != null) {
|
||||
imageTypes.add(ImageType.IMAGE_BACK);
|
||||
}
|
||||
@@ -935,7 +958,8 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
null,
|
||||
false,
|
||||
this,
|
||||
addPadding);
|
||||
addPadding,
|
||||
isFullscreen);
|
||||
mTasks.executeTask(TaskHandler.TYPE.BARCODE, barcodeWriter);
|
||||
}
|
||||
}
|
||||
@@ -1129,11 +1153,18 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
binding.container.setVisibility(View.GONE);
|
||||
binding.fullscreenLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
// Only show width slider if the barcode isn't square (square barcodes will resize height and width together)
|
||||
// or if the internals of the barcode are squares, like DATA_MATRIX
|
||||
binding.setWidthLayout.setVisibility((format.isSquare() || format.format() == BarcodeFormat.DATA_MATRIX) ? View.GONE : View.VISIBLE);
|
||||
|
||||
drawMainImage(mainImageIndex, true, isFullscreen);
|
||||
|
||||
binding.barcodeScaler.setProgress(loyaltyCard.zoomLevel);
|
||||
setScalerGuideline(loyaltyCard.zoomLevel);
|
||||
|
||||
binding.barcodeWidthscaler.setProgress(loyaltyCard.zoomLevelWidth);
|
||||
setScalerWidthGuideline(loyaltyCard.zoomLevelWidth);
|
||||
|
||||
// Hide actionbar
|
||||
if (actionBar != null) {
|
||||
actionBar.hide();
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.CursorIndexOutOfBoundsException;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
@@ -27,12 +28,14 @@ import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.view.ActionMode;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.core.splashscreen.SplashScreen;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
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.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -43,6 +46,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import protect.card_locker.databinding.ContentMainBinding;
|
||||
import protect.card_locker.databinding.MainActivityBinding;
|
||||
import protect.card_locker.databinding.SortingOptionBinding;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
import protect.card_locker.preferences.SettingsActivity;
|
||||
|
||||
public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCardCursorAdapter.CardAdapterListener {
|
||||
@@ -52,6 +56,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
public static final String RESTART_ACTIVITY_INTENT = "restart_activity_intent";
|
||||
|
||||
private static final int MEDIUM_SCALE_FACTOR_DIP = 460;
|
||||
static final String STATE_SEARCH_QUERY = "SEARCH_QUERY";
|
||||
|
||||
private SQLiteDatabase mDatabase;
|
||||
private LoyaltyCardCursorAdapter mAdapter;
|
||||
@@ -59,6 +64,8 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
private SearchView mSearchView;
|
||||
private int mLoyaltyCardCount = 0;
|
||||
protected String mFilter = "";
|
||||
private String currentQuery = "";
|
||||
private String finalQuery = "";
|
||||
protected Object mGroup = null;
|
||||
protected DBHelper.LoyaltyCardOrder mOrder = DBHelper.LoyaltyCardOrder.Alpha;
|
||||
protected DBHelper.LoyaltyCardOrderDirection mOrderDirection = DBHelper.LoyaltyCardOrderDirection.Ascending;
|
||||
@@ -68,9 +75,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
private View mNoMatchingCardsText;
|
||||
private View mNoGroupCardsText;
|
||||
private TabLayout groupsTabLayout;
|
||||
|
||||
private Runnable mUpdateLoyaltyCardListRunnable;
|
||||
|
||||
private ActivityResultLauncher<Intent> mBarcodeScannerLauncher;
|
||||
private ActivityResultLauncher<Intent> mSettingsLauncher;
|
||||
|
||||
@@ -198,11 +203,33 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
SplashScreen.installSplashScreen(this);
|
||||
super.onCreate(inputSavedInstanceState);
|
||||
|
||||
// Delete old cache files
|
||||
// These could be temporary images for the cropper, temporary images in LoyaltyCard toBundle/writeParcel/ etc.
|
||||
new Thread(() -> {
|
||||
long twentyFourHoursAgo = System.currentTimeMillis() - (1000 * 60 * 60 * 24);
|
||||
|
||||
File[] tempFiles = getCacheDir().listFiles();
|
||||
|
||||
if (tempFiles == null) {
|
||||
Log.e(TAG, "getCacheDir().listFiles() somehow returned null, this should never happen... Skipping cache cleanup...");
|
||||
return;
|
||||
}
|
||||
|
||||
for (File file : tempFiles) {
|
||||
if (file.lastModified() < twentyFourHoursAgo) {
|
||||
if (!file.delete()) {
|
||||
Log.w(TAG, "Failed to delete cache file " + file.getPath());
|
||||
}
|
||||
};
|
||||
}
|
||||
}).start();
|
||||
|
||||
// We should extract the share intent after we called the super.onCreate as it may need to spawn a dialog window and the app needs to be initialized to not crash
|
||||
extractIntentFields(getIntent());
|
||||
|
||||
binding = MainActivityBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
setSupportActionBar(binding.toolbar);
|
||||
groupsTabLayout = binding.groups;
|
||||
contentMainBinding = ContentMainBinding.bind(binding.include.getRoot());
|
||||
@@ -249,21 +276,15 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
mCardList.setAdapter(mAdapter);
|
||||
registerForContextMenu(mCardList);
|
||||
|
||||
mGroup = null;
|
||||
updateLoyaltyCardList(true);
|
||||
|
||||
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();
|
||||
List<BarcodeValues> barcodeValuesList = Utils.parseSetBarcodeActivityResult(Utils.BARCODE_SCAN, result.getResultCode(), intent, this);
|
||||
|
||||
Bundle inputBundle = intent.getExtras();
|
||||
String group = inputBundle != null ? inputBundle.getString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP) : null;
|
||||
processBarcodeValuesList(barcodeValuesList, group, false);
|
||||
Intent editIntent = new Intent(getApplicationContext(), LoyaltyCardEditActivity.class);
|
||||
editIntent.putExtras(result.getData().getExtras());
|
||||
startActivity(editIntent);
|
||||
});
|
||||
|
||||
mSettingsLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
@@ -299,7 +320,6 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
if (mSearchView != null && !mSearchView.isIconified()) {
|
||||
mFilter = mSearchView.getQuery().toString();
|
||||
}
|
||||
|
||||
// Start of active tab logic
|
||||
updateTabGroups(groupsTabLayout);
|
||||
|
||||
@@ -357,6 +377,12 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
mBarcodeScannerLauncher.launch(intent);
|
||||
});
|
||||
addButton.bringToFront();
|
||||
|
||||
var layoutManager = (GridLayoutManager) mCardList.getLayoutManager();
|
||||
if (layoutManager != null) {
|
||||
var settings = new Settings(this);
|
||||
layoutManager.setSpanCount(settings.getPreferredColumnCount());
|
||||
}
|
||||
}
|
||||
|
||||
private void displayCardSetupOptions(Menu menu, boolean shouldShow) {
|
||||
@@ -418,21 +444,16 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
}
|
||||
}
|
||||
|
||||
private void processBarcodeValuesList(List<BarcodeValues> barcodeValuesList, String group, boolean closeAppOnNoBarcode) {
|
||||
if (barcodeValuesList.isEmpty()) {
|
||||
throw new IllegalArgumentException("barcodesValues may not be empty");
|
||||
private void processParseResultList(List<ParseResult> parseResultList, String group, boolean closeAppOnNoBarcode) {
|
||||
if (parseResultList.isEmpty()) {
|
||||
throw new IllegalArgumentException("parseResultList may not be empty");
|
||||
}
|
||||
|
||||
Utils.makeUserChooseBarcodeFromList(MainActivity.this, barcodeValuesList, new BarcodeValuesListDisambiguatorCallback() {
|
||||
Utils.makeUserChooseParseResultFromList(MainActivity.this, parseResultList, new ParseResultListDisambiguatorCallback() {
|
||||
@Override
|
||||
public void onUserChoseBarcode(BarcodeValues barcodeValues) {
|
||||
CatimaBarcode barcodeType = barcodeValues.format();
|
||||
|
||||
public void onUserChoseParseResult(ParseResult parseResult) {
|
||||
Intent intent = new Intent(getApplicationContext(), LoyaltyCardEditActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(LoyaltyCard.BUNDLE_LOYALTY_CARD_CARD_ID, barcodeValues.content());
|
||||
bundle.putString(LoyaltyCard.BUNDLE_LOYALTY_CARD_BARCODE_TYPE, barcodeType != null ? barcodeType.name() : null);
|
||||
bundle.putString(LoyaltyCard.BUNDLE_LOYALTY_CARD_BARCODE_ID, null);
|
||||
Bundle bundle = parseResult.toLoyaltyCardBundle(MainActivity.this);
|
||||
if (group != null) {
|
||||
bundle.putString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP, group);
|
||||
}
|
||||
@@ -453,28 +474,53 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
String receivedAction = intent.getAction();
|
||||
String receivedType = intent.getType();
|
||||
|
||||
// Check if an image or file was shared to us
|
||||
if (Intent.ACTION_SEND.equals(receivedAction)) {
|
||||
List<BarcodeValues> barcodeValuesList;
|
||||
if (receivedAction == null || receivedType == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (receivedType.equals("text/plain")) {
|
||||
barcodeValuesList = Collections.singletonList(new BarcodeValues(null, intent.getStringExtra(Intent.EXTRA_TEXT)));
|
||||
} else if (receivedType.startsWith("image/")) {
|
||||
barcodeValuesList = Utils.retrieveBarcodesFromImage(this, intent.getParcelableExtra(Intent.EXTRA_STREAM));
|
||||
List<ParseResult> parseResultList;
|
||||
|
||||
// Check for shared text
|
||||
if (receivedAction.equals(Intent.ACTION_SEND) && receivedType.equals("text/plain")) {
|
||||
LoyaltyCard loyaltyCard = new LoyaltyCard();
|
||||
loyaltyCard.setCardId(intent.getStringExtra(Intent.EXTRA_TEXT));
|
||||
parseResultList = Collections.singletonList(new ParseResult(ParseResultType.BARCODE_ONLY, loyaltyCard));
|
||||
} else {
|
||||
// Parse whatever file was sent, regardless of opening or sharing
|
||||
Uri data;
|
||||
if (receivedAction.equals(Intent.ACTION_VIEW)) {
|
||||
data = intent.getData();
|
||||
} else if (receivedAction.equals(Intent.ACTION_SEND)) {
|
||||
data = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
} else {
|
||||
Log.e(TAG, "Wrong action type to parse intent");
|
||||
return;
|
||||
}
|
||||
|
||||
if (receivedType.startsWith("image/")) {
|
||||
parseResultList = Utils.retrieveBarcodesFromImage(this, data);
|
||||
} else if (receivedType.equals("application/pdf")) {
|
||||
barcodeValuesList = Utils.retrieveBarcodesFromPdf(this, intent.getParcelableExtra(Intent.EXTRA_STREAM));
|
||||
parseResultList = Utils.retrieveBarcodesFromPdf(this, data);
|
||||
} else if (Arrays.asList("application/vnd.apple.pkpass", "application/vnd-com.apple.pkpass").contains(receivedType)) {
|
||||
parseResultList = Utils.retrieveBarcodesFromPkPass(this, data);
|
||||
} else if (receivedType.equals("application/vnd.espass-espass")) {
|
||||
// FIXME: espass is not pkpass
|
||||
// However, several users stated in https://github.com/CatimaLoyalty/Android/issues/2197 that the formats are extremely similar to the point they could rename an .espass file to .pkpass and have it imported
|
||||
// So it makes sense to "unofficially" treat it as a PKPASS for now, even though not completely correct
|
||||
parseResultList = Utils.retrieveBarcodesFromPkPass(this, data);
|
||||
} else {
|
||||
Log.e(TAG, "Wrong mime-type");
|
||||
return;
|
||||
}
|
||||
|
||||
if (barcodeValuesList.isEmpty()) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
processBarcodeValuesList(barcodeValuesList, null, true);
|
||||
}
|
||||
|
||||
// Give up if we should parse but there is nothing to parse
|
||||
if (parseResultList == null || parseResultList.isEmpty()) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
processParseResultList(parseResultList, null, true);
|
||||
}
|
||||
|
||||
private void extractIntentFields(Intent intent) {
|
||||
@@ -508,6 +554,24 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
// Saving currentQuery to finalQuery for user, this will be used to restore search history, happens when user clicks a card from list
|
||||
protected void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
finalQuery = currentQuery;
|
||||
// Putting the query also into outState for later use in onRestoreInstanceState when rotating screen
|
||||
if (mSearchView != null) {
|
||||
outState.putString(STATE_SEARCH_QUERY, finalQuery);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
// Restoring instance state when rotation of screen happens with the goal to restore search query for user
|
||||
protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
finalQuery = savedInstanceState.getString(STATE_SEARCH_QUERY, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu inputMenu) {
|
||||
getMenuInflater().inflate(R.menu.main_menu, inputMenu);
|
||||
@@ -520,7 +584,6 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
mSearchView = (SearchView) searchMenuItem.getActionView();
|
||||
mSearchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
|
||||
mSearchView.setSubmitButtonEnabled(false);
|
||||
|
||||
mSearchView.setOnCloseListener(() -> {
|
||||
invalidateOptionsMenu();
|
||||
return false;
|
||||
@@ -545,6 +608,9 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
mSearchView.clearFocus();
|
||||
return false;
|
||||
}
|
||||
currentQuery = "";
|
||||
mFilter = "";
|
||||
updateLoyaltyCardList(false);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@@ -559,7 +625,21 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
mFilter = newText;
|
||||
|
||||
// New logic to ensure search history after coming back from picked card - user will see the last search query
|
||||
if (newText.isEmpty()) {
|
||||
if(!finalQuery.isEmpty()){
|
||||
// Setting the query text for user after coming back from picked card from finalQuery
|
||||
mSearchView.setQuery(finalQuery, false);
|
||||
}
|
||||
else if(!currentQuery.isEmpty()){
|
||||
// Else if is needed in case user deletes search - expected behaviour is to show all cards
|
||||
currentQuery = "";
|
||||
mSearchView.setQuery(currentQuery, false);
|
||||
}
|
||||
} else {
|
||||
// Setting search query each time user changes the text in search to temporary variable to be used later in finalQuery String which will be used to restore search history
|
||||
currentQuery = newText;
|
||||
}
|
||||
TabLayout.Tab currentTab = groupsTabLayout.getTabAt(groupsTabLayout.getSelectedTabPosition());
|
||||
mGroup = currentTab != null ? currentTab.getTag() : null;
|
||||
|
||||
@@ -568,6 +648,14 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
|
||||
return true;
|
||||
}
|
||||
});
|
||||
// Check if we came from a picked card back to search, in that case we want to show the search view with previous search query
|
||||
if(!finalQuery.isEmpty()){
|
||||
// Expand the search view to show the query
|
||||
searchMenuItem.expandActionView();
|
||||
// Setting the query text to empty String due to behaviour of onQueryTextChange after coming back from picked card - onQueryTextChange is called automatically without users interaction
|
||||
finalQuery = "";
|
||||
mSearchView.setQuery(currentQuery, false);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onCreateOptionsMenu(inputMenu);
|
||||
|
||||
@@ -48,6 +48,7 @@ public class ManageGroupActivity extends CatimaAppCompatActivity implements Mana
|
||||
super.onCreate(inputSavedInstanceState);
|
||||
binding = ActivityManageGroupBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ManageGroupCursorAdapter extends LoyaltyCardCursorAdapter {
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(LoyaltyCardListItemViewHolder inputHolder, Cursor inputCursor) {
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.fromCursor(inputCursor);
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.fromCursor(mContext, inputCursor);
|
||||
Boolean overlayValue = mInGroupOverlay.get(loyaltyCard.id);
|
||||
if ((overlayValue != null ? overlayValue : isLoyaltyCardInGroup(loyaltyCard.id))) {
|
||||
mAnimationItemsIndex.put(inputCursor.getPosition(), true);
|
||||
|
||||
@@ -42,6 +42,7 @@ public class ManageGroupsActivity extends CatimaAppCompatActivity implements Gro
|
||||
binding = ManageGroupsActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.groups);
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
enableToolbarBackButton();
|
||||
|
||||
31
app/src/main/java/protect/card_locker/ParseResult.kt
Normal file
31
app/src/main/java/protect/card_locker/ParseResult.kt
Normal file
@@ -0,0 +1,31 @@
|
||||
package protect.card_locker
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
|
||||
class ParseResult(
|
||||
val parseResultType: ParseResultType,
|
||||
val loyaltyCard: LoyaltyCard) {
|
||||
var note: String? = null
|
||||
|
||||
fun toLoyaltyCardBundle(context: Context): Bundle {
|
||||
when (parseResultType) {
|
||||
ParseResultType.FULL -> return loyaltyCard.toBundle(context, listOf())
|
||||
ParseResultType.BARCODE_ONLY -> {
|
||||
val defaultLoyaltyCard = LoyaltyCard()
|
||||
defaultLoyaltyCard.setBarcodeId(null)
|
||||
defaultLoyaltyCard.setBarcodeType(loyaltyCard.barcodeType)
|
||||
defaultLoyaltyCard.setCardId(loyaltyCard.cardId)
|
||||
|
||||
return defaultLoyaltyCard.toBundle(
|
||||
context,
|
||||
listOf(
|
||||
LoyaltyCard.BUNDLE_LOYALTY_CARD_BARCODE_ID,
|
||||
LoyaltyCard.BUNDLE_LOYALTY_CARD_BARCODE_TYPE,
|
||||
LoyaltyCard.BUNDLE_LOYALTY_CARD_CARD_ID
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package protect.card_locker;
|
||||
|
||||
public interface ParseResultListDisambiguatorCallback {
|
||||
void onUserChoseParseResult(ParseResult parseResult);
|
||||
void onUserDismissedSelector();
|
||||
}
|
||||
6
app/src/main/java/protect/card_locker/ParseResultType.kt
Normal file
6
app/src/main/java/protect/card_locker/ParseResultType.kt
Normal file
@@ -0,0 +1,6 @@
|
||||
package protect.card_locker
|
||||
|
||||
enum class ParseResultType {
|
||||
FULL,
|
||||
BARCODE_ONLY
|
||||
}
|
||||
434
app/src/main/java/protect/card_locker/PkpassParser.kt
Normal file
434
app/src/main/java/protect/card_locker/PkpassParser.kt
Normal file
@@ -0,0 +1,434 @@
|
||||
package protect.card_locker
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
import android.util.ArrayMap
|
||||
import android.util.Log
|
||||
import com.google.zxing.BarcodeFormat
|
||||
import net.lingala.zip4j.io.inputstream.ZipInputStream
|
||||
import net.lingala.zip4j.model.LocalFileHeader
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
import java.io.FileNotFoundException
|
||||
import java.io.IOException
|
||||
import java.math.BigDecimal
|
||||
import java.text.DateFormat
|
||||
import java.text.ParseException
|
||||
import java.time.ZonedDateTime
|
||||
import java.time.format.DateTimeParseException
|
||||
import java.util.Currency
|
||||
import java.util.Date
|
||||
|
||||
class PkpassParser(context: Context, uri: Uri?) {
|
||||
private var mContext = context
|
||||
|
||||
private var translations: ArrayMap<String, Map<String, String>> = ArrayMap()
|
||||
|
||||
private var passContent: JSONObject? = null
|
||||
|
||||
private var store: String? = null
|
||||
private var note: String? = null
|
||||
private var validFrom: Date? = null
|
||||
private var expiry: Date? = null
|
||||
private val balance: BigDecimal = BigDecimal(0)
|
||||
private val balanceType: Currency? = null
|
||||
// FIXME: Some cards may not have any barcodes, but Catima doesn't accept null card ID
|
||||
// An empty string card ID would prevent a crash, but would be blocked in the edit activity
|
||||
// Setting the default to the "No barcode" text at least prevents a crash, but it is definitely a hack
|
||||
private var cardId: String = context.getString(R.string.noBarcode)
|
||||
private var barcodeId: String? = null
|
||||
private var barcodeType: CatimaBarcode? = null
|
||||
private var headerColor: Int? = null
|
||||
private val starStatus = 0
|
||||
private val lastUsed: Long = 0
|
||||
private val zoomLevel = DBHelper.DEFAULT_ZOOM_LEVEL
|
||||
private val zoomLevelWidth = DBHelper.DEFAULT_ZOOM_LEVEL_WIDTH
|
||||
private var archiveStatus = 0
|
||||
|
||||
var image: Bitmap? = null
|
||||
private set
|
||||
private var logoSize = 0
|
||||
|
||||
init {
|
||||
if (passContent != null) {
|
||||
throw IllegalStateException("Pkpass instance already initialized!")
|
||||
}
|
||||
|
||||
mContext = context
|
||||
|
||||
Log.i(TAG, "Received Pkpass file")
|
||||
if (uri == null) {
|
||||
Log.e(TAG, "Uri did not contain any data")
|
||||
throw IOException(context.getString(R.string.errorReadingFile))
|
||||
}
|
||||
|
||||
try {
|
||||
mContext.contentResolver.openInputStream(uri).use { inputStream ->
|
||||
ZipInputStream(inputStream).use { zipInputStream ->
|
||||
var localFileHeader: LocalFileHeader
|
||||
while ((zipInputStream.nextEntry.also { localFileHeader = it }) != null) {
|
||||
// Ignore directories
|
||||
if (localFileHeader.isDirectory) continue
|
||||
|
||||
// We assume there are three options, as per spec:
|
||||
// language.lproj/pass.strings
|
||||
// file.extension
|
||||
// More directories are ignored
|
||||
val filenameParts = localFileHeader.fileName.split('/')
|
||||
if (filenameParts.size > 2) {
|
||||
continue
|
||||
} else if (filenameParts.size == 2) {
|
||||
// Doesn't seem like a language directory, ignore
|
||||
if (!filenameParts[0].endsWith(".lproj")) continue
|
||||
|
||||
val locale = filenameParts[0].removeSuffix(".lproj")
|
||||
|
||||
translations[locale] = parseLanguageStrings(ZipUtils.read(zipInputStream))
|
||||
}
|
||||
|
||||
// Not a language, parse as normal files
|
||||
when (localFileHeader.fileName) {
|
||||
"logo.png" -> loadImageIfBiggerSize(1, zipInputStream)
|
||||
"logo@2x.png" -> loadImageIfBiggerSize(2, zipInputStream)
|
||||
"logo@3x.png" -> loadImageIfBiggerSize(3, zipInputStream)
|
||||
"pass.json" -> passContent = ZipUtils.readJSON(zipInputStream) // Parse this last, so we're sure we have all language info
|
||||
}
|
||||
}
|
||||
|
||||
checkNotNull(passContent) { "File lacks pass.json" }
|
||||
}
|
||||
}
|
||||
} catch (e: FileNotFoundException) {
|
||||
throw IOException(mContext.getString(R.string.errorReadingFile))
|
||||
} catch (e: Exception) {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
fun listLocales(): List<String> {
|
||||
return translations.keys.toList()
|
||||
}
|
||||
|
||||
fun toLoyaltyCard(locale: String?): LoyaltyCard {
|
||||
parsePassJSON(checkNotNull(passContent) { "Pkpass instance not yet initialized!" }, locale)
|
||||
|
||||
return LoyaltyCard(
|
||||
-1,
|
||||
store,
|
||||
note,
|
||||
validFrom,
|
||||
expiry,
|
||||
balance,
|
||||
balanceType,
|
||||
cardId,
|
||||
barcodeId,
|
||||
barcodeType,
|
||||
headerColor,
|
||||
starStatus,
|
||||
lastUsed,
|
||||
zoomLevel,
|
||||
zoomLevelWidth,
|
||||
archiveStatus,
|
||||
image,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
}
|
||||
|
||||
private fun getTranslation(string: String, locale: String?): String {
|
||||
if (locale == null) {
|
||||
return string
|
||||
}
|
||||
|
||||
val localeStrings = translations[locale]
|
||||
|
||||
return localeStrings?.get(string) ?: string
|
||||
}
|
||||
|
||||
private fun loadImageIfBiggerSize(fileLogoSize: Int, zipInputStream: ZipInputStream) {
|
||||
if (logoSize < fileLogoSize) {
|
||||
image = ZipUtils.readImage(zipInputStream)
|
||||
logoSize = fileLogoSize
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseColor(color: String): Int? {
|
||||
// First, try formats supported by Android natively
|
||||
try {
|
||||
return Color.parseColor(color)
|
||||
} catch (ignored: IllegalArgumentException) {}
|
||||
|
||||
// If that didn't work, try parsing it as a rbg(0,0,255) value
|
||||
val red: Int;
|
||||
val green: Int;
|
||||
val blue: Int;
|
||||
|
||||
// Parse rgb(0,0,0) string
|
||||
val rgbInfo = Regex("""^rgb\(\s*(?<red>\d+)\s*,\s*(?<green>\d+)\s*,\s*(?<blue>\d+)\s*\)$""").find(color)
|
||||
if (rgbInfo == null) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Convert to integers
|
||||
try {
|
||||
red = rgbInfo.groups[1]!!.value.toInt()
|
||||
green = rgbInfo.groups[2]!!.value.toInt()
|
||||
blue = rgbInfo.groups[3]!!.value.toInt()
|
||||
} catch (e: NumberFormatException) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Ensure everything is in a valid range as Color.rgb does not do range checks
|
||||
if (red < 0 || red > 255) return null
|
||||
if (green < 0 || green > 255) return null
|
||||
if (blue < 0 || blue > 255) return null
|
||||
|
||||
return Color.rgb(red, green, blue)
|
||||
}
|
||||
|
||||
private fun parseDateTime(dateTime: String): Date {
|
||||
return Date.from(ZonedDateTime.parse(dateTime).toInstant())
|
||||
}
|
||||
|
||||
private fun parseLanguageStrings(data: String): Map<String, String> {
|
||||
val output = ArrayMap<String, String>()
|
||||
|
||||
// Translations look like this:
|
||||
// "key_name" = "Translated value";
|
||||
//
|
||||
// However, "Translated value" may be multiple lines and may contain " (however, it'll be escaped)
|
||||
var translationLine = StringBuilder()
|
||||
|
||||
for (line in data.lines()) {
|
||||
translationLine.append(line)
|
||||
|
||||
// Make sure we don't have a false ending (this is the escaped double quote: \";)
|
||||
if (!line.endsWith("\\\";") and line.endsWith("\";")) {
|
||||
// We reached a translation ending, time to parse it
|
||||
|
||||
// 1. Split into key and value
|
||||
// 2. Remove cruft of each
|
||||
// 3. Clean up escape sequences
|
||||
val keyValue = translationLine.toString().split("=", ignoreCase = false, limit = 2)
|
||||
val key = keyValue[0].trim().removePrefix("\"").removeSuffix("\"")
|
||||
val value = keyValue[1].trim().removePrefix("\"").removeSuffix("\";").replace("\\", "")
|
||||
|
||||
output[key] = value
|
||||
|
||||
translationLine = StringBuilder()
|
||||
} else {
|
||||
translationLine.append("\n")
|
||||
}
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
private fun parsePassJSON(jsonObject: JSONObject, locale: String?) {
|
||||
if (jsonObject.getInt("formatVersion") != 1) {
|
||||
throw IllegalArgumentException(mContext.getString(R.string.unsupportedFile))
|
||||
}
|
||||
|
||||
// Prefer logoText for store, it's generally shorter
|
||||
try {
|
||||
store = jsonObject.getString("logoText")
|
||||
} catch (ignored: JSONException) {}
|
||||
|
||||
if (store.isNullOrEmpty()) {
|
||||
store = jsonObject.getString("organizationName")
|
||||
}
|
||||
|
||||
val noteText = StringBuilder()
|
||||
noteText.append(getTranslation(jsonObject.getString("description"), locale))
|
||||
|
||||
try {
|
||||
validFrom = parseDateTime(jsonObject.getString("relevantDate"))
|
||||
} catch (ignored: JSONException) {}
|
||||
|
||||
try {
|
||||
expiry = parseDateTime(jsonObject.getString("expirationDate"))
|
||||
} catch (ignored: JSONException) {}
|
||||
|
||||
try {
|
||||
headerColor = parseColor(jsonObject.getString("backgroundColor"))
|
||||
} catch (ignored: JSONException) {}
|
||||
|
||||
var pkPassHasBarcodes = false
|
||||
var validBarcodeFound = false
|
||||
|
||||
// Create a list of possible barcodes
|
||||
val barcodes = ArrayList<JSONObject>()
|
||||
|
||||
// Append the non-deprecated entries
|
||||
try {
|
||||
val foundInBarcodesField = jsonObject.getJSONArray("barcodes")
|
||||
|
||||
for (i in 0 until foundInBarcodesField.length()) {
|
||||
barcodes.add(foundInBarcodesField.getJSONObject(i))
|
||||
}
|
||||
} catch (ignored: JSONException) {}
|
||||
|
||||
// Append the deprecated entry if it exists
|
||||
try {
|
||||
barcodes.add(jsonObject.getJSONObject("barcode"))
|
||||
} catch (ignored: JSONException) {}
|
||||
|
||||
for (barcode in barcodes) {
|
||||
pkPassHasBarcodes = true
|
||||
|
||||
try {
|
||||
parsePassJSONBarcodeField(barcode)
|
||||
|
||||
validBarcodeFound = true
|
||||
break
|
||||
} catch (ignored: IllegalArgumentException) {}
|
||||
}
|
||||
|
||||
if (pkPassHasBarcodes && !validBarcodeFound) {
|
||||
throw FormatException(mContext.getString(R.string.errorReadingFile))
|
||||
}
|
||||
|
||||
// An used card being "archived" probably is the most sensible way to map "voided"
|
||||
archiveStatus = try {
|
||||
if (jsonObject.getBoolean("voided")) 1 else 0
|
||||
} catch (ignored: JSONException) {
|
||||
0
|
||||
}
|
||||
|
||||
// Append type-specific info to the pass
|
||||
|
||||
// Find the relevant pass type and parse it
|
||||
for (passType in listOf("boardingPass", "coupon", "eventTicket", "generic")) {
|
||||
try {
|
||||
var extraText = parsePassJSONPassFields(
|
||||
jsonObject.getJSONObject(passType),
|
||||
locale
|
||||
)
|
||||
|
||||
noteText.append("\n\n")
|
||||
noteText.append(extraText)
|
||||
|
||||
break
|
||||
} catch (ignored: JSONException) {}
|
||||
}
|
||||
|
||||
note = noteText.toString()
|
||||
}
|
||||
|
||||
/* Return success or failure */
|
||||
private fun parsePassJSONBarcodeField(barcodeInfo: JSONObject) {
|
||||
val format = barcodeInfo.getString("format")
|
||||
|
||||
// We only need to check these 4 formats as no other options are valid in the PkPass spec
|
||||
barcodeType = when(format) {
|
||||
"PKBarcodeFormatQR" -> CatimaBarcode.fromBarcode(BarcodeFormat.QR_CODE)
|
||||
"PKBarcodeFormatPDF417" -> CatimaBarcode.fromBarcode(BarcodeFormat.PDF_417)
|
||||
"PKBarcodeFormatAztec" -> CatimaBarcode.fromBarcode(BarcodeFormat.AZTEC)
|
||||
"PKBarcodeFormatCode128" -> CatimaBarcode.fromBarcode(BarcodeFormat.CODE_128)
|
||||
else -> throw IllegalArgumentException("No valid barcode type")
|
||||
}
|
||||
|
||||
// FIXME: We probably need to do something with the messageEncoding field
|
||||
try {
|
||||
cardId = barcodeInfo.getString("altText")
|
||||
barcodeId = barcodeInfo.getString("message")
|
||||
} catch (ignored: JSONException) {
|
||||
cardId = barcodeInfo.getString("message")
|
||||
barcodeId = null
|
||||
}
|
||||
|
||||
// Don't set barcodeId if it's the same as cardId
|
||||
if (cardId == barcodeId) {
|
||||
barcodeId = null
|
||||
}
|
||||
}
|
||||
|
||||
private fun parsePassJSONPassFields(fieldsParent: JSONObject, locale: String?): String {
|
||||
// These fields contain a lot of info on where we're supposed to display them, but Catima doesn't really have anything for that
|
||||
// So for now, throw them all into the description field in a logical order
|
||||
val noteContents: MutableList<String> = ArrayList()
|
||||
|
||||
// Collect all the groups of fields that exist
|
||||
for (fieldType in listOf("headerFields", "primaryFields", "secondaryFields", "auxiliaryFields", "backFields")) {
|
||||
val content = StringBuilder()
|
||||
|
||||
try {
|
||||
val fieldArray = fieldsParent.getJSONArray(fieldType)
|
||||
for (i in 0 until fieldArray.length()) {
|
||||
val entry = fieldArray.getJSONObject(i)
|
||||
|
||||
content.append(parsePassJSONPassField(entry, locale))
|
||||
|
||||
// If this is not the last part, add spacing on the end
|
||||
if (i < (fieldArray.length() - 1)) {
|
||||
content.append("\n")
|
||||
}
|
||||
}
|
||||
} catch (ignore: JSONException) {
|
||||
} catch (ignore: ParseException) {
|
||||
}
|
||||
|
||||
if (content.isNotEmpty()) {
|
||||
noteContents.add(content.toString())
|
||||
}
|
||||
}
|
||||
|
||||
// Merge all field groups together, one paragraph for field group
|
||||
val output = StringBuilder()
|
||||
|
||||
for (i in 0 until noteContents.size) {
|
||||
output.append(noteContents[i])
|
||||
|
||||
// If this is not the last part, add newlines to separate
|
||||
if (i < (noteContents.size - 1)) {
|
||||
output.append("\n\n")
|
||||
}
|
||||
}
|
||||
|
||||
return output.toString()
|
||||
}
|
||||
|
||||
private fun parsePassJSONPassField(field: JSONObject, locale: String?): String {
|
||||
// Value may be a localizable string, a date or a number. So let's try to parse it as a date first
|
||||
|
||||
var value = getTranslation(field.getString("value"), locale)
|
||||
try {
|
||||
value = DateFormat.getDateTimeInstance().format(parseDateTime(value))
|
||||
} catch (ignored: DateTimeParseException) {
|
||||
// It's fine if it's not a date
|
||||
}
|
||||
|
||||
// FIXME: Use the Android thing for formatted strings here
|
||||
if (field.has("currencyCode")) {
|
||||
val valueCurrency = Currency.getInstance(field.getString("currencyCode"))
|
||||
|
||||
value = Utils.formatBalance(
|
||||
mContext,
|
||||
Utils.parseBalance(value, valueCurrency),
|
||||
valueCurrency
|
||||
)
|
||||
} else if (field.has("numberStyle")) {
|
||||
if (field.getString("numberStyle") == "PKNumberStylePercent") {
|
||||
// FIXME: Android formatting string
|
||||
value = "${value}%"
|
||||
}
|
||||
}
|
||||
|
||||
val label = getTranslation(field.getString("label"), locale)
|
||||
|
||||
if (label.isNotEmpty()) {
|
||||
return "$label: $value"
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "Catima"
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.zxing.DecodeHintType;
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.google.zxing.client.android.Intents;
|
||||
import com.journeyapps.barcodescanner.BarcodeCallback;
|
||||
@@ -67,6 +68,7 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
|
||||
private static final int PERMISSION_SCAN_ADD_FROM_IMAGE = 100;
|
||||
private static final int PERMISSION_SCAN_ADD_FROM_PDF = 101;
|
||||
private static final int PERMISSION_SCAN_ADD_FROM_PKPASS = 102;
|
||||
|
||||
private CaptureManager capture;
|
||||
private DecoratedBarcodeView barcodeScannerView;
|
||||
@@ -79,6 +81,7 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
// can't use the pre-made contract because that launches the file manager for image type instead of gallery
|
||||
private ActivityResultLauncher<Intent> photoPickerLauncher;
|
||||
private ActivityResultLauncher<Intent> pdfPickerLauncher;
|
||||
private ActivityResultLauncher<Intent> pkpassPickerLauncher;
|
||||
|
||||
static final String STATE_SCANNER_ACTIVE = "scannerActive";
|
||||
private boolean mScannerActive = true;
|
||||
@@ -98,6 +101,7 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
customBarcodeScannerBinding = CustomBarcodeScannerBinding.bind(binding.zxingBarcodeScanner);
|
||||
setTitle(R.string.scanCardBarcode);
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
enableToolbarBackButton();
|
||||
@@ -107,6 +111,7 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
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()));
|
||||
pdfPickerLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> handleActivityResult(Utils.BARCODE_IMPORT_FROM_PDF_FILE, result.getResultCode(), result.getData()));
|
||||
pkpassPickerLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> handleActivityResult(Utils.BARCODE_IMPORT_FROM_PKPASS_FILE, result.getResultCode(), result.getData()));
|
||||
customBarcodeScannerBinding.fabOtherOptions.setOnClickListener(view -> {
|
||||
setScannerActive(false);
|
||||
|
||||
@@ -116,12 +121,14 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
getString(R.string.addManually),
|
||||
getString(R.string.addFromImage),
|
||||
getString(R.string.addFromPdfFile),
|
||||
getString(R.string.addFromPkpass)
|
||||
};
|
||||
Object[] icons = new Object[]{
|
||||
R.drawable.baseline_block_24,
|
||||
R.drawable.ic_edit,
|
||||
R.drawable.baseline_image_24,
|
||||
R.drawable.baseline_picture_as_pdf_24,
|
||||
R.drawable.local_activity_24px
|
||||
};
|
||||
String[] columns = new String[]{"text", "icon"};
|
||||
|
||||
@@ -156,7 +163,10 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
addFromImage();
|
||||
break;
|
||||
case 3:
|
||||
addFromPdfFile();
|
||||
addFromPdf();
|
||||
break;
|
||||
case 4:
|
||||
addFromPkPass();
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown 'Add a card in a different way' dialog option");
|
||||
@@ -167,7 +177,13 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
builder.show();
|
||||
});
|
||||
|
||||
// Configure barcodeScanner
|
||||
barcodeScannerView = binding.zxingBarcodeScanner;
|
||||
Intent barcodeScannerIntent = new Intent();
|
||||
Bundle barcodeScannerIntentBundle = new Bundle();
|
||||
barcodeScannerIntentBundle.putBoolean(DecodeHintType.ALSO_INVERTED.name(), Boolean.TRUE);
|
||||
barcodeScannerIntent.putExtras(barcodeScannerIntentBundle);
|
||||
barcodeScannerView.initializeFromIntent(barcodeScannerIntent);
|
||||
|
||||
// Even though we do the actual decoding with the barcodeScannerView
|
||||
// CaptureManager needs to be running to show the camera and scanning bar
|
||||
@@ -181,16 +197,11 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
barcodeScannerView.decodeSingle(new BarcodeCallback() {
|
||||
@Override
|
||||
public void barcodeResult(BarcodeResult result) {
|
||||
Intent scanResult = new Intent();
|
||||
Bundle scanResultBundle = new Bundle();
|
||||
scanResultBundle.putString(BARCODE_CONTENTS, result.getText());
|
||||
scanResultBundle.putString(BARCODE_FORMAT, result.getBarcodeFormat().name());
|
||||
if (addGroup != null) {
|
||||
scanResultBundle.putString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP, addGroup);
|
||||
}
|
||||
scanResult.putExtras(scanResultBundle);
|
||||
ScanActivity.this.setResult(RESULT_OK, scanResult);
|
||||
finish();
|
||||
LoyaltyCard loyaltyCard = new LoyaltyCard();
|
||||
loyaltyCard.setCardId(result.getText());
|
||||
loyaltyCard.setBarcodeType(CatimaBarcode.fromBarcode(result.getBarcodeFormat()));
|
||||
|
||||
returnResult(new ParseResult(ParseResultType.BARCODE_ONLY, loyaltyCard));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -294,35 +305,31 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
mScannerActive = isActive;
|
||||
}
|
||||
|
||||
private void returnResult(String barcodeContents, String barcodeFormat) {
|
||||
Intent manualResult = new Intent();
|
||||
Bundle manualResultBundle = new Bundle();
|
||||
manualResultBundle.putString(BARCODE_CONTENTS, barcodeContents);
|
||||
manualResultBundle.putString(BARCODE_FORMAT, barcodeFormat);
|
||||
private void returnResult(ParseResult parseResult) {
|
||||
Intent result = new Intent();
|
||||
Bundle bundle = parseResult.toLoyaltyCardBundle(ScanActivity.this);
|
||||
if (addGroup != null) {
|
||||
manualResultBundle.putString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP, addGroup);
|
||||
bundle.putString(LoyaltyCardEditActivity.BUNDLE_ADDGROUP, addGroup);
|
||||
}
|
||||
manualResult.putExtras(manualResultBundle);
|
||||
ScanActivity.this.setResult(RESULT_OK, manualResult);
|
||||
result.putExtras(bundle);
|
||||
ScanActivity.this.setResult(RESULT_OK, result);
|
||||
finish();
|
||||
}
|
||||
|
||||
private void handleActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||
super.onActivityResult(requestCode, resultCode, intent);
|
||||
|
||||
List<BarcodeValues> barcodeValuesList = Utils.parseSetBarcodeActivityResult(requestCode, resultCode, intent, this);
|
||||
List<ParseResult> parseResultList = Utils.parseSetBarcodeActivityResult(requestCode, resultCode, intent, this);
|
||||
|
||||
if (barcodeValuesList.isEmpty()) {
|
||||
if (parseResultList.isEmpty()) {
|
||||
setScannerActive(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Utils.makeUserChooseBarcodeFromList(this, barcodeValuesList, new BarcodeValuesListDisambiguatorCallback() {
|
||||
Utils.makeUserChooseParseResultFromList(this, parseResultList, new ParseResultListDisambiguatorCallback() {
|
||||
@Override
|
||||
public void onUserChoseBarcode(BarcodeValues barcodeValues) {
|
||||
CatimaBarcode barcodeType = barcodeValues.format();
|
||||
|
||||
returnResult(barcodeValues.content(), barcodeType != null ? barcodeType.name() : null);
|
||||
public void onUserChoseParseResult(ParseResult parseResult) {
|
||||
returnResult(parseResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -369,7 +376,9 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
|
||||
// Buttons
|
||||
builder.setPositiveButton(getString(R.string.ok), (dialog, which) -> {
|
||||
returnResult(input.getText().toString(), null);
|
||||
LoyaltyCard loyaltyCard = new LoyaltyCard();
|
||||
loyaltyCard.setCardId(input.getText().toString());
|
||||
returnResult(new ParseResult(ParseResultType.BARCODE_ONLY, loyaltyCard));
|
||||
});
|
||||
builder.setNegativeButton(getString(R.string.cancel), (dialog, which) -> dialog.cancel());
|
||||
AlertDialog dialog = builder.create();
|
||||
@@ -418,10 +427,14 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
PermissionUtils.requestStorageReadPermission(this, PERMISSION_SCAN_ADD_FROM_IMAGE);
|
||||
}
|
||||
|
||||
public void addFromPdfFile() {
|
||||
public void addFromPdf() {
|
||||
PermissionUtils.requestStorageReadPermission(this, PERMISSION_SCAN_ADD_FROM_PDF);
|
||||
}
|
||||
|
||||
public void addFromPkPass() {
|
||||
PermissionUtils.requestStorageReadPermission(this, PERMISSION_SCAN_ADD_FROM_PKPASS);
|
||||
}
|
||||
|
||||
private void addFromImageOrFileAfterPermission(String mimeType, ActivityResultLauncher<Intent> launcher, int chooserText, int errorMessage) {
|
||||
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
|
||||
photoPickerIntent.setType(mimeType);
|
||||
@@ -511,12 +524,14 @@ public class ScanActivity extends CatimaAppCompatActivity {
|
||||
} else {
|
||||
showCameraPermissionMissingText();
|
||||
}
|
||||
} else if (requestCode == PERMISSION_SCAN_ADD_FROM_IMAGE || requestCode == PERMISSION_SCAN_ADD_FROM_PDF) {
|
||||
} else if (requestCode == PERMISSION_SCAN_ADD_FROM_IMAGE || requestCode == PERMISSION_SCAN_ADD_FROM_PDF || requestCode == PERMISSION_SCAN_ADD_FROM_PKPASS) {
|
||||
if (granted) {
|
||||
if (requestCode == PERMISSION_SCAN_ADD_FROM_IMAGE) {
|
||||
addFromImageOrFileAfterPermission("image/*", photoPickerLauncher, R.string.addFromImage, R.string.failedLaunchingPhotoPicker);
|
||||
} else {
|
||||
} else if (requestCode == PERMISSION_SCAN_ADD_FROM_PDF) {
|
||||
addFromImageOrFileAfterPermission("application/pdf", pdfPickerLauncher, R.string.addFromPdfFile, R.string.failedLaunchingFileManager);
|
||||
} else {
|
||||
addFromImageOrFileAfterPermission("application/*", pkpassPickerLauncher, R.string.addFromPkpass, R.string.failedLaunchingFileManager);
|
||||
}
|
||||
} else {
|
||||
setScannerActive(true);
|
||||
|
||||
@@ -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_OVERLAY = Color.argb(127, 0, 0, 0);
|
||||
|
||||
/**
|
||||
* Add a card to the app shortcuts, and maintain a list of the most
|
||||
@@ -87,7 +86,7 @@ class ShortcutHelper {
|
||||
for (int index = 0; index < list.size(); index++) {
|
||||
ShortcutInfoCompat prevShortcut = list.get(index);
|
||||
|
||||
LoyaltyCard loyaltyCard = DBHelper.getLoyaltyCard(database, Integer.parseInt(prevShortcut.getId()));
|
||||
LoyaltyCard loyaltyCard = DBHelper.getLoyaltyCard(context, database, Integer.parseInt(prevShortcut.getId()));
|
||||
|
||||
// skip outdated cards that no longer exist
|
||||
if (loyaltyCard != null) {
|
||||
@@ -120,7 +119,7 @@ class ShortcutHelper {
|
||||
Bitmap createAdaptiveBitmap(@NotNull Bitmap in, int paddingColor) {
|
||||
Bitmap ret = Bitmap.createBitmap(ADAPTIVE_BITMAP_SIZE, ADAPTIVE_BITMAP_SIZE, Bitmap.Config.ARGB_8888);
|
||||
Canvas output = new Canvas(ret);
|
||||
output.drawColor(ColorUtils.compositeColors(PADDING_COLOR_OVERLAY, paddingColor));
|
||||
output.drawColor(paddingColor);
|
||||
Bitmap resized = Utils.resizeBitmap(in, ADAPTIVE_BITMAP_IMAGE_SIZE);
|
||||
output.drawBitmap(resized, (ADAPTIVE_BITMAP_SIZE - resized.getWidth()) / 2f, (ADAPTIVE_BITMAP_SIZE - resized.getHeight()) / 2f, null);
|
||||
return ret;
|
||||
@@ -136,11 +135,11 @@ class ShortcutHelper {
|
||||
bundle.putInt(LoyaltyCardViewActivity.BUNDLE_ID, loyaltyCard.id);
|
||||
intent.putExtras(bundle);
|
||||
|
||||
Bitmap iconBitmap = Utils.retrieveCardImage(context, loyaltyCard.id, ImageLocationType.icon);
|
||||
Bitmap iconBitmap = loyaltyCard.getImageThumbnail(context);
|
||||
if (iconBitmap == null) {
|
||||
iconBitmap = Utils.generateIcon(context, loyaltyCard, true).getLetterTile();
|
||||
} else {
|
||||
iconBitmap = createAdaptiveBitmap(iconBitmap, Utils.getHeaderColor(context, loyaltyCard));
|
||||
iconBitmap = createAdaptiveBitmap(iconBitmap, Utils.needsDarkForeground(Utils.getHeaderColor(context, loyaltyCard)) ? Color.BLACK : Color.WHITE);
|
||||
}
|
||||
|
||||
IconCompat icon = IconCompat.createWithAdaptiveBitmap(iconBitmap);
|
||||
|
||||
@@ -24,6 +24,13 @@ import com.yalantis.ucrop.UCropActivity;
|
||||
public class UCropWrapper extends UCropActivity {
|
||||
public static final String UCROP_TOOLBAR_TYPEFACE_STYLE = "ucop_toolbar_typeface_style";
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Utils.applyWindowInsets(findViewById(android.R.id.content));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ImageDecoder;
|
||||
import android.graphics.Matrix;
|
||||
@@ -26,6 +27,7 @@ import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -37,7 +39,10 @@ import androidx.annotation.RawRes;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.os.LocaleListCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.core.view.WindowInsetsControllerCompat;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
@@ -48,10 +53,11 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.zxing.BinaryBitmap;
|
||||
import com.google.zxing.LuminanceSource;
|
||||
import com.google.zxing.MultiFormatReader;
|
||||
import com.google.zxing.DecodeHintType;
|
||||
import com.google.zxing.NotFoundException;
|
||||
import com.google.zxing.RGBLuminanceSource;
|
||||
import com.google.zxing.Result;
|
||||
import com.google.zxing.common.HybridBinarizer;
|
||||
import com.google.zxing.common.GlobalHistogramBinarizer;
|
||||
import com.google.zxing.multi.GenericMultipleBarcodeReader;
|
||||
import com.google.zxing.multi.MultipleBarcodeReader;
|
||||
|
||||
@@ -77,7 +83,9 @@ import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Currency;
|
||||
import java.util.Date;
|
||||
import java.util.EnumMap;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@@ -95,12 +103,13 @@ public class Utils {
|
||||
public static final int BARCODE_SCAN = 3;
|
||||
public static final int BARCODE_IMPORT_FROM_IMAGE_FILE = 4;
|
||||
public static final int BARCODE_IMPORT_FROM_PDF_FILE = 5;
|
||||
public static final int CARD_IMAGE_FROM_CAMERA_FRONT = 6;
|
||||
public static final int CARD_IMAGE_FROM_CAMERA_BACK = 7;
|
||||
public static final int CARD_IMAGE_FROM_CAMERA_ICON = 8;
|
||||
public static final int CARD_IMAGE_FROM_FILE_FRONT = 9;
|
||||
public static final int CARD_IMAGE_FROM_FILE_BACK = 10;
|
||||
public static final int CARD_IMAGE_FROM_FILE_ICON = 11;
|
||||
public static final int BARCODE_IMPORT_FROM_PKPASS_FILE = 6;
|
||||
public static final int CARD_IMAGE_FROM_CAMERA_FRONT = 7;
|
||||
public static final int CARD_IMAGE_FROM_CAMERA_BACK = 8;
|
||||
public static final int CARD_IMAGE_FROM_CAMERA_ICON = 9;
|
||||
public static final int CARD_IMAGE_FROM_FILE_FRONT = 10;
|
||||
public static final int CARD_IMAGE_FROM_FILE_BACK = 11;
|
||||
public static final int CARD_IMAGE_FROM_FILE_ICON = 12;
|
||||
|
||||
public static final String CARD_IMAGE_FILENAME_REGEX = "^(card_)(\\d+)(_(?:front|back|icon)\\.png)$";
|
||||
|
||||
@@ -143,7 +152,7 @@ public class Utils {
|
||||
return ColorUtils.calculateLuminance(backgroundColor) > LUMINANCE_MIDPOINT;
|
||||
}
|
||||
|
||||
static public List<BarcodeValues> retrieveBarcodesFromImage(Context context, Uri uri) {
|
||||
static public List<ParseResult> retrieveBarcodesFromImage(Context context, Uri uri) {
|
||||
Log.i(TAG, "Received image file with possible barcode");
|
||||
|
||||
if (uri == null) {
|
||||
@@ -162,7 +171,7 @@ public class Utils {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<BarcodeValues> barcodesFromBitmap = getBarcodesFromBitmap(bitmap);
|
||||
List<ParseResult> barcodesFromBitmap = getBarcodesFromBitmap(bitmap);
|
||||
|
||||
if (barcodesFromBitmap.isEmpty()) {
|
||||
Log.i(TAG, "No barcode found in image file");
|
||||
@@ -172,7 +181,52 @@ public class Utils {
|
||||
return barcodesFromBitmap;
|
||||
}
|
||||
|
||||
static public List<BarcodeValues> retrieveBarcodesFromPdf(Context context, Uri uri) {
|
||||
static public List<ParseResult> retrieveBarcodesFromPkPass(Context context, Uri uri) {
|
||||
Log.i(TAG, "Received Pkpass file with possible barcode");
|
||||
if (uri == null) {
|
||||
Log.e(TAG, "Pkpass did not contain any data");
|
||||
Toast.makeText(context, R.string.errorReadingFile, Toast.LENGTH_LONG).show();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
PkpassParser pkpassParser;
|
||||
try {
|
||||
pkpassParser = new PkpassParser(context, uri);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error reading pkpass file", e);
|
||||
Toast.makeText(context, R.string.errorReadingFile, Toast.LENGTH_LONG).show();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<String> locales = pkpassParser.listLocales();
|
||||
if (locales.isEmpty()) {
|
||||
try {
|
||||
return Collections.singletonList(new ParseResult(ParseResultType.FULL, pkpassParser.toLoyaltyCard(null)));
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error calling toLoyaltyCard on pkpass file", e);
|
||||
Toast.makeText(context, R.string.errorReadingFile, Toast.LENGTH_LONG).show();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
List<ParseResult> parseResultList = new ArrayList<>();
|
||||
for (String locale : locales) {
|
||||
ParseResult parseResult;
|
||||
try {
|
||||
parseResult = new ParseResult(ParseResultType.FULL, pkpassParser.toLoyaltyCard(locale));
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error calling toLoyaltyCard on pkpass file", e);
|
||||
Toast.makeText(context, R.string.errorReadingFile, Toast.LENGTH_LONG).show();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
parseResult.setNote(locale);
|
||||
parseResultList.add(parseResult);
|
||||
}
|
||||
|
||||
return parseResultList;
|
||||
}
|
||||
|
||||
static public List<ParseResult> retrieveBarcodesFromPdf(Context context, Uri uri) {
|
||||
Log.i(TAG, "Received PDF file with possible barcode");
|
||||
if (uri == null) {
|
||||
Log.e(TAG, "Uri did not contain any data");
|
||||
@@ -182,7 +236,7 @@ public class Utils {
|
||||
|
||||
ParcelFileDescriptor parcelFileDescriptor = null;
|
||||
PdfRenderer renderer = null;
|
||||
List<BarcodeValues> barcodesFromPdfPages = new ArrayList<>();
|
||||
List<ParseResult> barcodesFromPdfPages = new ArrayList<>();
|
||||
|
||||
try {
|
||||
parcelFileDescriptor = context.getContentResolver().openFileDescriptor(uri, "r");
|
||||
@@ -194,13 +248,20 @@ public class Utils {
|
||||
for (int i = 0; i < renderer.getPageCount(); i++) {
|
||||
PdfRenderer.Page page = renderer.openPage(i);
|
||||
renderedPage = Bitmap.createBitmap(page.getWidth(), page.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
|
||||
// Ensure the page has a background
|
||||
// Fixes some transparent PDF files not being read well
|
||||
Canvas canvas = new Canvas(renderedPage);
|
||||
canvas.drawColor(Color.WHITE);
|
||||
canvas.drawBitmap(renderedPage, 0, 0, null);
|
||||
|
||||
page.render(renderedPage, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
|
||||
page.close();
|
||||
|
||||
List<BarcodeValues> barcodesFromPage = getBarcodesFromBitmap(renderedPage);
|
||||
for (BarcodeValues barcodeValues : barcodesFromPage) {
|
||||
barcodeValues.setNote(String.format(context.getString(R.string.pageWithNumber), i+1));
|
||||
barcodesFromPdfPages.add(barcodeValues);
|
||||
List<ParseResult> barcodesFromPage = getBarcodesFromBitmap(renderedPage);
|
||||
for (ParseResult parseResult : barcodesFromPage) {
|
||||
parseResult.setNote(String.format(context.getString(R.string.pageWithNumber), i+1));
|
||||
barcodesFromPdfPages.add(parseResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,17 +290,17 @@ public class Utils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* Returns the ParseResult based on the result of an activity.
|
||||
* It shows toasts to notify the end-user as needed itself and will return an empty list if the
|
||||
* activity was cancelled or nothing could be found.
|
||||
*
|
||||
* @param requestCode
|
||||
* @param resultCode
|
||||
* @param intent
|
||||
* @param context
|
||||
* @return BarcodeValues
|
||||
* @return List<ParseResult>
|
||||
*/
|
||||
static public List<BarcodeValues> parseSetBarcodeActivityResult(int requestCode, int resultCode, Intent intent, Context context) {
|
||||
static public List<ParseResult> parseSetBarcodeActivityResult(int requestCode, int resultCode, Intent intent, Context context) {
|
||||
String contents;
|
||||
String format;
|
||||
|
||||
@@ -255,6 +316,10 @@ public class Utils {
|
||||
return retrieveBarcodesFromPdf(context, intent.getData());
|
||||
}
|
||||
|
||||
if (requestCode == Utils.BARCODE_IMPORT_FROM_PKPASS_FILE) {
|
||||
return retrieveBarcodesFromPkPass(context, intent.getData());
|
||||
}
|
||||
|
||||
if (requestCode == Utils.BARCODE_SCAN || requestCode == Utils.SELECT_BARCODE_REQUEST) {
|
||||
if (requestCode == Utils.BARCODE_SCAN) {
|
||||
Log.i(TAG, "Received barcode information from camera");
|
||||
@@ -268,7 +333,15 @@ public class Utils {
|
||||
Log.i(TAG, "Read barcode id: " + contents);
|
||||
Log.i(TAG, "Read format: " + format);
|
||||
|
||||
return Collections.singletonList(new BarcodeValues(format != null ? CatimaBarcode.fromName(format) : null, contents));
|
||||
LoyaltyCard loyaltyCard = new LoyaltyCard();
|
||||
if (format != null) {
|
||||
loyaltyCard.setBarcodeType(CatimaBarcode.fromName(format));
|
||||
}
|
||||
if (contents != null) {
|
||||
loyaltyCard.setCardId(contents);
|
||||
}
|
||||
|
||||
return Collections.singletonList(new ParseResult(ParseResultType.BARCODE_ONLY, loyaltyCard));
|
||||
}
|
||||
|
||||
throw new UnsupportedOperationException("Unknown request code for parseSetBarcodeActivityResult");
|
||||
@@ -288,7 +361,7 @@ public class Utils {
|
||||
return MediaStore.Images.Media.getBitmap(context.getContentResolver(), data);
|
||||
}
|
||||
|
||||
static public List<BarcodeValues> getBarcodesFromBitmap(Bitmap bitmap) {
|
||||
static public List<ParseResult> getBarcodesFromBitmap(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++) {
|
||||
try {
|
||||
@@ -303,57 +376,65 @@ public class Utils {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
static private List<BarcodeValues> getBarcodesFromBitmapReal(Bitmap bitmap) {
|
||||
static private List<ParseResult> getBarcodesFromBitmapReal(Bitmap bitmap) {
|
||||
// In order to decode it, the Bitmap must first be converted into a pixel array...
|
||||
int[] intArray = new int[bitmap.getWidth() * bitmap.getHeight()];
|
||||
bitmap.getPixels(intArray, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||
|
||||
// ...and then turned into a binary bitmap from its luminance
|
||||
LuminanceSource source = new RGBLuminanceSource(bitmap.getWidth(), bitmap.getHeight(), intArray);
|
||||
BinaryBitmap binaryBitmap = new BinaryBitmap(new HybridBinarizer(source));
|
||||
BinaryBitmap binaryBitmap = new BinaryBitmap(new GlobalHistogramBinarizer(source));
|
||||
|
||||
List<BarcodeValues> barcodeValuesList = new ArrayList<>();
|
||||
List<ParseResult> parseResultList = new ArrayList<>();
|
||||
try {
|
||||
MultiFormatReader multiFormatReader = new MultiFormatReader();
|
||||
MultipleBarcodeReader multipleBarcodeReader = new GenericMultipleBarcodeReader(multiFormatReader);
|
||||
|
||||
Result[] barcodeResults = multipleBarcodeReader.decodeMultiple(binaryBitmap);
|
||||
Map<DecodeHintType, Object> hints = new EnumMap<>(DecodeHintType.class);
|
||||
hints.put(DecodeHintType.ALSO_INVERTED, Boolean.TRUE);
|
||||
|
||||
Result[] barcodeResults = multipleBarcodeReader.decodeMultiple(binaryBitmap,hints);
|
||||
|
||||
for (Result barcodeResult : barcodeResults) {
|
||||
Log.i(TAG, "Read barcode id: " + barcodeResult.getText());
|
||||
Log.i(TAG, "Read format: " + barcodeResult.getBarcodeFormat().name());
|
||||
|
||||
barcodeValuesList.add(new BarcodeValues(CatimaBarcode.fromBarcode(barcodeResult.getBarcodeFormat()), barcodeResult.getText()));
|
||||
LoyaltyCard loyaltyCard = new LoyaltyCard();
|
||||
loyaltyCard.setCardId(barcodeResult.getText());
|
||||
loyaltyCard.setBarcodeType(CatimaBarcode.fromBarcode(barcodeResult.getBarcodeFormat()));
|
||||
parseResultList.add(new ParseResult(ParseResultType.BARCODE_ONLY, loyaltyCard));
|
||||
}
|
||||
|
||||
return barcodeValuesList;
|
||||
return parseResultList;
|
||||
} catch (NotFoundException e) {
|
||||
return barcodeValuesList;
|
||||
return parseResultList;
|
||||
}
|
||||
}
|
||||
|
||||
static public void makeUserChooseBarcodeFromList(Context context, List<BarcodeValues> barcodeValuesList, BarcodeValuesListDisambiguatorCallback callback) {
|
||||
static public void makeUserChooseParseResultFromList(Context context, List<ParseResult> parseResultList, ParseResultListDisambiguatorCallback callback) {
|
||||
// If there is only one choice, consider it chosen
|
||||
if (barcodeValuesList.size() == 1) {
|
||||
callback.onUserChoseBarcode(barcodeValuesList.get(0));
|
||||
if (parseResultList.size() == 1) {
|
||||
callback.onUserChoseParseResult(parseResultList.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
// Ask user to choose a barcode
|
||||
// TODO: This should contain an image of the barcode in question to help users understand the choice they're making
|
||||
CharSequence[] barcodeDescriptions = new CharSequence[barcodeValuesList.size()];
|
||||
for (int i = 0; i < barcodeValuesList.size(); i++) {
|
||||
BarcodeValues barcodeValues = barcodeValuesList.get(i);
|
||||
CatimaBarcode catimaBarcode = barcodeValues.format();
|
||||
CharSequence[] barcodeDescriptions = new CharSequence[parseResultList.size()];
|
||||
for (int i = 0; i < parseResultList.size(); i++) {
|
||||
ParseResult parseResult = parseResultList.get(i);
|
||||
CatimaBarcode catimaBarcode = parseResult.getLoyaltyCard().barcodeType;
|
||||
|
||||
String barcodeContent = barcodeValues.content();
|
||||
String barcodeContent = parseResult.getLoyaltyCard().cardId;
|
||||
// Shorten overly long barcodes
|
||||
if (barcodeContent.length() > 22) {
|
||||
barcodeContent = barcodeContent.substring(0, 20) + "…";
|
||||
}
|
||||
|
||||
if (barcodeValues.note() != null) {
|
||||
barcodeDescriptions[i] = String.format("%s: %s (%s)", barcodeValues.note(), catimaBarcode != null ? catimaBarcode.prettyName() : context.getString(R.string.noBarcode), barcodeContent);
|
||||
String parseResultNote = parseResult.getNote();
|
||||
|
||||
if (parseResultNote != null) {
|
||||
barcodeDescriptions[i] = String.format("%s: %s (%s)", parseResultNote, catimaBarcode != null ? catimaBarcode.prettyName() : context.getString(R.string.noBarcode), barcodeContent);
|
||||
} else {
|
||||
barcodeDescriptions[i] = String.format("%s (%s)", catimaBarcode != null ? catimaBarcode.prettyName() : context.getString(R.string.noBarcode), barcodeContent);
|
||||
}
|
||||
@@ -363,7 +444,7 @@ public class Utils {
|
||||
builder.setTitle(context.getString(R.string.multipleBarcodesFoundPleaseChooseOne));
|
||||
builder.setItems(
|
||||
barcodeDescriptions,
|
||||
(dialogInterface, i) -> callback.onUserChoseBarcode(barcodeValuesList.get(i))
|
||||
(dialogInterface, i) -> callback.onUserChoseParseResult(parseResultList.get(i))
|
||||
);
|
||||
builder.setOnCancelListener(dialogInterface -> callback.onUserDismissedSelector());
|
||||
builder.show();
|
||||
@@ -783,7 +864,7 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
public static Bitmap loadImage(String path) {
|
||||
public static @Nullable Bitmap loadImage(String path) {
|
||||
try {
|
||||
return BitmapFactory.decodeStream(new FileInputStream(path));
|
||||
} catch (IOException e) {
|
||||
@@ -792,7 +873,7 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
public static Bitmap loadTempImage(Context context, String name) {
|
||||
public static @Nullable Bitmap loadTempImage(Context context, String name) {
|
||||
return loadImage(context.getCacheDir() + "/" + name);
|
||||
}
|
||||
|
||||
@@ -869,7 +950,7 @@ public class Utils {
|
||||
return typedValue.data;
|
||||
}
|
||||
|
||||
public static int getHeaderColorFromImage(Bitmap image, int fallback) {
|
||||
public static int getHeaderColorFromImage(@Nullable Bitmap image, int fallback) {
|
||||
if (image == null) {
|
||||
return fallback;
|
||||
}
|
||||
@@ -934,27 +1015,37 @@ public class Utils {
|
||||
* @param textWhenNoImage TextView to write the loyalty card name into if icon is null
|
||||
* @return background colour
|
||||
*/
|
||||
public static int setIconOrTextWithBackground(Context context, LoyaltyCard loyaltyCard, Bitmap icon, ImageView backgroundOrIcon, TextView textWhenNoImage) {
|
||||
public static int setIconOrTextWithBackground(Context context, LoyaltyCard loyaltyCard, Bitmap icon, ImageView backgroundOrIcon, TextView textWhenNoImage, int columnCount) {
|
||||
int headerColor = getHeaderColor(context, loyaltyCard);
|
||||
backgroundOrIcon.setImageBitmap(icon);
|
||||
backgroundOrIcon.setBackgroundColor(headerColor);
|
||||
|
||||
if (icon != null) {
|
||||
// Use header colour to decide if this image will need a white or black background
|
||||
backgroundOrIcon.setBackgroundColor(needsDarkForeground(headerColor) ? Color.BLACK : Color.WHITE);
|
||||
|
||||
// Ensure correct cropping style
|
||||
backgroundOrIcon.setScaleType(Utils.getRecommendedScaleTypeForThumbnailImage(icon));
|
||||
|
||||
textWhenNoImage.setVisibility(View.GONE);
|
||||
} else {
|
||||
// Use header colour as background colour
|
||||
backgroundOrIcon.setBackgroundColor(headerColor);
|
||||
|
||||
// Manually calculate how many lines will be needed
|
||||
// This is necessary because Android's auto sizing will split over lines way before reaching the minimum font size and store names split over multiple lines are harder to scan with a quick glance so we should try to prevent it
|
||||
// Because we have to write the text before we can actually know the exact laid out size (trying to delay this causes bugs where the autosize fails) we have to take some... weird shortcuts
|
||||
|
||||
// At this point textWhenNoImage.getWidth() still returns 0, so we cheat by calculating the whole width of the screen and then dividing it by the amount of columns
|
||||
int textviewWidth = Resources.getSystem().getDisplayMetrics().widthPixels / context.getResources().getInteger(R.integer.main_view_card_columns);
|
||||
int columnWidth = Resources.getSystem().getDisplayMetrics().widthPixels / columnCount;
|
||||
|
||||
// Calculate how wide a character is and calculate how many characters fit in a line
|
||||
// text size is generally based on height, so setting 1:1 as width may be fishy
|
||||
int characterWidth = TextViewCompat.getAutoSizeMinTextSize(textWhenNoImage);
|
||||
int maxWidthPerLine = textviewWidth - textWhenNoImage.getPaddingStart() - textWhenNoImage.getPaddingEnd();
|
||||
int maxWidthPerLine = columnWidth - textWhenNoImage.getPaddingStart() - textWhenNoImage.getPaddingEnd();
|
||||
|
||||
// Set amount of lines based on what could fit at most
|
||||
int maxLines = ((loyaltyCard.store.length() * characterWidth) / maxWidthPerLine) + 1;
|
||||
// Set number of lines based on what could fit at most
|
||||
int fullTextWidth = loyaltyCard.store.length() * characterWidth;
|
||||
int maxLines = (fullTextWidth / maxWidthPerLine) + 1;
|
||||
textWhenNoImage.setMaxLines(maxLines);
|
||||
|
||||
// Actually set the text and colour
|
||||
@@ -966,21 +1057,6 @@ public class Utils {
|
||||
return headerColor;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1042,4 +1118,35 @@ public class Utils {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void applyWindowInsets(View root) {
|
||||
/* This function basically fakes the activity being edge-to-edge. Useful for those activities that are really hard to get to behave well */
|
||||
ViewCompat.setOnApplyWindowInsetsListener(root, (view, windowInsets) -> {
|
||||
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
|
||||
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
layoutParams.leftMargin = insets.left;
|
||||
layoutParams.bottomMargin = insets.bottom;
|
||||
layoutParams.rightMargin = insets.right;
|
||||
layoutParams.topMargin = insets.top;
|
||||
view.setLayoutParams(layoutParams);
|
||||
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
}
|
||||
|
||||
public static ImageView.ScaleType getRecommendedScaleTypeForThumbnailImage(@Nullable Bitmap image) {
|
||||
// Return something sensible if no image
|
||||
if (image == null) {
|
||||
return ImageView.ScaleType.FIT_CENTER;
|
||||
}
|
||||
|
||||
// If the image is relatively close to 85.6:53.98 (width = 1.58577250834 * height), allow cropping it to fit it
|
||||
double ratio = (double) image.getWidth() / image.getHeight();
|
||||
if (ratio >= 1.55 && ratio <= 1.60) {
|
||||
return ImageView.ScaleType.CENTER_CROP;
|
||||
}
|
||||
|
||||
return ImageView.ScaleType.FIT_CENTER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ZipUtils {
|
||||
return new JSONObject(read(zipInputStream));
|
||||
}
|
||||
|
||||
private static String read(ZipInputStream zipInputStream) throws IOException {
|
||||
public static String read(ZipInputStream zipInputStream) throws IOException {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
Reader reader = new BufferedReader(new InputStreamReader(zipInputStream, StandardCharsets.UTF_8));
|
||||
int c;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class CatimaExporter implements Exporter {
|
||||
// Generate CSV
|
||||
ByteArrayOutputStream catimaOutputStream = new ByteArrayOutputStream();
|
||||
OutputStreamWriter catimaOutputStreamWriter = new OutputStreamWriter(catimaOutputStream, StandardCharsets.UTF_8);
|
||||
writeCSV(database, catimaOutputStreamWriter);
|
||||
writeCSV(context, database, catimaOutputStreamWriter);
|
||||
|
||||
// Add CSV to zip file
|
||||
ZipParameters csvZipParameters = createZipParameters("catima.csv", password);
|
||||
@@ -64,12 +64,12 @@ public class CatimaExporter implements Exporter {
|
||||
Cursor cardCursor = DBHelper.getLoyaltyCardCursor(database);
|
||||
while (cardCursor.moveToNext()) {
|
||||
// For each card
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(cardCursor);
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(context, cardCursor);
|
||||
|
||||
// For each image
|
||||
for (ImageLocationType imageLocationType : ImageLocationType.values()) {
|
||||
// If it exists, add to the .zip file
|
||||
Bitmap image = Utils.retrieveCardImage(context, card.id, imageLocationType);
|
||||
Bitmap image = card.getImageForImageLocationType(context, imageLocationType);
|
||||
if (image != null) {
|
||||
ZipParameters imageZipParameters = createZipParameters(Utils.getCardImageFileName(card.id, imageLocationType), password);
|
||||
zipOutputStream.putNextEntry(imageZipParameters);
|
||||
@@ -95,7 +95,7 @@ public class CatimaExporter implements Exporter {
|
||||
return zipParameters;
|
||||
}
|
||||
|
||||
private void writeCSV(SQLiteDatabase database, OutputStreamWriter output) throws IOException, InterruptedException {
|
||||
private void writeCSV(Context context, SQLiteDatabase database, OutputStreamWriter output) throws IOException, InterruptedException {
|
||||
CSVPrinter printer = new CSVPrinter(output, CSVFormat.RFC4180);
|
||||
|
||||
// Print the version
|
||||
@@ -142,7 +142,7 @@ public class CatimaExporter implements Exporter {
|
||||
Cursor cardCursor = DBHelper.getLoyaltyCardCursor(database);
|
||||
|
||||
while (cardCursor.moveToNext()) {
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(cardCursor);
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(context, cardCursor);
|
||||
|
||||
printer.printRecord(card.id,
|
||||
card.store,
|
||||
@@ -176,7 +176,7 @@ public class CatimaExporter implements Exporter {
|
||||
Cursor cardCursor2 = DBHelper.getLoyaltyCardCursor(database);
|
||||
|
||||
while (cardCursor2.moveToNext()) {
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(cardCursor2);
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(context, cardCursor2);
|
||||
|
||||
for (Group group : DBHelper.getLoyaltyCardGroups(database, card.id)) {
|
||||
printer.printRecord(card.id, group._id);
|
||||
|
||||
@@ -124,7 +124,7 @@ public class CatimaImporter implements Importer {
|
||||
Set<String> existingImages = DBHelper.imageFiles(context, database);
|
||||
|
||||
for (LoyaltyCard card : data.cards) {
|
||||
LoyaltyCard existing = DBHelper.getLoyaltyCard(database, card.id);
|
||||
LoyaltyCard existing = DBHelper.getLoyaltyCard(context, database, card.id);
|
||||
if (existing == null) {
|
||||
DBHelper.insertLoyaltyCard(database, card.id, card.store, card.note, card.validFrom, card.expiry, card.balance, card.balanceType,
|
||||
card.cardId, card.barcodeId, card.barcodeType, card.headerColor, card.starStatus, card.lastUsed, card.archiveStatus);
|
||||
@@ -152,7 +152,7 @@ public class CatimaImporter implements Importer {
|
||||
}
|
||||
|
||||
public boolean isDuplicate(Context context, final LoyaltyCard existing, final LoyaltyCard card, final Set<String> existingImages, final Map<String, String> imageChecksums) throws IOException {
|
||||
if (!LoyaltyCard.isDuplicate(existing, card)) {
|
||||
if (!LoyaltyCard.isDuplicate(context, existing, card)) {
|
||||
return false;
|
||||
}
|
||||
for (ImageLocationType imageLocationType : ImageLocationType.values()) {
|
||||
@@ -490,7 +490,30 @@ public class CatimaImporter implements Importer {
|
||||
// We catch this exception so we can still import old backups
|
||||
}
|
||||
|
||||
return new LoyaltyCard(id, store, note, validFrom, expiry, balance, balanceType, cardId, barcodeId, barcodeType, headerColor, starStatus, lastUsed, DBHelper.DEFAULT_ZOOM_LEVEL, archiveStatus);
|
||||
return new LoyaltyCard(
|
||||
id,
|
||||
store,
|
||||
note,
|
||||
validFrom,
|
||||
expiry,
|
||||
balance,
|
||||
balanceType,
|
||||
cardId,
|
||||
barcodeId,
|
||||
barcodeType,
|
||||
headerColor,
|
||||
starStatus,
|
||||
lastUsed,
|
||||
DBHelper.DEFAULT_ZOOM_LEVEL,
|
||||
DBHelper.DEFAULT_ZOOM_LEVEL_WIDTH,
|
||||
archiveStatus,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -149,7 +149,30 @@ public class FidmeImporter implements Importer {
|
||||
// TODO: Front and back image
|
||||
|
||||
// use -1 for the ID, it will be ignored when inserting the card into the DB
|
||||
return new LoyaltyCard(-1, store, note, null, null, BigDecimal.valueOf(0), null, cardId, null, barcodeType, headerColor, starStatus, Utils.getUnixTime(), DBHelper.DEFAULT_ZOOM_LEVEL, archiveStatus);
|
||||
return new LoyaltyCard(
|
||||
-1,
|
||||
store,
|
||||
note,
|
||||
null,
|
||||
null,
|
||||
BigDecimal.valueOf(0),
|
||||
null,
|
||||
cardId,
|
||||
null,
|
||||
barcodeType,
|
||||
headerColor,
|
||||
starStatus,
|
||||
Utils.getUnixTime(),
|
||||
DBHelper.DEFAULT_ZOOM_LEVEL,
|
||||
DBHelper.DEFAULT_ZOOM_LEVEL_WIDTH,
|
||||
archiveStatus,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public void saveAndDeduplicate(SQLiteDatabase database, final ImportedData data) {
|
||||
|
||||
@@ -354,7 +354,30 @@ public class StocardImporter implements Importer {
|
||||
|
||||
long lastUsed = record.lastUsed != null ? record.lastUsed : Utils.getUnixTime();
|
||||
|
||||
LoyaltyCard card = new LoyaltyCard(tempID, store, note, null, null, BigDecimal.valueOf(0), null, record.cardId, null, barcodeType, headerColor, 0, lastUsed, DBHelper.DEFAULT_ZOOM_LEVEL, 0);
|
||||
LoyaltyCard card = new LoyaltyCard(
|
||||
tempID,
|
||||
store,
|
||||
note,
|
||||
null,
|
||||
null,
|
||||
BigDecimal.valueOf(0),
|
||||
null,
|
||||
record.cardId,
|
||||
null,
|
||||
barcodeType,
|
||||
headerColor,
|
||||
0,
|
||||
lastUsed,
|
||||
DBHelper.DEFAULT_ZOOM_LEVEL,
|
||||
DBHelper.DEFAULT_ZOOM_LEVEL_WIDTH,
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
importedData.cards.add(card);
|
||||
|
||||
Map<ImageLocationType, Bitmap> images = new HashMap<>();
|
||||
|
||||
@@ -151,7 +151,30 @@ public class VoucherVaultImporter implements Importer {
|
||||
}
|
||||
|
||||
// use -1 for the ID, it will be ignored when inserting the card into the DB
|
||||
importedData.cards.add(new LoyaltyCard(-1, store, "", null, expiry, balance, balanceType, cardId, null, barcodeType, headerColor, 0, Utils.getUnixTime(), DBHelper.DEFAULT_ZOOM_LEVEL, 0));
|
||||
importedData.cards.add(new LoyaltyCard(
|
||||
-1,
|
||||
store,
|
||||
"",
|
||||
null,
|
||||
expiry,
|
||||
balance,
|
||||
balanceType,
|
||||
cardId,
|
||||
null,
|
||||
barcodeType,
|
||||
headerColor,
|
||||
0,
|
||||
Utils.getUnixTime(),
|
||||
DBHelper.DEFAULT_ZOOM_LEVEL,
|
||||
DBHelper.DEFAULT_ZOOM_LEVEL_WIDTH,
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
));
|
||||
}
|
||||
|
||||
return importedData;
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package protect.card_locker.preferences;
|
||||
|
||||
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.IntegerRes;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.preference.PreferenceManager;
|
||||
@@ -14,8 +18,9 @@ import protect.card_locker.R;
|
||||
import protect.card_locker.Utils;
|
||||
|
||||
public class Settings {
|
||||
private static final String TAG = "Catima";
|
||||
private final Context mContext;
|
||||
private SharedPreferences mSettings;
|
||||
private final SharedPreferences mSettings;
|
||||
|
||||
public Settings(Context context) {
|
||||
mContext = context.getApplicationContext();
|
||||
@@ -42,10 +47,11 @@ public class Settings {
|
||||
return mSettings.getBoolean(getResString(keyId), defaultValue);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Locale getLocale() {
|
||||
String value = getString(R.string.settings_key_locale, "");
|
||||
|
||||
if (value.length() == 0) {
|
||||
if (value.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -92,6 +98,21 @@ public class Settings {
|
||||
return getString(R.string.setting_key_theme_color, mContext.getResources().getString(R.string.settings_key_system_theme));
|
||||
}
|
||||
|
||||
public int getPreferredColumnCount() {
|
||||
var defaultSymbol = mContext.getResources().getString(R.string.settings_key_automatic_column_count);
|
||||
var defaultColumnCount = mContext.getResources().getInteger(R.integer.main_view_card_columns);
|
||||
var orientation = mContext.getResources().getConfiguration().orientation;
|
||||
var columnCountPrefKey = orientation == ORIENTATION_PORTRAIT ? R.string.setting_key_column_count_portrait : R.string.setting_key_column_count_landscape;
|
||||
var columnCountSetting = getString(columnCountPrefKey, defaultSymbol);
|
||||
try {
|
||||
// the pref may be unset or explicitly set to default
|
||||
return columnCountSetting.equals(defaultSymbol) ? defaultColumnCount : Integer.parseInt(columnCountSetting);
|
||||
} catch (NumberFormatException nfe) {
|
||||
Log.e(TAG, "Failed to parseInt the column count pref", nfe);
|
||||
return defaultColumnCount;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean useVolumeKeysForNavigation() {
|
||||
return getBoolean(R.string.settings_key_use_volume_keys_navigation, false);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public class SettingsActivity extends CatimaAppCompatActivity {
|
||||
binding = SettingsActivityBinding.inflate(getLayoutInflater());
|
||||
setTitle(R.string.settings);
|
||||
setContentView(binding.getRoot());
|
||||
Utils.applyWindowInsets(binding.getRoot());
|
||||
Toolbar toolbar = binding.toolbar;
|
||||
setSupportActionBar(toolbar);
|
||||
enableToolbarBackButton();
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package protect.card_locker.viewmodels
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.lifecycle.ViewModel
|
||||
import protect.card_locker.LoyaltyCard
|
||||
import protect.card_locker.LoyaltyCardField
|
||||
import protect.card_locker.async.TaskHandler
|
||||
|
||||
class LoyaltyCardEditActivityViewModel : ViewModel() {
|
||||
var initialized: Boolean = false
|
||||
var hasChanged: Boolean = false
|
||||
|
||||
var taskHandler: TaskHandler = TaskHandler();
|
||||
|
||||
var addGroup: String? = null
|
||||
var openSetIconMenu: Boolean = false
|
||||
var loyaltyCardId: Int = 0
|
||||
var updateLoyaltyCard: Boolean = false
|
||||
var duplicateFromLoyaltyCardId: Boolean = false
|
||||
var importLoyaltyCardUri: Uri? = null
|
||||
|
||||
var tabIndex: Int = 0
|
||||
var requestedImageType: Int = 0
|
||||
var tempLoyaltyCardField: LoyaltyCardField? = null
|
||||
|
||||
var loyaltyCard: LoyaltyCard = LoyaltyCard()
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="@android:color/black">
|
||||
<path
|
||||
android:fillColor="@android:color/black"
|
||||
android:pathData="M20.54,5.23l-1.39,-1.68C18.88,3.21 18.47,3 18,3H6c-0.47,0 -0.88,0.21 -1.16,0.55L3.46,5.23C3.17,5.57 3,6.02 3,6.5V19c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V6.5c0,-0.48 -0.17,-0.93 -0.46,-1.27zM12,17.5L6.5,12H10v-2h4v2h3.5L12,17.5zM5.12,5l0.81,-1h12l0.94,1H5.12z"/>
|
||||
</vector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
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,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 +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="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 +0,0 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="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>
|
||||
@@ -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="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>
|
||||
10
app/src/main/res/drawable/local_activity_24px.xml
Normal file
10
app/src/main/res/drawable/local_activity_24px.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="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M368,640L480,556L590,640L548,504L660,416L524,416L480,280L436,416L300,416L410,504L368,640ZM160,800Q127,800 103.5,776.5Q80,753 80,720L80,585Q80,574 87,566Q94,558 105,556Q129,548 144.5,527Q160,506 160,480Q160,454 144.5,433Q129,412 105,404Q94,402 87,394Q80,386 80,375L80,240Q80,207 103.5,183.5Q127,160 160,160L800,160Q833,160 856.5,183.5Q880,207 880,240L880,375Q880,386 873,394Q866,402 855,404Q831,412 815.5,433Q800,454 800,480Q800,506 815.5,527Q831,548 855,556Q866,558 873,566Q880,574 880,585L880,720Q880,753 856.5,776.5Q833,800 800,800L160,800ZM160,720L800,720Q800,720 800,720Q800,720 800,720L800,618Q763,596 741.5,559.5Q720,523 720,480Q720,437 741.5,400.5Q763,364 800,342L800,240Q800,240 800,240Q800,240 800,240L160,240Q160,240 160,240Q160,240 160,240L160,342Q197,364 218.5,400.5Q240,437 240,480Q240,523 218.5,559.5Q197,596 160,618L160,720Q160,720 160,720Q160,720 160,720ZM480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480Z"/>
|
||||
</vector>
|
||||
@@ -2,9 +2,10 @@
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="@android:color/white">
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20.54,5.23l-1.39,-1.68C18.88,3.21 18.47,3 18,3H6c-0.47,0 -0.88,0.21 -1.16,0.55L3.46,5.23C3.17,5.57 3,6.02 3,6.5V19c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V6.5c0,-0.48 -0.17,-0.93 -0.46,-1.27zM12,17.5L6.5,12H10v-2h4v2h3.5L12,17.5zM5.12,5l0.81,-1h12l0.94,1H5.12z"/>
|
||||
android:fillColor="#D3D3D3"
|
||||
android:pathData="M20.54,5.23l-1.39,-1.68C18.88,3.21 18.47,3 18,3H6c-0.47,0 -0.88,0.21 -1.16,0.55L3.46,5.23C3.17,5.57 3,6.02 3,6.5V19c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V6.5c0,-0.48 -0.17,-0.93 -0.46,-1.27zM12,17.5L6.5,12H10v-2h4v2h3.5L12,17.5zM5.12,5l0.81,-1h12l0.94,1H5.12z"
|
||||
android:strokeWidth="0.25"
|
||||
android:strokeColor="#777777"/>
|
||||
</vector>
|
||||
11
app/src/main/res/drawable/loyalty_card_icon_starred.xml
Normal file
11
app/src/main/res/drawable/loyalty_card_icon_starred.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#D3D3D3"
|
||||
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"
|
||||
android:strokeWidth="0.25"
|
||||
android:strokeColor="#777777"/>
|
||||
</vector>
|
||||
@@ -15,8 +15,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_baseline_archive_24" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="1"
|
||||
app:spanCount="@integer/main_view_card_columns"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent" />
|
||||
</RelativeLayout>
|
||||
@@ -6,7 +6,7 @@
|
||||
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:context="protect.card_locker.ManageGroupActivity"
|
||||
tools:showIn="@layout/main_activity">
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -97,36 +97,6 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/importOptionFilesystemButton" />
|
||||
|
||||
<View
|
||||
android:id="@+id/dividerImportApplication"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="16dp"
|
||||
android:background="?android:attr/listDivider"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/importOptionApplicationTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
android:text="@string/importOptionApplicationTitle"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/importOptionApplicationExplanation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textSize="@dimen/text_size_medium"
|
||||
android:text="@string/importOptionApplicationExplanation"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/importOptionApplicationButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/importOptionApplicationButton" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
@@ -41,9 +41,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textStyle="bold"
|
||||
app:autoSizeMinTextSize="6sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
android:gravity="center"
|
||||
android:padding="20dp" />
|
||||
android:padding="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:importantForAccessibility="no"
|
||||
@@ -71,29 +72,15 @@
|
||||
android:layout_width="@dimen/cardThumbnailSize"
|
||||
android:layout_height="@dimen/cardThumbnailSize"
|
||||
android:layout_gravity="end"
|
||||
android:alpha="0.5"
|
||||
android:alpha="0.8"
|
||||
android:contentDescription="@string/starred"
|
||||
android:elevation="4dp"
|
||||
android:rotationX="2"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_starred_white"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
|
||||
<ImageView
|
||||
android:importantForAccessibility="no"
|
||||
android:id="@+id/star_border"
|
||||
android:layout_width="@dimen/cardThumbnailSize"
|
||||
android:layout_height="@dimen/cardThumbnailSize"
|
||||
android:layout_gravity="end"
|
||||
android:alpha="0.5"
|
||||
android:contentDescription="@string/starImage"
|
||||
android:elevation="4dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_unstarred_black"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
app:srcCompat="@drawable/loyalty_card_icon_starred"
|
||||
tools:ignore="ImageContrastCheck"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -109,18 +96,18 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/archive_background"
|
||||
android:layout_width="41dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_width="@dimen/cardThumbnailSize"
|
||||
android:layout_height="@dimen/cardThumbnailSize"
|
||||
android:layout_gravity="end"
|
||||
android:alpha="0.5"
|
||||
android:alpha="0.8"
|
||||
android:contentDescription="@string/archived"
|
||||
android:elevation="4dp"
|
||||
android:rotationX="2"
|
||||
android:visibility="visible"
|
||||
app:srcCompat="@drawable/ic_baseline_archive_24"
|
||||
tools:ignore="ImageContrastCheck,MissingConstraints"
|
||||
tools:layout_editor_absoluteX="0dp"
|
||||
tools:layout_editor_absoluteY="-1dp" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/loyalty_card_icon_archived"
|
||||
tools:ignore="ImageContrastCheck" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -150,6 +137,8 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:textAppearance="?attr/textAppearanceBody2"
|
||||
android:maxLines="5"
|
||||
android:ellipsize="end"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/store"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:id="@+id/coordinator_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
@@ -142,20 +143,30 @@
|
||||
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">
|
||||
|
||||
<!-- Top white background that stays white even when scaling the fullscreen image-->
|
||||
<ImageView
|
||||
android:importantForAccessibility="no"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:background="#FFFFFFFF"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scaler_guideline" />
|
||||
|
||||
<ImageView
|
||||
android:importantForAccessibility="no"
|
||||
android:id="@+id/fullscreen_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scaler_guideline"/>
|
||||
app:layout_constraintBottom_toTopOf="@+id/scaler_guideline"
|
||||
app:layout_constraintStart_toStartOf="@+id/scaler_startwidthguideline"
|
||||
app:layout_constraintEnd_toEndOf="@+id/scaler_endwidthguideline"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/scaler_guideline"
|
||||
@@ -164,10 +175,24 @@
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/scaler_startwidthguideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="1"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/scaler_endwidthguideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="1"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@+id/fullscreen_button_minimize"
|
||||
app:layout_constraintBottom_toTopOf="@+id/set_width_layout"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip">
|
||||
@@ -188,6 +213,31 @@
|
||||
android:max="100" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/set_width_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15.0dip"
|
||||
android:layout_marginEnd="15.0dip"
|
||||
app:layout_constraintBottom_toTopOf="@+id/fullscreen_button_minimize">
|
||||
|
||||
<TextView
|
||||
android:importantForAccessibility="no"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/width"/>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/barcode_widthscaler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/setBarcodeWidth"
|
||||
android:min="20"
|
||||
android:max="100" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/fullscreen_button_minimize"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -11,57 +11,74 @@ Katharine Chui
|
||||
SlavekB
|
||||
mondstern
|
||||
IllusiveMan196
|
||||
大王叫我来巡山
|
||||
Altonss
|
||||
B o d o
|
||||
Michael Moroni
|
||||
Eric
|
||||
Максим Горпиніч
|
||||
GM
|
||||
Petr Novák
|
||||
laralem
|
||||
大王叫我来巡山
|
||||
Petr Novák
|
||||
Joel A
|
||||
Priit Jõerüüt
|
||||
Taco
|
||||
Edgars Andersons
|
||||
nadiafekihahmed
|
||||
pfaffenrodt
|
||||
Aayush Gupta
|
||||
Scrambled777
|
||||
HudobniVolk
|
||||
Nyatsuki
|
||||
Jiri Grönroos
|
||||
Silvério Santos
|
||||
ikanakova
|
||||
Giovanni Donisi
|
||||
Priit Jõerüüt
|
||||
Samantaz Fox
|
||||
HudobniVolk
|
||||
Jiri Grönroos
|
||||
Nyatsuki
|
||||
Balázs Meskó
|
||||
Milo Ivir
|
||||
Arno-github
|
||||
Ankit Tiwari
|
||||
Sergio Paredes
|
||||
josé m
|
||||
Samantaz Fox
|
||||
Cliff Heraldo
|
||||
Sergio Paredes
|
||||
Ankit Tiwari
|
||||
Arno-github
|
||||
Jose Delvani
|
||||
mdvhimself
|
||||
Milan Šalka
|
||||
ikanakova
|
||||
Kachelkaiser
|
||||
Skrripy
|
||||
huuhaa
|
||||
தமிழ் நேரம்
|
||||
waffshappen
|
||||
Silvério Santos
|
||||
Marnick L'Eau
|
||||
ngocanhtve
|
||||
Vasilis
|
||||
Quentin PAGÈS
|
||||
Projjal Moitra
|
||||
Denis Shilin
|
||||
Robin Liu
|
||||
Robin
|
||||
JungHee Lee
|
||||
Ziad OUALHADJ
|
||||
Robin Liu
|
||||
Renko
|
||||
Denis Shilin
|
||||
しいたけ
|
||||
Alexander Ivanov
|
||||
Viet Nguyen Hoang
|
||||
Fjuro
|
||||
Miha Frangež
|
||||
Viet Nguyen Hoang
|
||||
stavpup
|
||||
hajertabbane
|
||||
ehrt74
|
||||
Virginie
|
||||
Tim Trek
|
||||
Renko
|
||||
Ricky Tigg
|
||||
Peter Dave Hello
|
||||
Michael Gangolf
|
||||
rudy3
|
||||
Kim Seohyun
|
||||
Govind S Nair
|
||||
Freddo espresso
|
||||
Augustin LAVILLE
|
||||
arshbeerSingh
|
||||
Aliaksandr Trush
|
||||
MisterCosta96
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
<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="noGiftCards">اضغط على زر الإضافة+ لإضافة بطاقة، أو استورد من ⋮ القائمة.</string>
|
||||
<string name="noMatchingGiftCards">لا نتائج. حاول تغيير كلمات البحث.</string>
|
||||
<string name="storeName">اسم</string>
|
||||
<string name="note">مذكرة</string>
|
||||
<string name="cardId">معرّف البطاقة</string>
|
||||
<string name="barcodeType">نوع الباركود</string>
|
||||
<string name="noBarcode">لا يوجد باركود</string>
|
||||
<string name="star">أضف الي المفضلة</string>
|
||||
<string name="star">أضف الى المفضلة</string>
|
||||
<string name="unstar">حذف من المفضلة</string>
|
||||
<string name="cancel">إلغاء</string>
|
||||
<string name="save">حفظ</string>
|
||||
@@ -25,7 +25,7 @@
|
||||
<string name="scanCardBarcode">مسح باركود</string>
|
||||
<string name="cardShortcut">اختصار البطاقة</string>
|
||||
<string name="noCardsMessage">اضف بطاقة أولا</string>
|
||||
<string name="barcodeImageDescriptionWithType">صورة <xliff:g>%s</xliff:g> باركود</string>
|
||||
<string name="barcodeImageDescriptionWithType">صورة <xliff:g>%s</xliff:g> الباركود</string>
|
||||
<string name="noCardExistsError">لا يمكن العثور على هذه البطاقة</string>
|
||||
<string name="failedParsingImportUriError">لا يمكن تحليل الرابط المستورد</string>
|
||||
<string name="importExport">استيراد/تصدير</string>
|
||||
@@ -36,9 +36,6 @@
|
||||
<string name="exportFailed">لا يمكن عمل التصدير</string>
|
||||
<string name="exportOptionExplanation">ستتم كتابة البيانات في الموقع الذي تختاره.</string>
|
||||
<string name="importOptionFilesystemButton">من نظام الملفات</string>
|
||||
<string name="importOptionApplicationTitle">استخدم تطبيقًا آخر</string>
|
||||
<string name="importOptionApplicationExplanation">استخدم أي تطبيق أو مدير الملفات المفضل لديك لفتح ملف.</string>
|
||||
<string name="importOptionApplicationButton">استخدم تطبيقًا آخر</string>
|
||||
<string name="about">حول</string>
|
||||
<string name="app_copyright_old">بناء على Loyalty Card Keychain
|
||||
\nحقوق النشر © 2016-2020 Branden Archer</string>
|
||||
@@ -50,11 +47,11 @@
|
||||
<string name="settings">اعدادات</string>
|
||||
<string name="settings_light_theme">فاتح</string>
|
||||
<string name="settings_dark_theme">داكن</string>
|
||||
<string name="settings_card_orientation">اتجاه الباركود</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_display_barcode_max_brightness">عرض مشرق علي الباركود</string>
|
||||
<string name="settings_display_barcode_max_brightness">شاشة ساطعة</string>
|
||||
<string name="importSuccessful">تم استيراد البيانات</string>
|
||||
<string name="exportSuccessful">تم تصدير البيانات</string>
|
||||
<string name="enter_group_name">أدخل اسم المجموعة</string>
|
||||
@@ -141,7 +138,7 @@
|
||||
<string name="archived">تمت أرشفة البطاقة</string>
|
||||
<string name="unarchived">البطاقة غير مؤرشفة</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>
|
||||
@@ -261,7 +258,7 @@
|
||||
<string name="anyDate">أي تاريخ</string>
|
||||
<string name="chooseValidFromDate">اختر صالح من التاريخ</string>
|
||||
<string name="validFromSentence">صالح من:<xliff:g>%s</xliff:g></string>
|
||||
<string name="height">الطول:</string>
|
||||
<string name="height">الطول</string>
|
||||
<string name="permissionReadCardsDescription">اقرأ بطاقتك مع جميع التفاصيل، بما فيه الملاحضات والصور</string>
|
||||
<string name="settings_display_barcode_max_brightness_summary">ظروري لعمل بعض الماسحات الضوئية</string>
|
||||
<string name="permissionReadCardsLabel">اقرأ بطاقات كاتيما</string>
|
||||
@@ -277,7 +274,7 @@
|
||||
<string name="action_display_options">خيارات العرض</string>
|
||||
<string name="settings_oled_dark_summary">يقلل من استخدام البطارية على شاشات OLED</string>
|
||||
<string name="icon_header_click_text">اضغط لفترة طويلة لتحرير الصورة المصغرة</string>
|
||||
<string name="settings_category_title_cards">البطاقات</string>
|
||||
<string name="settings_category_title_cards">البطاقات الظاهرة</string>
|
||||
<string name="show_note">إظهار الملاحظة</string>
|
||||
<string name="switchToBackImage">التبديل إلى الصورة الخلفية</string>
|
||||
<string name="switchToFrontImage">التبديل إلى الصورة الأمامية</string>
|
||||
@@ -298,7 +295,7 @@
|
||||
<string name="enter_card_id">أدخل رقم الهوية أو النص الموجود على بطاقتك</string>
|
||||
<string name="addWithoutBarcode">إضافة بدون باركود</string>
|
||||
<string name="field_must_not_be_empty">يجب ألا يكون الحقل فارغا</string>
|
||||
<string name="app_name">Catima</string>
|
||||
<string name="app_name">كاتيما</string>
|
||||
<string name="settings_follow_sensor_orientation">التدوير دائمًا ( تجاهل إعدادات النظام)</string>
|
||||
<string name="add_manually_warning_title">الفحص موصى به</string>
|
||||
<string name="continue_">استمر</string>
|
||||
@@ -316,4 +313,23 @@
|
||||
<string name="exportCancelled">تم الغاء الاستخراج</string>
|
||||
<string name="useFrontImage">استخدام صورة أمامية</string>
|
||||
<string name="useBackImage">استخدم صورة خلفية</string>
|
||||
</resources>
|
||||
<string name="addFromPkpass">اختر ملف الدفتر(.pkpass)</string>
|
||||
<string name="unsupportedFile">هذا الملف غير مدعوم</string>
|
||||
<string name="generic_error_please_retry">نعتذر، حدث خطأ ما، حاول مرة أخرى...</string>
|
||||
<string name="settings_use_volume_keys_navigation">تبديل البطاقات باستخدام أزرار الصوت</string>
|
||||
<string name="settings_use_volume_keys_navigation_summary">تبديل البطاقات الظاهرة باستخدام أزرار الصوت</string>
|
||||
<string name="settings_category_title_cards_overview">نظرة عامة على البطاقات</string>
|
||||
<string name="settings_column_count_portrait">الأعمدة في الوضع الرأسي</string>
|
||||
<string name="settings_column_count_landscape">الأعمدة في الوضع الأفقي</string>
|
||||
<string name="settings_automatic_column_count">تلقائي</string>
|
||||
<string name="settings_column_count_1">١</string>
|
||||
<string name="settings_column_count_2">٢</string>
|
||||
<string name="settings_column_count_3">٣</string>
|
||||
<string name="settings_column_count_4">٤</string>
|
||||
<string name="settings_column_count_5">٥</string>
|
||||
<string name="settings_column_count_6">٦</string>
|
||||
<string name="settings_column_count_7">٧</string>
|
||||
<string name="sort_by_valid_from">صالح من</string>
|
||||
<string name="width">العرض</string>
|
||||
<string name="setBarcodeWidth">تعيين عرض الرمز الشريطي \"باركود\"</string>
|
||||
</resources>
|
||||
|
||||
@@ -45,4 +45,4 @@
|
||||
<string name="thumbnailDescription">Miniatura</string>
|
||||
<string name="settings">Configuración</string>
|
||||
<string name="settings_theme">Estilu</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
||||
317
app/src/main/res/values-be/strings.xml
Normal file
317
app/src/main/res/values-be/strings.xml
Normal file
@@ -0,0 +1,317 @@
|
||||
<?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="noMatchingGiftCards">Няма вынікаў. Паспрабуйце змяніць параметры пошуку.</string>
|
||||
<plurals name="selectedCardCount">
|
||||
<item quantity="one"><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="action_add">Дадаць</string>
|
||||
<string name="app_name">Catima</string>
|
||||
<string name="action_search">Пошук</string>
|
||||
<string name="noGiftCards">Націсніце кнопку + плюс, каб дадаць картку, або імпартуйце праз меню ⋮.</string>
|
||||
<string name="storeName">Назва</string>
|
||||
<string name="star">Дадаць у абраныя</string>
|
||||
<string name="unstar">Выдаліць з абраных</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">OK</string>
|
||||
<string name="share">Абагуліць</string>
|
||||
<string name="sendLabel">Адправіць…</string>
|
||||
<string name="addCardTitle">Дадаць карту</string>
|
||||
<string name="cardShortcut">Ярлык карты</string>
|
||||
<string name="barcodeImageDescriptionWithType">Відарыс штрыхкоду <xliff:g>%s</xliff:g></string>
|
||||
<string name="scanCardBarcode">Сканаваць штрыхкод</string>
|
||||
<string name="noCardExistsError">Не ўдалося знайсці карту</string>
|
||||
<string name="exportName">Экспарт</string>
|
||||
<string name="importSuccessfulTitle">Імпартавана</string>
|
||||
<string name="importFailedTitle">Не ўдалося імпартаваць</string>
|
||||
<string name="importFailed">Немагчыма выканаць імпарт</string>
|
||||
<string name="exportSuccessfulTitle">Экспартавана</string>
|
||||
<string name="importing">Імпартаванне…</string>
|
||||
<string name="storageReadPermissionRequired">Для гэтага дзеяння патрабуецца дазвол на чытанне сховішча…</string>
|
||||
<string name="cameraPermissionRequired">Для гэтага дзеяння патрабуецца дазвол на доступ да камеры…</string>
|
||||
<string name="permissionReadCardsLabel">Чытаць карты Catima</string>
|
||||
<string name="exportOptionExplanation">Даныя будуць запісаны ў выбранае вамі месца.</string>
|
||||
<string name="importOptionFilesystemExplanation">Выберыце пэўны файл з файлавай сістэмы.</string>
|
||||
<string name="importOptionFilesystemButton">З файлавай сістэмы</string>
|
||||
<string name="about">Аб праграме</string>
|
||||
<string name="app_copyright_short">Аўтарскае права © Sylvia van Os і суаўтары</string>
|
||||
<plurals name="deleteCardsConfirmation">
|
||||
<item quantity="one">Выдаліць <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="barcodeType">Тып штрыхкода</string>
|
||||
<string name="deleteTitle">Выдаліць карту</string>
|
||||
<plurals name="deleteCardsTitle">
|
||||
<item quantity="one">Выдаліць <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="noGiftCardsGroup">Стварыце некалькі карт, а затым прызначце іх у групу тут.</string>
|
||||
<string name="noBarcode">Няма штрыхкода</string>
|
||||
<string name="note">Нататка</string>
|
||||
<string name="editCardTitle">Рэдагаваць карту</string>
|
||||
<string name="cardId">ID карты</string>
|
||||
<string name="noCardsMessage">Спачатку дадайце карту</string>
|
||||
<string name="importExport">Імпарт/Экспарт</string>
|
||||
<string name="importOptionFilesystemTitle">Імпарт з файлавай сістэмы</string>
|
||||
<string name="app_copyright_fmt" tools:ignore="PluralsCandidate">Аўтарскае права © 2019–<xliff:g>%d</xliff:g> Sylvia van Os і суаўтары</string>
|
||||
<string name="importExportHelp">Рэзервовае капіяванне даных дазваляе перанесці іх на іншую прыладу.</string>
|
||||
<string name="failedParsingImportUriError">Не атрымалася разабраць URI імпарту</string>
|
||||
<string name="exportFailedTitle">Не ўдалося экспартаваць</string>
|
||||
<string name="exportFailed">Немагчыма выканаць экспарт</string>
|
||||
<string name="permissionReadCardsDescription">чытаць вашы карты Catima і ўсе іх дэталі, уключаючы нататкі і выявы</string>
|
||||
<string name="exporting">Экспартаванне…</string>
|
||||
<string name="cameraPermissionDeniedTitle">Не атрымалася атрымаць доступ да камеры</string>
|
||||
<string name="app_copyright_old">Заснавана на Loyalty Card Keychain\nаўтарскае права © 2016–2020 Branden Archer</string>
|
||||
<string name="noCameraPermissionDirectToSystemSetting">Каб сканаваць штрыхкоды, Catima спатрэбіцца доступ да вашай камеры. Націсніце тут, каб змяніць параметры дазволу.</string>
|
||||
<string name="about_title_fmt">Пра <xliff:g id="app_name">%s</xliff:g></string>
|
||||
<string name="debug_version_fmt">Версія: <xliff:g id="version">%s</xliff:g></string>
|
||||
<string name="app_libraries">Бясплатныя староннія бібліятэкі: <xliff:g id="app_libraries_list">%s</xliff:g></string>
|
||||
<string name="selectBarcodeTitle">Выберыце штрыхкод</string>
|
||||
<string name="starImage">Зорка абранага</string>
|
||||
<string name="settings">Налады</string>
|
||||
<string name="settings_theme">Тэма</string>
|
||||
<string name="settings_system_theme">Сістэмная</string>
|
||||
<string name="settings_light_theme">Светлая</string>
|
||||
<string name="settings_dark_theme">Цёмная</string>
|
||||
<string name="settings_card_orientation">Арыентацыя экрана</string>
|
||||
<string name="settings_follow_sensor_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_keep_screen_on_summary">Адключае тайм-аўт экрана падчас прагляду карты</string>
|
||||
<string name="settings_disable_lockscreen_while_viewing_card">Прадухіляць блакіроўку экрана</string>
|
||||
<string name="settings_disable_lockscreen_while_viewing_card_summary">Адключае блакіроўку экрана падчас прагляду карты</string>
|
||||
<string name="settings_allow_content_provider_read_summary">Праграмам усё роўна трэба будзе запытваць дазвол, каб атрымаць доступ</string>
|
||||
<string name="settings_use_volume_keys_navigation">Пераключаць карты з дапамогай кнопак гучнасці</string>
|
||||
<string name="settings_use_volume_keys_navigation_summary">Выкарыстоўвайце кнопкі гучнасці, каб змяніць, якая карта будзе адлюстроўвацца</string>
|
||||
<string name="intent_import_card_from_url_share_text">Я хачу падзяліцца з вамі картай</string>
|
||||
<string name="importSuccessful">Даныя імпартаваны</string>
|
||||
<string name="exportSuccessful">Даныя экспартаваны</string>
|
||||
<string name="enter_group_name">Увядзіце назву групы</string>
|
||||
<string name="groups">Групы</string>
|
||||
<string name="group_edit">Рэдагаваць групу</string>
|
||||
<string name="noGroups">Націсніце кнопку +, каб дадаць групы для катэгарызацыі.</string>
|
||||
<string name="noGroupCards">Гэтая група пустая</string>
|
||||
<plurals name="groupCardCount">
|
||||
<item quantity="one"><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="group_updated">Група абноўлена</string>
|
||||
<string name="deleteConfirmationGroup">Выдаліць групу?</string>
|
||||
<string name="moveUp">Перасунуць уверх</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>
|
||||
<plurals name="balancePoints">
|
||||
<item quantity="one"><xliff:g>%s</xliff:g> бал</item>
|
||||
<item quantity="few"><xliff:g>%s</xliff:g> балы</item>
|
||||
<item quantity="many"><xliff:g>%s</xliff:g> балаў</item>
|
||||
<item quantity="other"><xliff:g>%s</xliff:g> балаў</item>
|
||||
</plurals>
|
||||
<string name="card">Карта</string>
|
||||
<string name="expiryDate">Тэрмін прыдатнасці</string>
|
||||
<string name="never">Ніколі</string>
|
||||
<string name="chooseExpiryDate">Выбраць тэрмін прыдатнасці</string>
|
||||
<string name="moveBarcodeToTopOfScreen">Перамясціць штрыхкод у верхнюю частку экрана</string>
|
||||
<string name="noBarcodeFound">Штрыхкод не знойдзены</string>
|
||||
<string name="errorReadingImage">Не атрымалася прачытаць малюнак</string>
|
||||
<string name="balance">Баланс</string>
|
||||
<string name="currency">Валюта</string>
|
||||
<string name="points">Балы</string>
|
||||
<string name="balanceParsingFailed">Няправільны баланс</string>
|
||||
<string name="chooseImportType">Імпартаваць даныя з</string>
|
||||
<string name="app_loyalty_card_keychain">Loyalty Card Keychain</string>
|
||||
<string name="privacy_policy">Палітыка прыватнасці</string>
|
||||
<string name="accept">Прыняць</string>
|
||||
<string name="importCatima">Імпарт з Catima</string>
|
||||
<string name="importFidme">Імпарт з FidMe</string>
|
||||
<string name="importLoyaltyCardKeychain">Імпарт з Loyalty Card Keychain</string>
|
||||
<string name="importStocard">Імпарт з Stocard</string>
|
||||
<string name="importVoucherVault">Імпарт з Voucher Vault</string>
|
||||
<string name="barcodeId">Значэнне штрыхкода</string>
|
||||
<string name="importVoucherVaultMessage">Каб імпартаваць, выберыце файл <i>vouchervault.json</i> з Voucher Vault. \nСтварыце яго, націснуўшы Экспарт у Voucher Vault .</string>
|
||||
<string name="sameAsCardId">Такі ж як ID</string>
|
||||
<string name="setBarcodeId">Задаць значэнне штрыхкода</string>
|
||||
<string name="unsupportedBarcodeType">Гэты тып штрыхкода пакуль не можа быць адлюстраваны. Гэта магчыма будзе падтрымлівацца ў больш позняй версіі праграмы.</string>
|
||||
<string name="wrongValueForBarcodeType">Значэнне няправільнае для абранага тыпу штрыхкода</string>
|
||||
<string name="intent_import_card_from_url_share_multiple_text">Я хачу падзяліцца з вамі некаторымі картамі</string>
|
||||
<string name="photos">Фота</string>
|
||||
<string name="backImageDescription">Задні відарыс</string>
|
||||
<string name="setFrontImage">Задаць пярэдні відарыс</string>
|
||||
<string name="setBackImage">Задаць задні відарыс</string>
|
||||
<string name="removeImage">Выдаліць відарыс</string>
|
||||
<string name="takePhoto">Зрабіць фота</string>
|
||||
<string name="updateBarcodeQuestionTitle">Абнавіць значэнне штрыхкода?</string>
|
||||
<string name="yes">Так</string>
|
||||
<string name="passwordRequired">Увядзіце пароль</string>
|
||||
<string name="exportPassword">Задайце пароль для абароны вашага экспарту (неабавязкова)</string>
|
||||
<string name="exportPasswordHint">Увядзіце пароль</string>
|
||||
<string name="failedGeneratingShareURL">Не атрымалася стварыць URL для сумеснага выкарыстання. Калі ласка, паведаміце аб гэтым.</string>
|
||||
<string name="turn_flashlight_on">Уключыць ліхтарык</string>
|
||||
<string name="settings_oled_dark">Чысты чорны фон для цёмнай тэмы</string>
|
||||
<string name="selectColor">Выбраць колер</string>
|
||||
<string name="setIcon">Задаць мініяцюру</string>
|
||||
<string name="settings_theme_color">Колер тэмы</string>
|
||||
<string name="settings_catima_theme">Catima</string>
|
||||
<string name="settings_magenta_theme">Пурпурны</string>
|
||||
<string name="app_contributors">Стала магчымым дзякуючы: <xliff:g id="app_contributors">%s</xliff:g></string>
|
||||
<string name="sort">Сартаваць</string>
|
||||
<string name="showMoreInfo">Паказаць інфармацыю</string>
|
||||
<string name="updateBalance">Абнавіць баланс</string>
|
||||
<string name="failedToRetrieveImageFile">Не ўдалося атрымаць файл відарысу</string>
|
||||
<string name="barcodeLongPressMessage">У галерэі можна адкрываць толькі відарысы</string>
|
||||
<string name="sort_by_name">Назва</string>
|
||||
<string name="sort_by_most_recently_used">Частата выкарыстання</string>
|
||||
<string name="sort_by_valid_from">Дзейнічае ад</string>
|
||||
<string name="sort_by_expiry">Тэрмін дзеяння</string>
|
||||
<string name="reverse">...у адваротным парадку</string>
|
||||
<string name="sort_by">Сартаваць па</string>
|
||||
<string name="version_history">Гісторыя версій</string>
|
||||
<string name="credits">Удзельнікі</string>
|
||||
<string name="help_translate_this_app">Дапамажыце перакласці гэтую праграму</string>
|
||||
<string name="license">Ліцэнзія</string>
|
||||
<string name="source_repository">Зыходны рэпазіторый</string>
|
||||
<string name="on_github">на GitHub</string>
|
||||
<string name="and_data_usage">і выкарыстанне трафіка</string>
|
||||
<string name="rate_this_app">Ацаніце праграму</string>
|
||||
<string name="on_google_play">у Google Play</string>
|
||||
<string name="translate_platform">на Weblate</string>
|
||||
<string name="shortcutSelectCard">Выбраць карту</string>
|
||||
<string name="options">Параметры</string>
|
||||
<string name="starred">Пазначаныя зорачкай</string>
|
||||
<string name="include_if_asking_support">Калі вы хочаце запытаць падтрымку, уключыце наступную інфармацыю:</string>
|
||||
<string name="duplicateCard">Дубляваць</string>
|
||||
<string name="archive">Архіваваць</string>
|
||||
<string name="unarchive">Разархіваваць</string>
|
||||
<string name="archived">Карта заархівавана</string>
|
||||
<string name="previousCard">Папярэдняя</string>
|
||||
<string name="nextCard">Наступная</string>
|
||||
<string name="failedToOpenUrl">Спачатку ўсталюйце вэб-браўзер</string>
|
||||
<string name="welcome">Сардэчна запрашаем у Catima</string>
|
||||
<string name="importCards">Імпартаваць карты</string>
|
||||
<string name="updateBalanceTitle">Колькі вы патрацілі або атрымалі?</string>
|
||||
<string name="updateBalanceHint">Увядзіце суму</string>
|
||||
<string name="currentBalanceSentence">Бягучы баланс: <xliff:g>%s</xliff:g></string>
|
||||
<string name="newBalanceSentence">Новы баланс: <xliff:g>%s</xliff:g></string>
|
||||
<string name="validFromDate">Дзейнічае ад</string>
|
||||
<string name="anyDate">Любая дата</string>
|
||||
<string name="chooseValidFromDate">Выбраць дату дзеяння</string>
|
||||
<string name="validFromSentence">Дзейнічае з: <xliff:g>%s</xliff:g></string>
|
||||
<string name="height">Вышыня</string>
|
||||
<string name="switchToFrontImage">Пераключыцца на пярэдні відарыс</string>
|
||||
<string name="openBackImageInGalleryApp">Адкрыць задні відарыс у галерэі</string>
|
||||
<string name="setBarcodeHeight">Задаць вышыню штрыхкода</string>
|
||||
<string name="donate">Ахвяраваць</string>
|
||||
<string name="icon_header_click_text">Доўгі націск для рэдагавання мініяцюры</string>
|
||||
<string name="show_name_below_image_thumbnail">Паказаць назву пад мініяцюрай відарыса</string>
|
||||
<string name="show_note">Паказваць нататку</string>
|
||||
<string name="show_balance">Паказваць баланс</string>
|
||||
<string name="show_validity">Паказваць тэрмін дзеяння</string>
|
||||
<string name="settings_category_title_cards">Прагляд карты</string>
|
||||
<string name="settings_category_title_cards_overview">Агляд карт</string>
|
||||
<string name="settings_column_count_portrait">Калонкі ў партрэтным рэжыме</string>
|
||||
<string name="settings_column_count_landscape">Слупкі ў ландшафтным рэжыме</string>
|
||||
<string name="settings_automatic_column_count">Аўтаматычна</string>
|
||||
<string name="settings_column_count_1">1</string>
|
||||
<string name="settings_column_count_2">2</string>
|
||||
<string name="settings_column_count_3">3</string>
|
||||
<string name="settings_column_count_4">4</string>
|
||||
<string name="settings_column_count_5">5</string>
|
||||
<string name="settings_column_count_6">6</string>
|
||||
<string name="settings_column_count_7">7</string>
|
||||
<string name="settings_category_title_privacy">Прыватнасць</string>
|
||||
<string name="settings_category_title_general">Агульныя</string>
|
||||
<string name="action_display_options">Параметры адлюстравання</string>
|
||||
<string name="show_archived_cards">Паказваць заархіваваныя карты</string>
|
||||
<string name="view_online">Прагляд анлайн</string>
|
||||
<string name="action_more_options">Іншыя параметры</string>
|
||||
<string name="addWithoutBarcode">Дадаць карту без штрыхкода</string>
|
||||
<string name="enter_card_id">Увядзіце нумар ID або тэкст вашай карты</string>
|
||||
<string name="card_id_must_not_be_empty">ID карты не павінен быць пустым</string>
|
||||
<string name="add_a_card_in_a_different_way">Дадаць карту іншым спосабам</string>
|
||||
<string name="manually_enter_barcode_instructions">Увядзіце ID нумар або тэкст з вашай картцы і націсніце на штрыхкод, які выглядае як на вашай картцы.</string>
|
||||
<string name="continue_">Працягнуць</string>
|
||||
<string name="spend">Патрачана</string>
|
||||
<string name="receive">Атрымана</string>
|
||||
<string name="amountParsingFailed">Памылковая сума</string>
|
||||
<string name="addFromPdfFile">Выберыце файл PDF</string>
|
||||
<string name="failedLaunchingFileManager">Не атрымалася знайсці падтрымліваемы файлавы менеджар</string>
|
||||
<string name="pageWithNumber">Старонка <xliff:g>%d</xliff:g></string>
|
||||
<string name="importCancelled">Імпарт адменены</string>
|
||||
<string name="exportCancelled">Экспарт адменены</string>
|
||||
<string name="useFrontImage">Выкарыстоўваць пярэдні відарыс</string>
|
||||
<string name="useBackImage">Выкарыстоўваць задні відарыс</string>
|
||||
<string name="addFromPkpass">Выбраць файл Passbook (.pkpass)</string>
|
||||
<string name="width">Шырыня</string>
|
||||
<string name="settings_oled_dark_summary">Змяншае выкарыстанне батарэі на OLED-дысплэях</string>
|
||||
<string name="group_name_already_in_use">Назва групы ўжо выкарыстоўваецца</string>
|
||||
<string name="group_name_is_empty">Назва групы не павінна быць пустой</string>
|
||||
<string name="failedOpeningFileManager">Спачатку ўсталюйце файлавы менеджар.</string>
|
||||
<string name="moveDown">Перасунуць уніз</string>
|
||||
<string name="addManually">Увесці штрыхкод уручную</string>
|
||||
<string name="turn_flashlight_off">Выключыць ліхтарык</string>
|
||||
<string name="thumbnailDescription">Мініяцюра</string>
|
||||
<string name="editGroup">Рэдагаванне групы: <xliff:g>%s</xliff:g></string>
|
||||
<string name="addFromImage">Выбраць малюнак з галерэі</string>
|
||||
<string name="settings_keep_screen_on">Трымаць экран уключаным</string>
|
||||
<string name="app_resources">Бясплатныя староннія рэсурсы: <xliff:g id="app_resources_list">%s</xliff:g></string>
|
||||
<string name="settings_follow_system_orientation">Як у сістэме</string>
|
||||
<string name="leaveWithoutSaveTitle">Выйсці</string>
|
||||
<string name="settings_allow_content_provider_read_title">Дазволіць іншым праграмам доступ да маіх даных</string>
|
||||
<string name="settings_display_barcode_max_brightness">Павялічваць яркасць экрану</string>
|
||||
<string name="settings_display_barcode_max_brightness_summary">Неабходна для працы некаторых сканераў</string>
|
||||
<string name="all">Усе</string>
|
||||
<string name="editBarcode">Рэдагаваць штрыхкод</string>
|
||||
<string name="leaveWithoutSaveConfirmation">Выйсці без захавання?</string>
|
||||
<string name="importLoyaltyCardKeychainMessage">Каб імпартаваць, выберыце файл <i>LoyaltyCardKeychain.csv</i> з Loyalty Card Keychain. \nСтварыце яго з меню «Імпарт/Экспарт» у Loyalty Card Keychain, спачатку націснуўшы там «Экспарт».</string>
|
||||
<string name="importStocardMessage">Каб імпартаваць, выберыце файл <i>***.zip</i> з Stocard. \nАтрымайце яго па электроннай пошце support@stocardapp.com з запытам на экспарт вашых даных.</string>
|
||||
<string name="frontImageDescription">Пярэдні відарыс</string>
|
||||
<string name="groupsList">Групы: <xliff:g>%s</xliff:g></string>
|
||||
<string name="switchToBackImage">Пераключыцца на задні відарыс</string>
|
||||
<string name="importFidmeMessage">Каб імпартаваць, выберыце файл <i>fidme-export-request-xxxxxx.zip</i> з FidMe, а потым уручную выберыце тыпы штрыхкодаў. \nСтварыце яго з вашага профілю FidMe, выбраўшы \"Абарону даных\", а затым націснуўшы \"Выняць мае даныя\".</string>
|
||||
<string name="importCatimaMessage">Каб імпартаваць, выберыце файл <i>catima.zip</i> з Catima. \nСтварыце яго з меню \"Імпарт/Экспарт\" іншай праграмы Catima, спачатку націснуўшы там \"Экспарт\".</string>
|
||||
<string name="settings_sky_blue_theme">Нябесна-блакітны</string>
|
||||
<string name="settings_brown_theme">Карычневы</string>
|
||||
<string name="switchToBarcode">Пераключыцца на штрыхкод</string>
|
||||
<string name="settings_locale">Мова</string>
|
||||
<plurals name="groupCardCountWithArchived">
|
||||
<item quantity="one"><xliff:g>%1$d</xliff:g> карта (<xliff:g id="archivedCount">%2$d</xliff:g> заархівавана)</item>
|
||||
<item quantity="few"><xliff:g>%1$d</xliff:g> карты (<xliff:g id="archivedCount">%2$d</xliff:g> заархівавана)</item>
|
||||
<item quantity="many"><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>
|
||||
</plurals>
|
||||
<string name="unarchived">Карта разархівавана</string>
|
||||
<string name="updateBarcodeQuestionText">Вы змянілі ID. Вы хочаце таксама абнавіць штрыхкод, каб выкарыстоўваць тое ж значэнне?</string>
|
||||
<string name="no">Не</string>
|
||||
<string name="settings_pink_theme">Ружовы</string>
|
||||
<string name="settings_system_locale">Сістэма</string>
|
||||
<string name="settings_violet_theme">Фіялетавы</string>
|
||||
<string name="multipleBarcodesFoundPleaseChooseOne">Які са знойдзеных штрыхкодаў вы хочаце выкарыстоўваць?</string>
|
||||
<string name="settings_blue_theme">Сіні</string>
|
||||
<string name="settings_green_theme">Зялёны</string>
|
||||
<string name="report_error">Паведаміць пра памылку</string>
|
||||
<string name="failedLaunchingPhotoPicker">Не атрымалася знайсці праграму для галерэі, якая падтрымліваецца</string>
|
||||
<string name="unsupportedFile">Гэты файл не падтрымліваецца</string>
|
||||
<string name="openFrontImageInGalleryApp">Адкрыць пярэдні відарыс у галерэі</string>
|
||||
<string name="field_must_not_be_empty">Поле не павінна быць пустым</string>
|
||||
<string name="add_manually_warning_title">Рэкамендуецца сканаванне</string>
|
||||
<string name="errorReadingFile">Не атрымалася прачытаць файл</string>
|
||||
<string name="add_manually_warning_message">У некаторых крамах значэнне штрыхкода адрозніваецца ад лічбы, напісанай на картцы. З-за гэтага ўвод штрыхкода ўручную можа не заўсёды працаваць. Настойліва рэкамендуецца адсканаваць штрыхкод з дапамогай камеры. Вы ўсё яшчэ хочаце працягнуць?</string>
|
||||
<string name="noCameraFoundGuideText">Здаецца, у вашай прылады няма камеры. Калі яна ёсць, паспрабуйце перазагрузіць прыладу. У адваротным выпадку выкарыстоўвайце кнопку \"Іншыя параметры\" ніжэй, каб дадаць штрыхкод іншым спосабам.</string>
|
||||
<string name="generic_error_please_retry">На жаль, нешта пайшло не так, паспрабуйце яшчэ раз...</string>
|
||||
<string name="setBarcodeWidth">Задаць шырыню штрыхкода</string>
|
||||
<string name="app_license">Свабоднае копілефт праграмнае забеспячэнне, ліцэнзаванае паводле GPLv3+</string>
|
||||
</resources>
|
||||
@@ -31,7 +31,6 @@
|
||||
<string name="setBackImage">Снимка на задната страна</string>
|
||||
<string name="setFrontImage">Снимка на предната страна</string>
|
||||
<string name="photos">Снимки</string>
|
||||
<string name="importOptionApplicationExplanation">Изберете файл на друго приложение.</string>
|
||||
<string name="noCardExistsError">Картата не е намерена</string>
|
||||
<string name="updateBarcodeQuestionText">Номерът е променен. Желаете ли същата стойност да бъде приложена и към щрихкода\?</string>
|
||||
<string name="updateBarcodeQuestionTitle">Обновяване на щрихкода\?</string>
|
||||
@@ -41,7 +40,7 @@
|
||||
<string name="removeImage">Премахване на изображение</string>
|
||||
<string name="takePhoto">Снимане</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="barcodeId">Стойност на щрихкода</string>
|
||||
@@ -86,7 +85,6 @@
|
||||
<string name="starImage">Звезда за любимо</string>
|
||||
<string name="thumbnailDescription">Миниатюра</string>
|
||||
<string name="selectBarcodeTitle">Избиране на щрихкод</string>
|
||||
<string name="importOptionApplicationButton">Избиране чрез приложение</string>
|
||||
<string name="importing">Внасяне…</string>
|
||||
<string name="exporting">Изнасяне…</string>
|
||||
<string name="exportFailed">Данните не могат да бъдат изнесени</string>
|
||||
@@ -107,7 +105,6 @@
|
||||
<string name="chooseImportType">Внасяне на данни на</string>
|
||||
<string name="importCatimaMessage">Изберете файла <i>catima.zip</i>, предварително изнесен от Catima.
|
||||
\nСъздайте такъв файл от меню Внасяне/изнасяне от друго устройство с Catima като изберете Изнасяне.</string>
|
||||
<string name="importOptionApplicationTitle">Чрез друго приложение</string>
|
||||
<string name="importOptionFilesystemButton">Избиране от файлова система</string>
|
||||
<string name="importOptionFilesystemExplanation">Изберете определен файл от файловата система.</string>
|
||||
<string name="app_resources">Свободни ресурси: <xliff:g id="app_resources_list">%s</xliff:g></string>
|
||||
@@ -238,7 +235,7 @@
|
||||
<string name="anyDate">Без значение от датата</string>
|
||||
<string name="validFromSentence">Валидност от: <xliff:g>%s</xliff:g></string>
|
||||
<string name="chooseValidFromDate">Определена дата</string>
|
||||
<string name="height">Височина:</string>
|
||||
<string name="height">Височина</string>
|
||||
<string name="switchToFrontImage">Показване на предната страна</string>
|
||||
<string name="switchToBackImage">Показване на задната страна</string>
|
||||
<string name="switchToBarcode">Показване на щрихкода</string>
|
||||
@@ -258,7 +255,7 @@
|
||||
<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_cards">Преглед на карта</string>
|
||||
<string name="settings_category_title_general">Общи</string>
|
||||
<string name="settings_category_title_privacy">Поверителност</string>
|
||||
<string name="settings_keep_screen_on_summary">Спира автоматичното заключване на екрана при преглед на карти</string>
|
||||
@@ -294,4 +291,21 @@
|
||||
<string name="useBackImage">Използване на задната страна</string>
|
||||
<string name="settings_use_volume_keys_navigation">Сменяне на картите с бутоните за звука</string>
|
||||
<string name="settings_use_volume_keys_navigation_summary">Бутоните за силата на звука сменят видимата карта</string>
|
||||
</resources>
|
||||
<string name="settings_automatic_column_count">Автоматично</string>
|
||||
<string name="settings_column_count_2">2</string>
|
||||
<string name="settings_column_count_4">4</string>
|
||||
<string name="settings_column_count_5">5</string>
|
||||
<string name="settings_column_count_1">1</string>
|
||||
<string name="settings_column_count_3">3</string>
|
||||
<string name="settings_column_count_6">6</string>
|
||||
<string name="settings_column_count_7">7</string>
|
||||
<string name="settings_column_count_landscape">Колони в пейзажен изглед</string>
|
||||
<string name="settings_column_count_portrait">Колони в портретен изглед</string>
|
||||
<string name="settings_category_title_cards_overview">Списък с карти</string>
|
||||
<string name="generic_error_please_retry">Съжаляваме, нещо се обърка, опитайте отново…</string>
|
||||
<string name="addFromPkpass">Изберете файл на Passbook (.pkpass)</string>
|
||||
<string name="unsupportedFile">Този вид файлове не се поддържат</string>
|
||||
<string name="sort_by_valid_from">Начало валидност</string>
|
||||
<string name="width">Ширина</string>
|
||||
<string name="setBarcodeWidth">Задаване ширина на щрих кода</string>
|
||||
</resources>
|
||||
|
||||
@@ -85,14 +85,12 @@
|
||||
<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>
|
||||
<plurals name="deleteCardsConfirmation">
|
||||
@@ -136,7 +134,6 @@
|
||||
<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>
|
||||
@@ -241,7 +238,7 @@
|
||||
<string name="show_name_below_image_thumbnail">ছবির থাম্বনেইল এর নিচে নামটি দেখান</string>
|
||||
<string name="show_note">নোট দেখান</string>
|
||||
<string name="show_validity">বৈধতা দেখান</string>
|
||||
<string name="height">উচ্চতা:</string>
|
||||
<string name="height">উচ্চতা</string>
|
||||
<string name="switchToBackImage">পিছনের ছবিটিতে সুইচ করুন</string>
|
||||
<string name="switchToFrontImage">সামনের ছবিটিতে সুইচ করুন</string>
|
||||
<string name="switchToBarcode">বারকোডে সুইচ করুন</string>
|
||||
@@ -251,4 +248,4 @@
|
||||
<string name="icon_header_click_text">দীর্ঘক্ষন টাচ করে থাম্বনেইল এডিট করবেন</string>
|
||||
<string name="show_balance">ব্যালান্স দেখান</string>
|
||||
<string name="donate">দান করুন</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
||||
@@ -100,9 +100,6 @@
|
||||
<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>
|
||||
<string name="noBarcode">Nema barkoda</string>
|
||||
<string name="deleteTitle">Obriši karticu</string>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user