Compare commits
2477 Commits
v1.1.1
...
543be48cb1
| Author | SHA1 | Date | |
|---|---|---|---|
| 543be48cb1 | |||
| 297a381e67 | |||
| 542750207e | |||
| 46a3b69971 | |||
| 5aa8744ef4 | |||
| ce4879ac2b | |||
| 516bf394f8 | |||
| 5fe9704c36 | |||
| 2816b7c3d0 | |||
|
|
0a4086ec8c | ||
| a9acbd6cab | |||
| e121f46b61 | |||
| d57de9d10c | |||
| e4348a2144 | |||
| e608c6ea62 | |||
| 5403b6bd51 | |||
| a6cf43dbca | |||
| 074627f6e1 | |||
|
|
96e20f751f | ||
| 0daa4f6a2f | |||
| 035b392ece | |||
| 648c7277cf | |||
| 5006f5128b | |||
| 97b98a872d | |||
| 862a851e1c | |||
| 804030f5c0 | |||
| 08ab3c22ce | |||
| b58f836d8e | |||
| 9ed4630f9b | |||
| 70dab74528 | |||
| 7e5d2fa207 | |||
| 0e432fb332 | |||
|
|
c987144f4a | ||
| 897a236501 | |||
| 0cccecec77 | |||
| f1ed875256 | |||
| e82bd47aab | |||
| e9517f7378 | |||
| 12cc70a51a | |||
| fa670b19b7 | |||
| 45b100aad9 | |||
| 3c0c0b77ff | |||
| 66fa56ea62 | |||
| 951dabea8b | |||
| 76b9dd8bd9 | |||
| f68510f860 | |||
| 245b0eb4d6 | |||
| 4a0599fce4 | |||
| abbfe87260 | |||
| 3330014fa9 | |||
|
|
cc720e3dcb | ||
|
|
6e3d06cff9 | ||
|
|
d458cbd47a | ||
|
|
74ce269446 | ||
|
|
9eb8624863 | ||
|
|
c4bc301fb2 | ||
|
|
107c898f51 | ||
|
|
4a7d7ef490 | ||
|
|
13ecc2a386 | ||
|
|
2296a49999 | ||
|
|
303020a8c0 | ||
|
|
37219cb13f | ||
|
|
62d9d29e91 | ||
| 451b536e71 | |||
| 14dbf90c23 | |||
| 280a5ddceb | |||
| 22331ed364 | |||
| d0a45eb523 | |||
|
|
fec73af665 | ||
|
fc9cc423d0
|
|||
|
e7165d993f
|
|||
|
732ec1c70a
|
|||
|
e823cd5758
|
|||
| 46fe683d71 | |||
|
7f6248123c
|
|||
|
2024277ebe
|
|||
| c216fb01d6 | |||
|
7cb32f486b
|
|||
|
093591fbaf
|
|||
|
985234cdf3
|
|||
|
06090e238a
|
|||
|
e48452f724
|
|||
|
|
936986e110 | ||
|
|
4b3910aea8 | ||
|
|
10074ded32 | ||
|
|
1280e798d2
|
||
|
|
b09306e793
|
||
|
|
e30636a447
|
||
|
|
ad8738180c
|
||
|
|
08410c59d0
|
||
|
|
ab86cee70b | ||
|
|
3a0603605b
|
||
|
|
6a78b4d853 | ||
|
|
fe43b1435d | ||
|
|
12503b8a6d | ||
|
|
ef7f78bff0 | ||
|
|
53c208ded5 | ||
|
|
1bdc83e92f | ||
|
|
680c1cdc76 | ||
|
|
80916bac50 | ||
|
|
a5e3e9b3cf | ||
|
248ba50a8e
|
|||
|
|
45a82b3c2d
|
||
|
770d1293dc
|
|||
|
d10538e720
|
|||
|
02e9e2384e
|
|||
|
|
b627ff4413
|
||
|
|
0683ea43f4
|
||
|
08f77a5cae
|
|||
|
27df792775
|
|||
|
|
800f92f255
|
||
|
|
e06ed3ed7d | ||
|
|
3bb119c6ed | ||
|
|
0762699a86 | ||
|
|
8837326d44 | ||
|
|
481a3d5784 | ||
|
8eff782f54
|
|||
|
c590734c42
|
|||
|
7e7f68282b
|
|||
|
4bd5cee17b
|
|||
|
b2421dc8b1
|
|||
|
93363bff96
|
|||
|
d01044b203
|
|||
|
70fe513e52
|
|||
|
dee93fde8f
|
|||
|
f0ce05e06e
|
|||
|
4975ba2752
|
|||
|
ed8c60e52f
|
|||
|
|
7735247521 | ||
|
|
b32a6ad1b8 | ||
|
|
21a512ae71 | ||
|
|
b0944d3f1c | ||
|
|
8a9b719c50 | ||
|
|
ef7454ae75 | ||
|
|
b51f6abfce | ||
|
|
a013635224 | ||
|
|
a9f028a34b | ||
|
|
3b0fba12f5 | ||
|
|
4139f09fb7 | ||
|
|
248ff2ec62 | ||
|
|
cc7178eb21 | ||
|
6116ef9450
|
|||
|
8801960615
|
|||
|
b0a4284b66
|
|||
|
|
334dabb407 | ||
|
|
b2fc79a3ab | ||
|
|
f0e8643e6b | ||
|
|
5cd616f967 | ||
|
|
b53ef758ec | ||
|
|
5add03bf23 | ||
|
|
b465ee588b | ||
|
|
b9253d41ea | ||
|
|
ca0a9dd85f | ||
|
|
9951525cbe | ||
|
|
98b2c9cce2 | ||
|
|
19de2a2d1c | ||
|
|
80f783b669 | ||
|
|
761fe59c5e | ||
|
|
f58d8a52ff | ||
|
|
f4e5b68258 | ||
|
|
5df3ee0d61 | ||
|
|
25cff3d9b0 | ||
|
|
9f66a27b82 | ||
|
|
4bbb20e18e | ||
|
|
4f9ab6d263 | ||
|
|
af21fd25db | ||
|
|
35097e1263 | ||
|
|
8e4274d923 | ||
|
|
12649141b1 | ||
|
|
0526d37fbd | ||
|
|
b083899ec8 | ||
|
|
6b793c7c16 | ||
|
|
11ca993a75 | ||
|
|
7348ddeffa | ||
|
88df8d2552
|
|||
|
d4f4f8b4a9
|
|||
|
9ca1aa911a
|
|||
|
ba57ebad31
|
|||
|
|
e4d2c93a1d | ||
|
|
07065a60ad | ||
|
|
916cd76be1 | ||
|
8b55ffb147
|
|||
|
727e88b7b1
|
|||
|
f70d33878c
|
|||
|
6a55d3c01a
|
|||
|
69b5ed3a6d
|
|||
|
8b2adbf301
|
|||
|
88cc3a2a12
|
|||
|
26526a71a9
|
|||
|
11eb3713e5
|
|||
|
1df9cc7664
|
|||
|
|
499eb467cb | ||
|
|
9d4df73c56 | ||
|
|
d0f32dfa0a | ||
|
|
c609eceefc | ||
|
|
eb68220b8d | ||
|
|
f1a003fabf | ||
|
b76da35752
|
|||
|
abead88ceb
|
|||
|
908eb4ac99
|
|||
|
|
856a0726f7 | ||
|
|
df97b1fd4f | ||
|
71a05d598a
|
|||
|
2131fb3a3d
|
|||
|
1470dcd560
|
|||
| dc678e59df | |||
|
|
d95084500f | ||
|
6f7215b46f
|
|||
|
|
c423d2b3ca | ||
|
|
758fc56277 | ||
|
|
c7d1e92cae | ||
|
|
d24dcbf2ca | ||
|
|
579b33cc78 | ||
|
|
1a3e6315a1 | ||
|
|
7f4d06d15d | ||
|
|
b8033a6012 | ||
|
471f977209
|
|||
|
2ba5f5fb98
|
|||
|
4de67bd27a
|
|||
|
0bb82a48a5
|
|||
|
d5a5273607
|
|||
|
404671546c
|
|||
|
a94c6e8b9f
|
|||
|
da09df2dd1
|
|||
|
40a4d254f5
|
|||
|
177d01edd9
|
|||
|
9f5da7b4fe
|
|||
|
e42d41ef30
|
|||
|
5498ff8a87
|
|||
|
20dcc7929b
|
|||
|
1283cf979d
|
|||
|
0a493ff065
|
|||
|
16cd249bae
|
|||
|
d136572960
|
|||
|
318aa3c821
|
|||
|
73712e0d10
|
|||
| bf504641c6 | |||
|
ec1f0c5356
|
|||
|
2154d8c192
|
|||
|
961fb7618f
|
|||
|
11f726064a
|
|||
|
4c5a722dc5
|
|||
| ee39ff0eda | |||
| abced92a07 | |||
|
|
eeacc5eef8 | ||
|
|
16c65f19fd | ||
|
|
6a9c3a36eb | ||
|
|
99ccb44ad3 | ||
| fc402fd81b | |||
| f7c6bc716c | |||
| 2535347d5a | |||
|
|
8c0655c352 | ||
|
|
335f8c32fd | ||
|
|
f77c064722 | ||
|
|
8b0b757f04 | ||
| 13af054214 | |||
| fcbb586e80 | |||
| 458c9f3b15 | |||
| dfa74960b3 | |||
| f082842fbe | |||
| d4d818a085 | |||
|
|
f074d0331d | ||
|
|
f94bc62a94 | ||
|
|
428bf42e79 | ||
| b0097fa45e | |||
|
|
15fa1fea8c | ||
| 31368cff45 | |||
| b44dd96dd3 | |||
| 838e13f30c | |||
|
|
08fab0cd8d | ||
|
|
a142685d2e | ||
| a7a95f2030 | |||
|
|
d3c90481be | ||
| f9bb0d7d7b | |||
| f23a1bedee | |||
| dcf31ba115 | |||
| 0eae43fe55 | |||
| c0fcd4e763 | |||
| 79e2402c9d | |||
|
|
5409a324e8 | ||
|
|
504362e680 | ||
|
|
0ce2f8fae2 | ||
| 2fc6c67432 | |||
| 459cf02642 | |||
| 44cb64601f | |||
| 53c270ee12 | |||
| e4b16f6d59 | |||
| 3021e408a7 | |||
| 7649119db7 | |||
| b0a4f26e7a | |||
|
|
dd47d4cf08 | ||
|
|
8912a9d73c | ||
|
|
9bd1c6f685 | ||
|
|
e15e06034c | ||
|
|
a6180a5049 | ||
|
|
7c69b17e77 | ||
|
|
602a40a532 | ||
|
|
e00998f913 | ||
|
|
af5914c2db | ||
|
|
6c5f70638a | ||
|
|
ba88552919 | ||
|
|
8c90c4f68d | ||
|
|
08eb1a600d | ||
|
|
8ea0480d4a | ||
|
|
36ee39589e | ||
|
|
ac7a721940 | ||
|
|
b36ca8673a | ||
|
|
7cfac486f9 | ||
|
|
21dd413ab5 | ||
|
|
39e10638b5 | ||
| 0a95b6d2a0 | |||
| e6bcbb39ff | |||
| 90de1f3723 | |||
| 68740b4043 | |||
| b66a6ff717 | |||
| 7c1a91e35a | |||
| 366e9af167 | |||
| 03b02aaa06 | |||
|
|
180cf25ad3 | ||
| 3490cd183a | |||
|
|
0c292d1eaa | ||
| 0b256cb2c0 | |||
| cc03c48648 | |||
| 53e7ef2918 | |||
| 9609bee0f7 | |||
| 5b23a3f960 | |||
| d2d45991b0 | |||
| 25aeafb759 | |||
| 9045ae5c24 | |||
| 555873354c | |||
| 2a012619a7 | |||
| d1de3a852b | |||
| f04e37e905 | |||
| 825a5f2cb9 | |||
| 0de6896691 | |||
| 7187214282 | |||
|
|
9d4161a255 | ||
|
|
d82a3c145d | ||
|
|
a6cbd44e42 | ||
|
|
45c62b4ab2 | ||
|
|
d53312d261 | ||
|
|
c453810785 | ||
|
|
999057300b | ||
|
|
2245347e28 | ||
|
|
b79f7850ed | ||
|
|
4469f86e46 | ||
|
|
bdeddb149e | ||
|
|
3b12ec4bfe | ||
| ca4618579e | |||
| 2f13aba22c | |||
| dba5912ecd | |||
| 88b8663484 | |||
| 609886fd09 | |||
| a4db997e06 | |||
|
|
090216ccb7 | ||
|
|
472092d1bf | ||
|
|
6d3791de31 | ||
|
|
24a99d5791 | ||
|
|
6c631b1cf6 | ||
|
|
5d7677b354 | ||
|
|
22820f4f24 | ||
| 1d3bd48535 | |||
|
|
694446b7e3 | ||
|
|
20ae9d247e | ||
|
|
1943fac610 | ||
|
|
a07a50e635 | ||
|
|
8ccb9bbab1 | ||
|
|
743b8d26ad | ||
|
|
c47bd4c328 | ||
|
|
d84abc3a6a | ||
|
|
4ae85f1ec0 | ||
|
|
79d40d1d79 | ||
|
|
1902b8821e | ||
|
|
075542d605 | ||
|
|
0b5894ee6d | ||
|
|
92fb9dbdb6 | ||
|
|
1860abf532 | ||
|
|
3f4780c9fb | ||
|
|
d5d6e4616e | ||
|
|
18e267053d | ||
| 7ba9a7e4e7 | |||
| 5b8a7c39e2 | |||
| d40a5a89cd | |||
| 308d558347 | |||
| 9770ce187a | |||
| 535bc03b70 | |||
| 642e45af89 | |||
| 56d2307b75 | |||
| d875af8a8e | |||
| feeb4f057d | |||
| 1ad5c6b896 | |||
| baee3b9f86 | |||
| e6167baab1 | |||
|
|
1c15e7742e | ||
|
|
072ba63789 | ||
|
|
0fa0daa058 | ||
|
|
5a5ed3d631 | ||
|
|
3dfa376f59 | ||
|
|
7bf74634bb | ||
|
|
fc645a81bc | ||
|
|
35365bbdf3 | ||
|
|
779ef5dbee | ||
|
|
e82994c76b | ||
|
|
4e1d01d8d1 | ||
|
|
5de0fc86e5 | ||
| e26b643423 | |||
| 621534d610 | |||
| a01300e9c6 | |||
| ecb8ce105a | |||
| 32ef3c14f7 | |||
| 4972257635 | |||
| c98cb50baa | |||
| c331f34fa9 | |||
| a1aea532b5 | |||
| 43489aeb4c | |||
| 990c85aedd | |||
|
|
64337b9bee | ||
|
|
8bdfaa2434 | ||
|
|
5f6060858d | ||
| b62e436054 | |||
| bf63b4dbcf | |||
| a82d940bcc | |||
| ba59dc7ca9 | |||
| 181290a0f3 | |||
|
|
d553c2f3f2 | ||
|
|
7776093217 | ||
|
|
b27f3f8540 | ||
| eb041bf6b2 | |||
|
|
e3c53bf07f | ||
|
|
9ddab6ee59 | ||
|
|
2615795402 | ||
|
|
6531445d7f | ||
|
|
4fbf8a8ca2 | ||
|
|
707b2b4380 | ||
|
|
aae85c1170 | ||
|
|
c12a6c6a4d | ||
|
|
b15c02adbf | ||
|
|
9e24128675 | ||
|
|
66c61e2e6c | ||
|
|
7bddfbe5a7 | ||
|
|
8036b10ee6 | ||
|
|
71f400f587 | ||
|
|
79e302f922 | ||
|
|
af7f60fc4d | ||
|
|
7cc4b66dfd | ||
|
|
a9fddf9963 | ||
|
|
36c1504c6a | ||
|
|
d644170141 | ||
|
|
d38f83e961 | ||
|
|
c50c5af497 | ||
|
|
fa3774a32b | ||
|
|
fd124f2a6c | ||
|
|
265b65eb8a | ||
|
|
4c269c55d2 | ||
|
|
c03305120e | ||
|
|
29615b670b | ||
|
|
6ab4a696b6 | ||
|
|
23479c7765 | ||
|
|
6d98f7aafa | ||
| 75078ed52b | |||
| 2a0afedb1d | |||
| 66a2b41250 | |||
|
|
d6a7fa3d7a | ||
|
|
07e55f1c76 | ||
| 4ee5dd910b | |||
| 87f071b5b4 | |||
| bb0b5e8adf | |||
|
|
c79d1e82a5 | ||
|
|
4aebeedec6 | ||
|
|
7de94f2caf | ||
|
|
17ed85fc1b | ||
|
|
4355fb4d68 | ||
|
|
508200abeb | ||
|
|
a29943e783 | ||
|
|
3e6a9181d6 | ||
| 1fe3a3d1ca | |||
|
|
b2951a3475 | ||
|
|
9d3c63cf62 | ||
|
|
65d237254c | ||
|
|
fe1d5c66cb | ||
|
|
113a5028af | ||
|
|
1a56260757 | ||
|
|
697fffbc99 | ||
|
|
804edfa64e | ||
| 2ab6c396d0 | |||
| a55f467339 | |||
|
|
cf682f68c9 | ||
| 0e988e746c | |||
|
|
f119cbf8e7 | ||
|
|
056f5f6fce | ||
|
|
42f6125d5e | ||
|
|
3e20fc4d1d | ||
|
|
1f763feb69 | ||
|
|
6e7ad329fe | ||
|
|
5cb241475d | ||
|
|
27e76c7243 | ||
|
|
576ad04064 | ||
|
|
5f8187ef6d | ||
|
|
f16f919e27 | ||
|
|
736bb8a75e | ||
|
|
de9ad6d4a4 | ||
|
|
1d37ce54ea | ||
|
|
f88f1cfb54 | ||
|
|
fc1478645b | ||
|
|
ffab001b09 | ||
|
|
a58a8005e1 | ||
|
|
c884ada187 | ||
|
|
e3d46ad5a0 | ||
|
|
f4a2c03216 | ||
|
|
f2b8f2f98d | ||
|
|
2c5fd87a2a | ||
|
|
39768f7f04 | ||
|
|
cc3e1ced15 | ||
|
|
2e26cc104e | ||
|
|
42fd0926ef | ||
| ec202aa9a7 | |||
|
|
1fb56c8777 | ||
|
|
a5d4a37da8 | ||
|
|
4804a48549 | ||
|
|
c892a845b4 | ||
|
|
e98064b6a5 | ||
| 57f5f6ed5b | |||
| 79f5b8b7e8 | |||
| f15c660d33 | |||
| 1866743c47 | |||
| 6b9a7917b4 | |||
| 2a5725f382 | |||
| edeabb6ee3 | |||
| 24a9fbe414 | |||
| e5b8c4c3c4 | |||
|
|
a781a1f947 | ||
|
|
13e57b5026 | ||
|
|
f8c7abfff4 | ||
|
|
7fe3ce970c | ||
| 9c395243f4 | |||
|
|
b9eb244b0b | ||
|
|
420a99f1cf | ||
| e756a639ae | |||
|
|
91ff5f7a0c | ||
|
|
67b55a4ecf | ||
|
|
a5ae2eaa63 | ||
|
|
0bc2a8b6d4 | ||
|
|
95a1786c4a | ||
|
|
caa1c9d72e | ||
|
|
a7afe0b309 | ||
|
|
9c03174eef | ||
|
|
da02926fa6 | ||
|
|
250dabfe58 | ||
|
|
0bba3b76bc | ||
|
|
c2479278ba | ||
|
|
499a403a06 | ||
|
|
af5d622339 | ||
|
|
5eeb54bc47 | ||
|
|
e09e899aad | ||
| 69f0fc6c3a | |||
| 705dfb9cbd | |||
| d0ef749f19 | |||
| b54711243f | |||
| 37f03aca37 | |||
|
|
271de59a94 | ||
|
|
0ab55f6f5a | ||
|
|
43921721d4 | ||
|
|
33c88cded3 | ||
|
|
aecce891ea | ||
|
|
2ea98a7756 | ||
|
|
e667872d83 | ||
|
|
3602a614c4 | ||
|
|
d8c5f4d93c | ||
|
|
c9f4df9dae | ||
|
|
feb384bca6 | ||
|
|
71e9160460 | ||
|
|
64966d3c86 | ||
|
|
4787df4074 | ||
| 92291fd919 | |||
| be51538704 | |||
| 89b24911ba | |||
| 1cf71b3973 | |||
| 2fe3b15806 | |||
| 33468bfc1c | |||
|
|
5908692a5c | ||
|
|
693dce8719 | ||
| b232827dfd | |||
|
|
02f9f411ce | ||
| bbf9da44e1 | |||
|
|
ee896fb4f9 | ||
|
|
4d7d8b6206 | ||
|
|
55b841a8b4 | ||
| 7fac86b617 | |||
|
|
c31d42be2d | ||
| 31c09b9c0b | |||
|
|
db91dce57f | ||
| 12c76245e6 | |||
| 2163a2b93b | |||
| afad56ab91 | |||
| ece1b93f8d | |||
| 10416e40fa | |||
| 88f8581acc | |||
| b33dd2a994 | |||
| d87961d800 | |||
| 38d2606d6d | |||
| 0a91c097e8 | |||
|
|
b1c53bd820 | ||
| c973f93424 | |||
| fcadbe7c38 | |||
| 59a4d7552c | |||
| 9d7840bdd1 | |||
| 89e3dd7655 | |||
| df56608a5d | |||
| 3489f176d6 | |||
| 75fdd9d2b1 | |||
| dd1999681f | |||
|
|
32db4e363b | ||
|
|
004bb8d71c | ||
|
|
21a1e88c47 | ||
|
|
86fb718896 | ||
|
|
a4e9b2f874 | ||
|
|
ac924470b8 | ||
| 63883032c4 | |||
| a8c9b1b71c | |||
| 61529fde4d | |||
| 1050cc4e47 | |||
| a7845c9290 | |||
| 1feefe107c | |||
| 1654ff9af3 | |||
| 58adff6a22 | |||
| 2728c311d8 | |||
| b561dfe90d | |||
| 53a40b2cfa | |||
| 98ce802f87 | |||
| 853b4275be | |||
| df4355c072 | |||
| 33c3feb11a | |||
| f88a9bd46a | |||
| 5dd9f43464 | |||
| 4a13623b2c | |||
| 6b368bffdf | |||
| 8d87988871 | |||
| 256ca13dca | |||
| b0c5552cfa | |||
| 616ab4861d | |||
| fcff067b2e | |||
| da018fc64d | |||
| f27a9f9103 | |||
|
|
fe59565ded | ||
|
|
419d2faa78 | ||
|
|
55f3bab13a | ||
|
|
212cc4259b | ||
|
|
e1ec8cfa10 | ||
|
|
6af2edb690 | ||
|
|
9d6b3ebb25 | ||
|
|
ed0744d5ab | ||
|
|
b59886dc77 | ||
|
|
23954eed27 | ||
| 071b6bd090 | |||
| 298bf1a538 | |||
| 8b2285787c | |||
| c83cd5fd10 | |||
| 381c67d020 | |||
| 81cffc7253 | |||
| e745b959ca | |||
|
|
d2ee210376 | ||
|
|
9c81f22a4d | ||
| 51947576aa | |||
|
|
6411f65fa5 | ||
|
|
a04349bfaa | ||
| 7b68938e14 | |||
| ee462715de | |||
| a95da72e19 | |||
| 3ece80f3da | |||
|
|
e00ff99af7 | ||
|
|
fc26d7967f | ||
| 9b753b07f8 | |||
|
|
73deb535ef | ||
|
|
a733e6ddf0 | ||
|
|
86c7200e6b | ||
|
|
15282e7ea6 | ||
|
|
96f87df052 | ||
|
|
bc623f044d | ||
|
|
773eef26e7 | ||
| b58af03a7c | |||
| c53997ffcc | |||
| 11d55bbf02 | |||
|
|
50ebff3edf | ||
| 8e1aa3d01e | |||
|
|
ea66cf04b3 | ||
|
|
b1da72dc3a | ||
|
|
91bd17bb9e | ||
| fca9557108 | |||
|
|
d76a4a84d0 | ||
|
|
8790c0e87b | ||
|
|
bc461e1239 | ||
| 589fd2f0f1 | |||
|
|
2e94bebcac | ||
|
|
ff748b27a5 | ||
|
|
8522318ed1 | ||
|
|
1f08d2f71c | ||
|
|
7fb3489ca8 | ||
| 129c86a030 | |||
| e4121b2564 | |||
| 98abebe099 | |||
| 0f86cb4d53 | |||
|
|
4dd77463fb | ||
|
|
2cf3347f8c | ||
| 5516f40571 | |||
| c006659ba4 | |||
| 5be2c51d79 | |||
|
|
2dcce080d3 | ||
|
|
6c3b4135c2 | ||
| 48c1adb3bb | |||
| 89bde4c9ae | |||
| a7e2e0e8da | |||
| 64d77fbb6b | |||
|
|
4b80e60b2b | ||
|
|
0f80505735 | ||
|
|
c26c140310 | ||
|
|
c05e008569 | ||
| a5255690ed | |||
| 56f0bbb7bd | |||
| 4e72bf93f8 | |||
| d31e42446e | |||
|
|
8ea71dc2b5 | ||
| 3ba26ac67e | |||
|
|
8537e0f910 | ||
| a6c9ea22e6 | |||
| 5767817de2 | |||
| b80344a443 | |||
| f36bc788c7 | |||
|
|
22136774de | ||
|
|
be39237a22 | ||
|
|
836eebd20b | ||
|
|
8d2aebaf7f | ||
|
|
1c2efb6c22 | ||
|
|
784877871a | ||
|
|
4a2fb2ac47 | ||
|
|
7caf22bd7a | ||
|
|
2d943b5942 | ||
|
|
dd4e0ee6f9 | ||
|
|
bb8d4abb9e | ||
|
|
64069a6e7f | ||
|
|
9ead803b6c | ||
|
|
af6387f1fc | ||
|
|
6d0764bbb8 | ||
|
|
eb9d017882 | ||
|
|
ec630ad1b1 | ||
|
|
df30c7c764 | ||
|
|
7a73f9c8c7 | ||
| 045612c00f | |||
| 25d3587545 | |||
| 4ffd78545d | |||
|
|
14d018c327 | ||
|
|
f1c88797a3 | ||
|
|
f882e18be9 | ||
|
|
0fc9bb57ae | ||
|
|
22dcd9f7ae | ||
|
|
7d361b2203 | ||
|
|
8131d37d8e | ||
|
|
6485c3efee | ||
|
|
2bfbff9b14 | ||
|
|
9a72141567 | ||
|
|
6992b5186e | ||
|
|
18db571507 | ||
|
|
09794ccb68 | ||
|
|
7644f52dfd | ||
|
|
21fa636e0c | ||
|
|
df755d30ee | ||
|
|
7f0c4626b0 | ||
|
|
ec42fda336 | ||
|
|
def9ff9746 | ||
|
|
a7df0bde3e | ||
|
|
1cec5a6067 | ||
|
|
a58cbffb81 | ||
|
|
30630c3358 | ||
|
|
98f9693cff | ||
|
|
228be95f9c | ||
|
|
457c58a660 | ||
|
|
39cec6f11d | ||
|
|
8f5f72d9fd | ||
|
|
b21eb3f118 | ||
|
|
136ec5b49b | ||
|
|
e84cc8e8b1 | ||
|
|
26fb76f95f | ||
|
|
68a8f9d356 | ||
|
|
f541f47476 | ||
|
|
9d4cfbd270 | ||
| 1869d05591 | |||
| 3f8b1008b4 | |||
| e671949dd2 | |||
|
|
dedeb13f46 | ||
|
|
9d0fbb9ea9 | ||
|
|
97dcf98e2b | ||
|
|
25b25acc94 | ||
|
|
ac6df47818 | ||
|
|
0f828cbd3a | ||
|
|
eb8d39fbe3 | ||
|
|
11831a2b24 | ||
|
|
e9816a22a3 | ||
|
|
8165b5417f | ||
|
|
714771fbc3 | ||
|
|
a2a8dc4489 | ||
|
|
bbe39f8523 | ||
|
|
a69490a23a | ||
|
|
b6223c3805 | ||
| e3524c112a | |||
| 8c0141508d | |||
| 8206450456 | |||
| a5dfe0ec51 | |||
| 9a4aaf47bc | |||
|
|
485e4245ff | ||
|
|
72a7cd9685 | ||
|
|
95a7c4f474 | ||
|
|
f208601bc4 | ||
|
|
d5b9fda636 | ||
| 99277491c8 | |||
| 2828dfcc75 | |||
| b14aa668c2 | |||
| 47de6243d3 | |||
| 7bad2c886b | |||
| c4e496a5ff | |||
| 7ee3e00e49 | |||
| 2f39b63723 | |||
| d279388884 | |||
|
|
358e1ccf42 | ||
| 236d56bbf0 | |||
| 68f9b8339f | |||
| 4a4356b72a | |||
| b71675585c | |||
| bebb356425 | |||
| 9fd36d8d53 | |||
| 1137088e20 | |||
| 6f2b2ab883 | |||
| d8fcc9160d | |||
| cb6843e08b | |||
| 162eac3bdf | |||
| e2d2b5b4b3 | |||
| de3668db96 | |||
| 93a2ec3186 | |||
| 354c930d85 | |||
| e97cdce467 | |||
| 13826f4934 | |||
| 1cdbc53dc5 | |||
| 51b9517897 | |||
| a74a4b390b | |||
| 79b134164a | |||
| ced78e0b1f | |||
| 9087025418 | |||
| 9a5263e508 | |||
| 75571e2eb0 | |||
| b5ed4b9a9c | |||
| 2daf08d22d | |||
| 2e51c73ac0 | |||
| 298bb01762 | |||
| a02c7bdc44 | |||
| feb3c98459 | |||
| 823d8bed7e | |||
| 68813580eb | |||
| 6bc1b91cc6 | |||
| 56f91526e6 | |||
| dbc6a16a98 | |||
| 4d3c5ad732 | |||
| 307ff5c1ca | |||
| 3b86a17b49 | |||
| 54fe849eef | |||
| c023711d16 | |||
| 9bc0f44777 | |||
| 4a3a767cb2 | |||
| d0c37fef67 | |||
| 11863cd7b0 | |||
| 1c696e2561 | |||
| 43c5e450a8 | |||
| 0a84d8a1d8 | |||
| 354a4d08be | |||
| af93c0e488 | |||
| b8aa322691 | |||
| a87987da87 | |||
| 8b8e9d3980 | |||
| a19f39308e | |||
| 0b23fbed86 | |||
| d1eeb559cb | |||
| 2e4a82418f | |||
| fcdb400edf | |||
|
|
f80fb35e35 | ||
| 056a7b722b | |||
| f4c0f353f3 | |||
| 3fb7fbac51 | |||
| bd70746278 | |||
| c744d945a4 | |||
| f0696b3f60 | |||
| bc36f24551 | |||
| 82b68b5f4e | |||
| e8238b5ed7 | |||
| 599f21fabb | |||
| e91e2c1c96 | |||
| 9f421bfd6d | |||
| 3a4071505e | |||
| 344c4a324c | |||
| 0aca118546 | |||
| 124c490f25 | |||
| 0a5622c78e | |||
| 373f21e247 | |||
| e80292e75d | |||
| 7173381d9b | |||
| 78f31a65d4 | |||
| 2e19fee83c | |||
| f6754ff180 | |||
| 3f74c77755 | |||
| c904e22c0f | |||
| 27023e50ae | |||
| 0f2f010f94 | |||
| cf2989d587 | |||
| 94c78ebb72 | |||
| d9be39b839 | |||
| 7fcad7b5c5 | |||
| cfeef3651f | |||
| e849e8a5c2 | |||
| 5bd21e68df | |||
| 71597ca89b | |||
| a3cf2877b8 | |||
| 23e9ccb236 | |||
| 7d97554cb1 | |||
| 5f8c0d67b8 | |||
| b468325f64 | |||
| 39d23424d6 | |||
| eba2dd0171 | |||
| 1bdd44085c | |||
| 596af6afe6 | |||
| 3f3ddc3955 | |||
| a58c60b8ce | |||
| b42ad0dd83 | |||
| e0fbe841c1 | |||
| 3523b2c1a3 | |||
| c15c14ffcd | |||
| 8cd729480f | |||
| 638bc2816f | |||
| 826ea17cdd | |||
| 19e221bb32 | |||
| 85de69bca7 | |||
| 7d5b9d0f63 | |||
| 816ab71d83 | |||
| c230b5c40d | |||
| 71620a320d | |||
| c016b0aecc | |||
| 95b3028c95 | |||
| ae4ac801a0 | |||
| bda3e42e2b | |||
| 4dc1df5887 | |||
| 302b9f5df4 | |||
| c2d89c7a60 | |||
| 45574753c7 | |||
| c84c618ef0 | |||
| 98d17d60a5 | |||
| 4c1c6e76fc | |||
| ac1441aba5 | |||
| 5d2ff40dc9 | |||
| 63f2b80515 | |||
| 52b25fbc72 | |||
| b94a887534 | |||
| f6699fbfda | |||
| 9743b05a78 | |||
| 9681b7b5ef | |||
| 017bc50698 | |||
| 1e94456a74 | |||
| 2fcba80f3a | |||
| fc4cbe84f0 | |||
| 011abf62a0 | |||
|
|
9c96857262 | ||
| 4f55ec6ea8 | |||
| 8139088b39 | |||
| 44f7d13449 | |||
| 16b0682229 | |||
| a77798f293 | |||
| 08050ff616 | |||
| 12b080152b | |||
| df3d660e83 | |||
| 4908709296 | |||
| 5717ae1bf1 | |||
| 872c8d9d81 | |||
| 0b6110f0f9 | |||
| 6df5e9ebe9 | |||
| 2b9fd74a1d | |||
| 4a4b3c6aeb | |||
| 7979f74bea | |||
| b0336fb495 | |||
| 328fcd23f4 | |||
| 9c0951ae58 | |||
| 3f51561271 | |||
| 1787c0e74e | |||
| 49faacda1c | |||
| 339eeff1ff | |||
| 849212fd2f | |||
| 356b2b06e4 | |||
| b6eefbdb36 | |||
| 2a72601153 | |||
| 2bf7358207 | |||
| 8c6e2ef461 | |||
| ce0cbb6ee2 | |||
| 67ef3bb90c | |||
| b82af419f8 | |||
| 49ff9a7edf | |||
| 53ebdf4f14 | |||
| 4762b54701 | |||
| aa288ac406 | |||
| 2228dbf0f4 | |||
| 9ca1c8e459 | |||
| 61414d62f4 | |||
| f97fed3b9b | |||
| d45281d137 | |||
| 1bb6ad41b2 | |||
| 56c180183e | |||
| af8d983cca | |||
| 0a49232ebd | |||
| cff8e26428 | |||
| e892bccb32 | |||
| 68ccf37fd5 | |||
| 659c528744 | |||
| b1560dd694 | |||
| 0de86ac66c | |||
| 06e5d517cc | |||
| 35ca041bc2 | |||
| 576a334dc9 | |||
| 294aee5d12 | |||
| 0859cec853 | |||
| 23f2978a64 | |||
| a2400172e2 | |||
| 5376f4bff8 | |||
| 0497890cb0 | |||
| 2848c4e77b | |||
| 8fa3ba1b18 | |||
| b4f36dd258 | |||
| 008902d3b7 | |||
| 4764c07f3b | |||
| 8f0cfa8614 | |||
| 865e1969e6 | |||
|
|
bfddc42f5e | ||
| dc0b8deccf | |||
| b674d14b49 | |||
| d594d3b085 | |||
| bef85bf93a | |||
| 76eaefc95b | |||
| 83c1ab35d5 | |||
| 7a6563736a | |||
| 55c50c1119 | |||
| ba08968600 | |||
|
|
2d488a67f2 | ||
|
|
d997b1378d | ||
| 720f98f9bd | |||
| ddea9e78a9 | |||
| c429cb41c0 | |||
| ae286cec14 | |||
| 31d631b155 | |||
| 20142d5f94 | |||
| ef186d55c6 | |||
| 8b847ae9fa | |||
|
|
a4ef657897 | ||
| f44556e281 | |||
| 8a895b2d20 | |||
| 61f32449dd | |||
|
|
07f8583c3d | ||
|
|
69f11c9d4e | ||
|
|
1ffc079042 | ||
| 5fa3f412c0 | |||
| b72cad5316 | |||
|
|
d59ab89426 | ||
| ea019321e6 | |||
| 6967def950 | |||
| 6d4cac427f | |||
| 152b2d5427 | |||
| 9d28fbe7b5 | |||
| c846dfc75a | |||
| ee7eb4ef51 | |||
|
|
57bfe3d801 | ||
| a5ee96f988 | |||
| 7b0eddeac5 | |||
| e8e52db9b1 | |||
| cddbf558e6 | |||
| 79459c373e | |||
| 84523869e8 | |||
| 590298bf5b | |||
| 8067fd5313 | |||
|
|
d2dc756a34 | ||
| 2af1dbf3a6 | |||
| ebab6f08ee | |||
| 4a2b21855a | |||
| 42d5edec26 | |||
| f368e43158 | |||
| 09eb8c9f4d | |||
| 209e709163 | |||
| d20a2be7e6 | |||
| bd68f8fc5a | |||
|
|
1a05f7d85d | ||
|
|
d9ff429c28 | ||
| 3554895a5d | |||
| 16491c142a | |||
| 859fea5ff5 | |||
| 34c73e89db | |||
| 09bf49a9ce | |||
| 48e43869c7 | |||
| 963fb58309 | |||
| 38fb37cde2 | |||
| d0b4e3e163 | |||
| 3ef3be4d16 | |||
| bae0e3bcc1 | |||
| 3e99d821a5 | |||
|
|
acb5051eec | ||
|
|
b76882dd1d | ||
|
|
978946baab | ||
|
|
d202f14c14 | ||
|
|
17a85e517a | ||
|
|
c5bc5deff0 | ||
|
|
b7f04957a5 | ||
|
|
b0f5f96eee | ||
|
|
fd76a3c6fd | ||
| b31482881b | |||
|
|
87231d7fa4 | ||
|
|
4d18a1335c | ||
|
|
424a417a13 | ||
|
|
96d23bdf22 | ||
| a8e77b8df8 | |||
| 5413569ce3 | |||
| d80b85ac8c | |||
| 40bc35935f | |||
| a6060f468d | |||
| 6ec9d51a1e | |||
| de28a5e74e | |||
| 3ba503604b | |||
| 6d48b53861 | |||
| 0cce6b30b1 | |||
| bf650a7565 | |||
| b78cd1dd0d | |||
| 6d9ad8c56c | |||
| e7a3f0cffa | |||
| 6aa72caf6c | |||
| 0b7697d172 | |||
| b9850fa085 | |||
| ecb3978bdd | |||
| fc57a9db6c | |||
| 6c9c2a6c1a | |||
| 3e0529d515 | |||
| 7d8d89fbbd | |||
| c43f3c2fd7 | |||
| 403ed8b250 | |||
| 9ccb2b2737 | |||
| 424a282847 | |||
| 309b6cbcaf | |||
| 72ad14119a | |||
|
|
652ed50d09 | ||
| 6070a7af2e | |||
| 8fd8c2802b | |||
| 923b923745 | |||
| 59c8031372 | |||
| 0058089e7d | |||
| d5a840388c | |||
| 4b07d7d5b1 | |||
| 2fffc25128 | |||
| 4a4501276c | |||
|
|
c8e3735dd6 | ||
|
|
61267e40e7 | ||
|
|
c0b664e1e4 | ||
|
|
e57c319658 | ||
|
|
e54ba826b3 | ||
|
|
9b8784b4c4 | ||
|
|
51a7b7a7d4 | ||
|
|
d761b474cf | ||
|
|
51be585b9d | ||
|
|
76be5037fd | ||
| aee0da2c64 | |||
| f1610e6603 | |||
| a7a1766809 | |||
| 5f83314d56 | |||
| c784f40c55 | |||
| 6a172d135b | |||
| 13f4981066 | |||
|
|
849b91dde2 | ||
|
|
66b4c48d92 | ||
|
|
2e64da4cac | ||
| 323ddcc11a | |||
| 175000efd1 | |||
| 6f94fc48c1 | |||
|
|
18d1d0d9f7 | ||
|
|
47edea47ae | ||
|
|
1714cf8050 | ||
|
|
7366e9a47f | ||
|
|
e58589cfbd | ||
|
|
2999e0e5eb | ||
|
|
fa7bc27124 | ||
|
|
f5be9d3c67 | ||
|
|
2c46e8909a | ||
|
|
8b042f30dc | ||
|
|
46761926d2 | ||
|
|
88d6a8e513 | ||
|
|
557ae19297 | ||
|
|
9c10a56dda | ||
|
|
895b068321 | ||
|
|
fb98c5fe9a | ||
|
|
0ec604f21e | ||
|
|
bcd9dd1bb5 | ||
|
|
61bcd253f8 | ||
|
|
fb40dbdabc | ||
|
|
0990192cd6 | ||
|
|
1cf2d69534 | ||
| a3344358b9 | |||
| 22fcecb48c | |||
| 58d8c799ce | |||
| f9437d61b0 | |||
|
|
0489dc39e0 | ||
|
|
88b9645be1 | ||
| 997ebfc28a | |||
| 6a91300d82 | |||
| 889ce9faef | |||
| b3a40efe46 | |||
| 547c7ffdf7 | |||
|
|
82486c7514 | ||
|
|
fe732ea385 | ||
|
|
85ec0faa99 | ||
|
|
9ac1ae9915 | ||
| 895d66b663 | |||
| 0f2a93cd27 | |||
| 323c98edb8 | |||
| aadfac68cd | |||
| 7076cffec5 | |||
| 0ef5a8dead | |||
| 526c8fe750 | |||
| 464eaf613d | |||
| b21d77514a | |||
| 58ed759224 | |||
| 7c742e1016 | |||
| 2e9330b5c5 | |||
| d1b83d069d | |||
| 7d35a85a37 | |||
| 616d9ab46c | |||
| b9c9d6852a | |||
| 29e4a8d4ec | |||
|
|
ceed784acd | ||
|
|
897887f802 | ||
|
|
dcd0c61b8d | ||
| 1285b653ed | |||
| dfd5c65595 | |||
| 315bddea96 | |||
| 938739d535 | |||
| 27f625873d | |||
| f37d25e86b | |||
| b2df70c059 | |||
| 3afd46c59c | |||
| e36c649333 | |||
| b2e7c9fe6e | |||
| 2171d582dc | |||
| b7be459537 | |||
|
|
cbee09c38f | ||
| 6f24e42d1f | |||
| 93bb105dac | |||
| f67b74d57d | |||
| abbf1e4d66 | |||
| e3f6353062 | |||
| 38d5b2bf16 | |||
| 7801c933f0 | |||
| 5cdb9eb9d5 | |||
| dee4670f65 | |||
| 50a6d7190b | |||
| d3371badf8 | |||
| ed1f3e5cdb | |||
| 5947926cd5 | |||
| 61cd77e5df | |||
| d6ec33d6d3 | |||
| 3f002efb53 | |||
| 5191290188 | |||
| cc05543692 | |||
|
|
e94e0c057e | ||
| 350f002ed3 | |||
| 04cf4e7785 | |||
| bf644f4e09 | |||
| 3658aef2e2 | |||
| 190a1171c4 | |||
| 2b20b6bb9d | |||
| caed1aef79 | |||
| 8341956a90 | |||
| de44b48dba | |||
| 7eafd92b2d | |||
| 47dc26fea0 | |||
| a6dd0939b2 | |||
| 898a33a754 | |||
| 1997d9491b | |||
| 6d57ea0368 | |||
| 83c1197dc1 | |||
| 48d145626f | |||
| a57f310c76 | |||
| 1e6cb2e841 | |||
| c676a02ca8 | |||
| ded57cd04a | |||
| b8f9e2f309 | |||
|
|
2fb9168686 | ||
| 9199a64d73 | |||
|
|
a69fb369df | ||
| 0790961bb5 | |||
| c88fa4a003 | |||
| f403dfd7d1 | |||
| 105baf629a | |||
|
|
af37036ac5 | ||
|
|
8717ad6ad0 | ||
|
|
95af0217ff | ||
|
|
fe091fa740 | ||
|
|
00abb4486d | ||
|
|
dadfcb7c16 | ||
|
|
77a9701805 | ||
| bfea4b024a | |||
|
|
3e2cf48223 | ||
| ec2fa16fab | |||
| 8d97a8d140 | |||
| 563aa8b7b4 | |||
| 74475bd191 | |||
| 957a5b7c17 | |||
| 64cc9f78a8 | |||
| e50c411d1e | |||
| 046a7eab7f | |||
| d96732b588 | |||
| a3bfc05068 | |||
| defa2f9431 | |||
| fe4139e268 | |||
| d463bb55d7 | |||
| 5ea19c9475 | |||
| b0cedde0a9 | |||
| e0894c9313 | |||
| 8378d88186 | |||
| ddd363917c | |||
| f310eaf7d9 | |||
| 8972f2d03d | |||
| e88c58916a | |||
| 7d169d8053 | |||
| c018d89ca6 | |||
| 5c402b5400 | |||
| 7ba7edb7d4 | |||
| fe219b5296 | |||
| 1abc041d87 | |||
| c16a0ecd65 | |||
| 6d527a31d7 | |||
| 4d0d631d8a | |||
| 5b2b554a7a | |||
| 33bae657a3 | |||
| 082c575f82 | |||
| 90f553b4f6 | |||
| 6af576c09c | |||
| c380abad5a | |||
| 905099ccdb | |||
| 76b848752c | |||
| 48c3ff584a | |||
| 979affef22 | |||
| 274d3d6858 | |||
| f491acdda9 | |||
| 6ac7ef7807 | |||
| 5d1f5168ad | |||
| 262b9460bd | |||
| f4e4da6dc5 | |||
| 024c99e60d | |||
| aa6b13f3a6 | |||
| 70a79856f2 | |||
| 6a30bb98c6 | |||
| 07cf74d400 | |||
| 94b35545b7 | |||
| 8544c5dc8a | |||
| a546f6de73 | |||
| 7cab0a39e5 | |||
| e19339d808 | |||
| 134975b8ba | |||
| 2d0a57efbd | |||
| 50e94c4d09 | |||
| 15974bdca8 | |||
| 0734e74154 | |||
| f108bc8dc1 | |||
| 4ccda9d6f7 | |||
| db1ba822fe | |||
| bd18a4320a | |||
|
|
b180f11834 | ||
|
|
d4b5c7b9d5 | ||
| a719f6ad98 | |||
|
|
d8894753e0 | ||
| 178061475e | |||
| 3581173193 | |||
| a839631aae | |||
| a3e0d7ffb1 | |||
| 6d4dbcdee7 | |||
| 33ae289ff1 | |||
| fca695ee6b | |||
| 8fd175685d | |||
| 6a3e430a5e | |||
|
|
07efa8b321 | ||
| 9183cb9f37 | |||
| a1bd4836dd | |||
| dc74c0e54b | |||
| 436d19dfea | |||
| 6ca4877f1f | |||
| 6ad302b697 | |||
| b0820095f1 | |||
| b5fda334d4 | |||
| 88beb7b883 | |||
| 49689317b7 | |||
| 052d26c708 | |||
| 76c88848b2 | |||
| 87f069f986 | |||
| ce27773138 | |||
| 0864f83307 | |||
| 624cc67d9b | |||
| 462bac8167 | |||
| 5865eb41f7 | |||
| 2bfd4a942d | |||
| b4a33cba39 | |||
| f02c86e61b | |||
| 5021f50e18 | |||
| 2654521647 | |||
| 778a7eb6bc | |||
| 71d559d6d9 | |||
| b94d2f2fa6 | |||
| 2904f3e2f8 | |||
| 1ad06bcc15 | |||
| bf8c14fc03 | |||
| b46b7aae25 | |||
| 357f51fd5e | |||
| 7f257e045b | |||
| 0dc46d02a4 | |||
| ecf3086aef | |||
|
|
10be875b48 | ||
| 0077d35ff9 | |||
| 2a4a7c975f | |||
| e91f1c3fa4 | |||
| 9d48b4bcdb | |||
| 7f1a35ebe5 | |||
| 5ccd546958 | |||
|
|
def71d8141 | ||
|
|
8feb07ff1b | ||
|
|
1edd76ae8c | ||
| 7613e6e1cb | |||
| 5629a28823 | |||
|
|
b1c2ab90d3 | ||
|
|
268cb0bc18 | ||
|
|
5a78de5a25 | ||
|
|
82972d6e47 | ||
| a201273781 | |||
| 819a8d341f | |||
| b8f7d4fad2 | |||
| dea4e069c5 | |||
| 07c7234bfc | |||
| bf3964a231 | |||
| 657cde75d8 | |||
| c56b86d32c | |||
| 16f20d50a0 | |||
| 7bb88dcb97 | |||
| 223b8bc5ec | |||
|
|
e052a144bd | ||
|
|
318caa886c | ||
|
|
46c61f9ea9 | ||
| ba78e563cd | |||
| acb94db6d6 | |||
|
|
d2cc283bd5 | ||
| 6c66078a65 | |||
|
|
be9c2ff64d | ||
| bb22972eb2 | |||
| e911fb35b6 | |||
| d1490ee771 | |||
| 6d44b4124d | |||
|
|
f8e0d07236 | ||
|
|
e970473876 | ||
|
|
cec05ccbca | ||
|
|
aac59367dc | ||
|
|
0421ca0549 | ||
|
|
43e802fb8e | ||
| 52c4282601 | |||
| 665204bf7a | |||
|
|
f52da56221 | ||
|
|
4d59783809 | ||
|
|
a680d57cac | ||
|
|
f6620be2d9 | ||
|
|
1c2abb543b | ||
|
|
87cf2871a7 | ||
|
|
e041d9041b | ||
| dccf5eae47 | |||
| b2a8c9c45f | |||
| 125a574ff9 | |||
| 7bb62c197f | |||
| a75a27ad42 | |||
| 4126f01ef1 | |||
| 9816fc9127 | |||
| b135aa09a3 | |||
| f3a64fd67a | |||
| 864636705d | |||
| 281861cac5 | |||
| c05f50998f | |||
| b2734b179c | |||
| 00a4abf266 | |||
| 47e279b3b3 | |||
| 87f1d635d8 | |||
| fdcb9daadc | |||
| 5fde0501b5 | |||
| f72799f48c | |||
| 60c62b8609 | |||
| e5bc06c138 | |||
| fa5ba0c1ef | |||
| 43be70b27c | |||
| 89400e281e | |||
| 57dc19550d | |||
| a8aa6f192c | |||
| 882ddba324 | |||
| 2f7509b94e | |||
| 10e68aa008 | |||
| a5720e8d7f | |||
| c7aaa98935 | |||
| efcb5710c0 | |||
| 3783fd8506 | |||
| 6f80a9c030 | |||
| a02376497a | |||
| 180c18f6bf | |||
| 2db4c06fe8 | |||
| 540a618ba8 | |||
| bf24cc608c | |||
| a73459784e | |||
| de3b97dfdf | |||
| 91996924d9 | |||
| 9fe446b424 | |||
| 3857eaf5e9 | |||
| e29fb58922 | |||
| 404fc869b0 | |||
| 001dd5a7c1 | |||
| 7930cc8f31 | |||
| 122b300c50 | |||
| 0984f7ff5d | |||
| 2d9a5ae7e2 | |||
|
|
02f9660fda | ||
|
|
d3d733ab42 | ||
| bb282da92d | |||
| 38d3b0d047 | |||
| 8ccada67d6 | |||
| 33f7acc9ca | |||
| 5d9563b9d8 | |||
| f55dc0d811 | |||
| 7872983064 | |||
| ea640a8a17 | |||
| 6801d1d1ae | |||
| 3584affbe0 | |||
| 1069fcfc62 | |||
| 59745fb90f | |||
| 1976160ae8 | |||
| 6dd7e49112 | |||
| ecb5352134 | |||
| b96385c4a7 | |||
| 96c1a046d4 | |||
| 00660d3e36 | |||
|
|
b14ca5c625 | ||
| 71fe6137be | |||
| 0a5d565030 | |||
| 6d06e06840 | |||
| edeba897fb | |||
| e4b9c50ee2 | |||
| af7c4e227d | |||
| 96ab887545 | |||
| 526830ba61 | |||
| fe1513bb64 | |||
| e06ace9ea8 | |||
| d727dabb2b | |||
| d17e8fcbfb | |||
| f8a9da59dd | |||
| 50a6c6d9dd | |||
| 8d181a6683 | |||
| 217516ad59 | |||
| fc4b610d59 | |||
| 382b52e5b2 | |||
| be3d7145ab | |||
| cf66587644 | |||
| 0dc9ec2e5f | |||
| 0a375ded96 | |||
| fa5d6f8fee | |||
| 277738f94d | |||
| cf25229fbc | |||
| 7652d71c94 | |||
| 74e0dcf706 | |||
| 4e1cc6dc80 | |||
| c34f9f9e9f | |||
| ed9066f393 | |||
| 96e1771c25 | |||
|
|
d0d3c7eef5 | ||
| 6875fc0428 | |||
| b88b3a683d | |||
| d97f94075d | |||
| 28f095e56a | |||
| ead87519b1 | |||
| 7cfe3355e4 | |||
| a51ecaaf24 | |||
| 322645da9b | |||
| 5eb63df633 | |||
| e4b5a3ea45 | |||
| 88c1e73720 | |||
| 0393e58d3b | |||
| 534e6c2d9d | |||
| b6501c9a29 | |||
| 238a1c724d | |||
| 34ca9d17a2 | |||
| 6ccfb53329 | |||
| 8a29fbf07d | |||
| e844390614 | |||
| 223aee3be2 | |||
| 745d07024c | |||
| 94025c5262 | |||
| ab09eb8a03 | |||
| e826c80ff2 | |||
| 6255fe2d12 | |||
| 1746920699 | |||
| c9b62669de | |||
| d2f367678f | |||
| 5e00d07b73 | |||
| 28b6ae7014 | |||
| 2a1bf5fc2e | |||
| ef7483f9dc | |||
| bbb9ed8f99 | |||
| c49d576871 | |||
| bc66ae4f7a | |||
| 56c5fb6c9d | |||
| d8d4c4f55e | |||
| 70423ddb0a | |||
| 94c70485b7 | |||
| 3e558be4d4 | |||
| 95385fa8f4 | |||
| fa4944700c | |||
| df0cf57984 | |||
| 29d1de46e7 | |||
| cb4ab3b436 | |||
| 370e7343d7 | |||
| acd653db70 | |||
| 51ca4aa98e | |||
| d23b59ced2 | |||
| f18ac9db48 | |||
| c20ca3921f | |||
| 96f620455f | |||
| 2dd14dbf04 | |||
| 8346f28497 | |||
| 97967b2b2e | |||
| cf6a257143 | |||
| 275125d230 | |||
| cb7b569d4e | |||
| 89b6f4c5cc | |||
| 8d555eb837 | |||
| 9288528f94 | |||
| e92ffb3894 | |||
| 96bdb42365 | |||
| ecb207d322 | |||
| 64001604cf | |||
| b9d3d22894 | |||
| 25705297cb | |||
| 532637ef7e | |||
| 0a1907ee2c | |||
| fa416adbb9 | |||
| 8b835b9918 | |||
| 471c5d341f | |||
| d0e76d3d55 | |||
| 1832ea639b | |||
| cd3944b90f | |||
| 9f2f8f7117 | |||
| 1b97b9040d | |||
|
|
8a80a66a80 | ||
|
|
894423e49f | ||
|
|
4ce9013e6a | ||
| 96b95edef8 | |||
| 704854fdf1 | |||
| 6e0393f611 | |||
| e6ceed9ec9 | |||
| cf3d289145 | |||
| 6bd59aad97 | |||
| a5567d491f | |||
| 9604c26973 | |||
| 81ad1ba8c8 | |||
| 1d68122a6f | |||
| 7d9d45ffed | |||
| 50e21b2cc1 | |||
| 57296745b3 | |||
| fb1b1221d3 | |||
| 788c790f9e | |||
| 293d838d80 | |||
| 3da996b8a4 | |||
| 08e3c9cc40 | |||
| 13b4128777 | |||
| b4e79c3f4b | |||
| 2d07f5e924 | |||
|
|
cb29fef17e | ||
| 1d76760dc8 | |||
| b6994034d2 | |||
| 8fc0c072e5 | |||
| e6deb1f281 | |||
|
|
bb0d43018e | ||
| 140ab34a76 | |||
| 0d6ad26505 | |||
| 65cc99dbf7 | |||
| 6855ef9d5e | |||
| 4c58b084c6 | |||
| 5c8e522646 | |||
| 55da0759d4 | |||
|
|
814b734ad3 | ||
| 6f5941472b | |||
| 7699423aa7 | |||
| 692fe3218f | |||
| 387930c08d | |||
| 6bd31f9607 | |||
| 9aafe7160c | |||
| 5cc4aac67a | |||
| 831421bc98 | |||
| e48dab9ed3 | |||
| 161d8f2517 | |||
| bfe4b822b3 | |||
| 53a599c6b8 | |||
| 103c0b57f8 | |||
| 7de69c1c10 | |||
| fe7e8ef039 | |||
| 19f4a19dba | |||
| b66da24e39 | |||
| 3dd33274e4 | |||
| c61834e604 | |||
| e082705b0c | |||
| 83ce92d8ac | |||
| 177525817c | |||
| 1dfa0c6b0d | |||
| b3f039d658 | |||
| 7d2e8573f8 | |||
| 5653651c0d | |||
| d3b540199c | |||
| f0430ffeb3 | |||
| d03edf2895 | |||
| 5c1ccfe6fe | |||
| 5b9e90fe7a | |||
| ac32460859 | |||
| e2a8de3acf | |||
| 7bf9f88ee3 | |||
| 19e79a8559 | |||
| 876d4f0ac7 | |||
| f4f7faf3a4 | |||
| 56f2ae57fe | |||
| 3fe09efe9b | |||
| f0de29fbfe | |||
| 324facfffd | |||
| 03e58f9ef2 | |||
| e6c9f7f0c9 | |||
| 42bdedb86a | |||
| ab0c510fda | |||
| e46fd58664 | |||
| 8532bd402e | |||
| 2c599b18ef | |||
| 0d78ba4ba9 | |||
|
|
611dfa00a5 | ||
|
|
54a195243d | ||
|
|
4fc30fae53 | ||
| b3fe9c65d2 | |||
| 09f1ae8765 | |||
| 0a8b763ece | |||
| edd5f25529 | |||
| d81fdb41dc | |||
| 02c8810e46 | |||
| 6adf8061d3 | |||
| d19d57e5df | |||
| c20d5c8729 | |||
| fd82e6c24b | |||
| 56263efa39 | |||
| d5eacba303 | |||
| 222261c674 | |||
| b1a06df7f8 | |||
| a1fc7dd0d1 | |||
|
|
10131d5124 | ||
| aa94959ad2 | |||
| 967dc2586b | |||
| 908fd1d6ae | |||
| 45fd8a29e1 | |||
| 4624acd477 | |||
| c8cd4fa389 | |||
| 8c4fab28aa | |||
| d6b91cef01 | |||
| e273fe7375 | |||
| ab3b946c65 | |||
| 38cd47c199 | |||
| fa64bd389d | |||
| d03578fd9e | |||
| 79ae181df2 | |||
| 320dca9070 | |||
| f3b9fc825a | |||
| 50da14022f | |||
| 84a02fe541 | |||
| b3aa3d14c0 | |||
| e9cdfd23c4 | |||
| 659ad2d817 | |||
| d537ba0dfa | |||
| 7c14725d88 | |||
| 638b3f763c | |||
| f876fc50bb | |||
| 919504ccfb | |||
| 1a8d9e72a1 | |||
| 8e82f369c7 | |||
| 0a5677211e | |||
| 65071797c9 | |||
| df1751b21a | |||
| 4e952dd87a | |||
|
|
132dce8919 | ||
| 5c8450191a | |||
| b1d00598eb | |||
| 518ade3165 | |||
| dc5d7930a6 | |||
|
|
ec34043041 | ||
| 4d5407a5cc | |||
| 904489d812 | |||
| d2436a3165 | |||
|
|
bc19858bca | ||
| a998a62cdb | |||
| 1a89bb02be | |||
| 6e8ea471aa | |||
| ec42fb54f4 | |||
| c46fa84135 | |||
| 16dcc0cbc2 | |||
| 6f10039aba | |||
|
|
5cbc0a3292 | ||
| 7f67a9eb63 | |||
| d3f7ebd60c | |||
| 461fe1f0b6 | |||
| 8eb9f398d5 | |||
| f178bcbdd2 | |||
| 66c3136fad | |||
| 4b04966617 | |||
| 3ea21fe823 | |||
| e0df69beb6 | |||
| b5cd4584b2 | |||
| af7c8b1f2e | |||
|
|
283cb2a3f0 | ||
| 79ddbca307 | |||
| 46a0777195 | |||
| b35305e16c | |||
| 8c4a745ecb | |||
|
|
e5162c48ab | ||
| b54c4de5f7 | |||
| 2bdc0b4f5e | |||
| 22db61db01 | |||
| c7cfbd1643 | |||
| 8655437f3e | |||
| 3ad3cf54ec | |||
| 9a470cc61d | |||
| fc2087fe68 | |||
| 7b8ab6a625 | |||
| 2d40fb0b82 | |||
| c961045b63 | |||
| d0db3359fe | |||
| 11378e07bf | |||
| 8132188e46 | |||
| 7eb454788f | |||
| c262adbe85 | |||
| 05aa5b1172 | |||
| dd3d78b82c | |||
| 3d4ae2126b | |||
| 5aa9114aff | |||
| 77e0ad007f | |||
| 2e53b75705 | |||
|
|
0ec03035f5 | ||
|
|
67ae48b527 | ||
|
|
82d2931559 | ||
| a527140802 | |||
| 9ec3d9048a | |||
| 3ed4f3b280 | |||
| f101975320 | |||
| 3a7f27755c | |||
| 3a3be664f7 | |||
| 33ae8d1edf | |||
| cb3b8f2cde | |||
| 307e025b1a | |||
| 03dd24d17b | |||
| 5f4ac21a41 | |||
| b33616d363 | |||
| b7d1c6d254 | |||
| bd30ceee1b | |||
| fe96313162 | |||
| 938fe3325e | |||
| 237de035bb | |||
| ddc85ced0b | |||
| eceb1bfb7d | |||
| 3b737996e9 | |||
| 7f75f9b6da | |||
| 74f78f0fdf | |||
| ef63dd19e7 | |||
| c7878d979f | |||
| ebd294be63 | |||
| 748cec06a8 | |||
| 15a4a2c002 | |||
| 37a9e793e7 | |||
| d54de9df89 | |||
| 94a5db2208 | |||
| a984467516 | |||
| d6dacfd24b | |||
| 3938ae6fa8 | |||
| 7dbbc51a9a | |||
| c9d1bb821c | |||
| 77f406dcee | |||
| 61b0b1fdea | |||
| 8cde0d6aca | |||
| fa9f90a09e | |||
| 28eb615b0e | |||
| c1e10e09a5 | |||
| 35e93fddc6 | |||
| 33596a2797 | |||
| 207f026ceb | |||
| 0f12d02990 | |||
| bc4bbaefac | |||
| a802053ef7 | |||
| cf98d1a5c3 | |||
| cc1e56894b | |||
| 06b5f89b7a | |||
| 17423b3ecd | |||
| 1526f617c5 | |||
| 365eb400d0 | |||
| 785d57c778 | |||
| 8e9f1aa166 | |||
| b2f97cb0a5 | |||
|
|
4c1ff4f0a8 | ||
| 94a48133ec | |||
| 71dd6cde89 | |||
| b33420cabb | |||
| dbe268b8e9 | |||
| 3d53812d7f | |||
| 5b4b436f0f | |||
| 6ef2983906 | |||
| b749f7f391 | |||
| 922b234307 | |||
| 31fdae1c8b | |||
| 5d61fdd3d0 | |||
| 588b45d47b | |||
| 9a059275ce | |||
| 4ae813e6f9 | |||
| 52701666bc | |||
| a90e26691f | |||
| f0c62a5908 | |||
| e899a70eb0 | |||
| aa41717c66 | |||
| 6ba6d7c8c1 | |||
| efd0d1e051 | |||
| a11ad6e909 | |||
| a060cbe578 | |||
| a445ca962b | |||
| 2b6fc06b86 | |||
| 98ad3aab9d | |||
| c7e63a40da | |||
| b6ed33b1e6 | |||
| 91e39372a1 | |||
| c2dd26eeb3 | |||
| 5831340343 | |||
| d7f6f52a49 | |||
| 93b442332d | |||
| e248824bcd | |||
| ec4a381d70 | |||
| b13f2b4228 | |||
| efc7b2cebb | |||
| add08d6054 | |||
| 5d8a348aaf | |||
| ec0e8ac24c | |||
| fee3137a6f | |||
| abe6b10964 | |||
| 6484b96e5a | |||
| 3d3d5b9b96 | |||
| 14364901ff | |||
| 440706882b | |||
| ca9d56e59e | |||
| 9a6dafaa79 | |||
| 9a44774284 | |||
| 2b23b36e36 | |||
| 78d4f86cab | |||
| 18e8390aed | |||
| cabcd5b1bf | |||
| 7e8a2a0c1c | |||
| 650971bf36 | |||
| 00774368d4 | |||
| cbf1bd3e19 | |||
| 4061921b93 | |||
| 59d42fe62f | |||
| 3ffa079e24 | |||
| bb950d61fc | |||
| 0ad0e5cf36 | |||
| 3b56d6d596 | |||
| 8d57273987 | |||
| b98853ab26 | |||
| 071cad73d4 | |||
| 16dc9c25d2 | |||
| 6b23858136 | |||
| e0198e9926 | |||
| 6445bf62bc | |||
| 83ef8564e1 | |||
| 88e8aad0d8 | |||
| a4b6728721 | |||
| e6e80b9841 | |||
| 442c3ed78d | |||
| ca9745f550 | |||
| 33bc8f78e7 | |||
| 0f223f8504 | |||
| 007996c69e | |||
| ff9d50b32a | |||
| 38024d71ce | |||
| 9ec1afc208 | |||
| e0888a9b4d | |||
| 8aade2f145 | |||
| 1ba1d775f7 | |||
| 605593d739 | |||
| bfbfcbd8cf | |||
| bd6cba8303 | |||
| befc3a0ad8 | |||
| f4c963e2c1 | |||
| e9a4a047c1 | |||
| 7ce1988d2e | |||
| 53911fa410 | |||
| f5f43d9a16 | |||
| 2399dccddc | |||
| dd5f37290c | |||
| dbf569ff87 | |||
| d0e475ad78 | |||
| b3199cf092 | |||
| 73e6f2a2d4 | |||
| 5b402478e9 | |||
| e3b7e9f60f | |||
| b0040bd83c | |||
| 56e1268f85 | |||
| 41d9e2f0f5 | |||
| 1fcfb9b22e | |||
| 2c80544aaa | |||
| 097a5be864 | |||
| 0287473e61 | |||
| f403dc6f77 | |||
| 23466523df | |||
| 83ca136346 | |||
| 7830b599db | |||
| 49376d4f41 | |||
| 8ee9c9c0b1 | |||
| ee9da29422 | |||
| ae7b0408b2 | |||
| d926d9dbd6 | |||
| 5694da2413 | |||
| 7e0ae144b8 | |||
| 1426d887e7 | |||
| acb8e820fd | |||
| eae0d66f51 | |||
| e933cbbc43 | |||
| 0b95b6a78c | |||
| 5e873a3659 | |||
| d292ecd988 | |||
| 19b484c368 | |||
| 834ae92d87 | |||
| 26ce92d381 | |||
| 0eb12812d4 | |||
| a1a636c718 | |||
| b2811b9797 | |||
| 4db7a6e89c | |||
| 677a643e5b | |||
| dbca3238f6 | |||
| ae5dd700f3 | |||
| 7e4c508d7d | |||
| d0c056eeaa | |||
| f172c69eed | |||
| 0cd4a41438 | |||
| d77c78249c | |||
| d9d48ff984 | |||
| 7be71ba4f8 | |||
| f0534fefbc | |||
| 30ef75bb45 | |||
| 44ed74a693 | |||
| 4aea527e07 | |||
| 638539259a | |||
| 75dec88411 | |||
| 2dc4fcbc46 | |||
| 7977d5247c | |||
| 8b18e32a16 | |||
| dbcad9a5f4 | |||
| 3bba75ff50 | |||
| 9bbeee66e2 | |||
| c6e76f4cfd | |||
| 980db1d171 | |||
| aee5d975db | |||
| e2bb4371d3 | |||
| fcee8552f0 | |||
| a4864e4612 | |||
| 8ddf4574e3 | |||
| f1ca8c5449 | |||
| 81a188f125 | |||
| 44402bf3a4 | |||
| 7f159149ef | |||
| 0c1e8d5131 | |||
| a4e3f7e037 | |||
| b354a0765b | |||
| bbd959dfda | |||
| d05d404c55 | |||
| 8938b0c9a6 | |||
| bd6fcd066c | |||
| 6a5f2abb76 | |||
| 33b5215b00 | |||
| 5d808dd2e8 | |||
| 767ec1b6de | |||
| 9e5f3d8f58 | |||
| 775d028629 | |||
| 4bfb839370 | |||
| 8f64b696d8 | |||
| c4bf31e778 | |||
| c757ce6548 | |||
| 78994bb3c4 | |||
| 2373ba5407 | |||
| b601a643dd | |||
| 90e513e778 | |||
| 728c9557f0 | |||
| 5bd0c842f5 | |||
| 97711087f9 | |||
| 2fe2d8834a | |||
| 93a893d660 | |||
| feff9a18e6 | |||
| b42565b770 | |||
| 3de702ced2 | |||
| 42f7f4042d | |||
| 2115a590f2 | |||
| f5f3ec9f88 | |||
| 6d5a8f5753 | |||
| 06fc04092b | |||
|
|
24c02605d1 | ||
| 11fcb67624 | |||
| abc92e390a | |||
| 52c07660b1 | |||
| 35f778c376 | |||
| 436ae7e574 | |||
| 5c683a77c2 | |||
| dd1f6c9efc | |||
| cba089407b | |||
| a7b0395a2a | |||
| 7d2946360f | |||
| 04e8432522 | |||
| 13d34945b4 | |||
| 756578508e | |||
| 38fc7650b9 | |||
| cf06ec0a4b | |||
| f0701f7b35 | |||
| de8018af7d | |||
| ac885e1503 | |||
| f85e09288c | |||
| 6f11596bb7 | |||
| 64c4367706 | |||
| c08702341a | |||
| abb8c09bc9 | |||
| 87255ceb25 | |||
| aedbfded0f | |||
| 779c0040bd | |||
| 7bba6a887f | |||
| 52a1d19793 | |||
| 35e346e7ea | |||
| 3102158bdb | |||
| 7afa65a53c | |||
| 2e5533d480 | |||
| b29c7e695a | |||
| 7df745eb82 | |||
| c0d518ca4d | |||
| eeff14a2ca | |||
| af3b18f518 | |||
| 3811f4b339 | |||
| 50a8aece6f | |||
| 2f66cfc417 | |||
| 132ce36a57 | |||
| 147f010d1b | |||
| afc91ed89a | |||
| 684c37d167 | |||
| 8b296ce2ae | |||
| e2e9e2e27a | |||
| 8b2f31c44a | |||
| 83db9fe2f2 | |||
| 9891139b5a | |||
| cbc8cbfea3 | |||
| 96c46b655d | |||
| 0de52d4fa3 | |||
| 16d85dc4c7 | |||
| c51b1fd399 | |||
| eb8dd1d450 | |||
| 357646152f | |||
| ae5be202b2 | |||
| cc3e2153d0 | |||
| 7433a2413d | |||
| 1cd8eb6849 | |||
| 7f009e2365 | |||
| 4cec7d7367 | |||
| f59c0bd7ff | |||
| 2d2bb8b4ed | |||
| e476096ae1 | |||
| e2c814a982 | |||
| 4fcaa68baf | |||
| 02e45dbe27 | |||
| bf6562f854 | |||
| 3c927e009a | |||
| a9bcae0f2f | |||
| bc54f3f916 | |||
| 5763d76167 | |||
| 86b66b1388 | |||
| 5e0422848b | |||
| a67a3297b1 | |||
| b2f2d4ad28 | |||
| 4dc8201dcb | |||
| f24e300b40 | |||
| 21157eaa19 | |||
| 0ea2c8e5c8 | |||
| 826491bc90 | |||
| 72f5ca5531 | |||
| f9da90a93a | |||
| 96c6a97ad0 | |||
| 20469789ea | |||
| abafffcff1 | |||
| d45a4445cc | |||
| 94f56a8869 | |||
| bc331d0a4d | |||
| 2ba7246e5f | |||
| 67b88c5012 | |||
| e0b637e84d | |||
| e14d73cf32 | |||
| 16b9584868 | |||
| c091116105 | |||
| 37e1a6233c | |||
| 6838a0f2d3 | |||
| 53e737c169 | |||
| 285f79ed95 | |||
| 4f65c8bef1 | |||
| 51b7cfc8fa | |||
| 55ed2585ea | |||
| 2c62e1578a | |||
| e3d96c0431 | |||
| b4c2d2237a | |||
| d14fbbd130 | |||
| e2c99d745e | |||
| dfe41176bc | |||
| 1ef4f8d456 | |||
| 6c810ee7a3 | |||
| 5115379fdd | |||
| d176ea91fb | |||
| 62df660079 | |||
| 790beb185a | |||
| 59c0af17d7 | |||
| 28dad560a6 | |||
| 9e410f8395 | |||
| 3656c51e95 | |||
| d3ebb4ff25 | |||
| 3c595bc79d | |||
| 1120f56dd4 | |||
| 2dfbcfcdb0 | |||
| 90a3964f0f | |||
| 6c05366f0f | |||
| dcc771abe7 | |||
| 743431ef67 | |||
| d5fc1a6886 | |||
| eeb0b109ae | |||
| ad391fa791 | |||
| e8bbae8ef9 | |||
| c9793df7c7 | |||
| 3c6114fc87 | |||
| 4ea4201b6a | |||
|
|
30b5b90091 | ||
| e6b7b8b590 | |||
| 2d675ed9b0 | |||
| 1db2f69f05 | |||
| 49a80faca3 | |||
| aa5df56437 | |||
| 581197be03 | |||
| dfe5c4954e | |||
| a0582b65d5 | |||
| 9edc3e12c9 | |||
| 7bb3db213f | |||
| e05a69b527 | |||
| d5df6ddcdb | |||
| 3016263750 | |||
| f9377e1768 | |||
| ae0dad9120 | |||
| be114bde7f | |||
| e7148abc2e | |||
| 2d87076a48 | |||
| 7da4ddf91b | |||
| e4e8d77acc | |||
| 7945a5faf9 | |||
| 3f7d25461d | |||
| 519737a1c3 | |||
| c3ff1fbe03 | |||
| d39e1978a2 | |||
| 536c095f23 | |||
| 8aaa5aca28 | |||
| 5540a66e08 | |||
| 01ffc6c144 | |||
| 21aa658acc | |||
| e17667d85d | |||
| f2948dac6f | |||
| 31a7d92f77 | |||
| 82d7970f86 | |||
| af1a21a959 | |||
| e7c1575083 | |||
| d5a14ca55b | |||
| c4d6b80944 | |||
| c4b6cad6bb | |||
| 7070530d0e | |||
| 1332a70eb4 | |||
| 11c9a3dab0 | |||
| 74f7b0fd28 | |||
| e693504183 | |||
| 7d9a94ae9e | |||
| 326cb8f73f | |||
| 6826bd1ddc | |||
| b5bc347624 | |||
| 55c058ff42 | |||
| e829bb8109 | |||
| 0921f9346e | |||
| eb017bf99b | |||
| 79b6ef8200 | |||
| 7ba62d6784 | |||
| f5e4a88415 | |||
| 075b7812eb | |||
| 3d42505fb9 | |||
| 824f98dd96 | |||
| fcb82bcb72 | |||
| 851cae3662 | |||
| 7778c5fb21 | |||
| ef847dac17 | |||
| 8102c18c67 | |||
| 59ed9ec9bd | |||
| ffdc923268 | |||
| 9232378d04 | |||
| b20fd44cbc | |||
| ded8800017 | |||
| 606f66b8d9 | |||
| 1bb6cd405b | |||
| babf7d64f0 | |||
| dfbcf78dd7 | |||
| e01c668e4d | |||
| 2eef696027 | |||
| ddd10cacd1 | |||
| 0cdde4901e | |||
| f13e9b7362 | |||
| 558f72d7c5 | |||
| 6e493f55bc | |||
| 5186ab840a | |||
| 65fd82d888 | |||
| 866b62987c | |||
| 18abb2038f | |||
| f7f4b5eeb0 | |||
| 45a7433773 | |||
| 40420c3a77 | |||
| 988b39f2e5 | |||
| a0803966f9 | |||
| e4af662836 | |||
| e95adab422 | |||
| 012fed01eb | |||
| 4cf2b8072b | |||
| 196a79a88c | |||
| 4b7e2e79a7 | |||
| 9156bba267 | |||
| 1a18bb939d | |||
| 144524e53b | |||
| 3d1c53396c | |||
| 1930db3cd1 | |||
| a2c2a5531a | |||
| eee2605f74 | |||
|
|
9df0c9ae9e | ||
| e0533505c1 | |||
|
|
433894336c | ||
| 9061182301 | |||
| 8c45f52d56 | |||
| 53c9dca3e2 | |||
| 8b37daa9fb | |||
| f9c2e83c79 | |||
| 71bdc70c1a | |||
| 5e4a40579a | |||
| d326be1224 | |||
| fb8a09c95c | |||
| 1635b9905d | |||
| 2d88fc0b20 | |||
| 1d74359c06 | |||
| f75f77cec7 | |||
| 8b10138cd6 | |||
| 2b40633110 | |||
| 1102d05a61 | |||
| 51e8c2f111 | |||
| 547e4e5f63 | |||
| 84d5c2aac6 | |||
| 2b3b423fa3 | |||
| 3b28c37c5e | |||
| e749e787ad | |||
| 9c5d582f24 | |||
| 75a4edb61c | |||
| 34c0758308 | |||
| 85963ae061 | |||
| e3390d5397 | |||
| 59a2f31a73 | |||
| c01f8450d3 | |||
| cea5241135 | |||
| 7784fc5c75 | |||
| 6dd017f33e | |||
| c8cd9f85f6 | |||
| d038bdb741 | |||
| f55e8d2c85 | |||
| f8dc1d9eae | |||
| 85393b0d40 | |||
| 75599ad20c | |||
| c6b948cbf5 | |||
| 4d42133a4b | |||
| 5b151805ff | |||
| aa86826bdb | |||
| 821373a340 | |||
| 8f37e293b1 | |||
| 0fb8ed0b53 | |||
| 0c696b2eb2 | |||
| cd127bc3f8 | |||
| 2cfc809490 | |||
| ba31dee16a | |||
| 146c743fb8 | |||
| 0c00e9ec2d | |||
| 49af55a2de | |||
| 0114b48197 | |||
| 09f615a5e6 | |||
| 9014acc548 | |||
| 4fb386be86 | |||
| ea8606be97 | |||
| e0527dc8ff | |||
| aaf2789a21 | |||
| f8dc64cc6b | |||
| ced5b751be | |||
| 8a60dda74e | |||
| c8c4df6ef7 | |||
| 0c0ac9dee5 | |||
| fdf6c91929 | |||
| 08d6e39a17 | |||
| b9bc7bd1b5 | |||
| 7b73238448 | |||
| 83ccfb82ac | |||
| 199d35d9c7 | |||
| 382a2fe600 | |||
| e02f9c1d60 | |||
| 5e7636d7ff | |||
| 616322cd35 | |||
| 299c6a0c1d | |||
| b4911b6cb4 | |||
| f41f877107 | |||
| 58aa7f6687 | |||
| d196e01da0 | |||
| 1fbd12a947 | |||
| 7493291ade | |||
| 2a750704d9 | |||
| eb79113e4c | |||
| cb2f3823cd | |||
| 39e29dabb8 | |||
| 51d1b93d03 | |||
| 8acbc63914 | |||
| ac8e78ff24 | |||
| 162ded66d8 | |||
| 5428209543 | |||
| 141fd30d70 | |||
| 48d446a243 | |||
| ae7869d3a2 | |||
| b8cacaffa9 | |||
| 4def8f0409 | |||
| f0d12e9925 | |||
| a2331260e4 | |||
| c1a846d42b | |||
| 031d684b3e | |||
| 3a770e71e3 | |||
| b29dd8ea79 | |||
| 7f1553a4a1 | |||
| d748f5d6de | |||
| 7234e072e6 | |||
| 7f71f46367 | |||
| c1dae021bf | |||
| 88455acc76 | |||
| 6a1cb09ca2 | |||
| 33d7ab52ca | |||
| d2682358c2 | |||
| f511ca2028 | |||
| d5774e8511 | |||
| b6e7e72f5a | |||
| 27220c9ab2 | |||
| f1424e5820 | |||
| a18e0fbda0 | |||
| 4c3a72df81 | |||
| e9ce50f686 | |||
| acb26964f3 | |||
| 917d1218ae | |||
| f5ccd7d8c3 | |||
| 456a9e49a9 | |||
| 6b05004647 | |||
| f9a9339042 | |||
| 5e21d877c5 | |||
| af0ef90e4d | |||
| 02b3ea58cf | |||
| 0dcedb3c59 | |||
| 637d75fd2e |
36
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Report something broken in the app
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
<!--
|
||||||
|
Please use the template below for your bug report. Issues that do not follow this
|
||||||
|
template, or that do not contain all necessary information (namely, description of
|
||||||
|
the problem, steps to reproduce, phone, phone operating system, and app version)
|
||||||
|
will be closed without further consideration.
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Pre-submission checklist
|
||||||
|
- [ ] I am submitting a bug report, not a feature request.
|
||||||
|
- [ ] I have searched for similar issues, but did not find any matches.
|
||||||
|
|
||||||
|
## Description
|
||||||
|
A clear and concise description of what the problem is.
|
||||||
|
|
||||||
|
## Steps to reproduce
|
||||||
|
1. Go to ...
|
||||||
|
2. Click on ....
|
||||||
|
3. Scroll down to ....
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
## System information
|
||||||
|
- Phone: [e.g. Google Pixel 4]
|
||||||
|
- Phone Operating System: [e.g. Android 10]
|
||||||
|
- App version: [e.g. 2.0.2]
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: Feature requests
|
||||||
|
url: https://github.com/iSoron/uhabits/discussions/categories/feature-requests?discussions_q=category%3A%22Feature+Requests%22+sort%3Atop
|
||||||
|
about: Submit ideas for new features and for improving existing features
|
||||||
|
- name: Help & FAQ
|
||||||
|
url: https://github.com/iSoron/uhabits/discussions/categories/help-faq
|
||||||
|
about: Ask questions about using the app or setting up the project
|
||||||
53
.gitignore
vendored
@@ -1,35 +1,20 @@
|
|||||||
#built application files
|
|
||||||
*.apk
|
|
||||||
*.ap_
|
|
||||||
|
|
||||||
# files for the dex VM
|
|
||||||
*.dex
|
|
||||||
|
|
||||||
# Java class files
|
|
||||||
*.class
|
|
||||||
|
|
||||||
# generated files
|
|
||||||
bin/
|
|
||||||
gen/
|
|
||||||
|
|
||||||
# Local configuration file (sdk path, etc)
|
|
||||||
local.properties
|
|
||||||
|
|
||||||
# Windows thumbnail db
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# OSX files
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Eclipse project files
|
|
||||||
.classpath
|
|
||||||
.project
|
|
||||||
|
|
||||||
# Android Studio
|
|
||||||
.idea
|
|
||||||
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
|
|
||||||
.gradle
|
|
||||||
build/
|
|
||||||
*.iml
|
*.iml
|
||||||
|
*.pbxuser
|
||||||
art/
|
*.perspective
|
||||||
|
*.perspectivev3
|
||||||
|
*.swp
|
||||||
|
*~.nib
|
||||||
|
*.hprof
|
||||||
|
.DS_Store
|
||||||
|
._.DS_Store
|
||||||
|
.externalNativeBuild
|
||||||
|
.gradle
|
||||||
|
.idea
|
||||||
|
.secret
|
||||||
|
build
|
||||||
|
local.properties
|
||||||
|
node_modules
|
||||||
|
*xcuserdata*
|
||||||
|
*.sketch
|
||||||
|
crowdin.yml
|
||||||
|
kotlin-js-store
|
||||||
|
|||||||
3
.gitmodules
vendored
@@ -1,3 +0,0 @@
|
|||||||
[submodule "libs/drag-sort-listview"]
|
|
||||||
path = libs/drag-sort-listview
|
|
||||||
url = https://github.com/iSoron/drag-sort-listview.git
|
|
||||||
436
CHANGELOG.md
Normal file
@@ -0,0 +1,436 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [2.3.1] -- 2025-08-13
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Add notes to exported CSV files (@iSoron)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Prevent some views from being obscured by system UI (@iSoron, #2171)
|
||||||
|
- Disable confetti if animations are disabled globally (@iSoron, #2170)
|
||||||
|
- Make symbols easier to distinguish in "pure black" dark mode (powerjungle, #2136)
|
||||||
|
- Trim unit labels when necessary (@hiqua, @iSoron, #2158)
|
||||||
|
|
||||||
|
## [2.3.0] -- 2025-06-23
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add support for Android 15 and 16 (@iSoron)
|
||||||
|
- Show confetti animation (@gokulk16, @iSoron, #1743)
|
||||||
|
- Show streaks for measurable habits (@teckwarz, #2059)
|
||||||
|
- Allow user to unset measurable habits (@leontodd, @kalina559, #1899, #2109)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Change background widget color for habits with implicit checks (@wobbba, #1915)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix notification when goal type is set to maximum (@manish99verma, #1931)
|
||||||
|
- Never mark "at most" habits as completed for the day (@kalina559, #2077)
|
||||||
|
- Increase minimum widget size (@iSoron, #2118)
|
||||||
|
- Improve Gradle configuration (@jimlyas, #2108)
|
||||||
|
|
||||||
|
## [2.2.0] -- 2024-01-30
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add support for Android 14 (@iSoron, @hiqua)
|
||||||
|
- Allow user to change app language (@leondzn)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Implement workaround to make notifications non-dismissible in Android 14 (@iSoron, #1872)
|
||||||
|
- Fix splash screen background color in dark mode (@SIKV, #1888)
|
||||||
|
|
||||||
|
## [2.1.3] -- 2023-08-28
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Use text input on Samsung devices (@iSoron, #1719)
|
||||||
|
- Prevent crash if alarm permission is revoked (@iSoron)
|
||||||
|
- Adjust widget colors (@iSoron)
|
||||||
|
- Fix bug preventing screens from updating at midnight (@iSoron)
|
||||||
|
- Fix skip button in locales that use comma instead of dot (@iSoron, #1721)
|
||||||
|
|
||||||
|
## [2.1.2] -- 2023-05-26
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix bug that caused widget to enter checkmark on wrong date (@iSoron, #1541)
|
||||||
|
- Fix widget corners on Android 12 (@iSoron)
|
||||||
|
- Fix bug that caused notes to be lost when editing a checkmark (@iSoron, #1566)
|
||||||
|
- Prevent soft keyboard from covering entry popup (@iSoron)
|
||||||
|
- Accept comma (instead of dot) in certain locales (@iSoron)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Remove update delay after entering a checkmark (@iSoron)
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Remove stack widgets (@iSoron)
|
||||||
|
|
||||||
|
## [2.1.1] -- 2022-09-24
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix Tasker plugin (@iSoron, #1503)
|
||||||
|
|
||||||
|
## [2.1.0] -- 2022-09-10
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Allow user to add notes to specific dates (@vbh, #1103)
|
||||||
|
- Allow user to track "at most" numerical habits (@KristianTashkov, #1101)
|
||||||
|
- Allow user to add skips to measurable habits (@kalina559, #1319)
|
||||||
|
- Bring back custom frequencies (x times in y days) (@hiqua, #1079)
|
||||||
|
- Improve number picker (@hiqua, @iSoron, #1082, #1370)
|
||||||
|
- Add new checkmark and number picker (@iSoron, #1370)
|
||||||
|
- Allow user to import numerical habits from HabitBull (@hiqua, #1278)
|
||||||
|
- Add support for Android 13 themed icons (@cheeeeer, #1497)
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Hide snooze button Android 12 notifications (@hiqua, #1226)
|
||||||
|
- Remove preference to set LED lights (@iSoron)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Hide failed habits along with completed ones (@hiqua, #1052)
|
||||||
|
- Cycle through all checkmark states when toggling (@iSoron)
|
||||||
|
- Add delay after toggling a habit (@hiqua, @kalina559, #1147)
|
||||||
|
- Small theme improvements (@KristianTashkov, #1113)
|
||||||
|
- Left-align habit notes (@iSoron)
|
||||||
|
- Increase target SDK to 31 (@hiqua)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix small dialog buttons (@kalina559, #1096)
|
||||||
|
- Fix invalid CSV files (@hiqua, #1177)
|
||||||
|
- Fix small issues in calendar chart (@kalina559, #1314)
|
||||||
|
- Resort habit list after edit (@hiqua, #1350)
|
||||||
|
- Fix marker scaling in frequency display (@eduebernal, #1425)
|
||||||
|
- Fix widgets not working correctly on API 33 (@iSoron, #1488)
|
||||||
|
|
||||||
|
### Refactoring & Testing
|
||||||
|
|
||||||
|
- Replace raster icons by vector assets (@kalina559)
|
||||||
|
- Remove JVM dependencies from uhabits-core module (@sgallese)
|
||||||
|
- Add various missing tests (@sgallese)
|
||||||
|
- Upgrade project dependencies (@hiqua, @sgallese)
|
||||||
|
|
||||||
|
## [2.0.3] - 2021-08-21
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Improve automatic checkmarks for monthly habits (@iSoron, #947)
|
||||||
|
- Fix small theme issues (@iSoron)
|
||||||
|
- Fix ANR on some Samsung phones (@iSoron, #962)
|
||||||
|
- Fix dates before the year 2000 (@iSoron, #967)
|
||||||
|
- Fix notification adding checkmarks to the wrong day (@hiqua, #969)
|
||||||
|
- Fix crashes in widgets (@hiqua, @iSoron, #907, #966, #965)
|
||||||
|
- Fix crash when moving habits (@hiqua, #968)
|
||||||
|
|
||||||
|
## [2.0.2] - 2021-05-23
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Make checkmark widget resizable
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix crash caused by numerical habits with zero target (@iSoron, #903)
|
||||||
|
- Fix small issues with font size (@iSoron)
|
||||||
|
- Allow fractional target values (@sumanabhi, #911)
|
||||||
|
- Fix IllegalStateException in androidx.customview.view (@iSoron, #906)
|
||||||
|
- Fix crash when selecting habit frequency in some languages (@iSoron, #926)
|
||||||
|
- Fix IllegalArgumentException in RingView (@iSoron, #904)
|
||||||
|
|
||||||
|
## [2.0.1] - 2021-05-09
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Make midnight delay optional and disabled by default (@hiqua)
|
||||||
|
- Add arrows to sort menu (@iSoron)
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Temporarily remove experimental device sync functionality. This feature will be re-added in
|
||||||
|
Loop 2.1.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Make implicit checkmarks easier to read (@iSoron)
|
||||||
|
- Update and improve list of translators (@hiqua, @iSoron)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Disable transparency for stacked widgets (@hiqua)
|
||||||
|
- Fix various color issues on the dark theme (@hiqua, @iSoron)
|
||||||
|
- Fix "customize notifications" on older devices (@hiqua)
|
||||||
|
- Fix snooze button in notifications when device is locked (@hiqua)
|
||||||
|
- Fix a crash when deleting habits (@engineering4good)
|
||||||
|
- Fix checkmark widget not rendering properly on some Samsung phones (@iSoron)
|
||||||
|
|
||||||
|
### Refactoring & Testing
|
||||||
|
|
||||||
|
- Finish conversion of the entire project to Kotlin (@hiqua, @iSoron, @MarKco)
|
||||||
|
- Automatically run large tests on GitHub Actions (@iSoron)
|
||||||
|
- Remove unused v21 resources (@hiqua)
|
||||||
|
|
||||||
|
## [2.0.0-alpha] - 2020-11-29
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Track numeric habits (@iSoron, @namnl)
|
||||||
|
- Skip days without breaking streak (@KristianTashkov)
|
||||||
|
- Sort habits by status (@hiqua)
|
||||||
|
- Sort habits in reverse order (@iSoron)
|
||||||
|
- Add notes to habits (@recheej)
|
||||||
|
- Improve readibility of charts (@chennemann)
|
||||||
|
- Delay new day until 3am (@KristianTashkov)
|
||||||
|
- Export backups daily (@iSoron)
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Drop support to devices older than Android 6.0 (API 23)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Reset chart offset when switching scale (@alxmjo)
|
||||||
|
- Don't show reminders from archived habits (@KristianTashkov)
|
||||||
|
- Lapses on non-daily habits decrease the score too much (@iSoron)
|
||||||
|
- Update widgets at midnight (@KristianTashkov)
|
||||||
|
|
||||||
|
### Refactoring
|
||||||
|
|
||||||
|
- Convert files to Kotlin (@olegivo)
|
||||||
|
|
||||||
|
## [1.8.12] - 2021-01-30
|
||||||
|
|
||||||
|
- Fix bug that caused incorrect check marks to show after scrolling (#713)
|
||||||
|
- Fix issue preventing widgets from updating at midnight (#680)
|
||||||
|
|
||||||
|
## [1.8.11] - 2020-12-29
|
||||||
|
|
||||||
|
- Fix theme issues on Xiaomi phones
|
||||||
|
|
||||||
|
## [1.8.10] - 2020-11-26
|
||||||
|
|
||||||
|
- Update translations
|
||||||
|
|
||||||
|
## [1.8.9] - 2020-11-18
|
||||||
|
|
||||||
|
- Manage exceptions when activities don't exist to handle intents (#181)
|
||||||
|
- MemoryHabitList: Inherit parent's order (#598)
|
||||||
|
- Remove notification groups; revert to default system behavior
|
||||||
|
- Remove SyncManager and Internet permission
|
||||||
|
|
||||||
|
## [1.8.8] - 2020-06-21
|
||||||
|
|
||||||
|
- Make small changes to the habit scheduling algorithm, so that "1 time every x days" habits work
|
||||||
|
more predictably.
|
||||||
|
- Fix crash when saving habit
|
||||||
|
|
||||||
|
## [1.8.0] - 2020-01-01
|
||||||
|
|
||||||
|
- New bar chart showing number of repetitions performed in each week, month, quarter or year.
|
||||||
|
- Improved calculation of streaks for non-daily habits: performing habits on irregular weekdays will
|
||||||
|
no longer break your streak.
|
||||||
|
- Many more colors to choose from (now 20 in total).
|
||||||
|
- Ability to customize how transparent the widgets are on your home screen.
|
||||||
|
- Ability to customize the first day of the week.
|
||||||
|
- Yes/No buttons on notifications, instead of just "Check".
|
||||||
|
- Automatic dark theme according to phone settings (Android 10).
|
||||||
|
- Smaller APK and backup files.
|
||||||
|
- Many other internal code changes improving performance and stability.
|
||||||
|
|
||||||
|
## [1.7.11] - 2019-08-10
|
||||||
|
|
||||||
|
- Fix bug that produced corrupted CSV files in some countries
|
||||||
|
|
||||||
|
## [1.7.10] - 2019-06-15
|
||||||
|
|
||||||
|
- Fix bug that prevented some devices from showing notifications.
|
||||||
|
- Update targetSdk to Android Pie (API level 28)
|
||||||
|
|
||||||
|
## [1.7.8] - 2018-04-21
|
||||||
|
|
||||||
|
- Add support for adaptive icons (Oreo)
|
||||||
|
- Add support for notification channels (Oreo)
|
||||||
|
- Update translations
|
||||||
|
|
||||||
|
## [1.7.7] - 2017-09-30
|
||||||
|
|
||||||
|
- Fix bug that caused reminders to show repeatedly on DST changes
|
||||||
|
|
||||||
|
## [1.7.6] - 2017-07-18
|
||||||
|
|
||||||
|
- Fix bug that caused widgets not to render sometimes
|
||||||
|
- Fix other minor bugs
|
||||||
|
- Update translations
|
||||||
|
|
||||||
|
## [1.7.3] - 2017-05-30
|
||||||
|
|
||||||
|
- Improve performance of 'sort by score'
|
||||||
|
- Other minor bug fixes
|
||||||
|
|
||||||
|
## [1.7.2] - 2017-05-27
|
||||||
|
|
||||||
|
- Fix crash at startup
|
||||||
|
|
||||||
|
## [1.7.1] - 2017-05-21
|
||||||
|
|
||||||
|
- Fix crash (BadParcelableException)
|
||||||
|
- Fix layout for RTL languages such as Arabic
|
||||||
|
- Automatically detect and reject invalid database files
|
||||||
|
- Add Hebrew translation
|
||||||
|
|
||||||
|
## [1.7.0] - 2017-03-31
|
||||||
|
|
||||||
|
- Sort habits automatically
|
||||||
|
- Allow swiping the header to see previous days
|
||||||
|
- Import backups directly from Google Drive or Dropbox
|
||||||
|
- Refresh data automatically at midnight
|
||||||
|
- Other minor bug fixes and enhancements
|
||||||
|
|
||||||
|
## [1.6.2] - 2016-10-13
|
||||||
|
|
||||||
|
- Fix crash on Android 4.1
|
||||||
|
|
||||||
|
## [1.6.1] - 2016-10-10
|
||||||
|
|
||||||
|
- Fix a crash at startup when database is corrupted
|
||||||
|
|
||||||
|
## [1.6.0] - 2016-10-10
|
||||||
|
|
||||||
|
- Add option to make notifications sticky
|
||||||
|
- Add option to hide completed habits
|
||||||
|
- Display total number of repetitions for each habit
|
||||||
|
- Pebble integration: check/snooze habits from the watch
|
||||||
|
- Tasker/Locale integration: allow third-party apps to add checkmarks
|
||||||
|
- Export an unified CSV file, with checkmarks for all the habits
|
||||||
|
- Increase width of name column according to screen size
|
||||||
|
- Stop showing reminders for archived habits
|
||||||
|
- Add Danish, Dutch, Greek, Hindi and Portuguese (PT) translations
|
||||||
|
- Other minor fixes and enhancements
|
||||||
|
|
||||||
|
## [1.5.6] - 2016-06-19
|
||||||
|
|
||||||
|
- Fix bug that prevented checkmark widget from working
|
||||||
|
|
||||||
|
## [1.5.5] - 2016-06-19
|
||||||
|
|
||||||
|
- Fix bug that prevented check button on notification to work sometimes
|
||||||
|
- Fix bug that caused back button to apparently erase some checkmarks
|
||||||
|
- Complete French translation
|
||||||
|
- Add Croatian and Slovenian translations
|
||||||
|
|
||||||
|
## [1.5.4] - 2016-05-29
|
||||||
|
|
||||||
|
- Fix crash upon opening settings screen in some phones
|
||||||
|
- Fix missing folders in CSV archive
|
||||||
|
- Add Serbian translation
|
||||||
|
|
||||||
|
## [1.5.3] - 2016-05-22
|
||||||
|
|
||||||
|
- Complete Arabic and Czech translations
|
||||||
|
- Fix crash at startup
|
||||||
|
- Fix checkmark widget on custom launchers
|
||||||
|
|
||||||
|
## [1.5.2] - 2016-05-19
|
||||||
|
|
||||||
|
- Fix missing attachment on bug reports
|
||||||
|
- Fix bug that prevents some widgets from rendering
|
||||||
|
- Complete Japanese translation
|
||||||
|
|
||||||
|
## [1.5.1] - 2016-05-17
|
||||||
|
|
||||||
|
- Fix build on F-Droid
|
||||||
|
|
||||||
|
## [1.5.0] - 2016-05-15
|
||||||
|
|
||||||
|
- Add night mode, with AMOLED support
|
||||||
|
- Backport material design to older devices
|
||||||
|
- Display more information on statistics screen
|
||||||
|
- Display score on main screen and checkmark widget
|
||||||
|
- Make widgets react immediately to touch
|
||||||
|
- Reschedule reminders after reboot
|
||||||
|
- Pick first day of the week according to country
|
||||||
|
- Add option to reverse order of days on main screen
|
||||||
|
- Add option to change notification sounds
|
||||||
|
- Add Catalan, Indonesian, Turkish, Ukrainian translations
|
||||||
|
- Switch between Simplified/Traditional Chinese according to country
|
||||||
|
|
||||||
|
## [1.4.1] - 2016-04-09
|
||||||
|
|
||||||
|
- Show error message on widgets, instead of crashing
|
||||||
|
- Complete French translation
|
||||||
|
- Minor fixes to other translations
|
||||||
|
|
||||||
|
## [1.4.0] - 2016-04-07
|
||||||
|
|
||||||
|
- Ability to import data from third-party apps
|
||||||
|
- Ability to save and restore full database backup
|
||||||
|
- Show more information on streak chart
|
||||||
|
- Simplify interface for creating habits
|
||||||
|
- Add link to Frequently Asked Questions (FAQ)
|
||||||
|
- Reduce app loading time and lag on widgets
|
||||||
|
- Generate bug reports on crash and from settings screen
|
||||||
|
- Disable vibration according to phone settings
|
||||||
|
- Add Czech translation
|
||||||
|
- Fix wrong month names for some languages
|
||||||
|
|
||||||
|
## [1.3.3] - 2016-03-20
|
||||||
|
|
||||||
|
- Add Spanish and Korean translations
|
||||||
|
- Make small corrections to other translations
|
||||||
|
- Fix incorrect date in history calendar
|
||||||
|
|
||||||
|
## [1.3.2] - 2016-03-18
|
||||||
|
|
||||||
|
- Add Arabic, Italian, Polish, Russian and Swedish translations
|
||||||
|
- Minor fixes to German and French translations
|
||||||
|
- Minor bug fixes
|
||||||
|
|
||||||
|
## [1.3.1] - 2016-03-15
|
||||||
|
|
||||||
|
- Fixes crash on devices with large screen, such as the Nexus 10
|
||||||
|
- Fixes crash when clicking widgets and reminders of deleted habits
|
||||||
|
- Other minor bug fixes
|
||||||
|
|
||||||
|
## [1.3.0] - 2016-03-12
|
||||||
|
|
||||||
|
- New frequency plot: view total repetitions per day of week
|
||||||
|
- New history editor: put checkmarks in the past
|
||||||
|
- Add German, French and Japanese translations
|
||||||
|
- Add about screen, with credits to all contributors
|
||||||
|
- Fix small bug that prevented habit from being reordered
|
||||||
|
- Fix small bug caused by rotating the device
|
||||||
|
|
||||||
|
## [1.2.0] - 2016-03-04
|
||||||
|
|
||||||
|
- Ability to export habit data as CSV
|
||||||
|
- Widgets (checkmark, history, score and streaks)
|
||||||
|
- More natural scrolling on data views (fling)
|
||||||
|
- Minor UI improvements on pre-Lollipop devices
|
||||||
|
- Fix crash on Samsung Galaxy TabS 8.4
|
||||||
|
- Other minor bug fixes
|
||||||
|
|
||||||
|
## [1.1.1] - 2016-02-24
|
||||||
|
|
||||||
|
- Show reminder only on chosen days of the week
|
||||||
|
- Rearrange habits by long-pressing then dragging
|
||||||
|
- Select and modify multiple habits simultaneously
|
||||||
|
- 12/24 hour format according to phone preferences
|
||||||
|
- Permanently delete habits
|
||||||
|
- Usage hints during startup
|
||||||
|
- Translation to Brazilian Portuguese and Chinese
|
||||||
|
- Other minor fixes
|
||||||
|
|
||||||
|
## [1.0.0] - 2016-02-19
|
||||||
|
|
||||||
|
- Initial release
|
||||||
207
NOTICE.md
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
# Copyright Notices
|
||||||
|
|
||||||
|
## ActiveAndroid
|
||||||
|
|
||||||
|
<https://github.com/pardom/ActiveAndroid>
|
||||||
|
|
||||||
|
Copyright (C) 2010 Michael Pardo
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
## Android Open Source Project
|
||||||
|
|
||||||
|
<https://source.android.com/>
|
||||||
|
|
||||||
|
Copyright (C) 2013 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
## FontAwesome
|
||||||
|
|
||||||
|
<http://fontawesome.io>
|
||||||
|
|
||||||
|
Font Awesome is a full suite of 605 pictographic icons for easy scalable
|
||||||
|
vector graphics on websites, created and maintained by Dave Gandy. Licensed
|
||||||
|
under the SIL OFL 1.1.
|
||||||
|
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
## Material Design Icons
|
||||||
|
|
||||||
|
<https://github.com/google/material-design-icons>
|
||||||
|
|
||||||
|
Material design icons are the official icon set from Google that are designed
|
||||||
|
under the material design guidelines. Available under the Creative Common
|
||||||
|
Attribution 4.0 International License (CC-BY 4.0).
|
||||||
|
|
||||||
|
## Android Flow Layout
|
||||||
|
|
||||||
|
<https://github.com/ApmeM/android-flowlayout>
|
||||||
|
|
||||||
|
Extended linear layout that wrap its content when there is no place in the current line.
|
||||||
|
|
||||||
|
Copyright 2011, Artem Votincev (apmem.org)
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
|
use this file except in compliance with the License. You may obtain a copy
|
||||||
|
of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
License for the specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
|
||||||
|
## Dagger 2
|
||||||
|
|
||||||
|
<https://github.com/google/dagger>
|
||||||
|
|
||||||
|
A fast dependency injector for Android and Java.
|
||||||
|
|
||||||
|
Copyright 2012 Square, Inc.
|
||||||
|
Copyright 2012 Google, Inc.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
## AutoFactory
|
||||||
|
|
||||||
|
<https://github.com/google/auto/tree/master/factory>
|
||||||
|
|
||||||
|
A source code generator for JSR-330-compatible factories.
|
||||||
|
|
||||||
|
Copyright 2013 Google, Inc.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
## Retrolambda
|
||||||
|
|
||||||
|
<https://github.com/orfjackal/retrolambda>
|
||||||
|
|
||||||
|
Backport of Java 8's lambda expressions to Java 7, 6 and 5
|
||||||
|
|
||||||
|
Copyright (c) 2013-2016 Esko Luontola and other Retrolambda contributors
|
||||||
|
This software is released under the Apache License 2.0.
|
||||||
|
The license text is at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
## PebbleKit SDK
|
||||||
|
|
||||||
|
<https://github.com/pebble/pebble-android-sdk/>
|
||||||
|
|
||||||
|
Android PebbleKit SDK to talk to the Pebble via Bluetooth
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2014 - 2015 Pebble Technology
|
||||||
|
|
||||||
|
## AppIntro
|
||||||
|
|
||||||
|
<https://github.com/PaoloRotolo/AppIntro>
|
||||||
|
|
||||||
|
Make a cool intro for your Android app.
|
||||||
|
|
||||||
|
Copyright 2015 Paolo Rotolo
|
||||||
|
Copyright 2016 Maximilian Narr
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
## ButterKnife
|
||||||
|
|
||||||
|
<https://github.com/JakeWharton/butterknife>
|
||||||
|
|
||||||
|
Bind Android views and callbacks to fields and methods
|
||||||
|
|
||||||
|
Copyright 2013 Jake Wharton
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
## opencsv
|
||||||
|
|
||||||
|
<http://opencsv.sourceforge.net/>
|
||||||
|
|
||||||
|
Opencsv is a very simple csv (comma-separated values) parser library for Java.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
128
README.md
@@ -1,16 +1,22 @@
|
|||||||
# Loop Habit Tracker
|
<h1 align="center">Loop Habit Tracker</h1>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/iSoron/uhabits/releases/latest">
|
||||||
|
<img alt="release" src="https://img.shields.io/github/v/release/iSoron/uhabits" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/iSoron/uhabits/discussions">
|
||||||
|
<img alt="GitHub" src="https://img.shields.io/badge/GitHub-Discussions-%23fc4ebc" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
Loop is a simple Android app that helps you create and maintain good habits. Detailed graphs and statistics show you how your habits improved over time. It is completely ad-free and open source, with no intrusive permissions. Join the open beta at [Google Play Store](https://play.google.com/apps/testing/org.isoron.uhabits).
|
Loop is a mobile app that helps you create and maintain good habits,
|
||||||
|
allowing you to achieve your long-term goals. Detailed graphs and statistics
|
||||||
|
show you how your habits improved over time. It is completely ad-free and open
|
||||||
|
source.
|
||||||
|
|
||||||
## Features
|
<p align="center">
|
||||||
|
<a href="https://play.google.com/store/apps/details?id=org.isoron.uhabits&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-AC-global-none-all-co-pr-py-PartBadges-Oct1515-1"><img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" height="80px"/></a>
|
||||||
* Simple and beautiful interface, following the Material Design guidelines.
|
<a href="https://f-droid.org/app/org.isoron.uhabits"><img alt="Get it on F-Droid" src="https://f-droid.org/badge/get-it-on.png" height="80px"/></a>
|
||||||
* Advanced algorithms for calculating the strength of your habits. Every repetition makes your habit stronger, and every missed day makes it weaker. A few missed days after a long streak, however, will not completely destroy your entire progress.
|
</p>
|
||||||
* Detailed graphs and statistics, showing how did you habits improve over time. Scroll back to see the complete history of your habit.
|
|
||||||
* Support for both daily habits and habits with more complex schedules, such as 3 times every week; one time every other week; or every other day.
|
|
||||||
* Habit reminders at a chosen hour of the day.
|
|
||||||
* Support for Android Wear. Reminders can be checked or dismissed from the watch.
|
|
||||||
* Completely ad-free and open source. There are absolutely no advertisements, annoying notifications or intrusive permissions in this app, and there will never be. The complete source code is available under the GPLv3.
|
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
@@ -18,12 +24,96 @@ Loop is a simple Android app that helps you create and maintain good habits. Det
|
|||||||
[![Edit habit][screen2th]][screen2]
|
[![Edit habit][screen2th]][screen2]
|
||||||
[![Habit strength][screen3th]][screen3]
|
[![Habit strength][screen3th]][screen3]
|
||||||
[![Habit history and streaks][screen4th]][screen4]
|
[![Habit history and streaks][screen4th]][screen4]
|
||||||
|
[![Widgets][screen5th]][screen5]
|
||||||
|
[![Night mode][screen6th]][screen6]
|
||||||
|
|
||||||
[screen1]: screenshots/original/uhabits1.png
|
## Features
|
||||||
[screen2]: screenshots/original/uhabits2.png
|
|
||||||
[screen3]: screenshots/original/uhabits3.png
|
* **Beautiful, minimalistic and lightweight interface.** Loop has an elegant and minimalistic interface that is very easy to use, even for first-time users. Highly optimized for speed, the app works well even on older phones.
|
||||||
[screen4]: screenshots/original/uhabits4.png
|
|
||||||
[screen1th]: screenshots/thumbs/uhabits1.png
|
* **Habit score.** Loop has an advanced formula for calculating the strength of your habits. Every repetition makes your habit stronger and every missed day makes it weaker. A few missed days after a long streak, however, will not completely destroy your progress, unlike many other don't-break-the-chain apps.
|
||||||
[screen2th]: screenshots/thumbs/uhabits2.png
|
|
||||||
[screen3th]: screenshots/thumbs/uhabits3.png
|
* **Flexible schedules.** In addition to daily habits, Loop supports habits with more complex schedules, such as 3 times per week or every other day.
|
||||||
[screen4th]: screenshots/thumbs/uhabits4.png
|
|
||||||
|
* **Reminders.** Schedule notifications to remind you of your habits. Each habit can have its own reminder, at a chosen time of the day. Easily check or dismiss your habit directly from the notification.
|
||||||
|
|
||||||
|
* **Widgets.** Be reminded of your habits whenever you unlock your phone. Colorful widgets allow you to track your habits directly from your home screen, without even opening the app.
|
||||||
|
|
||||||
|
* **Take control of your data.** If you want to further analyze your data, or move it to another service, Loop allows you to export it to spreadsheets (CSV) or to a database file (SQLite). For power users, checkmarks can be added through other apps, such as Tasker.
|
||||||
|
|
||||||
|
* **No limitations.** Track as many habits as you wish. Loop imposes no artificial limits on how many habits you can have. All features are available to all users. There are no in-app purchases.
|
||||||
|
|
||||||
|
* **Completely ad-free and open source.** There are no advertisements, annoying notifications or intrusive permissions in this app, and there will never be. The app is completely open-source (GPLv3).
|
||||||
|
|
||||||
|
* **Works offline and respects your privacy.** Loop doesn't require an Internet connection or online account registration. Your confidential data is never sent to anyone. Neither the developers nor any third-parties have access to it.
|
||||||
|
|
||||||
|
## Installing
|
||||||
|
|
||||||
|
The easiest way to install Loop is through the [Google Play Store][playstore] or [F-Droid][fdroid].
|
||||||
|
You may also download and install the APK from the [releases page][releases];
|
||||||
|
note, however, that the app will not be updated automatically. To build this
|
||||||
|
app from the source code, see [build instructions][build].
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Loop is an open source project developed entirely by volunteers. If you would
|
||||||
|
like to contribute to the project, you are very welcome. There are many ways to
|
||||||
|
contribute, even if you are not a software developer.
|
||||||
|
|
||||||
|
* **Report bugs, suggest features.** The easiest way to contribute is to simply
|
||||||
|
use the app and let us know if you find any problems or have any suggestions
|
||||||
|
to improve it. To report a problem, please [create a new bug report](https://github.com/iSoron/uhabits/issues/new/choose).
|
||||||
|
To request a new feature or vote on existing feature requests, please visit
|
||||||
|
our [GitHub Discussions page](https://github.com/iSoron/uhabits/discussions/categories/feature-requests).
|
||||||
|
If you would like to receive the newest versions of the app
|
||||||
|
earlier than everyone else, [join our open beta on Google Play][beta].
|
||||||
|
|
||||||
|
* **Spread the word.** If you like the app, share it with your family, friends
|
||||||
|
and colleagues. You can also rate and review the app on Google Play Store, to help
|
||||||
|
other users find it more easily.
|
||||||
|
|
||||||
|
* **Translate the app into your own language.** If you are not a native English
|
||||||
|
speaker, and would like to see the app translated into your own language,
|
||||||
|
please join our [open translation project][poedit]. If the translation
|
||||||
|
is already completed, you are also very welcome to join and proofread it.
|
||||||
|
|
||||||
|
* **Write some code.** If you are an Android developer, you are very welcome to
|
||||||
|
contribute with code. Please see the [guidelines](https://github.com/iSoron/uhabits/blob/dev/docs/GUIDELINES.md).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
<img align="right" alt="GPL v3" src="https://www.gnu.org/graphics/gplv3-88x31.png">
|
||||||
|
|
||||||
|
Copyright (C) 2016-2025 Álinson Santos Xavier <isoron@gmail.com>
|
||||||
|
|
||||||
|
Loop Habit Tracker is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
Loop Habit Tracker is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
[screen1]: screenshots/1.png
|
||||||
|
[screen2]: screenshots/2.png
|
||||||
|
[screen3]: screenshots/3.png
|
||||||
|
[screen4]: screenshots/4.png
|
||||||
|
[screen5]: screenshots/5.png
|
||||||
|
[screen6]: screenshots/6.png
|
||||||
|
[screen1th]: screenshots/1.thumb.png
|
||||||
|
[screen2th]: screenshots/2.thumb.png
|
||||||
|
[screen3th]: screenshots/3.thumb.png
|
||||||
|
[screen4th]: screenshots/4.thumb.png
|
||||||
|
[screen5th]: screenshots/5.thumb.png
|
||||||
|
[screen6th]: screenshots/6.thumb.png
|
||||||
|
[poedit]: https://translate.loophabits.org
|
||||||
|
[playstore]: https://play.google.com/store/apps/details?id=org.isoron.uhabits
|
||||||
|
[releases]: https://github.com/iSoron/uhabits/releases
|
||||||
|
[fdroid]: https://f-droid.org/app/org.isoron.uhabits
|
||||||
|
[build]: https://github.com/iSoron/uhabits/blob/dev/docs/BUILD.md
|
||||||
|
[beta]: https://play.google.com/apps/testing/org.isoron.uhabits
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
apply plugin: 'com.android.application'
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 23
|
|
||||||
buildToolsVersion "21.1.2"
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "org.isoron.uhabits"
|
|
||||||
minSdkVersion 15
|
|
||||||
targetSdkVersion 23
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
minifyEnabled false
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lintOptions {
|
|
||||||
checkReleaseBuilds false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile 'com.android.support:support-v4:23.1.1'
|
|
||||||
compile 'com.github.paolorotolo:appintro:3.4.0'
|
|
||||||
compile project(':libs:drag-sort-listview:library')
|
|
||||||
compile files('libs/ActiveAndroid.jar')
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<lint>
|
|
||||||
</lint>
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest
|
|
||||||
package="org.isoron.uhabits"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:versionCode="8"
|
|
||||||
android:versionName="1.1.1">
|
|
||||||
|
|
||||||
<uses-permission
|
|
||||||
android:name="android.permission.VIBRATE"/>
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:name="com.activeandroid.app.Application"
|
|
||||||
android:icon="@mipmap/ic_launcher"
|
|
||||||
android:label="@string/main_activity_title"
|
|
||||||
android:theme="@style/AppBaseTheme"
|
|
||||||
android:backupAgent=".HabitsBackupAgent">
|
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="AA_DB_NAME"
|
|
||||||
android:value="uhabits.db"/>
|
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="AA_DB_VERSION"
|
|
||||||
android:value="11"/>
|
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="com.google.android.backup.api_key"
|
|
||||||
android:value="AEdPqrEAAAAI6aeWncbnMNo8E5GWeZ44dlc5cQ7tCROwFhOtiw" />
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".MainActivity"
|
|
||||||
android:label="@string/main_activity_title">
|
|
||||||
<intent-filter
|
|
||||||
android:label="@string/app_name">
|
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<receiver
|
|
||||||
android:name=".ReminderAlarmReceiver" />
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".ShowHabitActivity"
|
|
||||||
android:label="@string/title_activity_show_habit"
|
|
||||||
android:parentActivityName=".MainActivity">
|
|
||||||
<meta-data
|
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
|
||||||
android:value="org.isoron.uhabits.MainActivity"/>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".SettingsActivity"
|
|
||||||
android:label="@string/settings"
|
|
||||||
android:parentActivityName=".MainActivity">
|
|
||||||
<meta-data
|
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
|
||||||
android:value="org.isoron.uhabits.MainActivity"/>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity android:name=".IntroActivity"
|
|
||||||
android:label=""
|
|
||||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
alter table habits add column reminder_days integer not null default 127;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
alter table habits add column reminder_hour integer;
|
|
||||||
alter table habits add column reminder_min integer;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
alter table habits add column highlight integer not null default 0;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
alter table habits add column archived integer not null default 0;
|
|
||||||
|
Before Width: | Height: | Size: 40 KiB |
@@ -1,60 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.helpers;
|
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
|
|
||||||
public class ColorHelper
|
|
||||||
{
|
|
||||||
public static final int[] palette =
|
|
||||||
{
|
|
||||||
Color.parseColor("#D32F2F"), // red
|
|
||||||
Color.parseColor("#E64A19"), // orange
|
|
||||||
Color.parseColor("#F9A825"), // yellow
|
|
||||||
Color.parseColor("#AFB42B"), // light green
|
|
||||||
Color.parseColor("#388E3C"), // dark green
|
|
||||||
Color.parseColor("#00897B"), // teal
|
|
||||||
Color.parseColor("#00ACC1"), // cyan
|
|
||||||
Color.parseColor("#039BE5"), // blue
|
|
||||||
Color.parseColor("#5E35B1"), // deep purple
|
|
||||||
Color.parseColor("#8E24AA"), // purple
|
|
||||||
Color.parseColor("#D81B60"), // pink
|
|
||||||
Color.parseColor("#303030"), // dark grey
|
|
||||||
Color.parseColor("#aaaaaa") // light grey
|
|
||||||
};
|
|
||||||
|
|
||||||
public static int mixColors(int color1, int color2, float amount)
|
|
||||||
{
|
|
||||||
final byte ALPHA_CHANNEL = 24;
|
|
||||||
final byte RED_CHANNEL = 16;
|
|
||||||
final byte GREEN_CHANNEL = 8;
|
|
||||||
final byte BLUE_CHANNEL = 0;
|
|
||||||
|
|
||||||
final float inverseAmount = 1.0f - amount;
|
|
||||||
|
|
||||||
int a = ((int) (((float) (color1 >> ALPHA_CHANNEL & 0xff) * amount) +
|
|
||||||
((float) (color2 >> ALPHA_CHANNEL & 0xff) * inverseAmount))) & 0xff;
|
|
||||||
int r = ((int) (((float) (color1 >> RED_CHANNEL & 0xff) * amount) +
|
|
||||||
((float) (color2 >> RED_CHANNEL & 0xff) * inverseAmount))) & 0xff;
|
|
||||||
int g = ((int) (((float) (color1 >> GREEN_CHANNEL & 0xff) * amount) +
|
|
||||||
((float) (color2 >> GREEN_CHANNEL & 0xff) * inverseAmount))) & 0xff;
|
|
||||||
int b = ((int) (((float) (color1 & 0xff) * amount) +
|
|
||||||
((float) (color2 & 0xff) * inverseAmount))) & 0xff;
|
|
||||||
|
|
||||||
return a << ALPHA_CHANNEL | r << RED_CHANNEL | g << GREEN_CHANNEL | b << BLUE_CHANNEL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.helpers;
|
|
||||||
|
|
||||||
public abstract class Command
|
|
||||||
{
|
|
||||||
public abstract void execute();
|
|
||||||
|
|
||||||
public abstract void undo();
|
|
||||||
|
|
||||||
public Integer getExecuteStringId()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUndoStringId()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,188 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.helpers;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.text.format.DateFormat;
|
|
||||||
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.TimeZone;
|
|
||||||
|
|
||||||
public class DateHelper
|
|
||||||
{
|
|
||||||
public static int millisecondsInOneDay = 24 * 60 * 60 * 1000;
|
|
||||||
|
|
||||||
public static long getLocalTime()
|
|
||||||
{
|
|
||||||
TimeZone tz = TimeZone.getDefault();
|
|
||||||
long now = new Date().getTime();
|
|
||||||
return now + tz.getOffset(now);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static long toLocalTime(long timestamp)
|
|
||||||
{
|
|
||||||
TimeZone tz = TimeZone.getDefault();
|
|
||||||
long now = new Date(timestamp).getTime();
|
|
||||||
return now + tz.getOffset(now);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static long getStartOfDay(long timestamp)
|
|
||||||
{
|
|
||||||
return (timestamp / millisecondsInOneDay) * millisecondsInOneDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GregorianCalendar getStartOfTodayCalendar()
|
|
||||||
{
|
|
||||||
GregorianCalendar day = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
|
|
||||||
day.setTimeInMillis(DateHelper.getStartOfDay(DateHelper.getLocalTime()));
|
|
||||||
return day;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GregorianCalendar getCalendar(long timestamp)
|
|
||||||
{
|
|
||||||
GregorianCalendar day = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
|
|
||||||
day.setTimeInMillis(timestamp);
|
|
||||||
return day;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getWeekday(long timestamp)
|
|
||||||
{
|
|
||||||
GregorianCalendar day = getCalendar(timestamp);
|
|
||||||
return day.get(GregorianCalendar.DAY_OF_WEEK) % 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static long getStartOfToday()
|
|
||||||
{
|
|
||||||
return getStartOfDay(DateHelper.getLocalTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String formatTime(Context context, int hours, int minutes)
|
|
||||||
{
|
|
||||||
int reminderMilliseconds = (hours * 60 + minutes) * 60 * 1000;
|
|
||||||
|
|
||||||
Date date = new Date(reminderMilliseconds);
|
|
||||||
java.text.DateFormat df = DateFormat.getTimeFormat(context);
|
|
||||||
df.setTimeZone(TimeZone.getTimeZone("UTC"));
|
|
||||||
|
|
||||||
return df.format(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String formatHeaderDate(GregorianCalendar day)
|
|
||||||
{
|
|
||||||
String dayOfMonth = Integer.toString(day.get(GregorianCalendar.DAY_OF_MONTH));
|
|
||||||
String dayOfWeek = day.getDisplayName(GregorianCalendar.DAY_OF_WEEK,
|
|
||||||
GregorianCalendar.SHORT, Locale.getDefault());
|
|
||||||
|
|
||||||
return dayOfWeek + "\n" + dayOfMonth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int differenceInDays(Date from, Date to)
|
|
||||||
{
|
|
||||||
long milliseconds = getStartOfDay(to.getTime()) - getStartOfDay(from.getTime());
|
|
||||||
return (int) (milliseconds / millisecondsInOneDay);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String[] getShortDayNames()
|
|
||||||
{
|
|
||||||
return getDayNames(GregorianCalendar.SHORT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String[] getLongDayNames()
|
|
||||||
{
|
|
||||||
return getDayNames(GregorianCalendar.LONG);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static String[] getDayNames(int format)
|
|
||||||
{
|
|
||||||
String[] wdays = new String[7];
|
|
||||||
|
|
||||||
GregorianCalendar day = new GregorianCalendar();
|
|
||||||
day.set(GregorianCalendar.DAY_OF_WEEK, 0);
|
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++)
|
|
||||||
{
|
|
||||||
wdays[i] = day.getDisplayName(GregorianCalendar.DAY_OF_WEEK, format,
|
|
||||||
Locale.getDefault());
|
|
||||||
day.add(GregorianCalendar.DAY_OF_MONTH, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return wdays;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String formatWeekdayList(Context context, boolean weekday[])
|
|
||||||
{
|
|
||||||
String shortDayNames[] = getShortDayNames();
|
|
||||||
String longDayNames[] = getLongDayNames();
|
|
||||||
StringBuilder buffer = new StringBuilder();
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
int first = 0;
|
|
||||||
boolean isFirst = true;
|
|
||||||
for(int i = 0; i < 7; i++)
|
|
||||||
{
|
|
||||||
if(weekday[i])
|
|
||||||
{
|
|
||||||
if(isFirst) first = i;
|
|
||||||
else buffer.append(", ");
|
|
||||||
|
|
||||||
buffer.append(shortDayNames[i]);
|
|
||||||
isFirst = false;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(count == 1) return longDayNames[first];
|
|
||||||
if(count == 2 && weekday[0] && weekday[1]) return context.getString(R.string.weekends);
|
|
||||||
if(count == 5 && !weekday[0] && !weekday[1]) return context.getString(R.string.any_weekday);
|
|
||||||
if(count == 7) return context.getString(R.string.any_day);
|
|
||||||
return buffer.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer packWeekdayList(boolean weekday[])
|
|
||||||
{
|
|
||||||
int list = 0;
|
|
||||||
int current = 1;
|
|
||||||
|
|
||||||
for(int i = 0; i < 7; i++)
|
|
||||||
{
|
|
||||||
if(weekday[i]) list |= current;
|
|
||||||
current = current << 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean[] unpackWeekdayList(int list)
|
|
||||||
{
|
|
||||||
boolean[] weekday = new boolean[7];
|
|
||||||
int current = 1;
|
|
||||||
|
|
||||||
for(int i = 0; i < 7; i++)
|
|
||||||
{
|
|
||||||
if((list & current) != 0) weekday[i] = true;
|
|
||||||
current = current << 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return weekday;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.helpers;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.DialogInterface.OnClickListener;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.graphics.Typeface;
|
|
||||||
import android.os.Vibrator;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
|
|
||||||
public abstract class DialogHelper
|
|
||||||
{
|
|
||||||
|
|
||||||
private static Typeface fontawesome;
|
|
||||||
|
|
||||||
public interface OnSavedListener
|
|
||||||
{
|
|
||||||
void onSaved(Command command, Object savedObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void showSoftKeyboard(View view)
|
|
||||||
{
|
|
||||||
InputMethodManager imm = (InputMethodManager) view.getContext()
|
|
||||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
||||||
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void vibrate(Context context, int duration)
|
|
||||||
{
|
|
||||||
Vibrator vb = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
|
||||||
vb.vibrate(duration);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void incrementLaunchCount(Context context)
|
|
||||||
{
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
int count = prefs.getInt("launch_count", 0);
|
|
||||||
prefs.edit().putInt("launch_count", count + 1).apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getLaunchCount(Context context)
|
|
||||||
{
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
return prefs.getInt("launch_count", 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.helpers;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.backup.BackupManager;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
|
|
||||||
import java.util.LinkedList;
|
|
||||||
|
|
||||||
abstract public class ReplayableActivity extends Activity
|
|
||||||
{
|
|
||||||
private static int MAX_UNDO_LEVEL = 15;
|
|
||||||
|
|
||||||
private LinkedList<Command> undoList;
|
|
||||||
private LinkedList<Command> redoList;
|
|
||||||
private Toast toast;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
undoList = new LinkedList<>();
|
|
||||||
redoList = new LinkedList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void executeCommand(Command command, Long refreshKey)
|
|
||||||
{
|
|
||||||
executeCommand(command, false, refreshKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void undo()
|
|
||||||
{
|
|
||||||
if (undoList.isEmpty())
|
|
||||||
{
|
|
||||||
showToast(R.string.toast_nothing_to_undo);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Command last = undoList.pop();
|
|
||||||
redoList.push(last);
|
|
||||||
last.undo();
|
|
||||||
showToast(last.getUndoStringId());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void redo()
|
|
||||||
{
|
|
||||||
if (redoList.isEmpty())
|
|
||||||
{
|
|
||||||
showToast(R.string.toast_nothing_to_redo);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Command last = redoList.pop();
|
|
||||||
executeCommand(last, false, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showToast(Integer stringId)
|
|
||||||
{
|
|
||||||
if (stringId == null) return;
|
|
||||||
if (toast == null) toast = Toast.makeText(this, stringId, Toast.LENGTH_SHORT);
|
|
||||||
else toast.setText(stringId);
|
|
||||||
toast.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void executeCommand(final Command command, Boolean clearRedoStack, final Long refreshKey)
|
|
||||||
{
|
|
||||||
undoList.push(command);
|
|
||||||
|
|
||||||
if (undoList.size() > MAX_UNDO_LEVEL) undoList.removeLast();
|
|
||||||
if (clearRedoStack) redoList.clear();
|
|
||||||
|
|
||||||
new AsyncTask<Void, Void, Void>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... params)
|
|
||||||
{
|
|
||||||
command.execute();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Void aVoid)
|
|
||||||
{
|
|
||||||
ReplayableActivity.this.onPostExecuteCommand(refreshKey);
|
|
||||||
BackupManager.dataChanged("org.isoron.uhabits");
|
|
||||||
}
|
|
||||||
}.execute();
|
|
||||||
|
|
||||||
|
|
||||||
showToast(command.getExecuteStringId());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onPostExecuteCommand(Long refreshKey)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits;
|
|
||||||
|
|
||||||
import android.app.backup.BackupAgentHelper;
|
|
||||||
import android.app.backup.FileBackupHelper;
|
|
||||||
import android.app.backup.SharedPreferencesBackupHelper;
|
|
||||||
|
|
||||||
public class HabitsBackupAgent extends BackupAgentHelper
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onCreate()
|
|
||||||
{
|
|
||||||
addHelper("preferences", new SharedPreferencesBackupHelper(this, "preferences"));
|
|
||||||
addHelper("database", new FileBackupHelper(this, "../databases/uhabits.db"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits;
|
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import com.github.paolorotolo.appintro.AppIntro2;
|
|
||||||
import com.github.paolorotolo.appintro.AppIntroFragment;
|
|
||||||
|
|
||||||
public class IntroActivity extends AppIntro2
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void init(Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
showStatusBar(false);
|
|
||||||
|
|
||||||
addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_1),
|
|
||||||
getString(R.string.intro_description_1), R.drawable.intro_icon_1,
|
|
||||||
Color.parseColor("#194673")));
|
|
||||||
|
|
||||||
addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_2),
|
|
||||||
getString(R.string.intro_description_2), R.drawable.intro_icon_2,
|
|
||||||
Color.parseColor("#ffa726")));
|
|
||||||
|
|
||||||
addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_3),
|
|
||||||
getString(R.string.intro_description_3), R.drawable.intro_icon_3,
|
|
||||||
Color.parseColor("#7cb342")));
|
|
||||||
|
|
||||||
addSlide(AppIntroFragment.newInstance(getString(R.string.intro_title_4),
|
|
||||||
getString(R.string.intro_description_4), R.drawable.intro_icon_4,
|
|
||||||
Color.parseColor("#9575cd")));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNextPressed()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDonePressed()
|
|
||||||
{
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSlideChanged()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.helpers.DialogHelper;
|
|
||||||
import org.isoron.helpers.ReplayableActivity;
|
|
||||||
import org.isoron.uhabits.fragments.ListHabitsFragment;
|
|
||||||
import org.isoron.uhabits.helpers.ReminderHelper;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
public class MainActivity extends ReplayableActivity
|
|
||||||
implements ListHabitsFragment.OnHabitClickListener
|
|
||||||
{
|
|
||||||
private ListHabitsFragment listHabitsFragment;
|
|
||||||
SharedPreferences prefs;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.list_habits_activity);
|
|
||||||
|
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
listHabitsFragment =
|
|
||||||
(ListHabitsFragment) getFragmentManager().findFragmentById(R.id.fragment1);
|
|
||||||
|
|
||||||
onStartup();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onStartup()
|
|
||||||
{
|
|
||||||
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
|
|
||||||
ReminderHelper.createReminderAlarms(MainActivity.this);
|
|
||||||
DialogHelper.incrementLaunchCount(this);
|
|
||||||
showTutorial();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showTutorial()
|
|
||||||
{
|
|
||||||
Boolean firstRun = prefs.getBoolean("pref_first_run", true);
|
|
||||||
|
|
||||||
if (firstRun)
|
|
||||||
{
|
|
||||||
SharedPreferences.Editor editor = prefs.edit();
|
|
||||||
editor.putBoolean("pref_first_run", false);
|
|
||||||
editor.putLong("last_hint_timestamp", DateHelper.getStartOfToday()).apply();
|
|
||||||
editor.apply();
|
|
||||||
|
|
||||||
Intent intent = new Intent(this, IntroActivity.class);
|
|
||||||
this.startActivity(intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu)
|
|
||||||
{
|
|
||||||
getMenuInflater().inflate(R.menu.list_habits_menu, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item)
|
|
||||||
{
|
|
||||||
switch (item.getItemId())
|
|
||||||
{
|
|
||||||
case R.id.action_settings:
|
|
||||||
Intent intent = new Intent(this, SettingsActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onHabitClicked(Habit habit)
|
|
||||||
{
|
|
||||||
Intent intent = new Intent(this, ShowHabitActivity.class);
|
|
||||||
intent.setData(Uri.parse("content://org.isoron.uhabits/habit/" + habit.getId()));
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPostExecuteCommand(Long refreshKey)
|
|
||||||
{
|
|
||||||
listHabitsFragment.onPostExecuteCommand(refreshKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,207 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Notification;
|
|
||||||
import android.app.NotificationManager;
|
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.ContentUris;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.graphics.BitmapFactory;
|
|
||||||
import android.media.RingtoneManager;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.support.v4.app.NotificationCompat;
|
|
||||||
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.uhabits.helpers.ReminderHelper;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class ReminderAlarmReceiver extends BroadcastReceiver
|
|
||||||
{
|
|
||||||
public static final String ACTION_CHECK = "org.isoron.uhabits.ACTION_CHECK";
|
|
||||||
public static final String ACTION_DISMISS = "org.isoron.uhabits.ACTION_DISMISS";
|
|
||||||
public static final String ACTION_REMIND = "org.isoron.uhabits.ACTION_REMIND";
|
|
||||||
public static final String ACTION_REMOVE_REMINDER = "org.isoron.uhabits.ACTION_REMOVE_REMINDER";
|
|
||||||
public static final String ACTION_SNOOZE = "org.isoron.uhabits.ACTION_SNOOZE";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceive(final Context context, Intent intent)
|
|
||||||
{
|
|
||||||
switch (intent.getAction())
|
|
||||||
{
|
|
||||||
case ACTION_REMIND:
|
|
||||||
createNotification(context, intent);
|
|
||||||
createReminderAlarms(context);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ACTION_DISMISS:
|
|
||||||
dismissAllHabits();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ACTION_CHECK:
|
|
||||||
checkHabit(context, intent);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ACTION_SNOOZE:
|
|
||||||
snoozeHabit(context, intent);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createReminderAlarms(final Context context)
|
|
||||||
{
|
|
||||||
new Handler().postDelayed(new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
ReminderHelper.createReminderAlarms(context);
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void snoozeHabit(Context context, Intent intent)
|
|
||||||
{
|
|
||||||
Uri data = intent.getData();
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
long delayMinutes = Long.parseLong(prefs.getString("pref_snooze_interval", "15"));
|
|
||||||
|
|
||||||
Habit habit = Habit.get(ContentUris.parseId(data));
|
|
||||||
ReminderHelper.createReminderAlarm(context, habit,
|
|
||||||
new Date().getTime() + delayMinutes * 60 * 1000);
|
|
||||||
dismissNotification(context, habit);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkHabit(Context context, Intent intent)
|
|
||||||
{
|
|
||||||
Uri data = intent.getData();
|
|
||||||
Long timestamp = DateHelper.getStartOfToday();
|
|
||||||
String paramTimestamp = data.getQueryParameter("timestamp");
|
|
||||||
|
|
||||||
if(paramTimestamp != null) timestamp = Long.parseLong(paramTimestamp);
|
|
||||||
|
|
||||||
Habit habit = Habit.get(ContentUris.parseId(data));
|
|
||||||
habit.toggleRepetition(timestamp);
|
|
||||||
habit.save();
|
|
||||||
dismissNotification(context, habit);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dismissAllHabits()
|
|
||||||
{
|
|
||||||
for (Habit h : Habit.getHighlightedHabits())
|
|
||||||
{
|
|
||||||
h.highlight = 0;
|
|
||||||
h.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dismissNotification(Context context, Habit habit)
|
|
||||||
{
|
|
||||||
NotificationManager notificationManager =
|
|
||||||
(NotificationManager) context.getSystemService(Activity.NOTIFICATION_SERVICE);
|
|
||||||
|
|
||||||
int notificationId = (int) (habit.getId() % Integer.MAX_VALUE);
|
|
||||||
notificationManager.cancel(notificationId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void createNotification(Context context, Intent intent)
|
|
||||||
{
|
|
||||||
Uri data = intent.getData();
|
|
||||||
Habit habit = Habit.get(ContentUris.parseId(data));
|
|
||||||
|
|
||||||
if (habit.hasImplicitRepToday()) return;
|
|
||||||
|
|
||||||
habit.highlight = 1;
|
|
||||||
habit.save();
|
|
||||||
|
|
||||||
if (!checkWeekday(intent, habit)) return;
|
|
||||||
|
|
||||||
// Check if reminder has been turned off after alarm was scheduled
|
|
||||||
if (habit.reminderHour == null) return;
|
|
||||||
|
|
||||||
Intent contentIntent = new Intent(context, MainActivity.class);
|
|
||||||
contentIntent.setData(data);
|
|
||||||
PendingIntent contentPendingIntent =
|
|
||||||
PendingIntent.getActivity(context, 0, contentIntent, 0);
|
|
||||||
|
|
||||||
Intent deleteIntent = new Intent(context, ReminderAlarmReceiver.class);
|
|
||||||
deleteIntent.setAction(ACTION_DISMISS);
|
|
||||||
PendingIntent deletePendingIntent = PendingIntent.getBroadcast(context, 0, deleteIntent, 0);
|
|
||||||
|
|
||||||
Intent checkIntent = new Intent(context, ReminderAlarmReceiver.class);
|
|
||||||
checkIntent.setData(data);
|
|
||||||
checkIntent.setAction(ACTION_CHECK);
|
|
||||||
PendingIntent checkIntentPending = PendingIntent.getBroadcast(context, 0, checkIntent, 0);
|
|
||||||
|
|
||||||
Intent snoozeIntent = new Intent(context, ReminderAlarmReceiver.class);
|
|
||||||
snoozeIntent.setData(data);
|
|
||||||
snoozeIntent.setAction(ACTION_SNOOZE);
|
|
||||||
PendingIntent snoozeIntentPending = PendingIntent.getBroadcast(context, 0, snoozeIntent, 0);
|
|
||||||
|
|
||||||
Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
|
||||||
|
|
||||||
Long reminderTime = intent.getLongExtra("reminderTime", DateHelper.getStartOfToday());
|
|
||||||
|
|
||||||
NotificationCompat.WearableExtender wearableExtender =
|
|
||||||
new NotificationCompat.WearableExtender().setBackground(
|
|
||||||
BitmapFactory.decodeResource(context.getResources(), R.drawable.stripe));
|
|
||||||
|
|
||||||
Notification notification =
|
|
||||||
new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_notification)
|
|
||||||
.setContentTitle(habit.name)
|
|
||||||
.setContentText(habit.description)
|
|
||||||
.setContentIntent(contentPendingIntent)
|
|
||||||
.setDeleteIntent(deletePendingIntent)
|
|
||||||
.addAction(R.drawable.ic_action_check,
|
|
||||||
context.getString(R.string.check), checkIntentPending)
|
|
||||||
.addAction(R.drawable.ic_action_snooze,
|
|
||||||
context.getString(R.string.snooze), snoozeIntentPending)
|
|
||||||
.setSound(soundUri)
|
|
||||||
.extend(wearableExtender)
|
|
||||||
.setWhen(reminderTime)
|
|
||||||
.setShowWhen(true)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
notification.flags |= Notification.FLAG_AUTO_CANCEL;
|
|
||||||
|
|
||||||
NotificationManager notificationManager =
|
|
||||||
(NotificationManager) context.getSystemService(Activity.NOTIFICATION_SERVICE);
|
|
||||||
|
|
||||||
int notificationId = (int) (habit.getId() % Integer.MAX_VALUE);
|
|
||||||
notificationManager.notify(notificationId, notification);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean checkWeekday(Intent intent, Habit habit)
|
|
||||||
{
|
|
||||||
Long timestamp = intent.getLongExtra("timestamp", DateHelper.getStartOfToday());
|
|
||||||
|
|
||||||
boolean reminderDays[] = DateHelper.unpackWeekdayList(habit.reminderDays);
|
|
||||||
int weekday = DateHelper.getWeekday(timestamp);
|
|
||||||
|
|
||||||
return reminderDays[weekday];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import org.isoron.uhabits.fragments.SettingsFragment;
|
|
||||||
|
|
||||||
public class SettingsActivity extends Activity
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
getFragmentManager().beginTransaction()
|
|
||||||
.replace(android.R.id.content, new SettingsFragment())
|
|
||||||
.commit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits;
|
|
||||||
|
|
||||||
import android.content.ContentUris;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
import org.isoron.helpers.ReplayableActivity;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
public class ShowHabitActivity extends ReplayableActivity
|
|
||||||
{
|
|
||||||
|
|
||||||
public Habit habit;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
Uri data = getIntent().getData();
|
|
||||||
habit = Habit.get(ContentUris.parseId(data));
|
|
||||||
getActionBar().setTitle(habit.name);
|
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 21)
|
|
||||||
{
|
|
||||||
getActionBar().setBackgroundDrawable(new ColorDrawable(habit.color));
|
|
||||||
}
|
|
||||||
|
|
||||||
setContentView(R.layout.show_habit_activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu)
|
|
||||||
{
|
|
||||||
getMenuInflater().inflate(R.menu.show_habit_activity_menu, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item)
|
|
||||||
{
|
|
||||||
switch (item.getItemId())
|
|
||||||
{
|
|
||||||
case R.id.action_settings:
|
|
||||||
Intent intent = new Intent(this, SettingsActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.commands;
|
|
||||||
|
|
||||||
import org.isoron.helpers.Command;
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ArchiveHabitsCommand extends Command
|
|
||||||
{
|
|
||||||
|
|
||||||
private List<Habit> habits;
|
|
||||||
|
|
||||||
public ArchiveHabitsCommand(Habit habit)
|
|
||||||
{
|
|
||||||
habits = new LinkedList<>();
|
|
||||||
habits.add(habit);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArchiveHabitsCommand(List<Habit> habits)
|
|
||||||
{
|
|
||||||
this.habits = habits;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute()
|
|
||||||
{
|
|
||||||
for(Habit h : habits)
|
|
||||||
h.archive();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void undo()
|
|
||||||
{
|
|
||||||
for(Habit h : habits)
|
|
||||||
h.unarchive();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getExecuteStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_archived;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUndoStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_unarchived;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.commands;
|
|
||||||
|
|
||||||
import com.activeandroid.ActiveAndroid;
|
|
||||||
|
|
||||||
import org.isoron.helpers.Command;
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ChangeHabitColorCommand extends Command
|
|
||||||
{
|
|
||||||
List<Habit> habits;
|
|
||||||
List<Integer> originalColors;
|
|
||||||
Integer newColor;
|
|
||||||
|
|
||||||
public ChangeHabitColorCommand(List<Habit> habits, Integer newColor)
|
|
||||||
{
|
|
||||||
this.habits = habits;
|
|
||||||
this.newColor = newColor;
|
|
||||||
this.originalColors = new ArrayList<>(habits.size());
|
|
||||||
|
|
||||||
for(Habit h : habits)
|
|
||||||
originalColors.add(h.color);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute()
|
|
||||||
{
|
|
||||||
ActiveAndroid.beginTransaction();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for(Habit h : habits)
|
|
||||||
{
|
|
||||||
h.color = newColor;
|
|
||||||
h.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
ActiveAndroid.setTransactionSuccessful();
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
ActiveAndroid.endTransaction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void undo()
|
|
||||||
{
|
|
||||||
ActiveAndroid.beginTransaction();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int k = 0;
|
|
||||||
for(Habit h : habits)
|
|
||||||
{
|
|
||||||
h.color = originalColors.get(k++);
|
|
||||||
h.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
ActiveAndroid.setTransactionSuccessful();
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
ActiveAndroid.endTransaction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getExecuteStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUndoStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_changed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.commands;
|
|
||||||
|
|
||||||
import org.isoron.helpers.Command;
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DeleteHabitsCommand extends Command
|
|
||||||
{
|
|
||||||
private List<Habit> habits;
|
|
||||||
|
|
||||||
public DeleteHabitsCommand(List<Habit> habits)
|
|
||||||
{
|
|
||||||
this.habits = habits;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute()
|
|
||||||
{
|
|
||||||
for(Habit h : habits)
|
|
||||||
h.cascadeDelete();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void undo()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getExecuteStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_deleted;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUndoStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_restored;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.commands;
|
|
||||||
|
|
||||||
import org.isoron.helpers.Command;
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class UnarchiveHabitsCommand extends Command
|
|
||||||
{
|
|
||||||
|
|
||||||
private List<Habit> habits;
|
|
||||||
|
|
||||||
public UnarchiveHabitsCommand(Habit habit)
|
|
||||||
{
|
|
||||||
habits = new LinkedList<>();
|
|
||||||
habits.add(habit);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnarchiveHabitsCommand(List<Habit> habits)
|
|
||||||
{
|
|
||||||
this.habits = habits;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute()
|
|
||||||
{
|
|
||||||
for(Habit h : habits)
|
|
||||||
h.unarchive();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void undo()
|
|
||||||
{
|
|
||||||
for(Habit h : habits)
|
|
||||||
h.archive();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getExecuteStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_unarchived;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUndoStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_archived;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
package org.isoron.uhabits.dialogs;
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.app.DialogFragment;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
|
|
||||||
public class WeekdayPickerDialog extends DialogFragment
|
|
||||||
implements DialogInterface.OnMultiChoiceClickListener, DialogInterface.OnClickListener
|
|
||||||
{
|
|
||||||
|
|
||||||
public interface OnWeekdaysPickedListener
|
|
||||||
{
|
|
||||||
void onWeekdaysPicked(boolean[] selectedDays);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean[] selectedDays;
|
|
||||||
private OnWeekdaysPickedListener listener;
|
|
||||||
|
|
||||||
public void setListener(OnWeekdaysPickedListener listener)
|
|
||||||
{
|
|
||||||
this.listener = listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelectedDays(boolean[] selectedDays)
|
|
||||||
{
|
|
||||||
this.selectedDays = selectedDays;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
|
||||||
builder.setTitle(R.string.select_weekdays)
|
|
||||||
.setMultiChoiceItems(DateHelper.getLongDayNames(), selectedDays, this)
|
|
||||||
.setPositiveButton(android.R.string.yes, this)
|
|
||||||
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which)
|
|
||||||
{
|
|
||||||
dismiss();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return builder.create();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which, boolean isChecked)
|
|
||||||
{
|
|
||||||
selectedDays[which] = isChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which)
|
|
||||||
{
|
|
||||||
if(listener != null) listener.onWeekdaysPicked(selectedDays);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,331 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.fragments;
|
|
||||||
|
|
||||||
import android.app.DialogFragment;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.text.format.DateFormat;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.ImageButton;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.android.colorpicker.ColorPickerDialog;
|
|
||||||
import com.android.colorpicker.ColorPickerSwatch;
|
|
||||||
import com.android.datetimepicker.time.RadialPickerLayout;
|
|
||||||
import com.android.datetimepicker.time.TimePickerDialog;
|
|
||||||
|
|
||||||
import org.isoron.helpers.ColorHelper;
|
|
||||||
import org.isoron.helpers.Command;
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.helpers.DialogHelper.OnSavedListener;
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
import org.isoron.uhabits.dialogs.WeekdayPickerDialog;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
public class EditHabitFragment extends DialogFragment
|
|
||||||
implements OnClickListener, WeekdayPickerDialog.OnWeekdaysPickedListener,
|
|
||||||
TimePickerDialog.OnTimeSetListener
|
|
||||||
{
|
|
||||||
private Integer mode;
|
|
||||||
static final int EDIT_MODE = 0;
|
|
||||||
static final int CREATE_MODE = 1;
|
|
||||||
|
|
||||||
private OnSavedListener onSavedListener;
|
|
||||||
|
|
||||||
private Habit originalHabit, modifiedHabit;
|
|
||||||
private TextView tvName, tvDescription, tvFreqNum, tvFreqDen, tvReminderTime, tvReminderDays;
|
|
||||||
|
|
||||||
private SharedPreferences prefs;
|
|
||||||
private boolean is24HourMode;
|
|
||||||
|
|
||||||
static EditHabitFragment editSingleHabitFragment(long id)
|
|
||||||
{
|
|
||||||
EditHabitFragment frag = new EditHabitFragment();
|
|
||||||
Bundle args = new Bundle();
|
|
||||||
args.putLong("habitId", id);
|
|
||||||
args.putInt("editMode", EDIT_MODE);
|
|
||||||
frag.setArguments(args);
|
|
||||||
return frag;
|
|
||||||
}
|
|
||||||
|
|
||||||
static EditHabitFragment createHabitFragment()
|
|
||||||
{
|
|
||||||
EditHabitFragment frag = new EditHabitFragment();
|
|
||||||
Bundle args = new Bundle();
|
|
||||||
args.putInt("editMode", CREATE_MODE);
|
|
||||||
frag.setArguments(args);
|
|
||||||
return frag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
||||||
Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
View view = inflater.inflate(R.layout.edit_habit, container, false);
|
|
||||||
tvName = (TextView) view.findViewById(R.id.input_name);
|
|
||||||
tvDescription = (TextView) view.findViewById(R.id.input_description);
|
|
||||||
tvFreqNum = (TextView) view.findViewById(R.id.input_freq_num);
|
|
||||||
tvFreqDen = (TextView) view.findViewById(R.id.input_freq_den);
|
|
||||||
tvReminderTime = (TextView) view.findViewById(R.id.inputReminderTime);
|
|
||||||
tvReminderDays = (TextView) view.findViewById(R.id.inputReminderDays);
|
|
||||||
|
|
||||||
Button buttonSave = (Button) view.findViewById(R.id.buttonSave);
|
|
||||||
Button buttonDiscard = (Button) view.findViewById(R.id.buttonDiscard);
|
|
||||||
|
|
||||||
buttonSave.setOnClickListener(this);
|
|
||||||
buttonDiscard.setOnClickListener(this);
|
|
||||||
tvReminderTime.setOnClickListener(this);
|
|
||||||
tvReminderDays.setOnClickListener(this);
|
|
||||||
|
|
||||||
ImageButton buttonPickColor = (ImageButton) view.findViewById(R.id.buttonPickColor);
|
|
||||||
|
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
|
||||||
|
|
||||||
Bundle args = getArguments();
|
|
||||||
mode = (Integer) args.get("editMode");
|
|
||||||
|
|
||||||
is24HourMode = DateFormat.is24HourFormat(getActivity());
|
|
||||||
|
|
||||||
if (mode == CREATE_MODE)
|
|
||||||
{
|
|
||||||
getDialog().setTitle(R.string.create_habit);
|
|
||||||
modifiedHabit = new Habit();
|
|
||||||
|
|
||||||
int defaultNum = prefs.getInt("pref_default_habit_freq_num", modifiedHabit.freqNum);
|
|
||||||
int defaultDen = prefs.getInt("pref_default_habit_freq_den", modifiedHabit.freqDen);
|
|
||||||
int defaultColor = prefs.getInt("pref_default_habit_color", modifiedHabit.color);
|
|
||||||
|
|
||||||
modifiedHabit.color = defaultColor;
|
|
||||||
modifiedHabit.freqNum = defaultNum;
|
|
||||||
modifiedHabit.freqDen = defaultDen;
|
|
||||||
}
|
|
||||||
else if (mode == EDIT_MODE)
|
|
||||||
{
|
|
||||||
originalHabit = Habit.get((Long) args.get("habitId"));
|
|
||||||
modifiedHabit = new Habit(originalHabit);
|
|
||||||
|
|
||||||
getDialog().setTitle(R.string.edit_habit);
|
|
||||||
tvName.append(modifiedHabit.name);
|
|
||||||
tvDescription.append(modifiedHabit.description);
|
|
||||||
}
|
|
||||||
|
|
||||||
tvFreqNum.append(modifiedHabit.freqNum.toString());
|
|
||||||
tvFreqDen.append(modifiedHabit.freqDen.toString());
|
|
||||||
|
|
||||||
changeColor(modifiedHabit.color);
|
|
||||||
updateReminder();
|
|
||||||
|
|
||||||
buttonPickColor.setOnClickListener(this);
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void changeColor(Integer color)
|
|
||||||
{
|
|
||||||
modifiedHabit.color = color;
|
|
||||||
tvName.setTextColor(color);
|
|
||||||
|
|
||||||
SharedPreferences.Editor editor = prefs.edit();
|
|
||||||
editor.putInt("pref_default_habit_color", color);
|
|
||||||
editor.apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateReminder()
|
|
||||||
{
|
|
||||||
if (modifiedHabit.reminderHour != null)
|
|
||||||
{
|
|
||||||
tvReminderTime.setTextColor(Color.BLACK);
|
|
||||||
tvReminderTime.setText(DateHelper.formatTime(getActivity(), modifiedHabit.reminderHour,
|
|
||||||
modifiedHabit.reminderMin));
|
|
||||||
tvReminderDays.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tvReminderTime.setTextColor(Color.GRAY);
|
|
||||||
tvReminderTime.setText(R.string.reminder_off);
|
|
||||||
tvReminderDays.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean weekdays[] = DateHelper.unpackWeekdayList(modifiedHabit.reminderDays);
|
|
||||||
tvReminderDays.setText(DateHelper.formatWeekdayList(getActivity(), weekdays));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnSavedListener(OnSavedListener onSavedListener)
|
|
||||||
{
|
|
||||||
this.onSavedListener = onSavedListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v)
|
|
||||||
{
|
|
||||||
switch(v.getId())
|
|
||||||
{
|
|
||||||
case R.id.inputReminderTime:
|
|
||||||
onDateSpinnerClick();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.inputReminderDays:
|
|
||||||
onWeekdayClick();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.buttonSave:
|
|
||||||
onSaveButtonClick();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.buttonDiscard:
|
|
||||||
dismiss();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.buttonPickColor:
|
|
||||||
onColorButtonClick();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onColorButtonClick()
|
|
||||||
{
|
|
||||||
ColorPickerDialog picker = ColorPickerDialog.newInstance(
|
|
||||||
R.string.color_picker_default_title, ColorHelper.palette, modifiedHabit.color, 4,
|
|
||||||
ColorPickerDialog.SIZE_SMALL);
|
|
||||||
|
|
||||||
picker.setOnColorSelectedListener(new ColorPickerSwatch.OnColorSelectedListener()
|
|
||||||
{
|
|
||||||
public void onColorSelected(int color)
|
|
||||||
{
|
|
||||||
changeColor(color);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
picker.show(getFragmentManager(), "picker");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onSaveButtonClick()
|
|
||||||
{
|
|
||||||
Command command = null;
|
|
||||||
|
|
||||||
modifiedHabit.name = tvName.getText().toString().trim();
|
|
||||||
modifiedHabit.description = tvDescription.getText().toString().trim();
|
|
||||||
modifiedHabit.freqNum = Integer.parseInt(tvFreqNum.getText().toString());
|
|
||||||
modifiedHabit.freqDen = Integer.parseInt(tvFreqDen.getText().toString());
|
|
||||||
|
|
||||||
if (!validate()) return;
|
|
||||||
|
|
||||||
SharedPreferences.Editor editor = prefs.edit();
|
|
||||||
editor.putInt("pref_default_habit_freq_num", modifiedHabit.freqNum);
|
|
||||||
editor.putInt("pref_default_habit_freq_den", modifiedHabit.freqDen);
|
|
||||||
editor.apply();
|
|
||||||
|
|
||||||
Habit savedHabit = null;
|
|
||||||
|
|
||||||
if (mode == EDIT_MODE)
|
|
||||||
{
|
|
||||||
command = originalHabit.new EditCommand(modifiedHabit);
|
|
||||||
savedHabit = originalHabit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode == CREATE_MODE) command = new Habit.CreateCommand(modifiedHabit);
|
|
||||||
|
|
||||||
if (onSavedListener != null) onSavedListener.onSaved(command, savedHabit);
|
|
||||||
|
|
||||||
dismiss();
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean validate()
|
|
||||||
{
|
|
||||||
Boolean valid = true;
|
|
||||||
|
|
||||||
if (modifiedHabit.name.length() == 0)
|
|
||||||
{
|
|
||||||
tvName.setError(getString(R.string.validation_name_should_not_be_blank));
|
|
||||||
valid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (modifiedHabit.freqNum <= 0)
|
|
||||||
{
|
|
||||||
tvFreqNum.setError(getString(R.string.validation_number_should_be_positive));
|
|
||||||
valid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (modifiedHabit.freqNum > modifiedHabit.freqDen)
|
|
||||||
{
|
|
||||||
tvFreqNum.setError(getString(R.string.validation_at_most_one_rep_per_day));
|
|
||||||
valid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return valid;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onDateSpinnerClick()
|
|
||||||
{
|
|
||||||
int defaultHour = 8;
|
|
||||||
int defaultMin = 0;
|
|
||||||
|
|
||||||
if (modifiedHabit.reminderHour != null)
|
|
||||||
{
|
|
||||||
defaultHour = modifiedHabit.reminderHour;
|
|
||||||
defaultMin = modifiedHabit.reminderMin;
|
|
||||||
}
|
|
||||||
|
|
||||||
TimePickerDialog timePicker =
|
|
||||||
TimePickerDialog.newInstance(this, defaultHour, defaultMin, is24HourMode);
|
|
||||||
timePicker.show(getFragmentManager(), "timePicker");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onWeekdayClick()
|
|
||||||
{
|
|
||||||
WeekdayPickerDialog dialog = new WeekdayPickerDialog();
|
|
||||||
dialog.setListener(this);
|
|
||||||
dialog.setSelectedDays(DateHelper.unpackWeekdayList(modifiedHabit.reminderDays));
|
|
||||||
dialog.show(getFragmentManager(), "weekdayPicker");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTimeSet(RadialPickerLayout view, int hour, int minute)
|
|
||||||
{
|
|
||||||
modifiedHabit.reminderHour = hour;
|
|
||||||
modifiedHabit.reminderMin = minute;
|
|
||||||
updateReminder();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTimeCleared(RadialPickerLayout view)
|
|
||||||
{
|
|
||||||
modifiedHabit.reminderHour = null;
|
|
||||||
modifiedHabit.reminderMin = null;
|
|
||||||
updateReminder();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onWeekdaysPicked(boolean[] selectedDays)
|
|
||||||
{
|
|
||||||
int count = 0;
|
|
||||||
for(int i = 0; i < 7; i++)
|
|
||||||
if(selectedDays[i]) count++;
|
|
||||||
if(count == 0) Arrays.fill(selectedDays, true);
|
|
||||||
|
|
||||||
modifiedHabit.reminderDays = DateHelper.packWeekdayList(selectedDays);
|
|
||||||
updateReminder();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,785 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.fragments;
|
|
||||||
|
|
||||||
import android.animation.Animator;
|
|
||||||
import android.animation.AnimatorListenerAdapter;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.Typeface;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.util.DisplayMetrics;
|
|
||||||
import android.view.ActionMode;
|
|
||||||
import android.view.ContextMenu;
|
|
||||||
import android.view.ContextMenu.ContextMenuInfo;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.view.View.OnLongClickListener;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.AdapterView;
|
|
||||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
|
||||||
import android.widget.BaseAdapter;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.LinearLayout.LayoutParams;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.android.colorpicker.ColorPickerDialog;
|
|
||||||
import com.android.colorpicker.ColorPickerSwatch;
|
|
||||||
import com.mobeta.android.dslv.DragSortController;
|
|
||||||
import com.mobeta.android.dslv.DragSortListView;
|
|
||||||
import com.mobeta.android.dslv.DragSortListView.DropListener;
|
|
||||||
|
|
||||||
import org.isoron.helpers.ColorHelper;
|
|
||||||
import org.isoron.helpers.Command;
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.helpers.DialogHelper;
|
|
||||||
import org.isoron.helpers.DialogHelper.OnSavedListener;
|
|
||||||
import org.isoron.helpers.ReplayableActivity;
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
import org.isoron.uhabits.commands.ArchiveHabitsCommand;
|
|
||||||
import org.isoron.uhabits.commands.ChangeHabitColorCommand;
|
|
||||||
import org.isoron.uhabits.commands.DeleteHabitsCommand;
|
|
||||||
import org.isoron.uhabits.commands.UnarchiveHabitsCommand;
|
|
||||||
import org.isoron.uhabits.helpers.ReminderHelper;
|
|
||||||
import org.isoron.uhabits.loaders.HabitListLoader;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ListHabitsFragment extends Fragment
|
|
||||||
implements OnSavedListener, OnItemClickListener, OnLongClickListener, DropListener,
|
|
||||||
OnClickListener, HabitListLoader.Listener, AdapterView.OnItemLongClickListener
|
|
||||||
{
|
|
||||||
private class ListHabitsActionBarCallback implements ActionMode.Callback
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean onCreateActionMode(ActionMode mode, Menu menu)
|
|
||||||
{
|
|
||||||
getActivity().getMenuInflater().inflate(R.menu.list_habits_context, menu);
|
|
||||||
updateTitle(mode);
|
|
||||||
updateActions(menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onPrepareActionMode(ActionMode mode, Menu menu)
|
|
||||||
{
|
|
||||||
updateTitle(mode);
|
|
||||||
updateActions(menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateActions(Menu menu)
|
|
||||||
{
|
|
||||||
boolean showEdit = (selectedPositions.size() == 1);
|
|
||||||
boolean showColor = true;
|
|
||||||
boolean showArchive = true;
|
|
||||||
boolean showUnarchive = true;
|
|
||||||
|
|
||||||
if(showEdit) showColor = false;
|
|
||||||
for(int i : selectedPositions)
|
|
||||||
{
|
|
||||||
Habit h = loader.habitsList.get(i);
|
|
||||||
if(h.isArchived())
|
|
||||||
{
|
|
||||||
showColor = false;
|
|
||||||
showArchive = false;
|
|
||||||
}
|
|
||||||
else showUnarchive = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuItem itemEdit = menu.findItem(R.id.action_edit_habit);
|
|
||||||
MenuItem itemColor = menu.findItem(R.id.action_color);
|
|
||||||
MenuItem itemArchive = menu.findItem(R.id.action_archive_habit);
|
|
||||||
MenuItem itemUnarchive = menu.findItem(R.id.action_unarchive_habit);
|
|
||||||
|
|
||||||
itemEdit.setVisible(showEdit);
|
|
||||||
itemColor.setVisible(showColor);
|
|
||||||
itemArchive.setVisible(showArchive);
|
|
||||||
itemUnarchive.setVisible(showUnarchive);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateTitle(ActionMode mode)
|
|
||||||
{
|
|
||||||
mode.setTitle("" + selectedPositions.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onActionItemClicked(final ActionMode mode, MenuItem item)
|
|
||||||
{
|
|
||||||
final LinkedList<Habit> selectedHabits = new LinkedList<>();
|
|
||||||
for(int i : selectedPositions)
|
|
||||||
selectedHabits.add(loader.habitsList.get(i));
|
|
||||||
|
|
||||||
Habit firstHabit = selectedHabits.getFirst();
|
|
||||||
|
|
||||||
switch(item.getItemId())
|
|
||||||
{
|
|
||||||
case R.id.action_archive_habit:
|
|
||||||
executeCommand(new ArchiveHabitsCommand(selectedHabits), null);
|
|
||||||
mode.finish();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.action_unarchive_habit:
|
|
||||||
executeCommand(new UnarchiveHabitsCommand(selectedHabits), null);
|
|
||||||
mode.finish();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.action_edit_habit:
|
|
||||||
{
|
|
||||||
EditHabitFragment frag = EditHabitFragment.editSingleHabitFragment(firstHabit.getId());
|
|
||||||
frag.setOnSavedListener(ListHabitsFragment.this);
|
|
||||||
frag.show(getFragmentManager(), "dialog");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
case R.id.action_color:
|
|
||||||
{
|
|
||||||
ColorPickerDialog picker = ColorPickerDialog.newInstance(
|
|
||||||
R.string.color_picker_default_title, ColorHelper.palette,
|
|
||||||
firstHabit.color, 4, ColorPickerDialog.SIZE_SMALL);
|
|
||||||
|
|
||||||
picker.setOnColorSelectedListener(new ColorPickerSwatch.OnColorSelectedListener()
|
|
||||||
{
|
|
||||||
public void onColorSelected(int color)
|
|
||||||
{
|
|
||||||
executeCommand(new ChangeHabitColorCommand(selectedHabits, color), null);
|
|
||||||
mode.finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
picker.show(getFragmentManager(), "picker");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
case R.id.action_delete:
|
|
||||||
{
|
|
||||||
new AlertDialog.Builder(activity)
|
|
||||||
.setTitle(R.string.delete_habits)
|
|
||||||
.setMessage(R.string.delete_habits_message)
|
|
||||||
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which)
|
|
||||||
{
|
|
||||||
executeCommand(new DeleteHabitsCommand(selectedHabits), null);
|
|
||||||
mode.finish();
|
|
||||||
}
|
|
||||||
}).setNegativeButton(android.R.string.no, null)
|
|
||||||
.show();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroyActionMode(ActionMode mode)
|
|
||||||
{
|
|
||||||
actionMode = null;
|
|
||||||
|
|
||||||
selectedPositions.clear();
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
|
|
||||||
listView.setDragEnabled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final int INACTIVE_COLOR = Color.rgb(200, 200, 200);
|
|
||||||
public static final int INACTIVE_CHECKMARK_COLOR = Color.rgb(230, 230, 230);
|
|
||||||
|
|
||||||
public static final int HINT_INTERVAL = 5;
|
|
||||||
public static final int HINT_INTERVAL_OFFSET = 2;
|
|
||||||
|
|
||||||
public interface OnHabitClickListener
|
|
||||||
{
|
|
||||||
void onHabitClicked(Habit habit);
|
|
||||||
}
|
|
||||||
|
|
||||||
ListHabitsAdapter adapter;
|
|
||||||
DragSortListView listView;
|
|
||||||
ReplayableActivity activity;
|
|
||||||
TextView tvNameHeader;
|
|
||||||
long lastLongClick = 0;
|
|
||||||
|
|
||||||
private int tvNameWidth;
|
|
||||||
private int buttonCount;
|
|
||||||
private View llEmpty;
|
|
||||||
private View llHint;
|
|
||||||
|
|
||||||
private OnHabitClickListener habitClickListener;
|
|
||||||
private boolean isShortToggleEnabled;
|
|
||||||
|
|
||||||
private HabitListLoader loader;
|
|
||||||
private boolean showArchived;
|
|
||||||
private SharedPreferences prefs;
|
|
||||||
|
|
||||||
private ActionMode actionMode;
|
|
||||||
private List<Integer> selectedPositions;
|
|
||||||
private DragSortController dragSortController;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
||||||
Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
DisplayMetrics dm = getResources().getDisplayMetrics();
|
|
||||||
int width = (int) (dm.widthPixels / dm.density);
|
|
||||||
buttonCount = (int) ((width - 160) / 42.0);
|
|
||||||
tvNameWidth = (int) ((width - 30 - buttonCount * 42) * dm.density);
|
|
||||||
|
|
||||||
loader = new HabitListLoader();
|
|
||||||
loader.setListener(this);
|
|
||||||
loader.setCheckmarkCount(buttonCount);
|
|
||||||
|
|
||||||
View view = inflater.inflate(R.layout.list_habits_fragment, container, false);
|
|
||||||
tvNameHeader = (TextView) view.findViewById(R.id.tvNameHeader);
|
|
||||||
|
|
||||||
ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
|
|
||||||
loader.setProgressBar(progressBar);
|
|
||||||
|
|
||||||
adapter = new ListHabitsAdapter(getActivity());
|
|
||||||
listView = (DragSortListView) view.findViewById(R.id.listView);
|
|
||||||
listView.setAdapter(adapter);
|
|
||||||
listView.setOnItemClickListener(this);
|
|
||||||
listView.setOnItemLongClickListener(this);
|
|
||||||
listView.setDropListener(this);
|
|
||||||
listView.setDragListener(new DragSortListView.DragListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void drag(int from, int to)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void startDrag(int position)
|
|
||||||
{
|
|
||||||
selectItem(position);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
dragSortController = new DragSortController(listView) {
|
|
||||||
@Override
|
|
||||||
public View onCreateFloatView(int position)
|
|
||||||
{
|
|
||||||
return adapter.getView(position, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroyFloatView(View floatView)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
|
||||||
dragSortController.setRemoveEnabled(false);
|
|
||||||
|
|
||||||
listView.setFloatViewManager(dragSortController);
|
|
||||||
listView.setDragEnabled(true);
|
|
||||||
listView.setLongClickable(true);
|
|
||||||
|
|
||||||
llHint = view.findViewById(R.id.llHint);
|
|
||||||
llHint.setOnClickListener(this);
|
|
||||||
|
|
||||||
Typeface fontawesome = Typeface.createFromAsset(getActivity().getAssets(),
|
|
||||||
"fontawesome-webfont.ttf");
|
|
||||||
((TextView) view.findViewById(R.id.tvStarEmpty)).setTypeface(fontawesome);
|
|
||||||
llEmpty = view.findViewById(R.id.llEmpty);
|
|
||||||
|
|
||||||
loader.updateAllHabits(true);
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
|
|
||||||
selectedPositions = new LinkedList<>();
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void onAttach(Activity activity)
|
|
||||||
{
|
|
||||||
super.onAttach(activity);
|
|
||||||
this.activity = (ReplayableActivity) activity;
|
|
||||||
|
|
||||||
habitClickListener = (OnHabitClickListener) activity;
|
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume()
|
|
||||||
{
|
|
||||||
super.onResume();
|
|
||||||
Long timestamp = loader.getLastLoadTimestamp();
|
|
||||||
|
|
||||||
if (timestamp != null && timestamp != DateHelper.getStartOfToday())
|
|
||||||
loader.updateAllHabits(true);
|
|
||||||
|
|
||||||
updateEmptyMessage();
|
|
||||||
updateHeader();
|
|
||||||
showNextHint();
|
|
||||||
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
isShortToggleEnabled = prefs.getBoolean("pref_short_toggle", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateHeader()
|
|
||||||
{
|
|
||||||
LayoutInflater inflater = activity.getLayoutInflater();
|
|
||||||
View view = getView();
|
|
||||||
|
|
||||||
if (view == null) return;
|
|
||||||
|
|
||||||
GregorianCalendar day = DateHelper.getStartOfTodayCalendar();
|
|
||||||
|
|
||||||
LinearLayout llButtonsHeader = (LinearLayout) view.findViewById(R.id.llButtonsHeader);
|
|
||||||
llButtonsHeader.removeAllViews();
|
|
||||||
|
|
||||||
for (int i = 0; i < buttonCount; i++)
|
|
||||||
{
|
|
||||||
View tvDay = inflater.inflate(R.layout.list_habits_header_check, null);
|
|
||||||
Button btCheck = (Button) tvDay.findViewById(R.id.tvCheck);
|
|
||||||
btCheck.setText(DateHelper.formatHeaderDate(day));
|
|
||||||
llButtonsHeader.addView(tvDay);
|
|
||||||
|
|
||||||
day.add(GregorianCalendar.DAY_OF_MONTH, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadFinished()
|
|
||||||
{
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
updateEmptyMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
|
|
||||||
{
|
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
|
||||||
inflater.inflate(R.menu.list_habits_options, menu);
|
|
||||||
|
|
||||||
MenuItem showArchivedItem = menu.findItem(R.id.action_show_archived);
|
|
||||||
showArchivedItem.setChecked(showArchived);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo)
|
|
||||||
{
|
|
||||||
super.onCreateContextMenu(menu, view, menuInfo);
|
|
||||||
getActivity().getMenuInflater().inflate(R.menu.list_habits_context, menu);
|
|
||||||
|
|
||||||
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
|
|
||||||
final Habit habit = loader.habits.get(info.id);
|
|
||||||
|
|
||||||
if (habit.isArchived()) menu.findItem(R.id.action_archive_habit).setVisible(false);
|
|
||||||
else menu.findItem(R.id.action_unarchive_habit).setVisible(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item)
|
|
||||||
{
|
|
||||||
switch (item.getItemId())
|
|
||||||
{
|
|
||||||
case R.id.action_add:
|
|
||||||
{
|
|
||||||
EditHabitFragment frag = EditHabitFragment.createHabitFragment();
|
|
||||||
frag.setOnSavedListener(this);
|
|
||||||
frag.show(getFragmentManager(), "dialog");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
case R.id.action_show_archived:
|
|
||||||
{
|
|
||||||
showArchived = !showArchived;
|
|
||||||
loader.setIncludeArchived(showArchived);
|
|
||||||
loader.updateAllHabits(true);
|
|
||||||
activity.invalidateOptionsMenu();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemClick(AdapterView parent, View view, int position, long id)
|
|
||||||
{
|
|
||||||
if (new Date().getTime() - lastLongClick < 1000) return;
|
|
||||||
|
|
||||||
if(actionMode == null)
|
|
||||||
{
|
|
||||||
Habit habit = loader.habitsList.get(position);
|
|
||||||
habitClickListener.onHabitClicked(habit);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int k = selectedPositions.indexOf(position);
|
|
||||||
if(k < 0)
|
|
||||||
selectedPositions.add(position);
|
|
||||||
else
|
|
||||||
selectedPositions.remove(k);
|
|
||||||
|
|
||||||
if(selectedPositions.isEmpty()) actionMode.finish();
|
|
||||||
else actionMode.invalidate();
|
|
||||||
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id)
|
|
||||||
{
|
|
||||||
selectItem(position);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void selectItem(int position)
|
|
||||||
{
|
|
||||||
if(!selectedPositions.contains(position))
|
|
||||||
selectedPositions.add(position);
|
|
||||||
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
|
|
||||||
if(actionMode == null)
|
|
||||||
{
|
|
||||||
actionMode = getActivity().startActionMode(new ListHabitsActionBarCallback());
|
|
||||||
// listView.setDragEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(actionMode != null) actionMode.invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSaved(Command command, Object savedObject)
|
|
||||||
{
|
|
||||||
Habit h = (Habit) savedObject;
|
|
||||||
|
|
||||||
if (h == null) activity.executeCommand(command, null);
|
|
||||||
else activity.executeCommand(command, h.getId());
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
|
|
||||||
ReminderHelper.createReminderAlarms(activity);
|
|
||||||
|
|
||||||
if(actionMode != null) actionMode.finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateEmptyMessage()
|
|
||||||
{
|
|
||||||
if (loader.getLastLoadTimestamp() == null) llEmpty.setVisibility(View.GONE);
|
|
||||||
else llEmpty.setVisibility(loader.habits.size() > 0 ? View.GONE : View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onLongClick(View v)
|
|
||||||
{
|
|
||||||
lastLongClick = new Date().getTime();
|
|
||||||
|
|
||||||
switch (v.getId())
|
|
||||||
{
|
|
||||||
case R.id.tvCheck:
|
|
||||||
onCheckmarkLongClick(v);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onCheckmarkLongClick(View v)
|
|
||||||
{
|
|
||||||
if (isShortToggleEnabled) return;
|
|
||||||
|
|
||||||
toggleCheck(v);
|
|
||||||
DialogHelper.vibrate(activity, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void toggleCheck(View v)
|
|
||||||
{
|
|
||||||
Long tag = (Long) v.getTag(R.string.habit_key);
|
|
||||||
Habit habit = loader.habits.get(tag);
|
|
||||||
|
|
||||||
int offset = (Integer) v.getTag(R.string.offset_key);
|
|
||||||
long timestamp = DateHelper.getStartOfDay(
|
|
||||||
DateHelper.getLocalTime() - offset * DateHelper.millisecondsInOneDay);
|
|
||||||
|
|
||||||
if (v.getTag(R.string.toggle_key).equals(2)) updateCheckmark(habit.color, (TextView) v, 0);
|
|
||||||
else updateCheckmark(habit.color, (TextView) v, 2);
|
|
||||||
|
|
||||||
executeCommand(habit.new ToggleRepetitionCommand(timestamp), habit.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void executeCommand(Command c, Long refreshKey)
|
|
||||||
{
|
|
||||||
activity.executeCommand(c, refreshKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void hideHint()
|
|
||||||
{
|
|
||||||
llHint.animate().alpha(0f).setDuration(500).setListener(new AnimatorListenerAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation)
|
|
||||||
{
|
|
||||||
llHint.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showNextHint()
|
|
||||||
{
|
|
||||||
Integer lastHintNumber = prefs.getInt("last_hint_number", -1);
|
|
||||||
Long lastHintTimestamp = prefs.getLong("last_hint_timestamp", -1);
|
|
||||||
|
|
||||||
if(DateHelper.getStartOfToday() > lastHintTimestamp)
|
|
||||||
showHint(lastHintNumber + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showHint(int hintNumber)
|
|
||||||
{
|
|
||||||
String[] hints = activity.getResources().getStringArray(R.array.hints);
|
|
||||||
if(hintNumber >= hints.length) return;
|
|
||||||
|
|
||||||
prefs.edit().putInt("last_hint_number", hintNumber).apply();
|
|
||||||
prefs.edit().putLong("last_hint_timestamp", DateHelper.getStartOfToday()).apply();
|
|
||||||
|
|
||||||
TextView tvContent = (TextView) llHint.findViewById(R.id.hintContent);
|
|
||||||
tvContent.setText(hints[hintNumber]);
|
|
||||||
|
|
||||||
llHint.setAlpha(0.0f);
|
|
||||||
llHint.setVisibility(View.VISIBLE);
|
|
||||||
llHint.animate().alpha(1f).setDuration(500);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drop(int from, int to)
|
|
||||||
{
|
|
||||||
if(from == to) return;
|
|
||||||
if(actionMode != null) actionMode.finish();
|
|
||||||
|
|
||||||
loader.reorder(from, to);
|
|
||||||
adapter.notifyDataSetChanged();
|
|
||||||
loader.updateAllHabits(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v)
|
|
||||||
{
|
|
||||||
switch (v.getId())
|
|
||||||
{
|
|
||||||
case R.id.tvCheck:
|
|
||||||
if (isShortToggleEnabled) toggleCheck(v);
|
|
||||||
else activity.showToast(R.string.long_press_to_toggle);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.llHint:
|
|
||||||
hideHint();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ListHabitsAdapter extends BaseAdapter
|
|
||||||
{
|
|
||||||
private LayoutInflater inflater;
|
|
||||||
private Typeface fontawesome;
|
|
||||||
|
|
||||||
public ListHabitsAdapter(Context context)
|
|
||||||
{
|
|
||||||
|
|
||||||
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
||||||
fontawesome = Typeface.createFromAsset(context.getAssets(), "fontawesome-webfont.ttf");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getCount()
|
|
||||||
{
|
|
||||||
return loader.habits.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object getItem(int position)
|
|
||||||
{
|
|
||||||
return loader.habitsList.get(position);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getItemId(int position)
|
|
||||||
{
|
|
||||||
return ((Habit) getItem(position)).getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View getView(int position, View view, ViewGroup parent)
|
|
||||||
{
|
|
||||||
final Habit habit = loader.habitsList.get(position);
|
|
||||||
|
|
||||||
if (view == null ||
|
|
||||||
(Long) view.getTag(R.id.timestamp_key) != DateHelper.getStartOfToday())
|
|
||||||
{
|
|
||||||
view = inflater.inflate(R.layout.list_habits_item, null);
|
|
||||||
((TextView) view.findViewById(R.id.tvStar)).setTypeface(fontawesome);
|
|
||||||
|
|
||||||
LinearLayout.LayoutParams params =
|
|
||||||
new LinearLayout.LayoutParams(tvNameWidth, LayoutParams.WRAP_CONTENT, 1);
|
|
||||||
view.findViewById(R.id.tvName).setLayoutParams(params);
|
|
||||||
|
|
||||||
inflateCheckmarkButtons(view);
|
|
||||||
|
|
||||||
view.setTag(R.id.timestamp_key, DateHelper.getStartOfToday());
|
|
||||||
}
|
|
||||||
|
|
||||||
TextView tvStar = ((TextView) view.findViewById(R.id.tvStar));
|
|
||||||
TextView tvName = (TextView) view.findViewById(R.id.tvName);
|
|
||||||
LinearLayout llInner = (LinearLayout) view.findViewById(R.id.llInner);
|
|
||||||
LinearLayout llButtons = (LinearLayout) view.findViewById(R.id.llButtons);
|
|
||||||
|
|
||||||
llInner.setTag(R.string.habit_key, habit.getId());
|
|
||||||
|
|
||||||
updateNameAndIcon(habit, tvStar, tvName);
|
|
||||||
updateCheckmarkButtons(habit, llButtons);
|
|
||||||
|
|
||||||
boolean selected = selectedPositions.contains(position);
|
|
||||||
if(selected)
|
|
||||||
llInner.setBackgroundResource(R.drawable.selected_box);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 21)
|
|
||||||
llInner.setBackgroundResource(R.drawable.ripple_white);
|
|
||||||
else
|
|
||||||
llInner.setBackgroundColor(Color.WHITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void inflateCheckmarkButtons(View view)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < buttonCount; i++)
|
|
||||||
{
|
|
||||||
View check = inflater.inflate(R.layout.list_habits_item_check, null);
|
|
||||||
TextView btCheck = (TextView) check.findViewById(R.id.tvCheck);
|
|
||||||
btCheck.setTypeface(fontawesome);
|
|
||||||
btCheck.setOnLongClickListener(ListHabitsFragment.this);
|
|
||||||
btCheck.setOnClickListener(ListHabitsFragment.this);
|
|
||||||
((LinearLayout) view.findViewById(R.id.llButtons)).addView(check);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateCheckmarkButtons(Habit habit, LinearLayout llButtons)
|
|
||||||
{
|
|
||||||
int activeColor = getActiveColor(habit);
|
|
||||||
int m = llButtons.getChildCount();
|
|
||||||
Long habitId = habit.getId();
|
|
||||||
|
|
||||||
int isChecked[] = loader.checkmarks.get(habitId);
|
|
||||||
|
|
||||||
for (int i = 0; i < m; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
TextView tvCheck = (TextView) llButtons.getChildAt(i);
|
|
||||||
tvCheck.setTag(R.string.habit_key, habitId);
|
|
||||||
tvCheck.setTag(R.string.offset_key, i);
|
|
||||||
updateCheckmark(activeColor, tvCheck, isChecked[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateNameAndIcon(Habit habit, TextView tvStar, TextView tvName)
|
|
||||||
{
|
|
||||||
int activeColor = getActiveColor(habit);
|
|
||||||
|
|
||||||
tvName.setText(habit.name);
|
|
||||||
tvName.setTextColor(activeColor);
|
|
||||||
|
|
||||||
if (habit.isArchived())
|
|
||||||
{
|
|
||||||
tvStar.setText(getString(R.string.fa_archive));
|
|
||||||
tvStar.setTextColor(activeColor);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int score = loader.scores.get(habit.getId());
|
|
||||||
|
|
||||||
if (score < Habit.HALF_STAR_CUTOFF)
|
|
||||||
{
|
|
||||||
tvStar.setText(getString(R.string.fa_star_o));
|
|
||||||
tvStar.setTextColor(INACTIVE_COLOR);
|
|
||||||
}
|
|
||||||
else if (score < Habit.FULL_STAR_CUTOFF)
|
|
||||||
{
|
|
||||||
tvStar.setText(getString(R.string.fa_star_half_o));
|
|
||||||
tvStar.setTextColor(INACTIVE_COLOR);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tvStar.setText(getString(R.string.fa_star));
|
|
||||||
tvStar.setTextColor(activeColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getActiveColor(Habit habit)
|
|
||||||
{
|
|
||||||
int activeColor = habit.color;
|
|
||||||
if(habit.isArchived()) activeColor = INACTIVE_COLOR;
|
|
||||||
|
|
||||||
return activeColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateCheckmark(int activeColor, TextView tvCheck, int check)
|
|
||||||
{
|
|
||||||
switch (check)
|
|
||||||
{
|
|
||||||
case 2:
|
|
||||||
tvCheck.setText(R.string.fa_check);
|
|
||||||
tvCheck.setTextColor(activeColor);
|
|
||||||
tvCheck.setTag(R.string.toggle_key, 2);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
tvCheck.setText(R.string.fa_check);
|
|
||||||
tvCheck.setTextColor(INACTIVE_CHECKMARK_COLOR);
|
|
||||||
tvCheck.setTag(R.string.toggle_key, 1);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0:
|
|
||||||
tvCheck.setText(R.string.fa_times);
|
|
||||||
tvCheck.setTextColor(INACTIVE_CHECKMARK_COLOR);
|
|
||||||
tvCheck.setTag(R.string.toggle_key, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onPostExecuteCommand(Long refreshKey)
|
|
||||||
{
|
|
||||||
if (refreshKey == null) loader.updateAllHabits(true);
|
|
||||||
else loader.updateHabit(refreshKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.fragments;
|
|
||||||
|
|
||||||
import android.app.backup.BackupManager;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.PreferenceFragment;
|
|
||||||
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
|
|
||||||
public class SettingsFragment extends PreferenceFragment
|
|
||||||
implements SharedPreferences.OnSharedPreferenceChangeListener
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
addPreferencesFromResource(R.xml.preferences);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume()
|
|
||||||
{
|
|
||||||
super.onResume();
|
|
||||||
getPreferenceManager().getSharedPreferences().
|
|
||||||
registerOnSharedPreferenceChangeListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause()
|
|
||||||
{
|
|
||||||
getPreferenceManager().getSharedPreferences().
|
|
||||||
unregisterOnSharedPreferenceChangeListener(this);
|
|
||||||
super.onPause();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
|
|
||||||
{
|
|
||||||
BackupManager.dataChanged("org.isoron.uhabits");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.fragments;
|
|
||||||
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import org.isoron.helpers.ColorHelper;
|
|
||||||
import org.isoron.helpers.Command;
|
|
||||||
import org.isoron.helpers.DialogHelper;
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
import org.isoron.uhabits.helpers.ReminderHelper;
|
|
||||||
import org.isoron.uhabits.ShowHabitActivity;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
import org.isoron.uhabits.views.HabitHistoryView;
|
|
||||||
import org.isoron.uhabits.views.HabitScoreView;
|
|
||||||
import org.isoron.uhabits.views.HabitStreakView;
|
|
||||||
import org.isoron.uhabits.views.RingView;
|
|
||||||
|
|
||||||
public class ShowHabitFragment extends Fragment implements DialogHelper.OnSavedListener
|
|
||||||
{
|
|
||||||
protected ShowHabitActivity activity;
|
|
||||||
private Habit habit;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStart()
|
|
||||||
{
|
|
||||||
super.onStart();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
||||||
Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
View view = inflater.inflate(R.layout.show_habit, container, false);
|
|
||||||
activity = (ShowHabitActivity) getActivity();
|
|
||||||
habit = activity.habit;
|
|
||||||
|
|
||||||
habit.updateCheckmarks();
|
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 21)
|
|
||||||
{
|
|
||||||
int darkerHabitColor = ColorHelper.mixColors(habit.color, Color.BLACK, 0.75f);
|
|
||||||
activity.getWindow().setStatusBarColor(darkerHabitColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextView tvHistory = (TextView) view.findViewById(R.id.tvHistory);
|
|
||||||
TextView tvOverview = (TextView) view.findViewById(R.id.tvOverview);
|
|
||||||
TextView tvStrength = (TextView) view.findViewById(R.id.tvStrength);
|
|
||||||
TextView tvStreaks = (TextView) view.findViewById(R.id.tvStreaks);
|
|
||||||
tvHistory.setTextColor(habit.color);
|
|
||||||
tvOverview.setTextColor(habit.color);
|
|
||||||
tvStrength.setTextColor(habit.color);
|
|
||||||
tvStreaks.setTextColor(habit.color);
|
|
||||||
|
|
||||||
LinearLayout llOverview = (LinearLayout) view.findViewById(R.id.llOverview);
|
|
||||||
llOverview.addView(new RingView(activity,
|
|
||||||
(int) activity.getResources().getDimension(R.dimen.small_square_size) * 4,
|
|
||||||
habit.color, ((float) habit.getScore() / Habit.MAX_SCORE), activity.getString(R.string.habit_strength)));
|
|
||||||
|
|
||||||
LinearLayout llStrength = (LinearLayout) view.findViewById(R.id.llStrength);
|
|
||||||
llStrength.addView(new HabitScoreView(activity, habit,
|
|
||||||
(int) activity.getResources().getDimension(R.dimen.small_square_size)));
|
|
||||||
|
|
||||||
LinearLayout llHistory = (LinearLayout) view.findViewById(R.id.llHistory);
|
|
||||||
HabitHistoryView hhv = new HabitHistoryView(activity, habit,
|
|
||||||
(int) activity.getResources().getDimension(R.dimen.small_square_size));
|
|
||||||
llHistory.addView(hhv);
|
|
||||||
|
|
||||||
LinearLayout llStreaks = (LinearLayout) view.findViewById(R.id.llStreaks);
|
|
||||||
HabitStreakView hsv = new HabitStreakView(activity, habit,
|
|
||||||
(int) activity.getResources().getDimension(R.dimen.small_square_size));
|
|
||||||
llStreaks.addView(hsv);
|
|
||||||
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
|
|
||||||
{
|
|
||||||
inflater.inflate(R.menu.show_habit_fragment_menu, menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item)
|
|
||||||
{
|
|
||||||
switch (item.getItemId())
|
|
||||||
{
|
|
||||||
case R.id.action_edit_habit:
|
|
||||||
{
|
|
||||||
EditHabitFragment frag = EditHabitFragment.editSingleHabitFragment(habit.getId());
|
|
||||||
frag.setOnSavedListener(this);
|
|
||||||
frag.show(getFragmentManager(), "dialog");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSaved(Command command, Object savedObject)
|
|
||||||
{
|
|
||||||
Habit h = (Habit) savedObject;
|
|
||||||
|
|
||||||
if (h == null) activity.executeCommand(command, null);
|
|
||||||
else activity.executeCommand(command, h.getId());
|
|
||||||
|
|
||||||
ReminderHelper.createReminderAlarms(activity);
|
|
||||||
activity.recreate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.helpers;
|
|
||||||
|
|
||||||
import android.app.AlarmManager;
|
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.uhabits.ReminderAlarmReceiver;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class ReminderHelper
|
|
||||||
{
|
|
||||||
public static void createReminderAlarms(Context context)
|
|
||||||
{
|
|
||||||
for (Habit habit : Habit.getHabitsWithReminder())
|
|
||||||
createReminderAlarm(context, habit, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void createReminderAlarm(Context context, Habit habit, Long reminderTime)
|
|
||||||
{
|
|
||||||
if (reminderTime == null)
|
|
||||||
{
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
calendar.set(Calendar.HOUR_OF_DAY, habit.reminderHour);
|
|
||||||
calendar.set(Calendar.MINUTE, habit.reminderMin);
|
|
||||||
calendar.set(Calendar.SECOND, 0);
|
|
||||||
|
|
||||||
reminderTime = calendar.getTimeInMillis();
|
|
||||||
|
|
||||||
if (System.currentTimeMillis() > reminderTime)
|
|
||||||
reminderTime += AlarmManager.INTERVAL_DAY;
|
|
||||||
}
|
|
||||||
|
|
||||||
long timestamp = DateHelper.getStartOfDay(DateHelper.toLocalTime(reminderTime));
|
|
||||||
|
|
||||||
Uri uri = Uri.parse(String.format("content://org.isoron.uhabits/habit/%d", habit.getId()));
|
|
||||||
|
|
||||||
Intent alarmIntent = new Intent(context, ReminderAlarmReceiver.class);
|
|
||||||
alarmIntent.setAction(ReminderAlarmReceiver.ACTION_REMIND);
|
|
||||||
alarmIntent.setData(uri);
|
|
||||||
alarmIntent.putExtra("timestamp", timestamp);
|
|
||||||
alarmIntent.putExtra("reminderTime", reminderTime);
|
|
||||||
|
|
||||||
PendingIntent pendingIntent =
|
|
||||||
PendingIntent.getBroadcast(context, ((int) (habit.getId() % Integer.MAX_VALUE)) + 1,
|
|
||||||
alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
|
|
||||||
AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
|
||||||
if (Build.VERSION.SDK_INT >= 19)
|
|
||||||
manager.setExact(AlarmManager.RTC_WAKEUP, reminderTime, pendingIntent);
|
|
||||||
else
|
|
||||||
manager.set(AlarmManager.RTC_WAKEUP, reminderTime, pendingIntent);
|
|
||||||
|
|
||||||
Log.d("ReminderHelper", String.format("Setting alarm (%s): %s",
|
|
||||||
DateFormat.getDateTimeInstance().format(new Date(reminderTime)), habit.name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,253 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.loaders;
|
|
||||||
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class HabitListLoader
|
|
||||||
{
|
|
||||||
public interface Listener
|
|
||||||
{
|
|
||||||
void onLoadFinished();
|
|
||||||
}
|
|
||||||
|
|
||||||
private AsyncTask<Void, Integer, Void> currentFetchTask;
|
|
||||||
private int checkmarkCount;
|
|
||||||
private ProgressBar progressBar;
|
|
||||||
|
|
||||||
private Listener listener;
|
|
||||||
private Long lastLoadTimestamp;
|
|
||||||
|
|
||||||
public HashMap<Long, Habit> habits;
|
|
||||||
public List<Habit> habitsList;
|
|
||||||
public HashMap<Long, int[]> checkmarks;
|
|
||||||
public HashMap<Long, Integer> scores;
|
|
||||||
|
|
||||||
boolean includeArchived;
|
|
||||||
|
|
||||||
public void setIncludeArchived(boolean includeArchived)
|
|
||||||
{
|
|
||||||
this.includeArchived = includeArchived;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProgressBar(ProgressBar progressBar)
|
|
||||||
{
|
|
||||||
this.progressBar = progressBar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCheckmarkCount(int checkmarkCount)
|
|
||||||
{
|
|
||||||
this.checkmarkCount = checkmarkCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setListener(Listener listener)
|
|
||||||
{
|
|
||||||
this.listener = listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getLastLoadTimestamp()
|
|
||||||
{
|
|
||||||
return lastLoadTimestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HabitListLoader()
|
|
||||||
{
|
|
||||||
habits = new HashMap<>();
|
|
||||||
checkmarks = new HashMap<>();
|
|
||||||
scores = new HashMap<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reorder(int from, int to)
|
|
||||||
{
|
|
||||||
Habit fromHabit = habitsList.get(from);
|
|
||||||
Habit toHabit = habitsList.get(to);
|
|
||||||
|
|
||||||
habitsList.remove(from);
|
|
||||||
habitsList.add(to, fromHabit);
|
|
||||||
|
|
||||||
Habit.reorder(fromHabit, toHabit);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateAllHabits(final boolean updateScoresAndCheckmarks)
|
|
||||||
{
|
|
||||||
if (currentFetchTask != null) currentFetchTask.cancel(true);
|
|
||||||
|
|
||||||
currentFetchTask = new AsyncTask<Void, Integer, Void>()
|
|
||||||
{
|
|
||||||
public HashMap<Long, Habit> newHabits;
|
|
||||||
public HashMap<Long, int[]> newCheckmarks;
|
|
||||||
public HashMap<Long, Integer> newScores;
|
|
||||||
public List<Habit> newHabitList;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... params)
|
|
||||||
{
|
|
||||||
newHabits = new HashMap<>();
|
|
||||||
newCheckmarks = new HashMap<>();
|
|
||||||
newScores = new HashMap<>();
|
|
||||||
newHabitList = Habit.getAll(includeArchived);
|
|
||||||
|
|
||||||
long dateTo = DateHelper.getStartOfDay(DateHelper.getLocalTime());
|
|
||||||
long dateFrom = dateTo - (checkmarkCount - 1) * DateHelper.millisecondsInOneDay;
|
|
||||||
int[] empty = new int[checkmarkCount];
|
|
||||||
|
|
||||||
for(Habit h : newHabitList)
|
|
||||||
{
|
|
||||||
Long id = h.getId();
|
|
||||||
|
|
||||||
newHabits.put(id, h);
|
|
||||||
|
|
||||||
if(checkmarks.containsKey(id))
|
|
||||||
newCheckmarks.put(id, checkmarks.get(id));
|
|
||||||
else
|
|
||||||
newCheckmarks.put(id, empty);
|
|
||||||
|
|
||||||
if(scores.containsKey(id))
|
|
||||||
newScores.put(id, scores.get(id));
|
|
||||||
else
|
|
||||||
newScores.put(id, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
commit();
|
|
||||||
|
|
||||||
if(!updateScoresAndCheckmarks) return null;
|
|
||||||
|
|
||||||
int current = 0;
|
|
||||||
for (Habit h : newHabitList)
|
|
||||||
{
|
|
||||||
if (isCancelled()) return null;
|
|
||||||
|
|
||||||
Long id = h.getId();
|
|
||||||
newScores.put(id, h.getScore());
|
|
||||||
newCheckmarks.put(id, h.getCheckmarks(dateFrom, dateTo));
|
|
||||||
|
|
||||||
publishProgress(current++, newHabits.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void commit()
|
|
||||||
{
|
|
||||||
habits = newHabits;
|
|
||||||
scores = newScores;
|
|
||||||
checkmarks = newCheckmarks;
|
|
||||||
habitsList = newHabitList;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPreExecute()
|
|
||||||
{
|
|
||||||
if(progressBar != null)
|
|
||||||
{
|
|
||||||
progressBar.setIndeterminate(false);
|
|
||||||
progressBar.setProgress(0);
|
|
||||||
progressBar.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onProgressUpdate(Integer... values)
|
|
||||||
{
|
|
||||||
if(progressBar != null)
|
|
||||||
{
|
|
||||||
progressBar.setMax(values[1]);
|
|
||||||
progressBar.setProgress(values[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(listener != null) listener.onLoadFinished();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Void aVoid)
|
|
||||||
{
|
|
||||||
if (isCancelled()) return;
|
|
||||||
|
|
||||||
if(progressBar != null) progressBar.setVisibility(View.INVISIBLE);
|
|
||||||
lastLoadTimestamp = DateHelper.getStartOfToday();
|
|
||||||
currentFetchTask = null;
|
|
||||||
|
|
||||||
if(listener != null) listener.onLoadFinished();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
currentFetchTask.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateHabit(final Long id)
|
|
||||||
{
|
|
||||||
new AsyncTask<Void, Void, Void>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... params)
|
|
||||||
{
|
|
||||||
long dateTo = DateHelper.getStartOfDay(DateHelper.getLocalTime());
|
|
||||||
long dateFrom = dateTo - (checkmarkCount - 1) * DateHelper.millisecondsInOneDay;
|
|
||||||
|
|
||||||
Habit h = Habit.get(id);
|
|
||||||
habits.put(id, h);
|
|
||||||
scores.put(id, h.getScore());
|
|
||||||
checkmarks.put(id, h.getCheckmarks(dateFrom, dateTo));
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPreExecute()
|
|
||||||
{
|
|
||||||
new Handler().postDelayed(new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
if (getStatus() == Status.RUNNING)
|
|
||||||
{
|
|
||||||
if(progressBar != null)
|
|
||||||
{
|
|
||||||
progressBar.setIndeterminate(true);
|
|
||||||
progressBar.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Void aVoid)
|
|
||||||
{
|
|
||||||
if(progressBar != null) progressBar.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
if(listener != null)
|
|
||||||
listener.onLoadFinished();
|
|
||||||
|
|
||||||
}
|
|
||||||
}.execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.models;
|
|
||||||
|
|
||||||
import com.activeandroid.Model;
|
|
||||||
import com.activeandroid.annotation.Column;
|
|
||||||
import com.activeandroid.annotation.Table;
|
|
||||||
|
|
||||||
@Table(name = "Checkmarks")
|
|
||||||
public class Checkmark extends Model
|
|
||||||
{
|
|
||||||
|
|
||||||
public static final int UNCHECKED = 0;
|
|
||||||
public static final int CHECKED_IMPLICITLY = 1;
|
|
||||||
public static final int CHECKED_EXPLICITLY = 2;
|
|
||||||
|
|
||||||
@Column(name = "habit")
|
|
||||||
public Habit habit;
|
|
||||||
|
|
||||||
@Column(name = "timestamp")
|
|
||||||
public Long timestamp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether there is a checkmark at the given timestamp or not, and whether the
|
|
||||||
* checkmark is explicit or implicit. An explicit checkmark indicates that there is a
|
|
||||||
* repetition at that day. An implicit checkmark indicates that there is no repetition at that
|
|
||||||
* day, but a repetition was not needed, due to the frequency of the habit.
|
|
||||||
*/
|
|
||||||
@Column(name = "value")
|
|
||||||
public Integer value;
|
|
||||||
}
|
|
||||||
@@ -1,725 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.models;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
|
||||||
|
|
||||||
import com.activeandroid.ActiveAndroid;
|
|
||||||
import com.activeandroid.Cache;
|
|
||||||
import com.activeandroid.Model;
|
|
||||||
import com.activeandroid.annotation.Column;
|
|
||||||
import com.activeandroid.annotation.Table;
|
|
||||||
import com.activeandroid.query.Delete;
|
|
||||||
import com.activeandroid.query.From;
|
|
||||||
import com.activeandroid.query.Select;
|
|
||||||
import com.activeandroid.query.Update;
|
|
||||||
import com.activeandroid.util.SQLiteUtils;
|
|
||||||
|
|
||||||
import org.isoron.helpers.ColorHelper;
|
|
||||||
import org.isoron.helpers.Command;
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.uhabits.R;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Table(name = "Habits")
|
|
||||||
public class Habit extends Model
|
|
||||||
{
|
|
||||||
|
|
||||||
public static final int HALF_STAR_CUTOFF = 9629750;
|
|
||||||
public static final int FULL_STAR_CUTOFF = 15407600;
|
|
||||||
public static final int MAX_SCORE = 19259500;
|
|
||||||
|
|
||||||
@Column(name = "name")
|
|
||||||
public String name;
|
|
||||||
|
|
||||||
@Column(name = "description")
|
|
||||||
public String description;
|
|
||||||
|
|
||||||
@Column(name = "freq_num")
|
|
||||||
public Integer freqNum;
|
|
||||||
|
|
||||||
@Column(name = "freq_den")
|
|
||||||
public Integer freqDen;
|
|
||||||
|
|
||||||
@Column(name = "color")
|
|
||||||
public Integer color;
|
|
||||||
|
|
||||||
@Column(name = "position")
|
|
||||||
public Integer position;
|
|
||||||
|
|
||||||
@Column(name = "reminder_hour")
|
|
||||||
public Integer reminderHour;
|
|
||||||
|
|
||||||
@Column(name = "reminder_min")
|
|
||||||
public Integer reminderMin;
|
|
||||||
|
|
||||||
@Column(name = "reminder_days")
|
|
||||||
public Integer reminderDays;
|
|
||||||
|
|
||||||
@Column(name = "highlight")
|
|
||||||
public Integer highlight;
|
|
||||||
|
|
||||||
@Column(name = "archived")
|
|
||||||
public Integer archived;
|
|
||||||
|
|
||||||
public Habit(Habit model)
|
|
||||||
{
|
|
||||||
copyAttributes(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Habit()
|
|
||||||
{
|
|
||||||
this.color = ColorHelper.palette[5];
|
|
||||||
this.position = Habit.getCount();
|
|
||||||
this.highlight = 0;
|
|
||||||
this.archived = 0;
|
|
||||||
this.freqDen = 7;
|
|
||||||
this.freqNum = 3;
|
|
||||||
this.reminderDays = 127;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Habit get(Long id)
|
|
||||||
{
|
|
||||||
return Habit.load(Habit.class, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Habit> getAll(boolean includeArchive)
|
|
||||||
{
|
|
||||||
if(includeArchive) return selectWithArchived().execute();
|
|
||||||
else return select().execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("DefaultLocale")
|
|
||||||
public static void updateId(long oldId, long newId)
|
|
||||||
{
|
|
||||||
SQLiteUtils.execSql(String.format("update Habits set Id = %d where Id = %d", newId, oldId));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static From select()
|
|
||||||
{
|
|
||||||
return new Select().from(Habit.class).where("archived = 0").orderBy("position");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static From selectWithArchived()
|
|
||||||
{
|
|
||||||
return new Select().from(Habit.class).orderBy("position");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getCount()
|
|
||||||
{
|
|
||||||
return select().count();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static java.util.List<Habit> getHighlightedHabits()
|
|
||||||
{
|
|
||||||
return select().where("highlight = 1")
|
|
||||||
.orderBy("reminder_hour desc, reminder_min desc")
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static java.util.List<Habit> getHabitsWithReminder()
|
|
||||||
{
|
|
||||||
return select().where("reminder_hour is not null").execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void reorder(Habit from, Habit to)
|
|
||||||
{
|
|
||||||
if(from == to) return;
|
|
||||||
|
|
||||||
if (to.position < from.position)
|
|
||||||
{
|
|
||||||
new Update(Habit.class).set("position = position + 1")
|
|
||||||
.where("position >= ? and position < ?", to.position, from.position)
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
new Update(Habit.class).set("position = position - 1")
|
|
||||||
.where("position > ? and position <= ?", from.position, to.position)
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
from.position = to.position;
|
|
||||||
from.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void rebuildOrder()
|
|
||||||
{
|
|
||||||
List<Habit> habits = selectWithArchived().execute();
|
|
||||||
|
|
||||||
ActiveAndroid.beginTransaction();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
for (Habit h : habits)
|
|
||||||
{
|
|
||||||
h.position = i++;
|
|
||||||
h.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
ActiveAndroid.setTransactionSuccessful();
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
ActiveAndroid.endTransaction();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void copyAttributes(Habit model)
|
|
||||||
{
|
|
||||||
this.name = model.name;
|
|
||||||
this.description = model.description;
|
|
||||||
this.freqNum = model.freqNum;
|
|
||||||
this.freqDen = model.freqDen;
|
|
||||||
this.color = model.color;
|
|
||||||
this.position = model.position;
|
|
||||||
this.reminderHour = model.reminderHour;
|
|
||||||
this.reminderMin = model.reminderMin;
|
|
||||||
this.reminderDays = model.reminderDays;
|
|
||||||
this.highlight = model.highlight;
|
|
||||||
this.archived = model.archived;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save(Long id)
|
|
||||||
{
|
|
||||||
save();
|
|
||||||
Habit.updateId(getId(), id);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected From selectReps()
|
|
||||||
{
|
|
||||||
return new Select().from(Repetition.class).where("habit = ?", getId()).orderBy("timestamp");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected From selectRepsFromTo(long timeFrom, long timeTo)
|
|
||||||
{
|
|
||||||
return selectReps().and("timestamp >= ?", timeFrom).and("timestamp <= ?", timeTo);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasRep(long timestamp)
|
|
||||||
{
|
|
||||||
int count = selectReps().where("timestamp = ?", timestamp).count();
|
|
||||||
return (count > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cascadeDelete()
|
|
||||||
{
|
|
||||||
Long id = getId();
|
|
||||||
|
|
||||||
ActiveAndroid.beginTransaction();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
new Delete().from(Checkmark.class).where("habit = ?", id).execute();
|
|
||||||
new Delete().from(Repetition.class).where("habit = ?", id).execute();
|
|
||||||
new Delete().from(Score.class).where("habit = ?", id).execute();
|
|
||||||
new Delete().from(Streak.class).where("habit = ?", id).execute();
|
|
||||||
delete();
|
|
||||||
|
|
||||||
ActiveAndroid.setTransactionSuccessful();
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
ActiveAndroid.endTransaction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteReps(long timestamp)
|
|
||||||
{
|
|
||||||
new Delete().from(Repetition.class)
|
|
||||||
.where("habit = ?", getId())
|
|
||||||
.and("timestamp = ?", timestamp)
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteCheckmarksNewerThan(long timestamp)
|
|
||||||
{
|
|
||||||
new Delete().from(Checkmark.class)
|
|
||||||
.where("habit = ?", getId())
|
|
||||||
.and("timestamp >= ?", timestamp)
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteStreaksNewerThan(long timestamp)
|
|
||||||
{
|
|
||||||
new Delete().from(Streak.class)
|
|
||||||
.where("habit = ?", getId())
|
|
||||||
.and("end >= ?", timestamp - DateHelper.millisecondsInOneDay)
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] getCheckmarks(Long fromTimestamp, Long toTimestamp)
|
|
||||||
{
|
|
||||||
updateCheckmarks();
|
|
||||||
|
|
||||||
String query = "select value, timestamp from Checkmarks where " +
|
|
||||||
"habit = ? and timestamp >= ? and timestamp <= ?";
|
|
||||||
|
|
||||||
SQLiteDatabase db = Cache.openDatabase();
|
|
||||||
String args[] = {getId().toString(), fromTimestamp.toString(), toTimestamp.toString()};
|
|
||||||
Cursor cursor = db.rawQuery(query, args);
|
|
||||||
|
|
||||||
long day = DateHelper.millisecondsInOneDay;
|
|
||||||
int nDays = (int) ((toTimestamp - fromTimestamp) / day) + 1;
|
|
||||||
int[] checks = new int[nDays];
|
|
||||||
|
|
||||||
if (cursor.moveToFirst())
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
long timestamp = cursor.getLong(1);
|
|
||||||
int offset = (int) ((timestamp - fromTimestamp) / day);
|
|
||||||
checks[nDays - offset - 1] = cursor.getInt(0);
|
|
||||||
|
|
||||||
} while (cursor.moveToNext());
|
|
||||||
}
|
|
||||||
|
|
||||||
return checks;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateCheckmarks()
|
|
||||||
{
|
|
||||||
long beginning;
|
|
||||||
long today = DateHelper.getStartOfToday();
|
|
||||||
long day = DateHelper.millisecondsInOneDay;
|
|
||||||
|
|
||||||
Checkmark newestCheckmark = getNewestCheckmark();
|
|
||||||
if (newestCheckmark == null)
|
|
||||||
{
|
|
||||||
Repetition oldestRep = getOldestRep();
|
|
||||||
if (oldestRep == null) return;
|
|
||||||
|
|
||||||
beginning = oldestRep.timestamp;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
beginning = newestCheckmark.timestamp + day;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (beginning > today) return;
|
|
||||||
|
|
||||||
long beginningExtended = beginning - (long) (freqDen) * day;
|
|
||||||
List<Repetition> reps = selectRepsFromTo(beginningExtended, today).execute();
|
|
||||||
|
|
||||||
int nDays = (int) ((today - beginning) / day) + 1;
|
|
||||||
int nDaysExtended = (int) ((today - beginningExtended) / day) + 1;
|
|
||||||
|
|
||||||
int checks[] = new int[nDaysExtended];
|
|
||||||
|
|
||||||
// explicit checks
|
|
||||||
for (Repetition rep : reps)
|
|
||||||
{
|
|
||||||
int offset = (int) ((rep.timestamp - beginningExtended) / day);
|
|
||||||
checks[nDaysExtended - offset - 1] = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// implicit checks
|
|
||||||
for (int i = 0; i < nDays; i++)
|
|
||||||
{
|
|
||||||
int counter = 0;
|
|
||||||
|
|
||||||
for (int j = 0; j < freqDen; j++)
|
|
||||||
if (checks[i + j] == 2) counter++;
|
|
||||||
|
|
||||||
if (counter >= freqNum) checks[i] = Math.max(checks[i], 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ActiveAndroid.beginTransaction();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for (int i = 0; i < nDays; i++)
|
|
||||||
{
|
|
||||||
Checkmark c = new Checkmark();
|
|
||||||
c.habit = this;
|
|
||||||
c.timestamp = today - i * day;
|
|
||||||
c.value = checks[i];
|
|
||||||
c.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
ActiveAndroid.setTransactionSuccessful();
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
ActiveAndroid.endTransaction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Checkmark getNewestCheckmark()
|
|
||||||
{
|
|
||||||
return new Select().from(Checkmark.class)
|
|
||||||
.where("habit = ?", getId())
|
|
||||||
.orderBy("timestamp desc")
|
|
||||||
.limit(1)
|
|
||||||
.executeSingle();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRepsCount(int days)
|
|
||||||
{
|
|
||||||
long timeTo = DateHelper.getStartOfToday();
|
|
||||||
long timeFrom = timeTo - DateHelper.millisecondsInOneDay * days;
|
|
||||||
return selectRepsFromTo(timeFrom, timeTo).count();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasImplicitRepToday()
|
|
||||||
{
|
|
||||||
long today = DateHelper.getStartOfToday();
|
|
||||||
int reps[] = getCheckmarks(today - DateHelper.millisecondsInOneDay, today);
|
|
||||||
return (reps[0] > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Repetition getOldestRep()
|
|
||||||
{
|
|
||||||
return (Repetition) selectReps().limit(1).executeSingle();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Repetition getOldestRepNewerThan(long timestamp)
|
|
||||||
{
|
|
||||||
return selectReps().where("timestamp > ?", timestamp).limit(1).executeSingle();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toggleRepetition(long timestamp)
|
|
||||||
{
|
|
||||||
if (hasRep(timestamp))
|
|
||||||
{
|
|
||||||
deleteReps(timestamp);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Repetition rep = new Repetition();
|
|
||||||
rep.habit = this;
|
|
||||||
rep.timestamp = timestamp;
|
|
||||||
rep.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
deleteScoresNewerThan(timestamp);
|
|
||||||
deleteCheckmarksNewerThan(timestamp);
|
|
||||||
deleteStreaksNewerThan(timestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void archive()
|
|
||||||
{
|
|
||||||
archived = 1;
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void unarchive()
|
|
||||||
{
|
|
||||||
archived = 0;
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isArchived()
|
|
||||||
{
|
|
||||||
return archived != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toggleRepetitionToday()
|
|
||||||
{
|
|
||||||
toggleRepetition(DateHelper.getStartOfToday());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Score getNewestScore()
|
|
||||||
{
|
|
||||||
return new Select().from(Score.class)
|
|
||||||
.where("habit = ?", getId())
|
|
||||||
.orderBy("timestamp desc")
|
|
||||||
.limit(1)
|
|
||||||
.executeSingle();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteScoresNewerThan(long timestamp)
|
|
||||||
{
|
|
||||||
new Delete().from(Score.class)
|
|
||||||
.where("habit = ?", getId())
|
|
||||||
.and("timestamp >= ?", timestamp)
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getScore()
|
|
||||||
{
|
|
||||||
int beginningScore;
|
|
||||||
long beginningTime;
|
|
||||||
|
|
||||||
long today = DateHelper.getStartOfDay(DateHelper.getLocalTime());
|
|
||||||
long day = DateHelper.millisecondsInOneDay;
|
|
||||||
|
|
||||||
double freq = ((double) freqNum) / freqDen;
|
|
||||||
double multiplier = Math.pow(0.5, 1.0 / (14.0 / freq - 1));
|
|
||||||
|
|
||||||
Score newestScore = getNewestScore();
|
|
||||||
if (newestScore == null)
|
|
||||||
{
|
|
||||||
Repetition oldestRep = getOldestRep();
|
|
||||||
if (oldestRep == null) return 0;
|
|
||||||
beginningTime = oldestRep.timestamp;
|
|
||||||
beginningScore = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
beginningTime = newestScore.timestamp + day;
|
|
||||||
beginningScore = newestScore.score;
|
|
||||||
}
|
|
||||||
|
|
||||||
long nDays = (today - beginningTime) / day;
|
|
||||||
if (nDays < 0) return newestScore.score;
|
|
||||||
|
|
||||||
int reps[] = getCheckmarks(beginningTime, today);
|
|
||||||
|
|
||||||
ActiveAndroid.beginTransaction();
|
|
||||||
int lastScore = beginningScore;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for (int i = 0; i < reps.length; i++)
|
|
||||||
{
|
|
||||||
Score s = new Score();
|
|
||||||
s.habit = this;
|
|
||||||
s.timestamp = beginningTime + day * i;
|
|
||||||
s.score = (int) (lastScore * multiplier);
|
|
||||||
if (reps[reps.length - i - 1] == 2)
|
|
||||||
{
|
|
||||||
s.score += 1000000;
|
|
||||||
s.score = Math.min(s.score, MAX_SCORE);
|
|
||||||
}
|
|
||||||
s.save();
|
|
||||||
|
|
||||||
lastScore = s.score;
|
|
||||||
}
|
|
||||||
|
|
||||||
ActiveAndroid.setTransactionSuccessful();
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
ActiveAndroid.endTransaction();
|
|
||||||
}
|
|
||||||
|
|
||||||
return lastScore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Score> getScores(long fromTimestamp, long toTimestamp, int divisor, long offset)
|
|
||||||
{
|
|
||||||
return new Select().from(Score.class)
|
|
||||||
.where("habit = ? and timestamp > ? and " +
|
|
||||||
"timestamp <= ? and (timestamp - ?) % ? = 0", getId(), fromTimestamp,
|
|
||||||
toTimestamp, offset, divisor)
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Streak> getStreaks()
|
|
||||||
{
|
|
||||||
updateStreaks();
|
|
||||||
|
|
||||||
return new Select().from(Streak.class)
|
|
||||||
.where("habit = ?", getId())
|
|
||||||
.orderBy("end asc")
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Streak getNewestStreak()
|
|
||||||
{
|
|
||||||
return new Select().from(Streak.class)
|
|
||||||
.where("habit = ?", getId())
|
|
||||||
.orderBy("end desc")
|
|
||||||
.limit(1)
|
|
||||||
.executeSingle();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateStreaks()
|
|
||||||
{
|
|
||||||
long beginning;
|
|
||||||
long today = DateHelper.getStartOfToday();
|
|
||||||
long day = DateHelper.millisecondsInOneDay;
|
|
||||||
|
|
||||||
Streak newestStreak = getNewestStreak();
|
|
||||||
if (newestStreak == null)
|
|
||||||
{
|
|
||||||
Repetition oldestRep = getOldestRep();
|
|
||||||
if (oldestRep == null) return;
|
|
||||||
|
|
||||||
beginning = oldestRep.timestamp;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Repetition oldestRep = getOldestRepNewerThan(newestStreak.end);
|
|
||||||
if (oldestRep == null) return;
|
|
||||||
|
|
||||||
beginning = oldestRep.timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (beginning > today) return;
|
|
||||||
|
|
||||||
int checks[] = getCheckmarks(beginning, today);
|
|
||||||
ArrayList<Long> list = new ArrayList<>();
|
|
||||||
|
|
||||||
long current = beginning;
|
|
||||||
list.add(current);
|
|
||||||
|
|
||||||
for (int i = 1; i < checks.length; i++)
|
|
||||||
{
|
|
||||||
current += day;
|
|
||||||
int j = checks.length - i - 1;
|
|
||||||
|
|
||||||
if ((checks[j + 1] == 0 && checks[j] > 0)) list.add(current);
|
|
||||||
if ((checks[j + 1] > 0 && checks[j] == 0)) list.add(current - day);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list.size() % 2 == 1) list.add(current);
|
|
||||||
|
|
||||||
ActiveAndroid.beginTransaction();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for (int i = 0; i < list.size(); i += 2)
|
|
||||||
{
|
|
||||||
Streak streak = new Streak();
|
|
||||||
streak.habit = this;
|
|
||||||
streak.start = list.get(i);
|
|
||||||
streak.end = list.get(i + 1);
|
|
||||||
streak.length = (streak.end - streak.start) / day + 1;
|
|
||||||
streak.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
ActiveAndroid.setTransactionSuccessful();
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
ActiveAndroid.endTransaction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class CreateCommand extends Command
|
|
||||||
{
|
|
||||||
private Habit model;
|
|
||||||
private Long savedId;
|
|
||||||
|
|
||||||
public CreateCommand(Habit model)
|
|
||||||
{
|
|
||||||
this.model = model;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute()
|
|
||||||
{
|
|
||||||
Habit savedHabit = new Habit(model);
|
|
||||||
if (savedId == null)
|
|
||||||
{
|
|
||||||
savedHabit.save();
|
|
||||||
savedId = savedHabit.getId();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
savedHabit.save(savedId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void undo()
|
|
||||||
{
|
|
||||||
Habit.get(savedId).delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer getExecuteStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_created;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer getUndoStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_deleted;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EditCommand extends Command
|
|
||||||
{
|
|
||||||
private Habit original;
|
|
||||||
private Habit modified;
|
|
||||||
private long savedId;
|
|
||||||
private boolean hasIntervalChanged;
|
|
||||||
|
|
||||||
public EditCommand(Habit modified)
|
|
||||||
{
|
|
||||||
this.savedId = getId();
|
|
||||||
this.modified = new Habit(modified);
|
|
||||||
this.original = new Habit(Habit.this);
|
|
||||||
|
|
||||||
hasIntervalChanged = (this.original.freqDen != this.modified.freqDen ||
|
|
||||||
this.original.freqNum != this.modified.freqNum);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void execute()
|
|
||||||
{
|
|
||||||
Habit habit = Habit.get(savedId);
|
|
||||||
habit.copyAttributes(modified);
|
|
||||||
habit.save();
|
|
||||||
if (hasIntervalChanged)
|
|
||||||
{
|
|
||||||
habit.deleteCheckmarksNewerThan(0);
|
|
||||||
habit.deleteStreaksNewerThan(0);
|
|
||||||
habit.deleteScoresNewerThan(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void undo()
|
|
||||||
{
|
|
||||||
Habit habit = Habit.get(savedId);
|
|
||||||
habit.copyAttributes(original);
|
|
||||||
habit.save();
|
|
||||||
if (hasIntervalChanged)
|
|
||||||
{
|
|
||||||
habit.deleteCheckmarksNewerThan(0);
|
|
||||||
habit.deleteStreaksNewerThan(0);
|
|
||||||
habit.deleteScoresNewerThan(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getExecuteStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUndoStringId()
|
|
||||||
{
|
|
||||||
return R.string.toast_habit_changed_back;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ToggleRepetitionCommand extends Command
|
|
||||||
{
|
|
||||||
private Long offset;
|
|
||||||
|
|
||||||
public ToggleRepetitionCommand(long offset)
|
|
||||||
{
|
|
||||||
this.offset = offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute()
|
|
||||||
{
|
|
||||||
toggleRepetition(offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void undo()
|
|
||||||
{
|
|
||||||
execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.models;
|
|
||||||
|
|
||||||
import com.activeandroid.Model;
|
|
||||||
import com.activeandroid.annotation.Column;
|
|
||||||
import com.activeandroid.annotation.Table;
|
|
||||||
|
|
||||||
@Table(name = "Repetitions")
|
|
||||||
public class Repetition extends Model
|
|
||||||
{
|
|
||||||
|
|
||||||
@Column(name = "habit")
|
|
||||||
public Habit habit;
|
|
||||||
|
|
||||||
@Column(name = "timestamp")
|
|
||||||
public Long timestamp;
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.models;
|
|
||||||
|
|
||||||
import com.activeandroid.Model;
|
|
||||||
import com.activeandroid.annotation.Column;
|
|
||||||
import com.activeandroid.annotation.Table;
|
|
||||||
|
|
||||||
@Table(name = "Score")
|
|
||||||
public class Score extends Model
|
|
||||||
{
|
|
||||||
@Column(name = "habit")
|
|
||||||
public Habit habit;
|
|
||||||
|
|
||||||
@Column(name = "timestamp")
|
|
||||||
public Long timestamp;
|
|
||||||
|
|
||||||
@Column(name = "score")
|
|
||||||
public Integer score;
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.models;
|
|
||||||
|
|
||||||
import com.activeandroid.Model;
|
|
||||||
import com.activeandroid.annotation.Column;
|
|
||||||
|
|
||||||
public class Streak extends Model
|
|
||||||
{
|
|
||||||
@Column(name = "habit")
|
|
||||||
public Habit habit;
|
|
||||||
|
|
||||||
@Column(name = "start")
|
|
||||||
public Long start;
|
|
||||||
|
|
||||||
@Column(name = "end")
|
|
||||||
public Long end;
|
|
||||||
|
|
||||||
@Column(name = "length")
|
|
||||||
public Long length;
|
|
||||||
}
|
|
||||||
@@ -1,239 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.views;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.graphics.Paint.Align;
|
|
||||||
import android.graphics.Rect;
|
|
||||||
|
|
||||||
import org.isoron.helpers.ColorHelper;
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
|
|
||||||
public class HabitHistoryView extends ScrollableDataView
|
|
||||||
{
|
|
||||||
|
|
||||||
private Habit habit;
|
|
||||||
private int[] checkmarks;
|
|
||||||
private Paint pSquareBg, pSquareFg, pTextHeader;
|
|
||||||
private int squareSpacing;
|
|
||||||
|
|
||||||
private float squareTextOffset;
|
|
||||||
private float headerTextOffset;
|
|
||||||
|
|
||||||
private String wdays[];
|
|
||||||
private SimpleDateFormat dfMonth;
|
|
||||||
private SimpleDateFormat dfYear;
|
|
||||||
|
|
||||||
private Calendar baseDate;
|
|
||||||
private int nDays;
|
|
||||||
private int todayWeekday;
|
|
||||||
private int colors[];
|
|
||||||
|
|
||||||
public HabitHistoryView(Context context, Habit habit, int baseSize)
|
|
||||||
{
|
|
||||||
super(context);
|
|
||||||
this.habit = habit;
|
|
||||||
|
|
||||||
setDimensions(baseSize);
|
|
||||||
createPaints();
|
|
||||||
createColors();
|
|
||||||
|
|
||||||
wdays = DateHelper.getShortDayNames();
|
|
||||||
dfMonth = new SimpleDateFormat("MMM");
|
|
||||||
dfYear = new SimpleDateFormat("yyyy");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateDate()
|
|
||||||
{
|
|
||||||
baseDate = new GregorianCalendar();
|
|
||||||
baseDate.add(Calendar.DAY_OF_YEAR, -(dataOffset - 1) * 7);
|
|
||||||
|
|
||||||
nDays = (nColumns - 1) * 7;
|
|
||||||
todayWeekday = new GregorianCalendar().get(Calendar.DAY_OF_WEEK) % 7;
|
|
||||||
|
|
||||||
baseDate.add(Calendar.DAY_OF_YEAR, -nDays);
|
|
||||||
baseDate.add(Calendar.DAY_OF_YEAR, -todayWeekday);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onSizeChanged(int w, int h, int oldw, int oldh)
|
|
||||||
{
|
|
||||||
super.onSizeChanged(w, h, oldw, oldh);
|
|
||||||
updateDate();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createColors()
|
|
||||||
{
|
|
||||||
int primaryColor = habit.color;
|
|
||||||
int primaryColorBright = ColorHelper.mixColors(primaryColor, Color.WHITE, 0.5f);
|
|
||||||
int grey = Color.rgb(230, 230, 230);
|
|
||||||
|
|
||||||
colors = new int[3];
|
|
||||||
colors[0] = grey;
|
|
||||||
colors[1] = primaryColorBright;
|
|
||||||
colors[2] = primaryColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDimensions(int baseSize)
|
|
||||||
{
|
|
||||||
columnWidth = baseSize;
|
|
||||||
columnHeight = 8 * baseSize;
|
|
||||||
squareSpacing = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createPaints()
|
|
||||||
{
|
|
||||||
pTextHeader = new Paint();
|
|
||||||
pTextHeader.setColor(Color.LTGRAY);
|
|
||||||
pTextHeader.setTextAlign(Align.LEFT);
|
|
||||||
pTextHeader.setTextSize(columnWidth * 0.5f);
|
|
||||||
pTextHeader.setAntiAlias(true);
|
|
||||||
|
|
||||||
pSquareBg = new Paint();
|
|
||||||
pSquareBg.setColor(habit.color);
|
|
||||||
|
|
||||||
pSquareFg = new Paint();
|
|
||||||
pSquareFg.setColor(Color.WHITE);
|
|
||||||
pSquareFg.setAntiAlias(true);
|
|
||||||
pSquareFg.setTextSize(columnWidth * 0.5f);
|
|
||||||
pSquareFg.setTextAlign(Align.CENTER);
|
|
||||||
|
|
||||||
squareTextOffset = pSquareFg.getFontSpacing() * 0.4f;
|
|
||||||
headerTextOffset = pTextHeader.getFontSpacing() * 0.3f;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fetchData()
|
|
||||||
{
|
|
||||||
Calendar currentDate = new GregorianCalendar();
|
|
||||||
currentDate.add(Calendar.DAY_OF_YEAR, -dataOffset * 7);
|
|
||||||
int dayOfWeek = currentDate.get(Calendar.DAY_OF_WEEK) % 7;
|
|
||||||
|
|
||||||
long dateTo = DateHelper.getStartOfToday();
|
|
||||||
for (int i = 0; i < 7 - dayOfWeek; i++)
|
|
||||||
dateTo += DateHelper.millisecondsInOneDay;
|
|
||||||
|
|
||||||
for (int i = 0; i < dataOffset * 7; i++)
|
|
||||||
dateTo -= DateHelper.millisecondsInOneDay;
|
|
||||||
|
|
||||||
long dateFrom = dateTo;
|
|
||||||
for (int i = 0; i < (nColumns - 1) * 7; i++)
|
|
||||||
dateFrom -= DateHelper.millisecondsInOneDay;
|
|
||||||
|
|
||||||
checkmarks = habit.getCheckmarks(dateFrom, dateTo);
|
|
||||||
updateDate();
|
|
||||||
}
|
|
||||||
|
|
||||||
private String previousMonth;
|
|
||||||
private String previousYear;
|
|
||||||
private boolean justPrintedYear;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDraw(Canvas canvas)
|
|
||||||
{
|
|
||||||
super.onDraw(canvas);
|
|
||||||
|
|
||||||
Rect location = new Rect(0, 0, columnWidth - squareSpacing, columnWidth - squareSpacing);
|
|
||||||
|
|
||||||
previousMonth = "";
|
|
||||||
previousYear = "";
|
|
||||||
justPrintedYear = false;
|
|
||||||
|
|
||||||
GregorianCalendar currentDate = (GregorianCalendar) baseDate.clone();
|
|
||||||
|
|
||||||
for (int column = 0; column < nColumns - 1; column++)
|
|
||||||
{
|
|
||||||
drawColumn(canvas, location, currentDate, column);
|
|
||||||
location.offset(columnWidth, -columnHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
drawAxis(canvas, location);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawColumn(Canvas canvas, Rect location, GregorianCalendar date, int column)
|
|
||||||
{
|
|
||||||
drawColumnHeader(canvas, location, date);
|
|
||||||
location.offset(0, columnWidth);
|
|
||||||
|
|
||||||
for (int j = 0; j < 7; j++)
|
|
||||||
{
|
|
||||||
if (!(column == nColumns - 2 && dataOffset == 0 && j > todayWeekday))
|
|
||||||
{
|
|
||||||
int checkmarkOffset = nDays - 7 * column - j;
|
|
||||||
drawSquare(canvas, location, date, checkmarkOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
date.add(Calendar.DAY_OF_MONTH, 1);
|
|
||||||
location.offset(0, columnWidth);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawSquare(Canvas canvas, Rect location, GregorianCalendar date,
|
|
||||||
int checkmarkOffset)
|
|
||||||
{
|
|
||||||
if (checkmarkOffset >= checkmarks.length) pSquareBg.setColor(colors[0]);
|
|
||||||
else pSquareBg.setColor(colors[checkmarks[checkmarkOffset]]);
|
|
||||||
|
|
||||||
canvas.drawRect(location, pSquareBg);
|
|
||||||
String text = Integer.toString(date.get(Calendar.DAY_OF_MONTH));
|
|
||||||
canvas.drawText(text, location.centerX(), location.centerY() + squareTextOffset, pSquareFg);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawAxis(Canvas canvas, Rect location)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < 7; i++)
|
|
||||||
{
|
|
||||||
location.offset(0, columnWidth);
|
|
||||||
canvas.drawText(wdays[i], location.left + headerTextOffset,
|
|
||||||
location.bottom - headerTextOffset, pTextHeader);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawColumnHeader(Canvas canvas, Rect location, GregorianCalendar date)
|
|
||||||
{
|
|
||||||
String month = dfMonth.format(date.getTime());
|
|
||||||
String year = dfYear.format(date.getTime());
|
|
||||||
|
|
||||||
if (!month.equals(previousMonth))
|
|
||||||
{
|
|
||||||
int offset = 0;
|
|
||||||
if (justPrintedYear) offset += columnWidth;
|
|
||||||
|
|
||||||
canvas.drawText(month, location.left + offset, location.bottom - headerTextOffset,
|
|
||||||
pTextHeader);
|
|
||||||
previousMonth = month;
|
|
||||||
justPrintedYear = false;
|
|
||||||
}
|
|
||||||
else if (!year.equals(previousYear))
|
|
||||||
{
|
|
||||||
canvas.drawText(year, location.left, location.bottom - headerTextOffset, pTextHeader);
|
|
||||||
previousYear = year;
|
|
||||||
justPrintedYear = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
justPrintedYear = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.views;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.graphics.RectF;
|
|
||||||
|
|
||||||
import org.isoron.helpers.ColorHelper;
|
|
||||||
import org.isoron.helpers.DateHelper;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
import org.isoron.uhabits.models.Score;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class HabitScoreView extends ScrollableDataView
|
|
||||||
{
|
|
||||||
public static final int BUCKET_SIZE = 7;
|
|
||||||
|
|
||||||
private final Paint pGrid;
|
|
||||||
private final float em;
|
|
||||||
private Habit habit;
|
|
||||||
|
|
||||||
private Paint pText, pGraph;
|
|
||||||
|
|
||||||
private int[] colors;
|
|
||||||
private List<Score> scores;
|
|
||||||
|
|
||||||
public HabitScoreView(Context context, Habit habit, int columnWidth)
|
|
||||||
{
|
|
||||||
super(context);
|
|
||||||
this.habit = habit;
|
|
||||||
|
|
||||||
pText = new Paint();
|
|
||||||
pText.setColor(Color.LTGRAY);
|
|
||||||
pText.setTextAlign(Paint.Align.LEFT);
|
|
||||||
pText.setTextSize(columnWidth * 0.5f);
|
|
||||||
pText.setAntiAlias(true);
|
|
||||||
|
|
||||||
pGraph = new Paint();
|
|
||||||
pGraph.setTextAlign(Paint.Align.CENTER);
|
|
||||||
pGraph.setTextSize(columnWidth * 0.5f);
|
|
||||||
pGraph.setAntiAlias(true);
|
|
||||||
pGraph.setStrokeWidth(columnWidth * 0.1f);
|
|
||||||
|
|
||||||
pGrid = new Paint();
|
|
||||||
pGrid.setColor(Color.LTGRAY);
|
|
||||||
pGrid.setAntiAlias(true);
|
|
||||||
pGrid.setStrokeWidth(columnWidth * 0.05f);
|
|
||||||
|
|
||||||
this.columnWidth = columnWidth;
|
|
||||||
columnHeight = 8 * columnWidth;
|
|
||||||
headerHeight = columnWidth;
|
|
||||||
footerHeight = columnWidth;
|
|
||||||
|
|
||||||
em = pText.getFontSpacing();
|
|
||||||
|
|
||||||
colors = new int[4];
|
|
||||||
|
|
||||||
colors[0] = Color.rgb(230, 230, 230);
|
|
||||||
colors[3] = habit.color;
|
|
||||||
colors[1] = ColorHelper.mixColors(colors[0], colors[3], 0.66f);
|
|
||||||
colors[2] = ColorHelper.mixColors(colors[0], colors[3], 0.33f);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fetchData()
|
|
||||||
{
|
|
||||||
|
|
||||||
long toTimestamp = DateHelper.getStartOfToday();
|
|
||||||
for (int i = 0; i < dataOffset * BUCKET_SIZE; i++)
|
|
||||||
toTimestamp -= DateHelper.millisecondsInOneDay;
|
|
||||||
|
|
||||||
long fromTimestamp = toTimestamp;
|
|
||||||
for (int i = 0; i < nColumns * BUCKET_SIZE; i++)
|
|
||||||
fromTimestamp -= DateHelper.millisecondsInOneDay;
|
|
||||||
|
|
||||||
scores = habit.getScores(fromTimestamp, toTimestamp,
|
|
||||||
BUCKET_SIZE * DateHelper.millisecondsInOneDay, toTimestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDraw(Canvas canvas)
|
|
||||||
{
|
|
||||||
super.onDraw(canvas);
|
|
||||||
|
|
||||||
float lineHeight = pText.getFontSpacing();
|
|
||||||
|
|
||||||
RectF rGrid = new RectF(0, 0, nColumns * columnWidth, columnHeight);
|
|
||||||
rGrid.offset(0, headerHeight);
|
|
||||||
drawGrid(canvas, rGrid);
|
|
||||||
|
|
||||||
SimpleDateFormat dfMonth = new SimpleDateFormat("MMM");
|
|
||||||
SimpleDateFormat dfDay = new SimpleDateFormat("d");
|
|
||||||
|
|
||||||
String previousMonth = "";
|
|
||||||
|
|
||||||
pGraph.setColor(habit.color);
|
|
||||||
RectF prevR = null;
|
|
||||||
|
|
||||||
for (int offset = nColumns - scores.size(); offset < nColumns; offset++)
|
|
||||||
{
|
|
||||||
Score score = scores.get(offset - nColumns + scores.size());
|
|
||||||
String month = dfMonth.format(score.timestamp);
|
|
||||||
String day = dfDay.format(score.timestamp);
|
|
||||||
|
|
||||||
long s = score.score;
|
|
||||||
double sRelative = ((double) s) / Habit.MAX_SCORE;
|
|
||||||
|
|
||||||
int height = (int) (columnHeight * sRelative);
|
|
||||||
|
|
||||||
RectF r = new RectF(0, 0, columnWidth, columnWidth);
|
|
||||||
r.offset(offset * columnWidth,
|
|
||||||
headerHeight + columnHeight - height - columnWidth / 2);
|
|
||||||
|
|
||||||
if (prevR != null)
|
|
||||||
{
|
|
||||||
drawLine(canvas, prevR, r);
|
|
||||||
drawMarker(canvas, prevR);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (offset == nColumns - 1) drawMarker(canvas, r);
|
|
||||||
|
|
||||||
prevR = r;
|
|
||||||
|
|
||||||
r = new RectF(0, 0, columnWidth, columnHeight);
|
|
||||||
r.offset(offset * columnWidth, headerHeight);
|
|
||||||
if (!month.equals(previousMonth))
|
|
||||||
canvas.drawText(month, r.centerX(), r.bottom + lineHeight * 1.2f, pText);
|
|
||||||
else
|
|
||||||
canvas.drawText(day, r.centerX(), r.bottom + lineHeight * 1.2f, pText);
|
|
||||||
|
|
||||||
previousMonth = month;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawGrid(Canvas canvas, RectF rGrid)
|
|
||||||
{
|
|
||||||
int nRows = 5;
|
|
||||||
float rowHeight = rGrid.height() / nRows;
|
|
||||||
|
|
||||||
pGrid.setColor(Color.rgb(240, 240, 240));
|
|
||||||
for (int i = 0; i < nRows; i++)
|
|
||||||
{
|
|
||||||
canvas.drawText(String.format("%d%%", (100 - i * 100 / nRows)), rGrid.left + 0.5f * em,
|
|
||||||
rGrid.top + 1f * em, pText);
|
|
||||||
canvas.drawLine(rGrid.left, rGrid.top, rGrid.right, rGrid.top, pGrid);
|
|
||||||
rGrid.offset(0, rowHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
canvas.drawLine(rGrid.left, rGrid.top, rGrid.right, rGrid.top, pGrid);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawLine(Canvas canvas, RectF rectFrom, RectF rectTo)
|
|
||||||
{
|
|
||||||
pGraph.setColor(habit.color);
|
|
||||||
canvas.drawLine(rectFrom.centerX(), rectFrom.centerY(), rectTo.centerX(), rectTo.centerY(),
|
|
||||||
pGraph);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawMarker(Canvas canvas, RectF rect)
|
|
||||||
{
|
|
||||||
rect.inset(columnWidth * 0.15f, columnWidth * 0.15f);
|
|
||||||
pGraph.setColor(Color.WHITE);
|
|
||||||
canvas.drawOval(rect, pGraph);
|
|
||||||
|
|
||||||
rect.inset(columnWidth * 0.1f, columnWidth * 0.1f);
|
|
||||||
pGraph.setColor(habit.color);
|
|
||||||
canvas.drawOval(rect, pGraph);
|
|
||||||
|
|
||||||
rect.inset(columnWidth * 0.1f, columnWidth * 0.1f);
|
|
||||||
pGraph.setColor(Color.WHITE);
|
|
||||||
canvas.drawOval(rect, pGraph);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.views;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.graphics.Rect;
|
|
||||||
|
|
||||||
import org.isoron.helpers.ColorHelper;
|
|
||||||
import org.isoron.uhabits.models.Habit;
|
|
||||||
import org.isoron.uhabits.models.Streak;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class HabitStreakView extends ScrollableDataView
|
|
||||||
{
|
|
||||||
private Habit habit;
|
|
||||||
private Paint pText, pBar;
|
|
||||||
private List<Streak> streaks;
|
|
||||||
private long maxStreakLength;
|
|
||||||
private int[] colors;
|
|
||||||
|
|
||||||
public HabitStreakView(Context context, Habit habit, int columnWidth)
|
|
||||||
{
|
|
||||||
super(context);
|
|
||||||
this.habit = habit;
|
|
||||||
|
|
||||||
setDimensions(columnWidth);
|
|
||||||
createPaints();
|
|
||||||
createColors();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDimensions(int baseSize)
|
|
||||||
{
|
|
||||||
this.columnWidth = baseSize;
|
|
||||||
columnHeight = 8 * baseSize;
|
|
||||||
headerHeight = baseSize;
|
|
||||||
footerHeight = baseSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createColors()
|
|
||||||
{
|
|
||||||
colors = new int[4];
|
|
||||||
colors[0] = Color.rgb(230, 230, 230);
|
|
||||||
colors[3] = habit.color;
|
|
||||||
colors[1] = ColorHelper.mixColors(colors[0], colors[3], 0.66f);
|
|
||||||
colors[2] = ColorHelper.mixColors(colors[0], colors[3], 0.33f);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createPaints()
|
|
||||||
{
|
|
||||||
pText = new Paint();
|
|
||||||
pText.setColor(Color.LTGRAY);
|
|
||||||
pText.setTextAlign(Paint.Align.CENTER);
|
|
||||||
pText.setTextSize(columnWidth * 0.5f);
|
|
||||||
pText.setAntiAlias(true);
|
|
||||||
|
|
||||||
pBar = new Paint();
|
|
||||||
pBar.setTextAlign(Paint.Align.CENTER);
|
|
||||||
pBar.setTextSize(columnWidth * 0.5f);
|
|
||||||
pBar.setAntiAlias(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fetchData()
|
|
||||||
{
|
|
||||||
streaks = habit.getStreaks();
|
|
||||||
|
|
||||||
for (Streak s : streaks)
|
|
||||||
maxStreakLength = Math.max(maxStreakLength, s.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDraw(Canvas canvas)
|
|
||||||
{
|
|
||||||
super.onDraw(canvas);
|
|
||||||
|
|
||||||
float lineHeight = pText.getFontSpacing();
|
|
||||||
float barHeaderOffset = lineHeight * 0.4f;
|
|
||||||
|
|
||||||
int nStreaks = streaks.size();
|
|
||||||
int start = Math.max(0, nStreaks - nColumns - dataOffset);
|
|
||||||
SimpleDateFormat dfMonth = new SimpleDateFormat("MMM");
|
|
||||||
|
|
||||||
String previousMonth = "";
|
|
||||||
|
|
||||||
for (int offset = 0; offset < nColumns && start + offset < nStreaks; offset++)
|
|
||||||
{
|
|
||||||
String month = dfMonth.format(streaks.get(start + offset).start);
|
|
||||||
|
|
||||||
long l = streaks.get(offset + start).length;
|
|
||||||
double lRelative = ((double) l) / maxStreakLength;
|
|
||||||
|
|
||||||
pBar.setColor(colors[(int) Math.floor(lRelative * 3)]);
|
|
||||||
|
|
||||||
int height = (int) (columnHeight * lRelative);
|
|
||||||
Rect r = new Rect(0, 0, columnWidth - 2, height);
|
|
||||||
r.offset(offset * columnWidth, headerHeight + columnHeight - height);
|
|
||||||
|
|
||||||
canvas.drawRect(r, pBar);
|
|
||||||
canvas.drawText(Long.toString(l), r.centerX(), r.top - barHeaderOffset, pBar);
|
|
||||||
|
|
||||||
if (!month.equals(previousMonth))
|
|
||||||
canvas.drawText(month, r.centerX(), r.bottom + lineHeight * 1.2f, pText);
|
|
||||||
|
|
||||||
previousMonth = month;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
/* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.views;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.graphics.RectF;
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
public class RingView extends View
|
|
||||||
{
|
|
||||||
|
|
||||||
private int size;
|
|
||||||
private int color;
|
|
||||||
private float perc;
|
|
||||||
private Paint pRing;
|
|
||||||
private float lineHeight;
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
public RingView(Context context, int size, int color, float perc, String label)
|
|
||||||
{
|
|
||||||
super(context);
|
|
||||||
this.size = size;
|
|
||||||
this.color = color;
|
|
||||||
this.perc = perc;
|
|
||||||
|
|
||||||
pRing = new Paint();
|
|
||||||
pRing.setColor(color);
|
|
||||||
pRing.setAntiAlias(true);
|
|
||||||
pRing.setTextAlign(Paint.Align.CENTER);
|
|
||||||
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
|
|
||||||
{
|
|
||||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
|
||||||
setMeasuredDimension(size, size + (int) (2 * lineHeight));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDraw(Canvas canvas)
|
|
||||||
{
|
|
||||||
super.onDraw(canvas);
|
|
||||||
float thickness = size * 0.15f;
|
|
||||||
|
|
||||||
pRing.setColor(color);
|
|
||||||
RectF r = new RectF(0, 0, size, size);
|
|
||||||
canvas.drawArc(r, -90, 360 * perc, true, pRing);
|
|
||||||
|
|
||||||
pRing.setColor(Color.rgb(230, 230, 230));
|
|
||||||
canvas.drawArc(r, 360 * perc - 90 + 2, 360 * (1 - perc) - 4, true, pRing);
|
|
||||||
|
|
||||||
pRing.setColor(Color.WHITE);
|
|
||||||
r.inset(thickness, thickness);
|
|
||||||
canvas.drawArc(r, -90, 360, true, pRing);
|
|
||||||
|
|
||||||
pRing.setColor(Color.GRAY);
|
|
||||||
pRing.setTextSize(size * 0.2f);
|
|
||||||
lineHeight = pRing.getFontSpacing();
|
|
||||||
canvas.drawText(String.format("%.0f%%", perc * 100), r.centerX(),
|
|
||||||
r.centerY() + lineHeight / 3, pRing);
|
|
||||||
|
|
||||||
pRing.setTextSize(size * 0.15f);
|
|
||||||
canvas.drawText(label, size / 2, size + lineHeight * 1.2f, pRing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2016 Alinson Santos Xavier
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
|
||||||
* Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.isoron.uhabits.views;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.support.v4.view.MotionEventCompat;
|
|
||||||
import android.view.MotionEvent;
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
public abstract class ScrollableDataView extends View
|
|
||||||
{
|
|
||||||
|
|
||||||
protected int dataOffset;
|
|
||||||
protected int nColumns;
|
|
||||||
protected int columnWidth, columnHeight;
|
|
||||||
protected int headerHeight, footerHeight;
|
|
||||||
|
|
||||||
private float prevX, prevY;
|
|
||||||
|
|
||||||
public ScrollableDataView(Context context)
|
|
||||||
{
|
|
||||||
super(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void fetchData();
|
|
||||||
|
|
||||||
protected boolean move(float dx)
|
|
||||||
{
|
|
||||||
int newDataOffset = dataOffset + (int) (dx / columnWidth);
|
|
||||||
newDataOffset = Math.max(0, newDataOffset);
|
|
||||||
|
|
||||||
if (newDataOffset != dataOffset)
|
|
||||||
{
|
|
||||||
dataOffset = newDataOffset;
|
|
||||||
fetchData();
|
|
||||||
invalidate();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onTouchEvent(MotionEvent event)
|
|
||||||
{
|
|
||||||
int action = event.getAction();
|
|
||||||
|
|
||||||
int pointerIndex = MotionEventCompat.getActionIndex(event);
|
|
||||||
final float x = MotionEventCompat.getX(event, pointerIndex);
|
|
||||||
final float y = MotionEventCompat.getY(event, pointerIndex);
|
|
||||||
|
|
||||||
if (action == MotionEvent.ACTION_DOWN)
|
|
||||||
{
|
|
||||||
prevX = x;
|
|
||||||
prevY = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action == MotionEvent.ACTION_MOVE)
|
|
||||||
{
|
|
||||||
float dx = x - prevX;
|
|
||||||
float dy = y - prevY;
|
|
||||||
|
|
||||||
if (Math.abs(dy) > Math.abs(dx)) return false;
|
|
||||||
getParent().requestDisallowInterceptTouchEvent(true);
|
|
||||||
if (move(dx))
|
|
||||||
{
|
|
||||||
prevX = x;
|
|
||||||
prevY = y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
|
|
||||||
{
|
|
||||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
|
||||||
setMeasuredDimension(getMeasuredWidth(), columnHeight + headerHeight + footerHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onSizeChanged(int w, int h, int oldw, int oldh)
|
|
||||||
{
|
|
||||||
super.onSizeChanged(w, h, oldw, oldh);
|
|
||||||
nColumns = w / columnWidth;
|
|
||||||
fetchData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 196 B |
|
Before Width: | Height: | Size: 187 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 181 B |
|
Before Width: | Height: | Size: 167 B |
|
Before Width: | Height: | Size: 338 B |
|
Before Width: | Height: | Size: 393 B |
|
Before Width: | Height: | Size: 432 B |
|
Before Width: | Height: | Size: 492 B |
|
Before Width: | Height: | Size: 563 B |
|
Before Width: | Height: | Size: 244 B |
|
Before Width: | Height: | Size: 822 B |
|
Before Width: | Height: | Size: 715 B |
|
Before Width: | Height: | Size: 822 B |
|
Before Width: | Height: | Size: 552 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 618 B |
|
Before Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 151 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 256 B |
|
Before Width: | Height: | Size: 134 B |
|
Before Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 214 B |
|
Before Width: | Height: | Size: 244 B |
|
Before Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 289 B |
|
Before Width: | Height: | Size: 319 B |
|
Before Width: | Height: | Size: 192 B |
|
Before Width: | Height: | Size: 554 B |
|
Before Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 554 B |
|
Before Width: | Height: | Size: 394 B |
|
Before Width: | Height: | Size: 694 B |
|
Before Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 435 B |
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
|
||||||
<item>
|
|
||||||
<shape android:shape="oval" >
|
|
||||||
<gradient
|
|
||||||
android:endColor="#00000000"
|
|
||||||
android:gradientRadius="50%p"
|
|
||||||
android:startColor="#50000000"
|
|
||||||
android:type="radial" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
<item
|
|
||||||
android:bottom="5dp"
|
|
||||||
android:left="2dp"
|
|
||||||
android:right="4dp"
|
|
||||||
android:top="1dp">
|
|
||||||
<shape android:shape="oval" >
|
|
||||||
<solid android:color="#ffffff" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
</layer-list>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
|
||||||
<item>
|
|
||||||
<shape android:shape="oval" >
|
|
||||||
<gradient
|
|
||||||
android:endColor="#00000000"
|
|
||||||
android:gradientRadius="50%p"
|
|
||||||
android:startColor="#50000000"
|
|
||||||
android:type="radial" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
<item
|
|
||||||
android:bottom="5dp"
|
|
||||||
android:left="2dp"
|
|
||||||
android:right="4dp"
|
|
||||||
android:top="1dp">
|
|
||||||
<shape android:shape="oval" >
|
|
||||||
<solid android:color="#20000000" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
</layer-list>
|
|
||||||
|
Before Width: | Height: | Size: 231 B |
|
Before Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 426 B |