mirror of https://github.com/tasks/tasks
Compare commits
578 Commits
Author | SHA1 | Date |
---|---|---|
![]() |
a4cd0829b0 | 16 hours ago |
![]() |
9a693177db | 1 day ago |
![]() |
58955bd0a1 | 1 day ago |
![]() |
95ecac8e7c | 1 day ago |
![]() |
57395423c6 | 1 day ago |
![]() |
b1613e9845 | 1 day ago |
![]() |
dcd70c7bc2 | 1 day ago |
![]() |
c1e2eb7cd0 | 2 days ago |
![]() |
145ea03714 | 2 days ago |
![]() |
bada09f5c2 | 2 days ago |
![]() |
007c536312 | 2 days ago |
![]() |
28de989a05 | 2 days ago |
![]() |
97c3852f2f | 3 days ago |
![]() |
f739cac8b4 | 3 days ago |
![]() |
cd6a474cce | 3 days ago |
![]() |
4ffc11903e | 3 days ago |
![]() |
70d6cc63ca | 3 days ago |
![]() |
6e97e602c9 | 3 days ago |
![]() |
3251becf9b | 4 days ago |
![]() |
d9293c7262 | 4 days ago |
![]() |
929a01cd8c | 4 days ago |
![]() |
0d5803b9ca | 4 days ago |
![]() |
bbaaf27386 | 5 days ago |
![]() |
4c1121869d | 6 days ago |
![]() |
b918e87e05 | 1 week ago |
![]() |
df8f637239 | 1 week ago |
![]() |
9fad43c6c9 | 1 week ago |
![]() |
eb95cd24d7 | 1 week ago |
![]() |
30cb374a21 | 2 weeks ago |
![]() |
b09a8967e4 | 2 weeks ago |
![]() |
39b56296bd | 2 weeks ago |
![]() |
1d8d2efce6 | 2 weeks ago |
![]() |
c9af39b6ba | 2 weeks ago |
![]() |
f8bb045d76 | 2 weeks ago |
![]() |
4040a2379b | 2 weeks ago |
![]() |
c4ee7479ca | 2 weeks ago |
![]() |
be861597ef | 2 weeks ago |
![]() |
f27332595d | 2 weeks ago |
![]() |
ea7f051d85 | 2 weeks ago |
![]() |
8be7fab033 | 2 weeks ago |
![]() |
d6e0c0bdcf | 2 weeks ago |
![]() |
5ec02011f8 | 2 weeks ago |
![]() |
b35090cd43 | 2 weeks ago |
![]() |
92f62450ae | 2 weeks ago |
![]() |
3ca6912492 | 2 weeks ago |
![]() |
080b1428dd | 2 weeks ago |
![]() |
f67c3bc56c | 2 weeks ago |
![]() |
5d0e88a620 | 2 weeks ago |
![]() |
c5d5795fe2 | 2 weeks ago |
![]() |
3bbc0e0ab0 | 2 weeks ago |
![]() |
009a195580 | 2 weeks ago |
![]() |
772f69d8c0 | 3 weeks ago |
![]() |
4229bf7067 | 3 weeks ago |
![]() |
212a4b0a3d | 3 weeks ago |
![]() |
4ddfe937b0 | 3 weeks ago |
![]() |
19de0e08a5 | 3 weeks ago |
![]() |
60211355e0 | 3 weeks ago |
![]() |
17d218aa4e | 3 weeks ago |
![]() |
505c8c29d5 | 3 weeks ago |
![]() |
7149308c97 | 3 weeks ago |
![]() |
2c5a497007 | 3 weeks ago |
![]() |
09f53fe1e5 | 3 weeks ago |
![]() |
5da4183aed | 3 weeks ago |
![]() |
d35912e503 | 3 weeks ago |
![]() |
82fd99f83e | 3 weeks ago |
![]() |
f944becea1 | 3 weeks ago |
![]() |
acd713dc5b | 3 weeks ago |
![]() |
1a93c87ad9 | 3 weeks ago |
![]() |
c4e25b8b15 | 3 weeks ago |
![]() |
e11c0d2528 | 3 weeks ago |
![]() |
2fc6833854 | 3 weeks ago |
![]() |
4a2fb13d10 | 4 weeks ago |
![]() |
a2572e2dee | 4 weeks ago |
![]() |
64e05c9f8f | 4 weeks ago |
![]() |
ad833b5f49 | 4 weeks ago |
![]() |
eea944cc7b | 4 weeks ago |
![]() |
c82dfc7d39 | 4 weeks ago |
![]() |
8607f9556a | 4 weeks ago |
![]() |
f338e84d46 | 4 weeks ago |
![]() |
9ee739627e | 4 weeks ago |
![]() |
a49c233584 | 4 weeks ago |
![]() |
74fca07c1b | 4 weeks ago |
![]() |
5bd0cef42e | 4 weeks ago |
![]() |
4c245edbb4 | 4 weeks ago |
![]() |
97a3f074d0 | 4 weeks ago |
![]() |
86ecd3cf81 | 4 weeks ago |
![]() |
07a2eda5ea | 4 weeks ago |
![]() |
09ffbdd036 | 1 month ago |
![]() |
60f22146ca | 1 month ago |
![]() |
c11225abaf | 1 month ago |
![]() |
133ea493e3 | 1 month ago |
![]() |
0ba901be69 | 1 month ago |
![]() |
ebe5e5c009 | 1 month ago |
![]() |
d556863fda | 1 month ago |
![]() |
55adbc2025 | 1 month ago |
![]() |
06c4255886 | 1 month ago |
![]() |
4734a99bae | 1 month ago |
![]() |
a6a8cac8e4 | 1 month ago |
![]() |
c3fc9a57cc | 1 month ago |
![]() |
6e14d07d0c | 1 month ago |
![]() |
6118121698 | 1 month ago |
![]() |
6bf3bd4d08 | 1 month ago |
![]() |
065be79355 | 1 month ago |
![]() |
f8f8ba3c51 | 1 month ago |
![]() |
89465f36b3 | 1 month ago |
![]() |
1380a34ffa | 1 month ago |
![]() |
10af5280a3 | 1 month ago |
![]() |
8c0f7b952d | 1 month ago |
![]() |
65362b203f | 1 month ago |
![]() |
3327f97a17 | 1 month ago |
![]() |
c9fc02a42e | 1 month ago |
![]() |
93670bb9e4 | 1 month ago |
![]() |
1fc6a50d0b | 1 month ago |
![]() |
e1ef924909 | 1 month ago |
![]() |
686cb5d346 | 1 month ago |
![]() |
ebec25c4cb | 1 month ago |
![]() |
c140f7e673 | 1 month ago |
![]() |
efbcf11a4a | 1 month ago |
![]() |
6adee85a37 | 1 month ago |
![]() |
5c8643110b | 1 month ago |
![]() |
abd13aeb75 | 1 month ago |
![]() |
c210fe1893 | 1 month ago |
![]() |
26aa916c20 | 1 month ago |
![]() |
1eff2d1cd5 | 1 month ago |
![]() |
c90e683ea3 | 1 month ago |
![]() |
3cd0295b71 | 1 month ago |
![]() |
95c351e9fd | 1 month ago |
![]() |
4ddb7816f1 | 1 month ago |
![]() |
91c30f7bbf | 1 month ago |
![]() |
3f4398b6e0 | 1 month ago |
![]() |
c822e989a3 | 2 months ago |
![]() |
da146723e5 | 2 months ago |
![]() |
931626c84a | 2 months ago |
![]() |
c534632c52 | 2 months ago |
![]() |
c1347a7455 | 2 months ago |
![]() |
9544909a58 | 2 months ago |
![]() |
5c10dce2b9 | 2 months ago |
![]() |
584d4a5cbb | 2 months ago |
![]() |
7c68a7fa59 | 2 months ago |
![]() |
215cc838ef | 2 months ago |
![]() |
d60472d1bc | 2 months ago |
![]() |
f84a37a60a | 2 months ago |
![]() |
7fb85b6da1 | 2 months ago |
![]() |
dc90e583e4 | 2 months ago |
![]() |
0eac5f61eb | 2 months ago |
![]() |
c686ce883d | 2 months ago |
![]() |
ab25398cd0 | 2 months ago |
![]() |
3b1c133d22 | 2 months ago |
![]() |
3bfd0ab4f8 | 2 months ago |
![]() |
ffc0113d7f | 2 months ago |
![]() |
9de9718ad5 | 2 months ago |
![]() |
a7d2c9c406 | 2 months ago |
![]() |
b3006b9ac2 | 2 months ago |
![]() |
de3ef1f9c9 | 2 months ago |
![]() |
ce9e722a3f | 2 months ago |
![]() |
4b892a0eb1 | 2 months ago |
![]() |
e6e275834a | 2 months ago |
![]() |
782f4d6d7c | 2 months ago |
![]() |
a1da71d3e1 | 2 months ago |
![]() |
c793a300cc | 2 months ago |
![]() |
bf84bf9e82 | 2 months ago |
![]() |
363b29babb | 2 months ago |
![]() |
c1ff953f5c | 2 months ago |
![]() |
63482e5db9 | 2 months ago |
![]() |
2f7dc0c7f1 | 2 months ago |
![]() |
d672507fae | 2 months ago |
![]() |
ce2a3c8a3f | 2 months ago |
![]() |
9cd114d68b | 3 months ago |
![]() |
0e663f0e08 | 3 months ago |
![]() |
1d1efd008d | 3 months ago |
![]() |
26ab3d5866 | 3 months ago |
![]() |
9a4fcbbd39 | 3 months ago |
![]() |
72bfda9224 | 3 months ago |
![]() |
1067de4183 | 3 months ago |
![]() |
d686b8c7e0 | 3 months ago |
![]() |
b2efb42d55 | 3 months ago |
![]() |
3448808c94 | 3 months ago |
![]() |
06a9626052 | 3 months ago |
![]() |
e92ab7f7e1 | 3 months ago |
![]() |
4ff7b18c0f | 3 months ago |
![]() |
91887f6b17 | 3 months ago |
![]() |
cf30b56098 | 3 months ago |
![]() |
9bcadaab5a | 3 months ago |
![]() |
be766074b0 | 3 months ago |
![]() |
64a42a3f61 | 3 months ago |
![]() |
7b65ba6f06 | 3 months ago |
![]() |
ac2b270e9e | 3 months ago |
![]() |
db2ea0a039 | 3 months ago |
![]() |
08b78fe9f4 | 3 months ago |
![]() |
1a1301ae3e | 3 months ago |
![]() |
d00061aa7f | 3 months ago |
![]() |
45add6ab32 | 3 months ago |
![]() |
af43737c4e | 3 months ago |
![]() |
dd40e59b17 | 3 months ago |
![]() |
13f3248a01 | 3 months ago |
![]() |
f6972e3e30 | 3 months ago |
![]() |
83cf48a836 | 3 months ago |
![]() |
b7b4747a04 | 3 months ago |
![]() |
6bec2ceef0 | 3 months ago |
![]() |
d1e60d6512 | 3 months ago |
![]() |
2b85089d3a | 3 months ago |
![]() |
2a0ef9feb6 | 3 months ago |
![]() |
33adbbd884 | 3 months ago |
![]() |
c25eb2e0c5 | 3 months ago |
![]() |
14026356eb | 3 months ago |
![]() |
b328651dd4 | 3 months ago |
![]() |
a0e9bfabeb | 3 months ago |
![]() |
a1ad421b33 | 3 months ago |
![]() |
3488a08af1 | 3 months ago |
![]() |
b71d1af516 | 3 months ago |
![]() |
041dce8617 | 3 months ago |
![]() |
3d92ca78dd | 3 months ago |
![]() |
a32fce2d8b | 3 months ago |
![]() |
4fb3cda173 | 3 months ago |
![]() |
f33cc896dd | 3 months ago |
![]() |
4d1d6a06a8 | 3 months ago |
![]() |
2202516688 | 3 months ago |
![]() |
d4a5008ecb | 3 months ago |
![]() |
08189e10f1 | 3 months ago |
![]() |
d3e4c066d8 | 3 months ago |
![]() |
bbc5ae4d6d | 3 months ago |
![]() |
c6cc00cf07 | 3 months ago |
![]() |
22e8720021 | 3 months ago |
![]() |
a3ce98f0ea | 3 months ago |
![]() |
258f607d52 | 3 months ago |
![]() |
927acae7e4 | 3 months ago |
![]() |
49ad9bafe3 | 3 months ago |
![]() |
6df616d9ce | 3 months ago |
![]() |
157668e35a | 3 months ago |
![]() |
efdf343869 | 3 months ago |
![]() |
5606df17c5 | 3 months ago |
![]() |
fc3b4971f4 | 3 months ago |
![]() |
6a1699bb33 | 3 months ago |
![]() |
e49303d5ca | 3 months ago |
![]() |
4b55569b51 | 4 months ago |
![]() |
2d7145cde3 | 4 months ago |
![]() |
f2ab8bed95 | 4 months ago |
![]() |
a5bc4cf536 | 4 months ago |
![]() |
1b35372b3a | 4 months ago |
![]() |
c0fd4bf66a | 4 months ago |
![]() |
5d366f0d61 | 4 months ago |
![]() |
d0635ac6f3 | 4 months ago |
![]() |
8d4cf4daa5 | 4 months ago |
![]() |
d1e439e70e | 4 months ago |
![]() |
4d4c3e5193 | 4 months ago |
![]() |
20f87061fd | 4 months ago |
![]() |
c03e3747c6 | 4 months ago |
![]() |
925b1b9124 | 4 months ago |
![]() |
43db712f64 | 4 months ago |
![]() |
9d33a73ee6 | 4 months ago |
![]() |
391c600ce2 | 4 months ago |
![]() |
ee4ae94817 | 4 months ago |
![]() |
70b4be1447 | 4 months ago |
![]() |
bc54d92789 | 4 months ago |
![]() |
2f34724b95 | 4 months ago |
![]() |
940fdc28dd | 4 months ago |
![]() |
68542fce38 | 4 months ago |
![]() |
7ba2977100 | 4 months ago |
![]() |
cb242539f0 | 4 months ago |
![]() |
304841f2c3 | 4 months ago |
![]() |
819ea797e6 | 5 months ago |
![]() |
2dbea57262 | 5 months ago |
![]() |
516a916fd5 | 5 months ago |
![]() |
3bd52efc80 | 5 months ago |
![]() |
64af955ea7 | 5 months ago |
![]() |
4cc5ec9639 | 5 months ago |
![]() |
0d9292e53a | 5 months ago |
![]() |
732ccf1913 | 5 months ago |
![]() |
a2852bdbbf | 5 months ago |
![]() |
68790ad401 | 5 months ago |
![]() |
e9afacb595 | 5 months ago |
![]() |
cf182aceab | 5 months ago |
![]() |
db889d233a | 5 months ago |
![]() |
457b89c092 | 5 months ago |
![]() |
ad53af1b6a | 5 months ago |
![]() |
2c32b08c97 | 5 months ago |
![]() |
a2fcf57c9e | 5 months ago |
![]() |
59a61325f2 | 5 months ago |
![]() |
38a6064677 | 5 months ago |
![]() |
67daccf3e8 | 5 months ago |
![]() |
dfe829d2a1 | 5 months ago |
![]() |
23c64f4d28 | 5 months ago |
![]() |
e4b8f694f3 | 5 months ago |
![]() |
e667c80731 | 5 months ago |
![]() |
909b077e25 | 5 months ago |
![]() |
e6fab9ad45 | 5 months ago |
![]() |
9474f5b7af | 5 months ago |
![]() |
1ee051d768 | 5 months ago |
![]() |
f42edaa158 | 5 months ago |
![]() |
b97eade59c | 5 months ago |
![]() |
41aa1ca65f | 5 months ago |
![]() |
3e9a13ea14 | 5 months ago |
![]() |
d966e8a12b | 5 months ago |
![]() |
8ba4e64994 | 5 months ago |
![]() |
ee792f1ceb | 5 months ago |
![]() |
caa09163a1 | 5 months ago |
![]() |
d270abf5b3 | 5 months ago |
![]() |
1ef530abad | 5 months ago |
![]() |
df26a6dbb9 | 5 months ago |
![]() |
1882c3b7e0 | 6 months ago |
![]() |
cb53a0ca9f | 6 months ago |
![]() |
b2fdef1ae7 | 6 months ago |
![]() |
defb16ce95 | 6 months ago |
![]() |
823f99b28a | 6 months ago |
![]() |
6df872b1a1 | 6 months ago |
![]() |
133b960583 | 6 months ago |
![]() |
2e6753faec | 6 months ago |
![]() |
cb07c2c267 | 6 months ago |
![]() |
23757ab320 | 6 months ago |
![]() |
1b6ce0e48e | 6 months ago |
![]() |
5af012068f | 6 months ago |
![]() |
6c9ffa57d7 | 7 months ago |
![]() |
52c54b1eac | 7 months ago |
![]() |
c8d81b44b6 | 7 months ago |
![]() |
ef27a50e42 | 7 months ago |
![]() |
bde1356e7f | 7 months ago |
![]() |
6c031925ba | 7 months ago |
![]() |
8058414137 | 7 months ago |
![]() |
3e37ea50f0 | 7 months ago |
![]() |
62f5a9c492 | 7 months ago |
![]() |
a84fd65722 | 7 months ago |
![]() |
517b2d8f1b | 7 months ago |
![]() |
90942bf0be | 7 months ago |
![]() |
83c3d1c4ba | 7 months ago |
![]() |
6362ece569 | 7 months ago |
![]() |
8df85041b8 | 7 months ago |
![]() |
6d85af4c34 | 7 months ago |
![]() |
63f001dd72 | 7 months ago |
![]() |
de49a50944 | 7 months ago |
![]() |
df20d2f593 | 7 months ago |
![]() |
fd16772236 | 7 months ago |
![]() |
b77caac255 | 7 months ago |
![]() |
ad058ed09b | 7 months ago |
![]() |
8312113d7b | 7 months ago |
![]() |
ee21cc660e | 7 months ago |
![]() |
5edc481ffe | 7 months ago |
![]() |
d0360a4862 | 7 months ago |
![]() |
ac35002408 | 7 months ago |
![]() |
582ebad0f0 | 7 months ago |
![]() |
684c47184a | 7 months ago |
![]() |
ac7a519e4e | 7 months ago |
![]() |
5c2b41af9d | 7 months ago |
![]() |
13986cf380 | 7 months ago |
![]() |
c4f0b404e9 | 7 months ago |
![]() |
145b5afbc6 | 7 months ago |
![]() |
0b87a206fe | 7 months ago |
![]() |
d0e70ceea8 | 7 months ago |
![]() |
bf3546a878 | 7 months ago |
![]() |
8895acbf6b | 7 months ago |
![]() |
a52b1200f5 | 7 months ago |
![]() |
23964e807a | 7 months ago |
![]() |
287b106dd4 | 8 months ago |
![]() |
33bab626e0 | 8 months ago |
![]() |
a980cd75cc | 8 months ago |
![]() |
7eac4ac223 | 8 months ago |
![]() |
82cb2f7d3f | 8 months ago |
![]() |
da2646597c | 8 months ago |
![]() |
495855133c | 8 months ago |
![]() |
242cb61662 | 8 months ago |
![]() |
ab8886f3dc | 8 months ago |
![]() |
e48e92d2e6 | 8 months ago |
![]() |
5f22f5cd38 | 8 months ago |
![]() |
8a47cc2934 | 8 months ago |
![]() |
0d94729d37 | 8 months ago |
![]() |
14599eb3c0 | 8 months ago |
![]() |
b477623524 | 8 months ago |
![]() |
c8bfb67b50 | 8 months ago |
![]() |
0a36e58525 | 8 months ago |
![]() |
94a719cb66 | 8 months ago |
![]() |
b5748aa8e6 | 8 months ago |
![]() |
7fd5647cb8 | 8 months ago |
![]() |
2545832d67 | 8 months ago |
![]() |
738bf435db | 8 months ago |
![]() |
ab02323f29 | 8 months ago |
![]() |
d73a9d2795 | 8 months ago |
![]() |
ebe67354b6 | 8 months ago |
![]() |
58edc6b4d8 | 8 months ago |
![]() |
78b2cdac06 | 8 months ago |
![]() |
c3d7db0087 | 8 months ago |
![]() |
d7b1770b85 | 8 months ago |
![]() |
bebb3165a5 | 8 months ago |
![]() |
ad1198aace | 8 months ago |
![]() |
7ae77a81e1 | 8 months ago |
![]() |
3e79dd5190 | 8 months ago |
![]() |
9d57a849bf | 8 months ago |
![]() |
82103eb477 | 8 months ago |
![]() |
11fa9a2bbd | 8 months ago |
![]() |
b65831120f | 8 months ago |
![]() |
f26a90a4f9 | 8 months ago |
![]() |
dd3aa20485 | 8 months ago |
![]() |
8c84e1af50 | 8 months ago |
![]() |
dc1eac23b9 | 8 months ago |
![]() |
5883952883 | 8 months ago |
![]() |
775289b058 | 8 months ago |
![]() |
ee500c24b1 | 8 months ago |
![]() |
68fd36b14d | 8 months ago |
![]() |
b8f265fa36 | 8 months ago |
![]() |
cf4e6c1273 | 8 months ago |
![]() |
0dcc577497 | 8 months ago |
![]() |
b525e8cab3 | 8 months ago |
![]() |
db0ad280eb | 8 months ago |
![]() |
5092f80dcc | 8 months ago |
![]() |
6bc42363dd | 8 months ago |
![]() |
115461c7b0 | 8 months ago |
![]() |
369c508890 | 8 months ago |
![]() |
a432cc33cc | 8 months ago |
![]() |
e5b51150cb | 8 months ago |
![]() |
d43639556e | 8 months ago |
![]() |
ef2dd8f202 | 8 months ago |
![]() |
abc099c309 | 8 months ago |
![]() |
348367e084 | 8 months ago |
![]() |
6a73f6745c | 8 months ago |
![]() |
5185c14e44 | 8 months ago |
![]() |
aa7ff0fa16 | 8 months ago |
![]() |
12b979d363 | 8 months ago |
![]() |
082f741983 | 8 months ago |
![]() |
0bdd83988f | 8 months ago |
![]() |
60784c10b5 | 9 months ago |
![]() |
da8467ac56 | 9 months ago |
![]() |
434d067822 | 9 months ago |
![]() |
04af310285 | 9 months ago |
![]() |
5555771f45 | 9 months ago |
![]() |
35b60df0ff | 9 months ago |
![]() |
fef19b4995 | 9 months ago |
![]() |
4c25b81a4d | 9 months ago |
![]() |
0f37f4859e | 9 months ago |
![]() |
ee3d3fa4f5 | 9 months ago |
![]() |
a32d35720a | 9 months ago |
![]() |
bf6fe02fe3 | 9 months ago |
![]() |
6664defc16 | 9 months ago |
![]() |
b318b930a5 | 9 months ago |
![]() |
91d18fd675 | 9 months ago |
![]() |
94b6d7569b | 9 months ago |
![]() |
e70f5f3b24 | 9 months ago |
![]() |
68c21c4b1f | 9 months ago |
![]() |
cbcc7f9bee | 9 months ago |
![]() |
ba394b9db4 | 9 months ago |
![]() |
13298aa3be | 9 months ago |
![]() |
993c41b197 | 9 months ago |
![]() |
2bfc46f32b | 9 months ago |
![]() |
4c61353411 | 9 months ago |
![]() |
f8d3985e97 | 9 months ago |
![]() |
c2a9d21f01 | 9 months ago |
![]() |
20c81417a0 | 9 months ago |
![]() |
77c86bbfb4 | 9 months ago |
![]() |
7e9ec26f53 | 9 months ago |
![]() |
928ec9f647 | 9 months ago |
![]() |
84ab8d0517 | 9 months ago |
![]() |
db66a66578 | 9 months ago |
![]() |
ea8a4b5e2d | 9 months ago |
![]() |
5a4485818f | 9 months ago |
![]() |
1d348fcac9 | 9 months ago |
![]() |
79250cb8ff | 9 months ago |
![]() |
5d550df62e | 9 months ago |
![]() |
1267fbeb0d | 9 months ago |
![]() |
2b0e285b42 | 9 months ago |
![]() |
374f10c731 | 9 months ago |
![]() |
a38fdc065e | 9 months ago |
![]() |
6d4159eaac | 9 months ago |
![]() |
20fe494cd9 | 9 months ago |
![]() |
e7686bd9eb | 9 months ago |
![]() |
d4d721f060 | 9 months ago |
![]() |
1e9b39afd5 | 9 months ago |
![]() |
8878df27c4 | 9 months ago |
![]() |
07eb9db157 | 9 months ago |
![]() |
b4ad27152f | 9 months ago |
![]() |
417a1cca46 | 9 months ago |
![]() |
3a6086adbd | 9 months ago |
![]() |
9f3f0a9698 | 9 months ago |
![]() |
8a085861de | 9 months ago |
![]() |
7048f6a965 | 9 months ago |
![]() |
a9cb7b0e89 | 9 months ago |
![]() |
4c7e2caa73 | 9 months ago |
![]() |
3a5e45283a | 9 months ago |
![]() |
a1885574da | 9 months ago |
![]() |
113cf6f1b8 | 9 months ago |
![]() |
138cc21796 | 9 months ago |
![]() |
dea3484a2f | 9 months ago |
![]() |
5948e4a958 | 9 months ago |
![]() |
10d2e8feda | 9 months ago |
![]() |
cef7998a52 | 9 months ago |
![]() |
834bef7933 | 9 months ago |
![]() |
8ed6afff2b | 9 months ago |
![]() |
7d13e4f0ba | 9 months ago |
![]() |
5cb8419206 | 9 months ago |
![]() |
7283491872 | 9 months ago |
![]() |
2de5b3c275 | 9 months ago |
![]() |
864550d027 | 9 months ago |
![]() |
b48348f30e | 9 months ago |
![]() |
81fdddc631 | 9 months ago |
![]() |
21cb25d902 | 9 months ago |
![]() |
b73ba43735 | 9 months ago |
![]() |
a3ba87e4e6 | 9 months ago |
![]() |
26321633e2 | 9 months ago |
![]() |
1c3656a69c | 9 months ago |
![]() |
88bb66a7b3 | 9 months ago |
![]() |
0f7c200851 | 9 months ago |
![]() |
f6d5732c07 | 9 months ago |
![]() |
b278a04fce | 9 months ago |
![]() |
71c2e2b0f6 | 9 months ago |
![]() |
87639da922 | 9 months ago |
![]() |
d7e366712c | 9 months ago |
![]() |
74ecb4a8bf | 10 months ago |
![]() |
305bd24883 | 10 months ago |
![]() |
68b7bef1ca | 10 months ago |
![]() |
f6a6b0716f | 10 months ago |
![]() |
dced669176 | 10 months ago |
![]() |
1b431f7a61 | 10 months ago |
![]() |
2b3b7184e0 | 10 months ago |
![]() |
a7062fe937 | 10 months ago |
![]() |
573f6b897e | 10 months ago |
![]() |
e1845d71bc | 10 months ago |
![]() |
1027d57860 | 10 months ago |
![]() |
a2c92b8fd9 | 10 months ago |
![]() |
77643d7355 | 10 months ago |
![]() |
54911021a5 | 10 months ago |
![]() |
908ac19754 | 10 months ago |
![]() |
4ebd53fdf7 | 10 months ago |
![]() |
a0fbeba938 | 10 months ago |
![]() |
bd6000fcd6 | 10 months ago |
![]() |
aa861cb5e5 | 10 months ago |
![]() |
17818c6e29 | 10 months ago |
![]() |
ca6521db23 | 10 months ago |
![]() |
dedf306106 | 10 months ago |
![]() |
40f9b83dba | 10 months ago |
![]() |
c8b057867f | 10 months ago |
![]() |
d1ebd45492 | 10 months ago |
![]() |
ac28e26333 | 10 months ago |
![]() |
fdf9fbce08 | 10 months ago |
![]() |
6d712642b3 | 10 months ago |
![]() |
329939e2b0 | 10 months ago |
![]() |
f62de8b7f3 | 10 months ago |
![]() |
a2ef184c7d | 10 months ago |
![]() |
6ac2c88782 | 10 months ago |
![]() |
ada31293ea | 10 months ago |
![]() |
805d914ff4 | 10 months ago |
![]() |
aa1b4ef71a | 10 months ago |
![]() |
3d0cf46f8d | 10 months ago |
![]() |
f7e2c7824a | 10 months ago |
![]() |
2e2bdbe07a | 10 months ago |
![]() |
427ee369b4 | 10 months ago |
![]() |
804c0f974a | 11 months ago |
![]() |
691dc635a9 | 11 months ago |
![]() |
9f2364867b | 11 months ago |
![]() |
cd638bba71 | 11 months ago |
![]() |
156669cb86 | 11 months ago |
![]() |
6c1daf5a3c | 11 months ago |
![]() |
0a297c595f | 11 months ago |
![]() |
b698fc04db | 11 months ago |
![]() |
ab6f3463d0 | 11 months ago |
![]() |
dbcaa36812 | 11 months ago |
![]() |
83a42c9d8f | 11 months ago |
![]() |
ec97722857 | 11 months ago |
![]() |
dd78acadcd | 11 months ago |
![]() |
454faa234e | 11 months ago |
![]() |
55027ad625 | 11 months ago |
![]() |
13740c3d0d | 11 months ago |
![]() |
6037ee70e5 | 11 months ago |
![]() |
0f2e659e6f | 11 months ago |
![]() |
7945ecb9c4 | 11 months ago |
![]() |
56f0be50ff | 11 months ago |
![]() |
91d46c5f11 | 11 months ago |
![]() |
bab3898a7f | 11 months ago |
![]() |
7b12e491ad | 11 months ago |
![]() |
ce2bc81276 | 11 months ago |
![]() |
39ddc8d0d6 | 11 months ago |
![]() |
8081da3a36 | 11 months ago |
![]() |
766d5fa043 | 11 months ago |
![]() |
b2135f33c5 | 11 months ago |
![]() |
d1afb5891a | 11 months ago |
![]() |
dff522437d | 11 months ago |
![]() |
5308404ed6 | 11 months ago |
![]() |
320b399ab3 | 11 months ago |
![]() |
28c1ecaebc | 11 months ago |
![]() |
7083eb2ede | 11 months ago |
![]() |
194edd2084 | 11 months ago |
![]() |
e21637cb3c | 11 months ago |
![]() |
ee82f683bd | 11 months ago |
@ -1 +1 @@
|
||||
3.2.2
|
||||
3.3.3
|
||||
|
@ -1,263 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
|
||||
<!-- https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-8.16/src/main/resources/google_checks.xml -->
|
||||
|
||||
<!--
|
||||
Checkstyle configuration that checks the Google coding conventions from Google Java Style
|
||||
that can be found at https://google.github.io/styleguide/javaguide.html.
|
||||
|
||||
Checkstyle is very configurable. Be sure to read the documentation at
|
||||
http://checkstyle.sf.net (or in your downloaded distribution).
|
||||
|
||||
To completely disable a check, just comment it out or delete it from the file.
|
||||
|
||||
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
|
||||
-->
|
||||
|
||||
<module name = "Checker">
|
||||
<property name="charset" value="UTF-8"/>
|
||||
|
||||
<property name="severity" value="warning"/>
|
||||
|
||||
<property name="fileExtensions" value="java, properties, xml"/>
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="IllegalTokenText">
|
||||
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
|
||||
<property name="format"
|
||||
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
|
||||
<property name="message"
|
||||
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
|
||||
</module>
|
||||
<module name="AvoidEscapedUnicodeCharacters">
|
||||
<property name="allowEscapesForControlCharacters" value="true"/>
|
||||
<property name="allowByTailComment" value="true"/>
|
||||
<property name="allowNonPrintableEscapes" value="true"/>
|
||||
</module>
|
||||
<module name="LineLength">
|
||||
<property name="max" value="100"/>
|
||||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||
</module>
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="OneTopLevelClass"/>
|
||||
<module name="NoLineWrap"/>
|
||||
<module name="EmptyBlock">
|
||||
<property name="option" value="TEXT"/>
|
||||
<property name="tokens"
|
||||
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
|
||||
</module>
|
||||
<module name="NeedBraces"/>
|
||||
<module name="LeftCurly"/>
|
||||
<module name="RightCurly">
|
||||
<property name="id" value="RightCurlySame"/>
|
||||
<property name="tokens"
|
||||
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
|
||||
LITERAL_DO"/>
|
||||
</module>
|
||||
<module name="RightCurly">
|
||||
<property name="id" value="RightCurlyAlone"/>
|
||||
<property name="option" value="alone"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
|
||||
INSTANCE_INIT"/>
|
||||
</module>
|
||||
<module name="WhitespaceAround">
|
||||
<property name="allowEmptyConstructors" value="true"/>
|
||||
<property name="allowEmptyMethods" value="true"/>
|
||||
<property name="allowEmptyTypes" value="true"/>
|
||||
<property name="allowEmptyLoops" value="true"/>
|
||||
<message key="ws.notFollowed"
|
||||
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
|
||||
<message key="ws.notPreceded"
|
||||
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
<module name="OneStatementPerLine"/>
|
||||
<module name="MultipleVariableDeclarations"/>
|
||||
<module name="ArrayTypeStyle"/>
|
||||
<module name="MissingSwitchDefault"/>
|
||||
<module name="FallThrough"/>
|
||||
<module name="UpperEll"/>
|
||||
<module name="ModifierOrder"/>
|
||||
<module name="EmptyLineSeparator">
|
||||
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="id" value="SeparatorWrapDot"/>
|
||||
<property name="tokens" value="DOT"/>
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="id" value="SeparatorWrapComma"/>
|
||||
<property name="tokens" value="COMMA"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
|
||||
<property name="id" value="SeparatorWrapEllipsis"/>
|
||||
<property name="tokens" value="ELLIPSIS"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
|
||||
<property name="id" value="SeparatorWrapArrayDeclarator"/>
|
||||
<property name="tokens" value="ARRAY_DECLARATOR"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="id" value="SeparatorWrapMethodRef"/>
|
||||
<property name="tokens" value="METHOD_REF"/>
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
<module name="PackageName">
|
||||
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Package name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="TypeName">
|
||||
<message key="name.invalidPattern"
|
||||
value="Type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="MemberName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Member name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ParameterName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="LambdaParameterName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="CatchParameterName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="LocalVariableName">
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ClassTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Class type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="MethodTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Method type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="InterfaceTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="NoFinalizer"/>
|
||||
<module name="GenericWhitespace">
|
||||
<message key="ws.followed"
|
||||
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
|
||||
<message key="ws.preceded"
|
||||
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
|
||||
<message key="ws.illegalFollow"
|
||||
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
|
||||
<message key="ws.notPreceded"
|
||||
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
<module name="Indentation">
|
||||
<property name="basicOffset" value="2"/>
|
||||
<property name="braceAdjustment" value="0"/>
|
||||
<property name="caseIndent" value="2"/>
|
||||
<property name="throwsIndent" value="4"/>
|
||||
<property name="lineWrappingIndentation" value="4"/>
|
||||
<property name="arrayInitIndent" value="2"/>
|
||||
</module>
|
||||
<module name="AbbreviationAsWordInName">
|
||||
<property name="ignoreFinal" value="false"/>
|
||||
<property name="allowedAbbreviationLength" value="1"/>
|
||||
</module>
|
||||
<module name="OverloadMethodsDeclarationOrder"/>
|
||||
<module name="VariableDeclarationUsageDistance"/>
|
||||
<module name="CustomImportOrder">
|
||||
<property name="sortImportsInGroupAlphabetically" value="true"/>
|
||||
<property name="separateLineBetweenGroups" value="true"/>
|
||||
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
|
||||
</module>
|
||||
<module name="MethodParamPad"/>
|
||||
<module name="NoWhitespaceBefore">
|
||||
<property name="tokens"
|
||||
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
|
||||
<property name="allowLineBreaks" value="true"/>
|
||||
</module>
|
||||
<module name="ParenPad"/>
|
||||
<module name="OperatorWrap">
|
||||
<property name="option" value="NL"/>
|
||||
<property name="tokens"
|
||||
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
|
||||
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
|
||||
</module>
|
||||
<module name="AnnotationLocation">
|
||||
<property name="id" value="AnnotationLocationMostCases"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="AnnotationLocation">
|
||||
<property name="id" value="AnnotationLocationVariables"/>
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="allowSamelineMultipleAnnotations" value="true"/>
|
||||
</module>
|
||||
<module name="NonEmptyAtclauseDescription"/>
|
||||
<module name="JavadocTagContinuationIndentation">
|
||||
<property name="severity" value="ignore" />
|
||||
</module>
|
||||
<module name="SummaryJavadoc">
|
||||
<property name="severity" value="ignore" />
|
||||
<property name="forbiddenSummaryFragments"
|
||||
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
|
||||
</module>
|
||||
<module name="JavadocParagraph">
|
||||
<property name="severity" value="ignore" />
|
||||
</module>
|
||||
<module name="AtclauseOrder">
|
||||
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
|
||||
<property name="target"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
|
||||
</module>
|
||||
<module name="JavadocMethod">
|
||||
<property name="severity" value="ignore" />
|
||||
<property name="scope" value="public"/>
|
||||
<property name="allowMissingParamTags" value="true"/>
|
||||
<property name="allowMissingThrowsTags" value="true"/>
|
||||
<property name="allowMissingReturnTag" value="true"/>
|
||||
<property name="minLineCount" value="2"/>
|
||||
<property name="allowedAnnotations" value="Override, Test"/>
|
||||
<property name="allowThrowsTagsForSubclasses" value="true"/>
|
||||
</module>
|
||||
<module name="MethodName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Method name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="SingleLineJavadoc">
|
||||
<property name="severity" value="ignore"/>
|
||||
</module>
|
||||
<module name="EmptyCatchBlock">
|
||||
<property name="exceptionVariableName" value="expected"/>
|
||||
</module>
|
||||
<module name="CommentsIndentation"/>
|
||||
</module>
|
||||
</module>
|
@ -1,106 +1,290 @@
|
||||
package com.todoroo.astrid.alarms
|
||||
|
||||
import com.natpryce.makeiteasy.MakeItEasy.with
|
||||
import com.todoroo.andlib.utility.DateUtilities
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import dagger.hilt.android.testing.UninstallModules
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.tasks.data.Alarm
|
||||
import org.tasks.data.Alarm.Companion.TYPE_DATE_TIME
|
||||
import org.tasks.data.Alarm.Companion.TYPE_RANDOM
|
||||
import org.tasks.data.Alarm.Companion.TYPE_SNOOZE
|
||||
import org.tasks.data.Alarm.Companion.whenDue
|
||||
import org.tasks.data.Alarm.Companion.whenOverdue
|
||||
import org.tasks.data.AlarmDao
|
||||
import org.tasks.data.TaskDao
|
||||
import org.tasks.date.DateTimeUtils.newDateTime
|
||||
import org.tasks.SuspendFreeze.Companion.freezeAt
|
||||
import org.tasks.data.createDueDate
|
||||
import org.tasks.data.dao.TaskDao
|
||||
import org.tasks.data.entity.Alarm
|
||||
import org.tasks.data.entity.Notification
|
||||
import org.tasks.data.entity.Task
|
||||
import org.tasks.injection.InjectingTestCase
|
||||
import org.tasks.injection.ProductionModule
|
||||
import org.tasks.jobs.AlarmEntry
|
||||
import org.tasks.jobs.NotificationQueue
|
||||
import org.tasks.makers.TaskMaker.COMPLETION_TIME
|
||||
import org.tasks.makers.TaskMaker.DELETION_TIME
|
||||
import org.tasks.makers.TaskMaker.DUE_DATE
|
||||
import org.tasks.makers.TaskMaker.DUE_TIME
|
||||
import org.tasks.makers.TaskMaker.REMINDER_LAST
|
||||
import org.tasks.makers.TaskMaker.newTask
|
||||
import org.tasks.time.DateTime
|
||||
import org.tasks.time.DateTimeUtils2
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
@UninstallModules(ProductionModule::class)
|
||||
@HiltAndroidTest
|
||||
class AlarmJobServiceTest : InjectingTestCase() {
|
||||
@Inject lateinit var alarmDao: AlarmDao
|
||||
@Inject lateinit var taskDao: TaskDao
|
||||
@Inject lateinit var jobs: NotificationQueue
|
||||
@Inject lateinit var alarmService: AlarmService
|
||||
|
||||
@Test
|
||||
fun scheduleAlarm() = runBlocking {
|
||||
val task = taskDao.createNew(newTask())
|
||||
val alarm = insertAlarm(Alarm(task, DateTime(2017, 9, 24, 19, 57).millis, TYPE_DATE_TIME))
|
||||
fun testNoAlarms() = runBlocking {
|
||||
testResults(emptyList(), 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun futureAlarmWithNoPastAlarm() = runBlocking {
|
||||
freezeAt(DateTime(2024, 5, 17, 23, 20)) {
|
||||
taskDao.insert(
|
||||
Task(
|
||||
dueDate = createDueDate(
|
||||
Task.URGENCY_SPECIFIC_DAY,
|
||||
DateTime(2024, 5, 18).millis
|
||||
)
|
||||
)
|
||||
)
|
||||
alarmService.synchronizeAlarms(1, mutableSetOf(Alarm(type = Alarm.TYPE_REL_END)))
|
||||
|
||||
verify(AlarmEntry(alarm, task, DateTime(2017, 9, 24, 19, 57).millis, TYPE_DATE_TIME))
|
||||
testResults(emptyList(), DateTime(2024, 5, 18, 18, 0).millis)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ignoreStaleAlarm() = runBlocking {
|
||||
val alarmTime = DateTime(2017, 9, 24, 19, 57)
|
||||
val task = taskDao.createNew(newTask(with(REMINDER_LAST, alarmTime.endOfMinute())))
|
||||
alarmDao.insert(Alarm(task, alarmTime.millis, TYPE_DATE_TIME))
|
||||
fun pastAlarmWithNoFutureAlarm() = runBlocking {
|
||||
freezeAt(DateTime(2024, 5, 17, 23, 20)) {
|
||||
taskDao.insert(
|
||||
Task(
|
||||
dueDate = createDueDate(
|
||||
Task.URGENCY_SPECIFIC_DAY,
|
||||
DateTime(2024, 5, 17).millis
|
||||
)
|
||||
)
|
||||
)
|
||||
alarmService.synchronizeAlarms(1, mutableSetOf(Alarm(type = Alarm.TYPE_REL_END)))
|
||||
|
||||
verify()
|
||||
testResults(
|
||||
listOf(
|
||||
Notification(
|
||||
taskId = 1L,
|
||||
timestamp = DateTimeUtils2.currentTimeMillis(),
|
||||
type = Alarm.TYPE_REL_END
|
||||
)
|
||||
),
|
||||
0
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dontScheduleReminderForCompletedTask() = runBlocking {
|
||||
val task = taskDao.insert(
|
||||
newTask(
|
||||
with(DUE_DATE, newDateTime()),
|
||||
with(COMPLETION_TIME, newDateTime())
|
||||
fun pastRecurringAlarmWithFutureRecurrence() = runBlocking {
|
||||
freezeAt(DateTime(2024, 5, 17, 23, 20)) {
|
||||
taskDao.insert(
|
||||
Task(
|
||||
dueDate = createDueDate(
|
||||
Task.URGENCY_SPECIFIC_DAY,
|
||||
DateTime(2024, 5, 17).millis
|
||||
)
|
||||
)
|
||||
)
|
||||
alarmService.synchronizeAlarms(
|
||||
1,
|
||||
mutableSetOf(
|
||||
Alarm(
|
||||
type = Alarm.TYPE_REL_END,
|
||||
repeat = 1,
|
||||
interval = TimeUnit.HOURS.toMillis(6)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
alarmDao.insert(whenDue(task))
|
||||
|
||||
verify()
|
||||
testResults(
|
||||
listOf(
|
||||
Notification(
|
||||
taskId = 1L,
|
||||
timestamp = DateTimeUtils2.currentTimeMillis(),
|
||||
type = Alarm.TYPE_REL_END
|
||||
)
|
||||
),
|
||||
DateTime(2024, 5, 18, 0, 0).millis
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dontScheduleReminderForDeletedTask() = runBlocking {
|
||||
val task = taskDao.insert(
|
||||
newTask(
|
||||
with(DUE_DATE, newDateTime()),
|
||||
with(DELETION_TIME, newDateTime())
|
||||
fun pastAlarmsRemoveSnoozed() = runBlocking {
|
||||
freezeAt(DateTime(2024, 5, 17, 23, 20)) {
|
||||
taskDao.insert(
|
||||
Task(
|
||||
dueDate = createDueDate(
|
||||
Task.URGENCY_SPECIFIC_DAY,
|
||||
DateTime(2024, 5, 17).millis
|
||||
)
|
||||
)
|
||||
)
|
||||
alarmService.synchronizeAlarms(
|
||||
1,
|
||||
mutableSetOf(
|
||||
Alarm(type = Alarm.TYPE_REL_END),
|
||||
Alarm(time = DateTimeUtils2.currentTimeMillis(), type = Alarm.TYPE_SNOOZE)
|
||||
)
|
||||
)
|
||||
)
|
||||
alarmDao.insert(whenDue(task))
|
||||
|
||||
verify()
|
||||
testResults(
|
||||
listOf(
|
||||
Notification(
|
||||
taskId = 1L,
|
||||
timestamp = DateTimeUtils2.currentTimeMillis(),
|
||||
type = Alarm.TYPE_REL_END
|
||||
)
|
||||
),
|
||||
0
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
listOf(Alarm(id = 1, task = 1, time = 0, type = Alarm.TYPE_REL_END)),
|
||||
alarmService.getAlarms(1)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun snoozeOverridesAll() = runBlocking {
|
||||
val now = newDateTime()
|
||||
val task = taskDao.insert(newTask(with(DUE_TIME, now)))
|
||||
fun alarmsOneMinuteApart() = runBlocking {
|
||||
freezeAt(DateTime(2024, 5, 17, 23, 20)) {
|
||||
taskDao.insert(
|
||||
Task(
|
||||
dueDate = createDueDate(
|
||||
Task.URGENCY_SPECIFIC_DAY_TIME,
|
||||
DateTime(2024, 5, 17, 23, 20).millis
|
||||
)
|
||||
)
|
||||
)
|
||||
alarmService.synchronizeAlarms(1, mutableSetOf(Alarm(type = Alarm.TYPE_REL_END)))
|
||||
taskDao.insert(Task())
|
||||
alarmService.synchronizeAlarms(
|
||||
taskId = 2,
|
||||
alarms = mutableSetOf(
|
||||
Alarm(
|
||||
type = Alarm.TYPE_SNOOZE,
|
||||
time = DateTime(2024, 5, 17, 23, 21).millis)
|
||||
)
|
||||
)
|
||||
|
||||
testResults(
|
||||
listOf(
|
||||
Notification(
|
||||
taskId = 1L,
|
||||
timestamp = DateTimeUtils2.currentTimeMillis(),
|
||||
type = Alarm.TYPE_REL_END
|
||||
)
|
||||
),
|
||||
DateTime(2024, 5, 17, 23, 21).millis
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
alarmDao.insert(whenDue(task))
|
||||
alarmDao.insert(whenOverdue(task))
|
||||
alarmDao.insert(Alarm(task, DateUtilities.ONE_HOUR, TYPE_RANDOM))
|
||||
val alarm = alarmDao.insert(Alarm(task, now.plusMonths(12).millis, TYPE_SNOOZE))
|
||||
@Test
|
||||
fun futureSnoozeOverrideOverdue() = runBlocking {
|
||||
freezeAt(DateTime(2024, 5, 17, 23, 20)) {
|
||||
taskDao.insert(
|
||||
Task(
|
||||
dueDate = createDueDate(
|
||||
Task.URGENCY_SPECIFIC_DAY,
|
||||
DateTime(2024, 5, 17).millis
|
||||
)
|
||||
)
|
||||
)
|
||||
alarmService.synchronizeAlarms(
|
||||
1,
|
||||
mutableSetOf(
|
||||
Alarm(type = Alarm.TYPE_REL_END),
|
||||
Alarm(
|
||||
time = DateTimeUtils2.currentTimeMillis() + TimeUnit.MINUTES.toMillis(5),
|
||||
type = Alarm.TYPE_SNOOZE
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
verify(AlarmEntry(alarm, task, now.plusMonths(12).millis, TYPE_SNOOZE))
|
||||
testResults(
|
||||
emptyList(),
|
||||
DateTimeUtils2.currentTimeMillis() + TimeUnit.MINUTES.toMillis(5)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ignoreStaleAlarm() = runBlocking {
|
||||
freezeAt(DateTime(2024, 5, 17, 23, 20)) {
|
||||
taskDao.insert(
|
||||
Task(
|
||||
dueDate = createDueDate(
|
||||
Task.URGENCY_SPECIFIC_DAY,
|
||||
DateTime(2024, 5, 17).millis
|
||||
),
|
||||
reminderLast = DateTime(2024, 5, 17, 18, 0).millis,
|
||||
)
|
||||
)
|
||||
alarmService.synchronizeAlarms(
|
||||
1,
|
||||
mutableSetOf(Alarm(type = Alarm.TYPE_REL_END))
|
||||
)
|
||||
|
||||
testResults(
|
||||
emptyList(),
|
||||
0
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun insertAlarm(alarm: Alarm): Long {
|
||||
alarm.id = alarmDao.insert(alarm)
|
||||
return alarm.id
|
||||
@Test
|
||||
fun dontScheduleForCompletedTask() = runBlocking {
|
||||
freezeAt(DateTime(2024, 5, 17, 23, 20)) {
|
||||
taskDao.insert(
|
||||
Task(
|
||||
dueDate = createDueDate(
|
||||
Task.URGENCY_SPECIFIC_DAY,
|
||||
DateTime(2024, 5, 17).millis
|
||||
),
|
||||
completionDate = DateTime(2024, 5, 17, 14, 0).millis,
|
||||
)
|
||||
)
|
||||
alarmService.synchronizeAlarms(
|
||||
1,
|
||||
mutableSetOf(Alarm(type = Alarm.TYPE_REL_END))
|
||||
)
|
||||
|
||||
testResults(
|
||||
emptyList(),
|
||||
0
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun verify(vararg alarms: AlarmEntry) {
|
||||
alarmService.scheduleAllAlarms()
|
||||
@Test
|
||||
fun dontScheduleForDeletedTask() = runBlocking {
|
||||
freezeAt(DateTime(2024, 5, 17, 23, 20)) {
|
||||
taskDao.insert(
|
||||
Task(
|
||||
dueDate = createDueDate(
|
||||
Task.URGENCY_SPECIFIC_DAY,
|
||||
DateTime(2024, 5, 17).millis
|
||||
),
|
||||
deletionDate = DateTime(2024, 5, 17, 14, 0).millis,
|
||||
)
|
||||
)
|
||||
alarmService.synchronizeAlarms(
|
||||
1,
|
||||
mutableSetOf(Alarm(type = Alarm.TYPE_REL_END))
|
||||
)
|
||||
|
||||
testResults(
|
||||
emptyList(),
|
||||
0
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
assertEquals(alarms.toList(), jobs.getJobs())
|
||||
private suspend fun testResults(notifications: List<Notification>, nextAlarm: Long) {
|
||||
val actualNextAlarm = alarmService.triggerAlarms {
|
||||
assertEquals(notifications, it)
|
||||
it.forEach { taskDao.setLastNotified(it.taskId, DateTimeUtils2.currentTimeMillis()) }
|
||||
}
|
||||
assertEquals(nextAlarm, actualNextAlarm)
|
||||
}
|
||||
}
|
@ -1,50 +1,68 @@
|
||||
package com.todoroo.astrid.repeats
|
||||
|
||||
import com.natpryce.makeiteasy.MakeItEasy.with
|
||||
import org.tasks.data.entity.Task
|
||||
import com.todoroo.astrid.service.TaskCompleter
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import dagger.hilt.android.testing.UninstallModules
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.tasks.data.TaskDao
|
||||
import org.tasks.data.dao.TaskDao
|
||||
import org.tasks.injection.InjectingTestCase
|
||||
import org.tasks.injection.ProductionModule
|
||||
import org.tasks.makers.TaskMaker.COMPLETION_TIME
|
||||
import org.tasks.makers.TaskMaker.PARENT
|
||||
import org.tasks.makers.TaskMaker.RECUR
|
||||
import org.tasks.makers.TaskMaker.newTask
|
||||
import org.tasks.time.DateTime
|
||||
import org.tasks.time.DateTimeUtils2.currentTimeMillis
|
||||
import javax.inject.Inject
|
||||
|
||||
@UninstallModules(ProductionModule::class)
|
||||
@HiltAndroidTest
|
||||
class RepeatWithSubtasksTests : InjectingTestCase() {
|
||||
@Inject lateinit var taskDao: TaskDao
|
||||
@Inject lateinit var repeat: RepeatTaskHelper
|
||||
@Inject lateinit var taskCompleter: TaskCompleter
|
||||
|
||||
@Test
|
||||
fun uncompleteGrandchildren() = runBlocking {
|
||||
val grandparent = taskDao.createNew(newTask(with(RECUR, "RRULE:FREQ=DAILY")))
|
||||
val parent = taskDao.createNew(newTask(with(PARENT, grandparent)))
|
||||
val child = taskDao.createNew(newTask(
|
||||
with(PARENT, parent),
|
||||
with(COMPLETION_TIME, DateTime())
|
||||
))
|
||||
val grandparent = taskDao.createNew(
|
||||
Task(
|
||||
recurrence = "RRULE:FREQ=DAILY"
|
||||
)
|
||||
)
|
||||
val parent = taskDao.createNew(
|
||||
Task(
|
||||
parent = grandparent
|
||||
)
|
||||
)
|
||||
val child = taskDao.createNew(
|
||||
Task(
|
||||
parent = parent,
|
||||
completionDate = currentTimeMillis(),
|
||||
)
|
||||
)
|
||||
|
||||
repeat.handleRepeat(taskDao.fetch(grandparent)!!)
|
||||
assertTrue(taskDao.fetch(child)!!.isCompleted)
|
||||
|
||||
taskCompleter.setComplete(grandparent)
|
||||
|
||||
assertFalse(taskDao.fetch(child)!!.isCompleted)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun uncompleteGoogleTaskChildren() = runBlocking {
|
||||
val parent = taskDao.createNew(newTask(with(RECUR, "RRULE:FREQ=DAILY")))
|
||||
val child = taskDao.createNew(newTask(
|
||||
with(PARENT, parent),
|
||||
with(COMPLETION_TIME, DateTime())
|
||||
))
|
||||
val parent = taskDao.createNew(
|
||||
Task(
|
||||
recurrence = "RRULE:FREQ=DAILY"
|
||||
)
|
||||
)
|
||||
val child = taskDao.createNew(
|
||||
Task(
|
||||
parent = parent,
|
||||
completionDate = currentTimeMillis(),
|
||||
)
|
||||
)
|
||||
|
||||
assertTrue(taskDao.fetch(child)!!.isCompleted)
|
||||
|
||||
repeat.handleRepeat(taskDao.fetch(parent)!!)
|
||||
taskCompleter.setComplete(parent)
|
||||
|
||||
assertFalse(taskDao.fetch(child)!!.isCompleted)
|
||||
}
|
||||
|
@ -0,0 +1,161 @@
|
||||
package org.tasks.ui.editviewmodel
|
||||
|
||||
import com.todoroo.astrid.core.BuiltInFilterExposer
|
||||
import org.tasks.data.entity.Task
|
||||
import com.todoroo.astrid.service.TaskDeleter
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import dagger.hilt.android.testing.UninstallModules
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.tasks.LocalBroadcastManager
|
||||
import org.tasks.analytics.Firebase
|
||||
import org.tasks.billing.Inventory
|
||||
import org.tasks.data.dao.DeletionDao
|
||||
import org.tasks.data.dao.TaskDao
|
||||
import org.tasks.injection.InjectingTestCase
|
||||
import org.tasks.injection.ProductionModule
|
||||
import org.tasks.preferences.Preferences
|
||||
import org.tasks.time.DateTimeUtils2.currentTimeMillis
|
||||
import org.tasks.ui.TaskListViewModel
|
||||
import javax.inject.Inject
|
||||
|
||||
@UninstallModules(ProductionModule::class)
|
||||
@HiltAndroidTest
|
||||
class TaskListViewModelTest : InjectingTestCase() {
|
||||
private lateinit var viewModel: TaskListViewModel
|
||||
@Inject lateinit var preferences: Preferences
|
||||
@Inject lateinit var taskDao: TaskDao
|
||||
@Inject lateinit var taskDeleter: TaskDeleter
|
||||
@Inject lateinit var deletionDao: DeletionDao
|
||||
@Inject lateinit var localBroadcastManager: LocalBroadcastManager
|
||||
@Inject lateinit var inventory: Inventory
|
||||
@Inject lateinit var firebase: Firebase
|
||||
|
||||
@Before
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
viewModel = TaskListViewModel(
|
||||
context = context,
|
||||
preferences = preferences,
|
||||
taskDao = taskDao,
|
||||
deletionDao = deletionDao,
|
||||
taskDeleter = taskDeleter,
|
||||
localBroadcastManager = localBroadcastManager,
|
||||
inventory = inventory,
|
||||
firebase = firebase,
|
||||
)
|
||||
viewModel.setFilter(BuiltInFilterExposer.getMyTasksFilter(context.resources))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun clearCompletedTask() = runBlocking {
|
||||
val task = taskDao.createNew(
|
||||
Task(completionDate = currentTimeMillis())
|
||||
)
|
||||
|
||||
clearCompleted()
|
||||
|
||||
assertTrue(taskDao.fetch(task)!!.isDeleted)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dontDeleteTaskWithRecurringParent() = runBlocking {
|
||||
val parent = taskDao.createNew(
|
||||
Task(
|
||||
recurrence = "RRULE:FREQ=DAILY;INTERVAL=1"
|
||||
)
|
||||
)
|
||||
val child = taskDao.createNew(
|
||||
Task(
|
||||
parent = parent,
|
||||
completionDate = currentTimeMillis(),
|
||||
)
|
||||
)
|
||||
|
||||
clearCompleted()
|
||||
|
||||
assertFalse(taskDao.fetch(child)!!.isDeleted)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dontDeleteTaskWithRecurringGrandparent() = runBlocking {
|
||||
val grandparent = taskDao.createNew(
|
||||
Task(recurrence = "RRULE:FREQ=DAILY;INTERVAL=1")
|
||||
)
|
||||
val parent = taskDao.createNew(
|
||||
Task(parent = grandparent)
|
||||
)
|
||||
val child = taskDao.createNew(
|
||||
Task(
|
||||
parent = parent,
|
||||
completionDate = currentTimeMillis(),
|
||||
)
|
||||
)
|
||||
|
||||
clearCompleted()
|
||||
|
||||
assertFalse(taskDao.fetch(child)!!.isDeleted)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun clearGrandchildWithNoRecurringAncestors() = runBlocking {
|
||||
val grandparent = taskDao.createNew(Task())
|
||||
val parent = taskDao.createNew(
|
||||
Task(parent = grandparent)
|
||||
)
|
||||
val child = taskDao.createNew(
|
||||
Task(
|
||||
parent = parent,
|
||||
completionDate = currentTimeMillis(),
|
||||
)
|
||||
)
|
||||
|
||||
clearCompleted()
|
||||
|
||||
assertTrue(taskDao.fetch(child)!!.isDeleted)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun clearGrandchildWithCompletedRecurringAncestor() = runBlocking {
|
||||
val grandparent = taskDao.createNew(
|
||||
Task(
|
||||
recurrence = "RRULE:FREQ=DAILY;INTERVAL=1",
|
||||
completionDate = currentTimeMillis(),
|
||||
)
|
||||
)
|
||||
val parent = taskDao.createNew(
|
||||
Task(parent = grandparent)
|
||||
)
|
||||
val child = taskDao.createNew(
|
||||
Task(
|
||||
parent = parent,
|
||||
completionDate = currentTimeMillis(),
|
||||
)
|
||||
)
|
||||
|
||||
clearCompleted()
|
||||
|
||||
assertTrue(taskDao.fetch(child)!!.isDeleted)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun clearHiddenSubtask() = runBlocking {
|
||||
preferences.showCompleted = false
|
||||
val parent = taskDao.createNew(Task())
|
||||
val child = taskDao.createNew(
|
||||
Task(
|
||||
parent = parent,
|
||||
completionDate = currentTimeMillis(),
|
||||
)
|
||||
)
|
||||
|
||||
clearCompleted()
|
||||
|
||||
assertTrue(taskDao.fetch(child)!!.isDeleted)
|
||||
}
|
||||
|
||||
private suspend fun clearCompleted() = viewModel.markDeleted(viewModel.getTasksToClear())
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package com.todoroo.andlib.data
|
||||
|
||||
import com.todoroo.andlib.sql.Field
|
||||
|
||||
class Property internal constructor(val name: String?, expression: String) : Field(expression) {
|
||||
|
||||
constructor(table: Table, columnName: String) : this(columnName, "${table.name()}.$columnName")
|
||||
}
|
@ -1,234 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Todoroo Inc
|
||||
*
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
|
||||
package com.todoroo.andlib.utility;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Build.VERSION;
|
||||
import android.os.Build.VERSION_CODES;
|
||||
import android.os.Looper;
|
||||
import android.text.InputType;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.tasks.BuildConfig;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
/**
|
||||
* Android Utility Classes
|
||||
*
|
||||
* @author Tim Su <tim@todoroo.com>
|
||||
*/
|
||||
public class AndroidUtilities {
|
||||
|
||||
public static final String SEPARATOR_ESCAPE = "!PIPE!"; // $NON-NLS-1$
|
||||
public static final String SERIALIZATION_SEPARATOR = "|"; // $NON-NLS-1$
|
||||
|
||||
// --- utility methods
|
||||
|
||||
/** Suppress virtual keyboard until user's first tap */
|
||||
public static void suppressVirtualKeyboard(final TextView editor) {
|
||||
final int inputType = editor.getInputType();
|
||||
editor.setInputType(InputType.TYPE_NULL);
|
||||
editor.setOnTouchListener(
|
||||
(v, event) -> {
|
||||
editor.setInputType(inputType);
|
||||
editor.setOnTouchListener(null);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
// --- serialization
|
||||
|
||||
/** Serializes a content value into a string */
|
||||
public static String mapToSerializedString(Map<String, Object> source) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (Entry<String, Object> entry : source.entrySet()) {
|
||||
addSerialized(result, entry.getKey(), entry.getValue());
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/** add serialized helper */
|
||||
private static void addSerialized(StringBuilder result, String key, Object value) {
|
||||
result
|
||||
.append(key.replace(SERIALIZATION_SEPARATOR, SEPARATOR_ESCAPE))
|
||||
.append(SERIALIZATION_SEPARATOR);
|
||||
if (value instanceof Integer) {
|
||||
result.append('i').append(value);
|
||||
} else if (value instanceof Double) {
|
||||
result.append('d').append(value);
|
||||
} else if (value instanceof Long) {
|
||||
result.append('l').append(value);
|
||||
} else if (value instanceof String) {
|
||||
result
|
||||
.append('s')
|
||||
.append(value.toString().replace(SERIALIZATION_SEPARATOR, SEPARATOR_ESCAPE));
|
||||
} else if (value instanceof Boolean) {
|
||||
result.append('b').append(value);
|
||||
} else {
|
||||
throw new UnsupportedOperationException(value.getClass().toString());
|
||||
}
|
||||
result.append(SERIALIZATION_SEPARATOR);
|
||||
}
|
||||
|
||||
public static Map<String, Object> mapFromSerializedString(String string) {
|
||||
if (string == null) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
fromSerialized(
|
||||
string,
|
||||
result,
|
||||
(object, key, type, value) -> {
|
||||
switch (type) {
|
||||
case 'i':
|
||||
object.put(key, Integer.parseInt(value));
|
||||
break;
|
||||
case 'd':
|
||||
object.put(key, Double.parseDouble(value));
|
||||
break;
|
||||
case 'l':
|
||||
object.put(key, Long.parseLong(value));
|
||||
break;
|
||||
case 's':
|
||||
object.put(key, value.replace(SEPARATOR_ESCAPE, SERIALIZATION_SEPARATOR));
|
||||
break;
|
||||
case 'b':
|
||||
object.put(key, Boolean.parseBoolean(value));
|
||||
break;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
private static <T> void fromSerialized(String string, T object, SerializedPut<T> putter) {
|
||||
String[] pairs = string.split("\\" + SERIALIZATION_SEPARATOR); // $NON-NLS-1$
|
||||
for (int i = 0; i < pairs.length; i += 2) {
|
||||
try {
|
||||
String key = pairs[i].replaceAll(SEPARATOR_ESCAPE, SERIALIZATION_SEPARATOR);
|
||||
String value = pairs[i + 1].substring(1);
|
||||
try {
|
||||
putter.put(object, key, pairs[i + 1].charAt(0), value);
|
||||
} catch (NumberFormatException e) {
|
||||
// failed parse to number
|
||||
putter.put(object, key, 's', value);
|
||||
Timber.e(e);
|
||||
}
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
Timber.e(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int convertDpToPixels(DisplayMetrics displayMetrics, int dp) {
|
||||
// developer.android.com/guide/practices/screens_support.html#dips-pels
|
||||
return (int) (dp * displayMetrics.density + 0.5f);
|
||||
}
|
||||
|
||||
public static boolean preOreo() {
|
||||
return !atLeastOreo();
|
||||
}
|
||||
|
||||
public static boolean preTiramisu() {
|
||||
return VERSION.SDK_INT < VERSION_CODES.TIRAMISU;
|
||||
}
|
||||
|
||||
public static boolean preUpsideDownCake() {
|
||||
return VERSION.SDK_INT <= VERSION_CODES.TIRAMISU;
|
||||
}
|
||||
|
||||
public static boolean atLeastNougatMR1() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1;
|
||||
}
|
||||
|
||||
public static boolean atLeastOreo() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
|
||||
}
|
||||
|
||||
public static boolean atLeastP() {
|
||||
return VERSION.SDK_INT >= Build.VERSION_CODES.P;
|
||||
}
|
||||
|
||||
public static boolean atLeastQ() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q;
|
||||
}
|
||||
|
||||
public static boolean atLeastR() {
|
||||
return VERSION.SDK_INT >= VERSION_CODES.R;
|
||||
}
|
||||
|
||||
public static boolean atLeastS() {
|
||||
return VERSION.SDK_INT >= VERSION_CODES.S;
|
||||
}
|
||||
|
||||
public static boolean atLeastTiramisu() {
|
||||
return VERSION.SDK_INT >= VERSION_CODES.TIRAMISU;
|
||||
}
|
||||
|
||||
public static void assertMainThread() {
|
||||
if (BuildConfig.DEBUG && !isMainThread()) {
|
||||
throw new IllegalStateException("Should be called from main thread");
|
||||
}
|
||||
}
|
||||
|
||||
public static void assertNotMainThread() {
|
||||
if (BuildConfig.DEBUG && isMainThread()) {
|
||||
throw new IllegalStateException("Should not be called from main thread");
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isMainThread() {
|
||||
return Thread.currentThread() == Looper.getMainLooper().getThread();
|
||||
}
|
||||
|
||||
/** Capitalize the first character */
|
||||
public static String capitalize(String string) {
|
||||
return string.substring(0, 1).toUpperCase() + string.substring(1);
|
||||
}
|
||||
|
||||
public static void hideKeyboard(Activity activity) {
|
||||
try {
|
||||
View currentFocus = activity.getCurrentFocus();
|
||||
if (currentFocus != null) {
|
||||
InputMethodManager inputMethodManager =
|
||||
(InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
|
||||
currentFocus.clearFocus();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Timber.e(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dismiss the keyboard if it is displayed by any of the listed views
|
||||
*
|
||||
* @param views - a list of views that might potentially be displaying the keyboard
|
||||
*/
|
||||
public static void hideSoftInputForViews(Context context, View... views) {
|
||||
InputMethodManager imm =
|
||||
(InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
for (View v : views) {
|
||||
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
interface SerializedPut<T> {
|
||||
|
||||
void put(T object, String key, char type, String value) throws NumberFormatException;
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Todoroo Inc
|
||||
*
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.andlib.utility
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Build.VERSION_CODES
|
||||
import android.os.Looper
|
||||
import android.text.InputType
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import org.tasks.BuildConfig
|
||||
|
||||
/**
|
||||
* Android Utility Classes
|
||||
*
|
||||
* @author Tim Su <tim></tim>@todoroo.com>
|
||||
*/
|
||||
object AndroidUtilities {
|
||||
// --- utility methods
|
||||
/** Suppress virtual keyboard until user's first tap */
|
||||
@JvmStatic
|
||||
fun suppressVirtualKeyboard(editor: TextView) {
|
||||
val inputType = editor.inputType
|
||||
editor.inputType = InputType.TYPE_NULL
|
||||
editor.setOnTouchListener { v: View?, event: MotionEvent? ->
|
||||
editor.inputType = inputType
|
||||
editor.setOnTouchListener(null)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fun convertDpToPixels(displayMetrics: DisplayMetrics, dp: Int): Int {
|
||||
// developer.android.com/guide/practices/screens_support.html#dips-pels
|
||||
return (dp * displayMetrics.density + 0.5f).toInt()
|
||||
}
|
||||
|
||||
fun preOreo(): Boolean {
|
||||
return !atLeastOreo()
|
||||
}
|
||||
|
||||
fun preS(): Boolean {
|
||||
return !atLeastS()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun preTiramisu(): Boolean {
|
||||
return !atLeastTiramisu()
|
||||
}
|
||||
|
||||
fun preUpsideDownCake(): Boolean {
|
||||
return Build.VERSION.SDK_INT <= VERSION_CODES.TIRAMISU
|
||||
}
|
||||
|
||||
fun atLeastNougatMR1(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= VERSION_CODES.N_MR1
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun atLeastOreo(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= VERSION_CODES.O
|
||||
}
|
||||
|
||||
fun atLeastOreoMR1(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= VERSION_CODES.O_MR1
|
||||
}
|
||||
|
||||
fun atLeastP(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= VERSION_CODES.P
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun atLeastQ(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= VERSION_CODES.Q
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun atLeastR(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= VERSION_CODES.R
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun atLeastS(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= VERSION_CODES.S
|
||||
}
|
||||
|
||||
fun atLeastTiramisu(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= VERSION_CODES.TIRAMISU
|
||||
}
|
||||
|
||||
fun assertMainThread() {
|
||||
check(!(BuildConfig.DEBUG && !isMainThread)) { "Should be called from main thread" }
|
||||
}
|
||||
|
||||
fun assertNotMainThread() {
|
||||
check(!(BuildConfig.DEBUG && isMainThread)) { "Should not be called from main thread" }
|
||||
}
|
||||
|
||||
private val isMainThread: Boolean
|
||||
get() = Thread.currentThread() === Looper.getMainLooper().thread
|
||||
}
|
@ -0,0 +1,238 @@
|
||||
package com.todoroo.astrid.activity
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.todoroo.astrid.activity.MainActivity.Companion.LOAD_FILTER
|
||||
import com.todoroo.astrid.activity.MainActivity.Companion.OPEN_FILTER
|
||||
import com.todoroo.astrid.api.CustomFilter
|
||||
import com.todoroo.astrid.api.GtasksFilter
|
||||
import com.todoroo.astrid.api.TagFilter
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.collections.immutable.toPersistentList
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.tasks.LocalBroadcastManager
|
||||
import org.tasks.R
|
||||
import org.tasks.Tasks.Companion.IS_GENERIC
|
||||
import org.tasks.billing.Inventory
|
||||
import org.tasks.compose.drawer.DrawerItem
|
||||
import org.tasks.data.NO_COUNT
|
||||
import org.tasks.data.count
|
||||
import org.tasks.data.dao.CaldavDao
|
||||
import org.tasks.data.dao.TaskDao
|
||||
import org.tasks.data.entity.Task
|
||||
import org.tasks.filters.CaldavFilter
|
||||
import org.tasks.filters.Filter
|
||||
import org.tasks.filters.FilterProvider
|
||||
import org.tasks.filters.NavigationDrawerSubheader
|
||||
import org.tasks.filters.PlaceFilter
|
||||
import org.tasks.preferences.DefaultFilterProvider
|
||||
import org.tasks.preferences.Preferences
|
||||
import org.tasks.themes.ColorProvider
|
||||
import org.tasks.themes.CustomIcons
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class MainActivityViewModel @Inject constructor(
|
||||
savedStateHandle: SavedStateHandle,
|
||||
private val defaultFilterProvider: DefaultFilterProvider,
|
||||
private val filterProvider: FilterProvider,
|
||||
private val taskDao: TaskDao,
|
||||
private val localBroadcastManager: LocalBroadcastManager,
|
||||
private val inventory: Inventory,
|
||||
private val colorProvider: ColorProvider,
|
||||
private val caldavDao: CaldavDao,
|
||||
private val preferences: Preferences,
|
||||
) : ViewModel() {
|
||||
|
||||
data class State(
|
||||
val begForMoney: Boolean = false,
|
||||
val filter: Filter,
|
||||
val task: Task? = null,
|
||||
val drawerOpen: Boolean = false,
|
||||
val drawerItems: ImmutableList<DrawerItem> = persistentListOf(),
|
||||
val searchItems: ImmutableList<DrawerItem> = persistentListOf(),
|
||||
val menuQuery: String = "",
|
||||
)
|
||||
|
||||
private val _state = MutableStateFlow(
|
||||
State(
|
||||
filter = savedStateHandle.get<Filter>(OPEN_FILTER)
|
||||
?: savedStateHandle.get<String>(LOAD_FILTER)?.let {
|
||||
runBlocking { defaultFilterProvider.getFilterFromPreference(it) }
|
||||
}
|
||||
?: runBlocking { defaultFilterProvider.getStartupFilter() },
|
||||
begForMoney = if (IS_GENERIC) !inventory.hasTasksAccount else !inventory.hasPro,
|
||||
)
|
||||
)
|
||||
val state = _state.asStateFlow()
|
||||
|
||||
private val refreshReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
when (intent?.action) {
|
||||
LocalBroadcastManager.REFRESH,
|
||||
LocalBroadcastManager.REFRESH_LIST -> updateFilters()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun resetFilter() {
|
||||
setFilter(defaultFilterProvider.getDefaultOpenFilter())
|
||||
}
|
||||
|
||||
fun setFilter(
|
||||
filter: Filter,
|
||||
task: Task? = null,
|
||||
) {
|
||||
if (filter == _state.value.filter && task == null) {
|
||||
return
|
||||
}
|
||||
_state.update {
|
||||
it.copy(
|
||||
filter = filter,
|
||||
task = task,
|
||||
)
|
||||
}
|
||||
updateFilters()
|
||||
defaultFilterProvider.setLastViewedFilter(filter)
|
||||
}
|
||||
|
||||
fun setDrawerOpen(open: Boolean) {
|
||||
_state.update {
|
||||
it.copy(
|
||||
drawerOpen = open,
|
||||
menuQuery = if (!open) "" else it.menuQuery,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
localBroadcastManager.registerRefreshListReceiver(refreshReceiver)
|
||||
updateFilters()
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
localBroadcastManager.unregisterReceiver(refreshReceiver)
|
||||
}
|
||||
|
||||
fun updateFilters() = viewModelScope.launch(Dispatchers.Default) {
|
||||
val selected = state.value.filter
|
||||
filterProvider
|
||||
.drawerItems()
|
||||
.map { item ->
|
||||
when (item) {
|
||||
is Filter ->
|
||||
DrawerItem.Filter(
|
||||
title = item.title ?: "",
|
||||
icon = getIcon(item),
|
||||
color = getColor(item),
|
||||
count = item.count.takeIf { it != NO_COUNT } ?: try {
|
||||
taskDao.count(item)
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e)
|
||||
0
|
||||
},
|
||||
selected = item.areItemsTheSame(selected),
|
||||
shareCount = if (item is CaldavFilter) item.principals else 0,
|
||||
type = { item },
|
||||
)
|
||||
is NavigationDrawerSubheader ->
|
||||
DrawerItem.Header(
|
||||
title = item.title ?: "",
|
||||
collapsed = item.isCollapsed,
|
||||
hasError = item.error,
|
||||
canAdd = item.addIntentRc != 0,
|
||||
type = { item },
|
||||
)
|
||||
else -> throw IllegalArgumentException()
|
||||
}
|
||||
}
|
||||
.let { filters -> _state.update { it.copy(drawerItems = filters.toPersistentList()) } }
|
||||
val query = _state.value.menuQuery
|
||||
filterProvider
|
||||
.allFilters()
|
||||
.filter { it.title!!.contains(query, ignoreCase = true) }
|
||||
.map { item ->
|
||||
DrawerItem.Filter(
|
||||
title = item.title ?: "",
|
||||
icon = getIcon(item),
|
||||
color = getColor(item),
|
||||
count = item.count.takeIf { it != NO_COUNT } ?: try {
|
||||
taskDao.count(item)
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e)
|
||||
0
|
||||
},
|
||||
selected = item.areItemsTheSame(selected),
|
||||
shareCount = if (item is CaldavFilter) item.principals else 0,
|
||||
type = { item },
|
||||
)
|
||||
}
|
||||
.let { filters -> _state.update { it.copy(searchItems = filters.toPersistentList()) } }
|
||||
}
|
||||
|
||||
private fun getColor(filter: Filter): Int {
|
||||
if (filter.tint != 0) {
|
||||
val color = colorProvider.getThemeColor(filter.tint, true)
|
||||
if (color.isFree || inventory.purchasedThemes()) {
|
||||
return color.primaryColor
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
private fun getIcon(filter: Filter): Int {
|
||||
if (filter.icon < 1000 || filter.icon == CustomIcons.PLACE || inventory.hasPro) {
|
||||
val icon = CustomIcons.getIconResId(filter.icon)
|
||||
if (icon != null) {
|
||||
return icon
|
||||
}
|
||||
}
|
||||
return when (filter) {
|
||||
is TagFilter -> R.drawable.ic_outline_label_24px
|
||||
is GtasksFilter,
|
||||
is CaldavFilter -> R.drawable.ic_list_24px
|
||||
|
||||
is CustomFilter -> R.drawable.ic_outline_filter_list_24px
|
||||
is PlaceFilter -> R.drawable.ic_outline_place_24px
|
||||
else -> filter.icon
|
||||
}
|
||||
}
|
||||
|
||||
fun toggleCollapsed(subheader: NavigationDrawerSubheader) = viewModelScope.launch {
|
||||
val collapsed = !subheader.isCollapsed
|
||||
when (subheader.subheaderType) {
|
||||
NavigationDrawerSubheader.SubheaderType.PREFERENCE -> {
|
||||
preferences.setBoolean(subheader.id.toInt(), collapsed)
|
||||
localBroadcastManager.broadcastRefreshList()
|
||||
}
|
||||
NavigationDrawerSubheader.SubheaderType.GOOGLE_TASKS,
|
||||
NavigationDrawerSubheader.SubheaderType.CALDAV,
|
||||
NavigationDrawerSubheader.SubheaderType.TASKS,
|
||||
NavigationDrawerSubheader.SubheaderType.ETESYNC -> {
|
||||
caldavDao.setCollapsed(subheader.id, collapsed)
|
||||
localBroadcastManager.broadcastRefreshList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setTask(task: Task?) {
|
||||
_state.update { it.copy(task = task) }
|
||||
}
|
||||
|
||||
fun queryMenu(query: String) {
|
||||
_state.update { it.copy(menuQuery = query) }
|
||||
updateFilters()
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package com.todoroo.astrid.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.todoroo.astrid.api.FilterListItem
|
||||
import org.tasks.databinding.FilterAdapterActionBinding
|
||||
import org.tasks.themes.DrawableUtil
|
||||
|
||||
class ActionViewHolder internal constructor(
|
||||
private val context: Context,
|
||||
itemView: View,
|
||||
private val onClick: ((FilterListItem?) -> Unit)?) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val row: View
|
||||
private val text: TextView
|
||||
private val icon: ImageView
|
||||
|
||||
init {
|
||||
FilterAdapterActionBinding.bind(itemView).let {
|
||||
row = it.row
|
||||
text = it.text
|
||||
icon = it.icon
|
||||
}
|
||||
}
|
||||
|
||||
fun bind(filter: FilterListItem) {
|
||||
text.text = filter.listingTitle
|
||||
icon.setImageDrawable(DrawableUtil.getWrapped(context, filter.icon))
|
||||
if (onClick != null) {
|
||||
row.setOnClickListener {
|
||||
onClick.invoke(filter)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
package com.todoroo.astrid.adapter
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
class SeparatorViewHolder internal constructor(itemView: View) : RecyclerView.ViewHolder(itemView)
|
@ -1,122 +0,0 @@
|
||||
package com.todoroo.astrid.api;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.todoroo.andlib.sql.Criterion;
|
||||
import com.todoroo.andlib.sql.Join;
|
||||
import com.todoroo.andlib.sql.QueryTemplate;
|
||||
import com.todoroo.astrid.data.Task;
|
||||
|
||||
import org.tasks.R;
|
||||
import org.tasks.data.CaldavCalendar;
|
||||
import org.tasks.data.CaldavTask;
|
||||
import org.tasks.data.TaskDao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class CaldavFilter extends Filter {
|
||||
|
||||
/** Parcelable Creator Object */
|
||||
public static final Parcelable.Creator<CaldavFilter> CREATOR =
|
||||
new Parcelable.Creator<CaldavFilter>() {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public CaldavFilter createFromParcel(Parcel source) {
|
||||
CaldavFilter item = new CaldavFilter();
|
||||
item.readFromParcel(source);
|
||||
return item;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public CaldavFilter[] newArray(int size) {
|
||||
return new CaldavFilter[size];
|
||||
}
|
||||
};
|
||||
|
||||
private CaldavCalendar calendar;
|
||||
|
||||
private CaldavFilter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CaldavFilter(CaldavCalendar calendar) {
|
||||
super(calendar.getName(), queryTemplate(calendar), getValuesForNewTask(calendar));
|
||||
this.calendar = calendar;
|
||||
id = calendar.getId();
|
||||
tint = calendar.getColor();
|
||||
icon = calendar.getIcon();
|
||||
order = calendar.getOrder();
|
||||
}
|
||||
|
||||
private static QueryTemplate queryTemplate(CaldavCalendar caldavCalendar) {
|
||||
return new QueryTemplate()
|
||||
.join(Join.left(CaldavTask.TABLE, Task.ID.eq(CaldavTask.TASK)))
|
||||
.where(getCriterion(caldavCalendar));
|
||||
}
|
||||
|
||||
private static Criterion getCriterion(CaldavCalendar caldavCalendar) {
|
||||
return Criterion.and(
|
||||
TaskDao.TaskCriteria.activeAndVisible(),
|
||||
CaldavTask.DELETED.eq(0),
|
||||
CaldavTask.CALENDAR.eq(caldavCalendar.getUuid()));
|
||||
}
|
||||
|
||||
private static Map<String, Object> getValuesForNewTask(CaldavCalendar caldavCalendar) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put(CaldavTask.KEY, caldavCalendar.getUuid());
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return calendar.getUuid();
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return calendar.getAccount();
|
||||
}
|
||||
|
||||
public CaldavCalendar getCalendar() {
|
||||
return calendar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return calendar.getAccess() == CaldavCalendar.ACCESS_READ_ONLY;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
super.writeToParcel(dest, flags);
|
||||
dest.writeParcelable(calendar, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readFromParcel(Parcel source) {
|
||||
super.readFromParcel(source);
|
||||
calendar = source.readParcelable(getClass().getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsManualSort() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMenu() {
|
||||
return R.menu.menu_caldav_list_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areContentsTheSame(@NonNull FilterListItem other) {
|
||||
return super.areContentsTheSame(other)
|
||||
&& Objects.equals(calendar, ((CaldavFilter) other).calendar);
|
||||
}
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
package com.todoroo.astrid.api;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import androidx.annotation.NonNull;
|
||||
import java.util.Objects;
|
||||
import org.tasks.R;
|
||||
|
||||
public class CustomFilter extends Filter {
|
||||
|
||||
/** Parcelable Creator Object */
|
||||
public static final Parcelable.Creator<CustomFilter> CREATOR =
|
||||
new Parcelable.Creator<CustomFilter>() {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public CustomFilter createFromParcel(Parcel source) {
|
||||
return new CustomFilter(source);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public CustomFilter[] newArray(int size) {
|
||||
return new CustomFilter[size];
|
||||
}
|
||||
};
|
||||
|
||||
private String criterion;
|
||||
|
||||
public CustomFilter(@NonNull org.tasks.data.Filter filter) {
|
||||
super(filter.getTitle(), filter.getSql(), filter.getValuesAsMap());
|
||||
id = filter.getId();
|
||||
criterion = filter.getCriterion();
|
||||
tint = filter.getColor();
|
||||
icon = filter.getIcon();
|
||||
order = filter.getOrder();
|
||||
}
|
||||
|
||||
private CustomFilter(Parcel parcel) {
|
||||
readFromParcel(parcel);
|
||||
}
|
||||
|
||||
public String getCriterion() {
|
||||
return criterion;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
super.writeToParcel(dest, flags);
|
||||
dest.writeString(criterion);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readFromParcel(Parcel source) {
|
||||
super.readFromParcel(source);
|
||||
criterion = source.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMenu() {
|
||||
return getId() > 0 ? R.menu.menu_custom_filter : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areContentsTheSame(@NonNull FilterListItem other) {
|
||||
return super.areContentsTheSame(other)
|
||||
&& Objects.equals(criterion, ((CustomFilter) other).criterion);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.todoroo.astrid.api
|
||||
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import org.tasks.filters.Filter
|
||||
import org.tasks.filters.FilterListItem
|
||||
import org.tasks.themes.CustomIcons
|
||||
|
||||
@Parcelize
|
||||
data class CustomFilter(
|
||||
val filter: org.tasks.data.entity.Filter,
|
||||
) : Filter {
|
||||
override val title: String?
|
||||
get() = filter.title
|
||||
override val sql: String
|
||||
get() = filter.sql!!
|
||||
|
||||
override val valuesForNewTasks: String?
|
||||
get() = filter.values
|
||||
|
||||
val criterion: String?
|
||||
get() = filter.criterion
|
||||
|
||||
override val order: Int
|
||||
get() = filter.order
|
||||
|
||||
val id: Long
|
||||
get() = filter.id
|
||||
override val icon: Int
|
||||
get() = filter.icon ?: CustomIcons.FILTER
|
||||
override val tint: Int
|
||||
get() = filter.color ?: 0
|
||||
|
||||
override fun areItemsTheSame(other: FilterListItem): Boolean {
|
||||
return other is CustomFilter && id == other.id
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue