Compare commits
1248 Commits
v2.0.3+for
...
1.1.4+fork
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a9d187727 | ||
|
|
affd69c577 | ||
|
|
deaca28fe8 | ||
|
|
37432ef21c | ||
|
|
79f500098b | ||
|
|
b5acaaf369 | ||
|
|
6aeca9ba26 | ||
|
|
95b28d30f7 | ||
|
|
5b4be77ded | ||
|
|
462457cf09 | ||
|
|
cc9012516a | ||
|
|
d716891453 | ||
|
|
71ffaad660 | ||
|
|
210349523f | ||
|
|
b883ed1e40 | ||
|
|
f4431fb00f | ||
|
|
b877488aa9 | ||
|
|
a4e3774739 | ||
|
|
c8580979e8 | ||
|
|
0aac29545f | ||
|
|
94a3d994fd | ||
|
|
043526f883 | ||
|
|
1a1f9e5cb1 | ||
|
|
3f2dd91749 | ||
|
|
ac1e000645 | ||
|
|
acdd203c26 | ||
|
|
caf07a60ea | ||
|
|
a26c835134 | ||
|
|
363ceed2ad | ||
|
|
46c9bd9807 | ||
|
|
4d23daf461 | ||
|
|
31b50d705f | ||
|
|
66932ccd4c | ||
|
|
d0cddff330 | ||
|
|
94a5807619 | ||
|
|
2c1be165f4 | ||
|
|
ddc4a8c46d | ||
|
|
c255fb5e58 | ||
|
|
d6705ba991 | ||
|
|
c3c9af872b | ||
|
|
7a71aad676 | ||
|
|
e34d4cf04c | ||
|
|
55b32111da | ||
|
|
00b081b20b | ||
|
|
8d08ff397a | ||
|
|
57a1c1b198 | ||
|
|
6be2978857 | ||
|
|
facde9ea15 | ||
|
|
02e9c5f577 | ||
|
|
d04b09f75f | ||
|
|
ec0f6edc41 | ||
|
|
a900c79e2c | ||
|
|
97dbd3499f | ||
|
|
f07e0906dd | ||
|
|
4f3e2f69d6 | ||
|
|
ec01da10f5 | ||
|
|
3015fa9b97 | ||
|
|
0ca2c4acb2 | ||
|
|
1180ac2d9f | ||
|
|
bc8fce60ec | ||
|
|
41f0679102 | ||
|
|
2a0d0d0811 | ||
|
|
6f234fddf7 | ||
|
|
83c850b782 | ||
|
|
2780363dab | ||
|
|
7273040c4d | ||
|
|
f7de52dfe7 | ||
|
|
fffa86d1b3 | ||
|
|
cae456278a | ||
|
|
d2808e9599 | ||
|
|
07f35723b6 | ||
|
|
5739b26eb2 | ||
|
|
9da7d899a6 | ||
|
|
b6a7649b94 | ||
|
|
8e2270d720 | ||
|
|
f92dcac291 | ||
|
|
e5cf8e3511 | ||
|
|
38b0cc3320 | ||
|
|
5fdd476277 | ||
|
|
c05f1d45fb | ||
|
|
01135937cc | ||
|
|
1e4cc8edb1 | ||
|
|
aa7beef17a | ||
|
|
f8e117fff1 | ||
|
|
494fab52fa | ||
|
|
e5ad2db1ad | ||
|
|
3520ebafc9 | ||
|
|
f7c85d7d53 | ||
|
|
fb812d5d88 | ||
|
|
fde44e61bc | ||
|
|
34e072a1b5 | ||
|
|
fe244112d4 | ||
|
|
3fcf8818c0 | ||
|
|
0b9b51294e | ||
|
|
2783806f97 | ||
|
|
0ee99fa709 | ||
|
|
e223bdd2bd | ||
|
|
c28a7d6029 | ||
|
|
b814c7eab9 | ||
|
|
ecfa255d75 | ||
|
|
979977aec6 | ||
|
|
a487a45828 | ||
|
|
0afcf10c74 | ||
|
|
43c82ed99b | ||
|
|
28302f3a4b | ||
|
|
d6ad1cbfbf | ||
|
|
fd08a1f845 | ||
|
|
67b2a82058 | ||
|
|
f7ab8bd27e | ||
|
|
5df8318200 | ||
|
|
0fcaa08ed0 | ||
|
|
2ce3167db0 | ||
|
|
2c8ecbd996 | ||
|
|
90aa8c5762 | ||
|
|
bb0ca63a03 | ||
|
|
e8a8691b03 | ||
|
|
7fe3d97347 | ||
|
|
a2e932934c | ||
|
|
e82e51ca88 | ||
|
|
ef561b6724 | ||
|
|
2bdff65c13 | ||
|
|
286b642101 | ||
|
|
27ed78c293 | ||
|
|
562a5aae7d | ||
|
|
4940eff7f9 | ||
|
|
cfb9854a8e | ||
|
|
594e49cf64 | ||
|
|
ad2895e297 | ||
|
|
dae2632c18 | ||
|
|
97f09d4569 | ||
|
|
ac1dbc0f90 | ||
|
|
cf67175826 | ||
|
|
dc8f81f447 | ||
|
|
b11b4c95d0 | ||
|
|
20dc664242 | ||
|
|
5cabab368f | ||
|
|
e512a0b327 | ||
|
|
4a96392f11 | ||
|
|
74a28cb881 | ||
|
|
cd712f5109 | ||
|
|
11d5a65f04 | ||
|
|
efc1a0b4e3 | ||
|
|
492d9e90b8 | ||
|
|
0928b5808f | ||
|
|
99c2555a88 | ||
|
|
ede4137935 | ||
|
|
b625ed7aec | ||
|
|
e7e3d94add | ||
|
|
03722868b1 | ||
|
|
a2a0c9801b | ||
|
|
9a55f847b9 | ||
|
|
0473062bc2 | ||
|
|
9393e845b7 | ||
|
|
3dc56286cc | ||
|
|
e22ea06d28 | ||
|
|
6fd5b77e51 | ||
|
|
372de91be9 | ||
|
|
ce3f8ce1b5 | ||
|
|
7c01809eb3 | ||
|
|
29cc73e84e | ||
|
|
c3567bcbff | ||
|
|
bd4ade0852 | ||
|
|
62649ffe60 | ||
|
|
b0a405337a | ||
|
|
18b6e33862 | ||
|
|
acb5b01cbd | ||
|
|
754c41389e | ||
|
|
d26ba6df4a | ||
|
|
cc9b97338d | ||
|
|
f714a00fc4 | ||
|
|
7097b5371e | ||
|
|
ad6ebf9e23 | ||
|
|
5436a45c5f | ||
|
|
4ba3baf354 | ||
|
|
9160a5b0e2 | ||
|
|
fdac91363e | ||
|
|
70a9c91f8a | ||
|
|
45ca3d1b48 | ||
|
|
9506d55149 | ||
|
|
16808b404b | ||
|
|
97a4cade1f | ||
|
|
55f3d80f3a | ||
|
|
10d66b732c | ||
|
|
e62c70268a | ||
|
|
cbb10ac480 | ||
|
|
33de46130c | ||
|
|
d1bd3a423c | ||
|
|
2e24e443c5 | ||
|
|
040b613d68 | ||
|
|
6659ca5f60 | ||
|
|
adaa09790a | ||
|
|
699bcc0377 | ||
|
|
b359a2bfa1 | ||
|
|
f821709afc | ||
|
|
a9899e8f9a | ||
|
|
e1b1ae717f | ||
|
|
0fd2894a8b | ||
|
|
05ddd2f8d9 | ||
|
|
6d9639b042 | ||
|
|
f3ee87a815 | ||
|
|
59c5ac0dd1 | ||
|
|
e647b37143 | ||
|
|
d94c3e3d9b | ||
|
|
9b508bd9ca | ||
|
|
fc49c20fff | ||
|
|
7cc791ccd9 | ||
|
|
b527ab6e84 | ||
|
|
a5fb358998 | ||
|
|
daa0497ce8 | ||
|
|
2d3f852fd6 | ||
|
|
cf288c9ba9 | ||
|
|
4847eff116 | ||
|
|
36430c6557 | ||
|
|
3fb8470899 | ||
|
|
e1f7feb875 | ||
|
|
0ec005d595 | ||
|
|
b2bed8e6b5 | ||
|
|
30c6a56f25 | ||
|
|
2ba575ecb8 | ||
|
|
d67cfe1d28 | ||
|
|
cab36e8f79 | ||
|
|
d30eb0bd36 | ||
|
|
31443d59ca | ||
|
|
79ccc4b14a | ||
|
|
6ce1dec467 | ||
|
|
81cac94fac | ||
|
|
4301c82856 | ||
|
|
2856a5e6d4 | ||
|
|
a06414e3a1 | ||
|
|
747edce53c | ||
|
|
c407b5d504 | ||
|
|
997c277beb | ||
|
|
2e392f3bad | ||
|
|
db133ad8d2 | ||
|
|
015479e6e0 | ||
|
|
8b26103049 | ||
|
|
8d095e7901 | ||
|
|
945b57681e | ||
|
|
1dcaa51f2c | ||
|
|
c7b377829e | ||
|
|
63ffd53b09 | ||
|
|
631f5f8691 | ||
|
|
89976d1894 | ||
|
|
ff7305da8b | ||
|
|
6593c43c1c | ||
|
|
cf36c6ca83 | ||
|
|
92fb0272f0 | ||
|
|
aad7b5d703 | ||
|
|
eb5f82af2a | ||
|
|
cf8cfd8093 | ||
|
|
2538c8b689 | ||
|
|
36d78abd1e | ||
|
|
072e78a89a | ||
|
|
58dee464e5 | ||
|
|
21f816860f | ||
|
|
84e5983c4c | ||
|
|
1a6ad6c029 | ||
|
|
f8ecbb8936 | ||
|
|
1c98bba7d2 | ||
|
|
b94e927439 | ||
|
|
eb0fcda3cc | ||
|
|
d7feb78197 | ||
|
|
acf1988827 | ||
|
|
3822263b1c | ||
|
|
1af82fde61 | ||
|
|
6062510844 | ||
|
|
27c34461bf | ||
|
|
abf801742f | ||
|
|
186604931d | ||
|
|
a726bf6101 | ||
|
|
0008b07072 | ||
|
|
527267b315 | ||
|
|
396836760a | ||
|
|
a5a293be78 | ||
|
|
ea8107d33e | ||
|
|
430dd6164c | ||
|
|
7588143ec6 | ||
|
|
1f97fa9447 | ||
|
|
fff7949e51 | ||
|
|
ce6b928964 | ||
|
|
0604326f3f | ||
|
|
338de2699f | ||
|
|
0b0fe98e2d | ||
|
|
84d412645f | ||
|
|
c565f6779d | ||
|
|
1733b1b065 | ||
|
|
49cff20785 | ||
|
|
65232b3b1e | ||
|
|
ac6177f3de | ||
|
|
48e6a6f624 | ||
|
|
73db5907fe | ||
|
|
69114b9f57 | ||
|
|
114283846c | ||
|
|
e0dd2e3a08 | ||
|
|
648c3a0c0d | ||
|
|
dd3bf1d1e0 | ||
|
|
5280ba1930 | ||
|
|
5c8c888024 | ||
|
|
b9a997730a | ||
|
|
446a2f8206 | ||
|
|
ea4c7dc51d | ||
|
|
16c0ff2f0b | ||
|
|
8941c2bc1d | ||
|
|
aa4a1648af | ||
|
|
5e27a43471 | ||
|
|
12a51eb51f | ||
|
|
5fd17778f4 | ||
|
|
a6028e06ea | ||
|
|
8a0f95affe | ||
|
|
1221a5622f | ||
|
|
b776b0bc1b | ||
|
|
09bf0f2c3c | ||
|
|
42dc6b7425 | ||
|
|
1b31284a95 | ||
|
|
672ed86630 | ||
|
|
862a23af5d | ||
|
|
d49733695d | ||
|
|
d79c4ad650 | ||
|
|
6e314f0ea5 | ||
|
|
e5a6dc33b4 | ||
|
|
8c6ac9e22b | ||
|
|
8d827054bf | ||
|
|
55a2ae8748 | ||
|
|
55640dddb9 | ||
|
|
9a2df814c5 | ||
|
|
0fcbf02a2c | ||
|
|
bc9edf1f69 | ||
|
|
50baffefbe | ||
|
|
3622eba057 | ||
|
|
9df738831f | ||
|
|
7939380172 | ||
|
|
b36b1b2a28 | ||
|
|
b63c0010a9 | ||
|
|
901f1763ab | ||
|
|
cf22096e35 | ||
|
|
c96e5cde7b | ||
|
|
5538d5af6c | ||
|
|
662fbbf8b6 | ||
|
|
247dea3af0 | ||
|
|
efff075bbc | ||
|
|
45832355a3 | ||
|
|
51d4fd63db | ||
|
|
ececa7aa2f | ||
|
|
6cf8793efe | ||
|
|
57251d58cb | ||
|
|
cf1f8e8d1a | ||
|
|
c77cb14602 | ||
|
|
de864edb33 | ||
|
|
699925ac9b | ||
|
|
e367b7711f | ||
|
|
b0e4f707aa | ||
|
|
2749ffb6f2 | ||
|
|
47f57bab17 | ||
|
|
f1b0f828ac | ||
|
|
afbf13ef95 | ||
|
|
8e4cff17a5 | ||
|
|
da954ed3fd | ||
|
|
9d48beaebb | ||
|
|
e607118347 | ||
|
|
5f6dafb763 | ||
|
|
052a000d3c | ||
|
|
59315f81ec | ||
|
|
e9cd29c59e | ||
|
|
327426e443 | ||
|
|
5b1188ce97 | ||
|
|
c11863388d | ||
|
|
476b462e86 | ||
|
|
f69b308936 | ||
|
|
bdcafd2564 | ||
|
|
3455aab3ba | ||
|
|
aac4f412bd | ||
|
|
26831c3375 | ||
|
|
d7004824fb | ||
|
|
53d93764b0 | ||
|
|
6a84462b79 | ||
|
|
739d30c887 | ||
|
|
aa3aa8a5f9 | ||
|
|
be48719f52 | ||
|
|
8e60d107fe | ||
|
|
c618feabe9 | ||
|
|
87164dc469 | ||
|
|
4ab1c61262 | ||
|
|
fe519f10a1 | ||
|
|
901c7c3806 | ||
|
|
211e6cdee2 | ||
|
|
394699c072 | ||
|
|
c9766defff | ||
|
|
737aa95bf5 | ||
|
|
38e035d792 | ||
|
|
4aa750c05e | ||
|
|
c3e5f4d254 | ||
|
|
2e5ff452fd | ||
|
|
c397c08e40 | ||
|
|
a4d2101f54 | ||
|
|
f956a17797 | ||
|
|
1c1d1772a3 | ||
|
|
4db87feec4 | ||
|
|
bef3c72513 | ||
|
|
4fa641b482 | ||
|
|
885b5d781a | ||
|
|
2f3bfb3e74 | ||
|
|
2be625fd76 | ||
|
|
134a371263 | ||
|
|
8b0eddb8e1 | ||
|
|
bd2d56b953 | ||
|
|
38e429f738 | ||
|
|
de8b15d447 | ||
|
|
0df1bcce31 | ||
|
|
4e17256cfa | ||
|
|
e12c3e2d68 | ||
|
|
aec2704f15 | ||
|
|
31f9173126 | ||
|
|
90196df65d | ||
|
|
6b9fa71806 | ||
|
|
130085f804 | ||
|
|
f4356e74a4 | ||
|
|
9c8a4b7a8e | ||
|
|
b7ccf1144c | ||
|
|
87d5b92a99 | ||
|
|
29f8260852 | ||
|
|
060745869b | ||
|
|
1aff3eacd8 | ||
|
|
0207ddb774 | ||
|
|
78d0add808 | ||
|
|
2fa042490a | ||
|
|
885f559092 | ||
|
|
77af7ceae3 | ||
|
|
09d4188d54 | ||
|
|
1ad03828e3 | ||
|
|
870ac2b946 | ||
|
|
394a3eebb1 | ||
|
|
95c10a9fea | ||
|
|
cc4483dea1 | ||
|
|
f0e14c5a13 | ||
|
|
b79b69d961 | ||
|
|
5118a1fb1e | ||
|
|
18275183d0 | ||
|
|
616049bff2 | ||
|
|
1a79bc0b61 | ||
|
|
d43cbe642f | ||
|
|
77cee4c46a | ||
|
|
0949ad1ce6 | ||
|
|
1e411c0c23 | ||
|
|
76d306aef7 | ||
|
|
7ff19ef481 | ||
|
|
6650bb946f | ||
|
|
bbbf1683aa | ||
|
|
5cdea99eb0 | ||
|
|
356426b5fc | ||
|
|
7577d60f42 | ||
|
|
8c7364d57d | ||
|
|
c0a2945378 | ||
|
|
1af9a71210 | ||
|
|
dc859fe91c | ||
|
|
d50c37af23 | ||
|
|
00c8a03b80 | ||
|
|
d15d222b72 | ||
|
|
34d134cb57 | ||
|
|
40eb3e2400 | ||
|
|
0af45e5f56 | ||
|
|
82e3250623 | ||
|
|
533a51fc77 | ||
|
|
6fc82cf26b | ||
|
|
6dcfdb9735 | ||
|
|
217d8348d4 | ||
|
|
9bce934944 | ||
|
|
a1ef3e1cae | ||
|
|
978c1cfdc4 | ||
|
|
9fb9ffc269 | ||
|
|
4f357637de | ||
|
|
1acd177e81 | ||
|
|
e4b1bf452f | ||
|
|
ce22cb4678 | ||
|
|
3c45215fca | ||
|
|
b17e63acae | ||
|
|
859ba5ebb9 | ||
|
|
164579cbb5 | ||
|
|
990f8189e4 | ||
|
|
4d0a642fd9 | ||
|
|
84b2994b99 | ||
|
|
efbca327c1 | ||
|
|
aa4b007d25 | ||
|
|
23dccef4b4 | ||
|
|
1ef96ed5e6 | ||
|
|
31e2a32233 | ||
|
|
168ae80743 | ||
|
|
8acf23ddac | ||
|
|
eb40211582 | ||
|
|
bf35161c9f | ||
|
|
456c50f69e | ||
|
|
587212cf46 | ||
|
|
fe800a259d | ||
|
|
c193741013 | ||
|
|
a7b752264f | ||
|
|
9075027f69 | ||
|
|
28faf4277a | ||
|
|
120ab8ca54 | ||
|
|
a3fc1a6a74 | ||
|
|
ec1fe07fea | ||
|
|
e3d054ae3e | ||
|
|
795d4b0801 | ||
|
|
0cf0f07f2d | ||
|
|
2cc5872ec7 | ||
|
|
6a151e00ac | ||
|
|
1e99862d40 | ||
|
|
3a1b12306b | ||
|
|
e31db6d506 | ||
|
|
b22c0a5d3d | ||
|
|
e7d856acf4 | ||
|
|
ee8b087b61 | ||
|
|
4e86314df5 | ||
|
|
cf5fbe3b55 | ||
|
|
952416fefc | ||
|
|
1645ce4486 | ||
|
|
2bde95b4d2 | ||
|
|
2de003c5bb | ||
|
|
a04e16c572 | ||
|
|
eb41d77d54 | ||
|
|
9325590319 | ||
|
|
d32a57a18d | ||
|
|
13b5462f63 | ||
|
|
480d4ad904 | ||
|
|
7fa52247e8 | ||
|
|
5a547015e6 | ||
|
|
513736f765 | ||
|
|
c6164b1bcd | ||
|
|
87342782d7 | ||
|
|
a4b18de72c | ||
|
|
3064b549cd | ||
|
|
6666f82329 | ||
|
|
ad87efa7e2 | ||
|
|
d06cf1bb1e | ||
|
|
096aa23f69 | ||
|
|
2464042329 | ||
|
|
928b04eda6 | ||
|
|
a31e33415e | ||
|
|
87ce6b8bb1 | ||
|
|
bb08d6585c | ||
|
|
94fa1133fd | ||
|
|
83822b8f69 | ||
|
|
9f3bd186ba | ||
|
|
58cb338cb2 | ||
|
|
6f447909eb | ||
|
|
af953e294d | ||
|
|
7504a1b9cb | ||
|
|
60ee781004 | ||
|
|
4b88ce5115 | ||
|
|
3842ecb0d1 | ||
|
|
3713063ce3 | ||
|
|
83b089457e | ||
|
|
ed9813f093 | ||
|
|
e45f3f30f3 | ||
|
|
df44d4cc4f | ||
|
|
b666048603 | ||
|
|
153542e1b4 | ||
|
|
57e0b96f36 | ||
|
|
ff65d150e3 | ||
|
|
88474ba826 | ||
|
|
dd92f1b66f | ||
|
|
7c7f3cc42a | ||
|
|
734a8049a5 | ||
|
|
417faa66f9 | ||
|
|
7223a13d08 | ||
|
|
a55002da0c | ||
|
|
ce89733f2d | ||
|
|
18811ec32a | ||
|
|
8bce03fad3 | ||
|
|
e65e6163ba | ||
|
|
9c3db24d2f | ||
|
|
19abbe199b | ||
|
|
b33003f7b0 | ||
|
|
9a5747efc8 | ||
|
|
980503ed57 | ||
|
|
c2dd858de8 | ||
|
|
d2ef6fb567 | ||
|
|
9c996b3568 | ||
|
|
2387d84bc0 | ||
|
|
3bd69b5447 | ||
|
|
71f6311598 | ||
|
|
e808977717 | ||
|
|
8594e34bb5 | ||
|
|
4591f06d63 | ||
|
|
b9c3143c6f | ||
|
|
adefb0e567 | ||
|
|
5a8fed3c06 | ||
|
|
2c1b8da475 | ||
|
|
707c51e4d6 | ||
|
|
1a075e32de | ||
|
|
73869b6ea2 | ||
|
|
3980329112 | ||
|
|
6107b21d3b | ||
|
|
42a0b881af | ||
|
|
2076818220 | ||
|
|
513bea7959 | ||
|
|
a48dc18df5 | ||
|
|
c55639e966 | ||
|
|
1fc89d7448 | ||
|
|
4fcc07fcd6 | ||
|
|
b50b1c33da | ||
|
|
25460191b0 | ||
|
|
1206ce6efc | ||
|
|
3cdcffe03d | ||
|
|
b09aab4a1d | ||
|
|
d27fe4ebd1 | ||
|
|
ab2cee08fe | ||
|
|
1fa42fd20f | ||
|
|
e343131670 | ||
|
|
f157313d9a | ||
|
|
9bd4433942 | ||
|
|
c9cc8e23c1 | ||
|
|
786dbaf92c | ||
|
|
8dd22e1853 | ||
|
|
34a4dd6d1f | ||
|
|
6e13e592d0 | ||
|
|
485ab4ee22 | ||
|
|
59a8d1d462 | ||
|
|
f4e5baf94d | ||
|
|
a782160dd3 | ||
|
|
871c17cbe2 | ||
|
|
047e72ce9c | ||
|
|
6c1424055f | ||
|
|
369902ffe5 | ||
|
|
6c778d05ea | ||
|
|
747439999d | ||
|
|
4d836f8032 | ||
|
|
f97ab73c5d | ||
|
|
147fb94442 | ||
|
|
975dc94d41 | ||
|
|
a5c1053c58 | ||
|
|
1bfbb4bf38 | ||
|
|
c2950ace90 | ||
|
|
f0846465c2 | ||
|
|
ddc4512116 | ||
|
|
1c9e4fe561 | ||
|
|
35299a7b3f | ||
|
|
2d9938e8b2 | ||
|
|
1e99940c1d | ||
|
|
2827bcffe3 | ||
|
|
3a1b71e95c | ||
|
|
ce4e762cd5 | ||
|
|
54ec1a6cf7 | ||
|
|
bed3e987b7 | ||
|
|
639ddb3f80 | ||
|
|
e645abb771 | ||
|
|
762adce054 | ||
|
|
263bde658e | ||
|
|
3951acf12e | ||
|
|
5cb640a387 | ||
|
|
c65b9ff873 | ||
|
|
13a80fb536 | ||
|
|
23e49c52e5 | ||
|
|
9fcc73984b | ||
|
|
67338b6c85 | ||
|
|
101e7efd74 | ||
|
|
a996a24b7f | ||
|
|
44dcc9fe2b | ||
|
|
58f79e06ef | ||
|
|
f197c8201d | ||
|
|
2fc5669203 | ||
|
|
0065b93060 | ||
|
|
3f9dbd6fe2 | ||
|
|
7ceff3eaa4 | ||
|
|
7cdddf06bc | ||
|
|
77e7b136ff | ||
|
|
c8d160fc35 | ||
|
|
ee0737c9c7 | ||
|
|
0f85be7114 | ||
|
|
34ba4ceb16 | ||
|
|
f2a536d0ea | ||
|
|
815c4d4cc9 | ||
|
|
969b91bba9 | ||
|
|
f24abde76e | ||
|
|
f486b1a9ce | ||
|
|
3dd6638ef3 | ||
|
|
bcfb63b57c | ||
|
|
c7f5f6827a | ||
|
|
8ed88b2b29 | ||
|
|
75db9f4623 | ||
|
|
b69015a25a | ||
|
|
1cdcc8794c | ||
|
|
a0c26b748a | ||
|
|
ce5e733c05 | ||
|
|
de485272c5 | ||
|
|
eab53b805e | ||
|
|
a60046f6ef | ||
|
|
b0d223c47c | ||
|
|
185a8c776b | ||
|
|
f510ee3b4d | ||
|
|
e7a29824e8 | ||
|
|
69b86dd98c | ||
|
|
55807dc7c6 | ||
|
|
9a6ee719c4 | ||
|
|
1b02af382c | ||
|
|
4fe87a9888 | ||
|
|
91995155e9 | ||
|
|
aae0ff5aa7 | ||
|
|
821d9b8a5e | ||
|
|
2070aed38f | ||
|
|
986979eefc | ||
|
|
ed3ce54b24 | ||
|
|
c80ebf2eda | ||
|
|
42fcd6df51 | ||
|
|
1f4031da61 | ||
|
|
d0ebee74ca | ||
|
|
e8ec042d96 | ||
|
|
bd61bf32b6 | ||
|
|
8b12fac766 | ||
|
|
ab7e6b3332 | ||
|
|
548da48615 | ||
|
|
0b6128bcdd | ||
|
|
198a7d5ad3 | ||
|
|
040f244e15 | ||
|
|
98bc6f14a9 | ||
|
|
b92e6d2c48 | ||
|
|
ac3875fe08 | ||
|
|
6fdbafc67b | ||
|
|
5aebdcaa6a | ||
|
|
2969a3e4fd | ||
|
|
e1fcf44aa6 | ||
|
|
ddbfe9de57 | ||
|
|
b2ee1527af | ||
|
|
c94706745f | ||
|
|
8aef61ff09 | ||
|
|
5d6e245ec2 | ||
|
|
8dd4d1a41d | ||
|
|
10f9230139 | ||
|
|
32c94c8948 | ||
|
|
4b947dd1f9 | ||
|
|
93a7d86f78 | ||
|
|
6ed3a57c58 | ||
|
|
ecdba3898f | ||
|
|
d82a9b25cf | ||
|
|
da4849e526 | ||
|
|
da1b47ea0d | ||
|
|
a617693f93 | ||
|
|
f4c573a95e | ||
|
|
d3476c1473 | ||
|
|
d58247d996 | ||
|
|
ee441d5b4a | ||
|
|
97a5c6f5cb | ||
|
|
b6566a2bcc | ||
|
|
af389f7a47 | ||
|
|
45577fc423 | ||
|
|
c00b9b3035 | ||
|
|
f17879783c | ||
|
|
08dfcdf508 | ||
|
|
c97e8fffc4 | ||
|
|
120585954f | ||
|
|
247669644c | ||
|
|
ff15bdeaea | ||
|
|
8b67320e20 | ||
|
|
48828ed1b7 | ||
|
|
1e615db77e | ||
|
|
629416ef2f | ||
|
|
d6b1c88085 | ||
|
|
3b7079be17 | ||
|
|
48d26017b6 | ||
|
|
8bdbe1c4d7 | ||
|
|
4093443bf8 | ||
|
|
c6709aba56 | ||
|
|
a817e03fa0 | ||
|
|
a757607f35 | ||
|
|
ecc9c45f6e | ||
|
|
2e157a9e68 | ||
|
|
8a39154bd3 | ||
|
|
b5e2aa8b7f | ||
|
|
aaea709201 | ||
|
|
c2a0f5e8bc | ||
|
|
2873a66450 | ||
|
|
7331a5a0cd | ||
|
|
c331cc95c2 | ||
|
|
91aa425f43 | ||
|
|
fd5165428e | ||
|
|
6df57aebf4 | ||
|
|
40b2e4c42e | ||
|
|
a762408df8 | ||
|
|
9fb6a0261b | ||
|
|
d90edc8cf1 | ||
|
|
eecc1242be | ||
|
|
6eedb0e156 | ||
|
|
519894a461 | ||
|
|
fe3052a359 | ||
|
|
245b91bebd | ||
|
|
2e47147367 | ||
|
|
8fec3fe56c | ||
|
|
c4d56179f3 | ||
|
|
64d24f6002 | ||
|
|
074efb0813 | ||
|
|
98b96c78d7 | ||
|
|
3a962c7c05 | ||
|
|
99e3658938 | ||
|
|
9cd7ad3601 | ||
|
|
96db2b7a8b | ||
|
|
a881f23253 | ||
|
|
54106c497b | ||
|
|
1554c6d422 | ||
|
|
dccd9dcb97 | ||
|
|
16c0866f7f | ||
|
|
db88de206b | ||
|
|
92f353e1c5 | ||
|
|
71c80dd381 | ||
|
|
d2be917bd4 | ||
|
|
ea3dc32e98 | ||
|
|
be86f1e96f | ||
|
|
d626d45f5c | ||
|
|
f007bdb39c | ||
|
|
a0cbfe9a36 | ||
|
|
21f99081f2 | ||
|
|
45952ef143 | ||
|
|
fedaaa6fc8 | ||
|
|
1eb08e40be | ||
|
|
6a4936853b | ||
|
|
b277eb4990 | ||
|
|
74efc5c332 | ||
|
|
6653dd97a6 | ||
|
|
d031acabf5 | ||
|
|
852f666b78 | ||
|
|
9f729e9ef0 | ||
|
|
027f19e710 | ||
|
|
14786f796b | ||
|
|
411e39a096 | ||
|
|
8a72c5b9ca | ||
|
|
9e88e28a59 | ||
|
|
df73c5ad8d | ||
|
|
98707dde76 | ||
|
|
444a9afabe | ||
|
|
315bcd5b1a | ||
|
|
c719ac22da | ||
|
|
f4596998aa | ||
|
|
5414f5cf41 | ||
|
|
d919827bc8 | ||
|
|
7b40bc157d | ||
|
|
c3ec64d1ff | ||
|
|
3464cb4a05 | ||
|
|
21f40e5b42 | ||
|
|
6d8ecab766 | ||
|
|
fc2e5112c0 | ||
|
|
8f6c57d5c9 | ||
|
|
8455dc7bd2 | ||
|
|
4677cef580 | ||
|
|
9ab6bf3da1 | ||
|
|
bc65fa6654 | ||
|
|
9fe5960449 | ||
|
|
b684dd5a3b | ||
|
|
5fff0cbdb0 | ||
|
|
99dc479d78 | ||
|
|
275eef912c | ||
|
|
b9de7632e6 | ||
|
|
7a000f2a44 | ||
|
|
9d91b8c0fb | ||
|
|
84d213bdd1 | ||
|
|
a2302ad318 | ||
|
|
42eacea4be | ||
|
|
664bfe895e | ||
|
|
9c1812ce08 | ||
|
|
49c83581f9 | ||
|
|
6aa0428879 | ||
|
|
838d0c678b | ||
|
|
35555d1362 | ||
|
|
6c6b5d7be9 | ||
|
|
037b8cc54e | ||
|
|
afb518cf8e | ||
|
|
b36c7375dd | ||
|
|
069356418d | ||
|
|
6b1c725ebd | ||
|
|
a46f8f1c20 | ||
|
|
3b3d98c4be | ||
|
|
3d4742e8f7 | ||
|
|
a6f1c21e1c | ||
|
|
a0b62ab434 | ||
|
|
0b8501e92b | ||
|
|
9a0851cb06 | ||
|
|
e4340f5015 | ||
|
|
0cd5d12d42 | ||
|
|
014398e050 | ||
|
|
4f77370977 | ||
|
|
5937215d3a | ||
|
|
ade1ce8e05 | ||
|
|
a4581dc61b | ||
|
|
50d4130b3f | ||
|
|
1147087531 | ||
|
|
4653a22635 | ||
|
|
e79501857f | ||
|
|
a8c05f6a32 | ||
|
|
c1d98cad00 | ||
|
|
fb54948f86 | ||
|
|
26297fbb5b | ||
|
|
cd342d1034 | ||
|
|
029650ef2d | ||
|
|
ca5f189e70 | ||
|
|
ac24f636df | ||
|
|
1688168bc1 | ||
|
|
46b842afc4 | ||
|
|
3f773a52cc | ||
|
|
48664bb580 | ||
|
|
094cd67728 | ||
|
|
a70bd4f906 | ||
|
|
4adac359e3 | ||
|
|
9adaf12c00 | ||
|
|
8bbfa2e417 | ||
|
|
9d800106cc | ||
|
|
e1ca97f323 | ||
|
|
68bb23e3b4 | ||
|
|
68397bd487 | ||
|
|
3104ddb4b6 | ||
|
|
9bddd6b274 | ||
|
|
677621f2da | ||
|
|
d40138dd99 | ||
|
|
d957e8f2fc | ||
|
|
681c327306 | ||
|
|
80c9afec7b | ||
|
|
eea8041abe | ||
|
|
1309bfe1ee | ||
|
|
70d3ef9984 | ||
|
|
52ac5f16e5 | ||
|
|
ea43070e6d | ||
|
|
14cd23c28b | ||
|
|
793668021e | ||
|
|
f0ea6ef43e | ||
|
|
2b2e4845a1 | ||
|
|
2dccec99cc | ||
|
|
b060894a6c | ||
|
|
92872edb58 | ||
|
|
c5fcf49eda | ||
|
|
d66a4c0920 | ||
|
|
e8a31cf867 | ||
|
|
c1f9a88ef4 | ||
|
|
e6200e186b | ||
|
|
5564502125 | ||
|
|
7947e7689c | ||
|
|
b53ada7ea2 | ||
|
|
584f28534a | ||
|
|
770fde7aac | ||
|
|
3d7f918132 | ||
|
|
29b8cedc7c | ||
|
|
33b65c3bf3 | ||
|
|
34ab1bcd9c | ||
|
|
cfdc88174b | ||
|
|
15123d8924 | ||
|
|
20086d76ce | ||
|
|
1ca4fb5c37 | ||
|
|
009016a835 | ||
|
|
33dfb2a30d | ||
|
|
1604c067fd | ||
|
|
0c7419e2b3 | ||
|
|
7cf30ccb98 | ||
|
|
aa2c8c5624 | ||
|
|
875695c239 | ||
|
|
61049a1302 | ||
|
|
28db90aa82 | ||
|
|
f0e7fc5e3b | ||
|
|
2169afa8e7 | ||
|
|
508ec06d93 | ||
|
|
9fb39d9403 | ||
|
|
4879d74f80 | ||
|
|
ba3f6c4f95 | ||
|
|
481241c4f6 | ||
|
|
5798587dc6 | ||
|
|
066e3e08a2 | ||
|
|
16d6c14633 | ||
|
|
80a4a3551c | ||
|
|
74f3bb8708 | ||
|
|
c3e398b3c2 | ||
|
|
dcfa812c83 | ||
|
|
065e65d708 | ||
|
|
bca0dab381 | ||
|
|
4a45c1055e | ||
|
|
7c789746ce | ||
|
|
f46ce5576c | ||
|
|
730e6fc1fa | ||
|
|
cb36cc042c | ||
|
|
5d586418f9 | ||
|
|
44f1d026d6 | ||
|
|
defaa1095c | ||
|
|
c67f2f8027 | ||
|
|
452128565f | ||
|
|
6322d3c984 | ||
|
|
d68c820e58 | ||
|
|
79f37b4813 | ||
|
|
87460a2fb6 | ||
|
|
6774a642d9 | ||
|
|
f0bd9233b7 | ||
|
|
66efe750a8 | ||
|
|
3658fc423b | ||
|
|
3c3ad7447e | ||
|
|
b570064b99 | ||
|
|
d9f6ef69fe | ||
|
|
bdac1d5bb4 | ||
|
|
1eee1ead5e | ||
|
|
0ec51f5b34 | ||
|
|
6c6fb05a7a | ||
|
|
09a0faacba | ||
|
|
d0d1d15de5 | ||
|
|
e4e9516d5d | ||
|
|
05eceecbea | ||
|
|
71ba1bb0d5 | ||
|
|
2160a26648 | ||
|
|
5433eac9c9 | ||
|
|
0a68f86200 | ||
|
|
c91dae0346 | ||
|
|
e1df7e5077 | ||
|
|
0560b54559 | ||
|
|
c78db7e835 | ||
|
|
c837a2d4b6 | ||
|
|
70b91b7a9a | ||
|
|
27079a7ec5 | ||
|
|
9563df0574 | ||
|
|
638209cc13 | ||
|
|
224c731afa | ||
|
|
0bbf937531 | ||
|
|
3556c92c3e | ||
|
|
87c5b23196 | ||
|
|
c83910c885 | ||
|
|
586622e90d | ||
|
|
e5e2430e03 | ||
|
|
04bfdba50e | ||
|
|
7abf15e9e0 | ||
|
|
6b680831b8 | ||
|
|
6cbf100828 | ||
|
|
3e7bbebe7f | ||
|
|
56d344045a | ||
|
|
7ab634cc08 | ||
|
|
9f0db3ebb5 | ||
|
|
6415eb8590 | ||
|
|
87c77b84a4 | ||
|
|
0b7bb16f22 | ||
|
|
5164b5ba78 | ||
|
|
f3c28bc66a | ||
|
|
239f7eb9e7 | ||
|
|
d6daf7a553 | ||
|
|
dfb3b230e6 | ||
|
|
484a5c878f | ||
|
|
3f27cfb13b | ||
|
|
38e2ba6ccd | ||
|
|
3dad38e614 | ||
|
|
0865c9d1bd | ||
|
|
20a8783d84 | ||
|
|
0b96fb05fc | ||
|
|
8767d62de7 | ||
|
|
74fb04e2d4 | ||
|
|
2537460e16 | ||
|
|
be3dfde3be | ||
|
|
42025035ad | ||
|
|
6a667fdf32 | ||
|
|
bfafac3d4f | ||
|
|
0cafbe9f91 | ||
|
|
2fbf172729 | ||
|
|
bb9755f4af | ||
|
|
2a01377a8a | ||
|
|
61cc6d5d07 | ||
|
|
1d74a37f60 | ||
|
|
ef9645f9e7 | ||
|
|
6a103ca3f3 | ||
|
|
c22772121b | ||
|
|
de7bc69d2a | ||
|
|
2eccd572c9 | ||
|
|
824a62024b | ||
|
|
3a3cfda919 | ||
|
|
e29120cc51 | ||
|
|
197d5c6bc3 | ||
|
|
d143cc75db | ||
|
|
1635a06c54 | ||
|
|
76de0d8c70 | ||
|
|
402a995b8f | ||
|
|
f580ba7779 | ||
|
|
bc3869b920 | ||
|
|
020f4a5a1a | ||
|
|
b054caa967 | ||
|
|
82b7633650 | ||
|
|
33497864f2 | ||
|
|
4c9d1544fa | ||
|
|
bce2367cfc | ||
|
|
390ecc48fb | ||
|
|
9ed99edd6e | ||
|
|
4362490539 | ||
|
|
f5d225fc3e | ||
|
|
063e9287fd | ||
|
|
ba376908cd | ||
|
|
caddf0021c | ||
|
|
90645f4d90 | ||
|
|
1316fcae22 | ||
|
|
27dee7297b | ||
|
|
13ecba40ae | ||
|
|
e15dd0d8b3 | ||
|
|
1ab26bc665 | ||
|
|
e6758d8c01 | ||
|
|
4621787e34 | ||
|
|
10ad35a285 | ||
|
|
d10145a6ba | ||
|
|
c9792ced32 | ||
|
|
a3fb09a33c | ||
|
|
6d875fd890 | ||
|
|
5d87fb7b67 | ||
|
|
4cbb59850b | ||
|
|
a2022b25e5 | ||
|
|
0d168f93ed | ||
|
|
94ac5b9bb7 | ||
|
|
024d358213 | ||
|
|
5562c93855 | ||
|
|
98e897d6a8 | ||
|
|
4aac6aa4f4 | ||
|
|
2bb4616e40 | ||
|
|
56e8476d2e | ||
|
|
97d81eb1b2 | ||
|
|
ffa21b26af | ||
|
|
9917712f66 | ||
|
|
11cdce6c90 | ||
|
|
8e82cf1e99 | ||
|
|
9767b11626 | ||
|
|
0f95694083 | ||
|
|
7dfc7dd9ef | ||
|
|
0407e958f1 | ||
|
|
e6a5fa1c3f | ||
|
|
6f48a7c4a4 | ||
|
|
80c56d71cb | ||
|
|
f77d9dcee2 | ||
|
|
f7195c7787 | ||
|
|
ca92cc6dc1 | ||
|
|
cd31b2ae5a | ||
|
|
00bec7174a | ||
|
|
236acab54f | ||
|
|
ba362f4457 | ||
|
|
8ed93baf8d | ||
|
|
bf953e96fa | ||
|
|
6b89a747e2 | ||
|
|
2fa1d54268 | ||
|
|
02ef34b451 | ||
|
|
1701fc71c4 | ||
|
|
fe200996db | ||
|
|
659333342f | ||
|
|
1ca5b6def2 | ||
|
|
4e8e3ee440 | ||
|
|
86dd724222 | ||
|
|
8242995027 | ||
|
|
49962a4734 | ||
|
|
509b16aee1 | ||
|
|
f3f5e4a887 | ||
|
|
7aabc1fa76 | ||
|
|
dcb5e36041 | ||
|
|
e0c072ab9c | ||
|
|
0231903868 | ||
|
|
f63bbeee79 | ||
|
|
db9e427444 | ||
|
|
4474a584df | ||
|
|
ab00ad68f1 | ||
|
|
d1e77efa1c | ||
|
|
de00353864 | ||
|
|
feec459d47 | ||
|
|
ad68d7e4f2 | ||
|
|
cf27c6bbf3 | ||
|
|
0115656d67 | ||
|
|
002687d2b1 | ||
|
|
a3267f6cd3 | ||
|
|
0ca9c536cd | ||
|
|
382a23c0b6 | ||
|
|
1f51331f67 | ||
|
|
cce6ba0746 | ||
|
|
be3c12dfb3 | ||
|
|
bfd87cf94e | ||
|
|
857bb1e483 | ||
|
|
75a131b675 | ||
|
|
d98b1c5ee1 | ||
|
|
1eeab25b7d | ||
|
|
82cc0c3c09 | ||
|
|
e102faff6c | ||
|
|
34369bd7e9 | ||
|
|
c71b620402 | ||
|
|
21b4bf23a1 | ||
|
|
d034311f2d | ||
|
|
2deed69766 | ||
|
|
bfbd21b826 | ||
|
|
ba8683301d | ||
|
|
0ed178167b | ||
|
|
b34e34de51 | ||
|
|
ba38e21e07 | ||
|
|
90bef7fddb | ||
|
|
c1b382ef34 | ||
|
|
028b88aa24 | ||
|
|
9d0ce33f5e | ||
|
|
dbb23d952c | ||
|
|
7fe7e47d53 | ||
|
|
d0c93dfd4d | ||
|
|
acdccaf80a | ||
|
|
769293ce1a | ||
|
|
8d0fe18b70 | ||
|
|
6926432a6c | ||
|
|
83f12b0840 | ||
|
|
290b7db7e4 | ||
|
|
f352c20ed9 | ||
|
|
2ccbffa165 | ||
|
|
06cd80a352 | ||
|
|
de97493e6a | ||
|
|
3a24ff0d15 | ||
|
|
c463a3fc39 | ||
|
|
fc845685cc | ||
|
|
0ef0aa1a44 | ||
|
|
337689aa45 | ||
|
|
f7e3423f9c | ||
|
|
b465c09cc8 | ||
|
|
ac6c0651d6 | ||
|
|
18af6f5a12 | ||
|
|
d11ee3a702 | ||
|
|
6d9f9ce2d2 | ||
|
|
ec1496a4cc | ||
|
|
41e19185e8 | ||
|
|
e15dd6024f | ||
|
|
e52dffeece | ||
|
|
5b85bb427d | ||
|
|
4d62388617 | ||
|
|
04b8055474 | ||
|
|
3c34b6a7d2 | ||
|
|
de4964c2cd | ||
|
|
fbcaa05c03 | ||
|
|
883f28696e | ||
|
|
df52230837 | ||
|
|
a90f26a37a | ||
|
|
8c1f76d7fa | ||
|
|
f384d44f8f | ||
|
|
4ab6ed55f5 | ||
|
|
cf99bf5152 | ||
|
|
10779717cf | ||
|
|
4e5c2a9ecf | ||
|
|
db4c1bfe47 | ||
|
|
27afba1cf2 | ||
|
|
4895425b40 | ||
|
|
004c414fba | ||
|
|
c8e38b134c | ||
|
|
de5a911286 | ||
|
|
606cd7442e | ||
|
|
3ebc972268 | ||
|
|
4e39bb381c | ||
|
|
b6178681b0 | ||
|
|
29abf70cec | ||
|
|
8d63be513d | ||
|
|
e63b9d0dd6 | ||
|
|
b1fda17ac7 | ||
|
|
bad44b145c | ||
|
|
77669cedf6 | ||
|
|
19238c389f | ||
|
|
1747ff98b5 | ||
|
|
8fa5824e3e | ||
|
|
6a674d7a7e | ||
|
|
dad3b8cd6b | ||
|
|
9179d2198d | ||
|
|
d096bef234 | ||
|
|
f2c47a1b84 | ||
|
|
bc2ac4e915 | ||
|
|
ff215412c8 |
3
.github/FUNDING.yml
vendored
@@ -1,9 +1,8 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
github: LucasGGamerM
|
||||||
patreon: # mastodon
|
patreon: # mastodon
|
||||||
open_collective: # Replace with a single Open Collective username e.g., user1
|
open_collective: # Replace with a single Open Collective username e.g., user1
|
||||||
ko_fi: xsk22
|
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
liberapay: # Replace with a single Liberapay username e.g., user1
|
liberapay: # Replace with a single Liberapay username e.g., user1
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -22,8 +22,6 @@ Steps to reproduce the behavior:
|
|||||||
**Does this happen in the official app?**
|
**Does this happen in the official app?**
|
||||||
|
|
||||||
Does this issue also occur with the respective upstream release?
|
Does this issue also occur with the respective upstream release?
|
||||||
(Please test using the respective `upstream-xxxxxx.apk` provided in [Releases](https://github.com/sk22/megalodon/releases) or at least using the current Mastodon version from the Play Store)
|
|
||||||
|
|
||||||
> No / Yes
|
> No / Yes
|
||||||
|
|
||||||
> In case it does, please consider filing an [upstream bug report](https://github.com/mastodon/mastodon-android/issues) instead.
|
> In case it does, please consider filing an [upstream bug report](https://github.com/mastodon/mastodon-android/issues) instead.
|
||||||
@@ -35,7 +33,7 @@ If applicable, add screenshots (and screen recordings, if possible) to help expl
|
|||||||
|
|
||||||
**Version**
|
**Version**
|
||||||
|
|
||||||
Megalodon version: [e.g. v1.1.4+fork.#]
|
Moshidon version: [e.g. v1.1.4+fork.#]
|
||||||
|
|
||||||
**Crash log**
|
**Crash log**
|
||||||
|
|
||||||
|
|||||||
165
README.md
@@ -1,25 +1,40 @@
|
|||||||

|

|
||||||
|
|
||||||
# Megalodon
|
# Moshidon, the material you mastodon client!
|
||||||
|
|
||||||
[](https://translate.codeberg.org/engage/megalodon/)
|
> A fork of [megalodon](https://github.com/sk22/megalodon) which is a fork of [official Mastodon Android app](https://github.com/mastodon/mastodon-android) adding important features that are missing in the official app and possibly won’t ever be implemented, such as the federated timeline, unlisted posting, bookmarks and an image description viewer.
|
||||||
|
|
||||||
[](https://github.com/sk22/megalodon/releases/latest/download/megalodon.apk)
|
|
||||||
|
|
||||||
<a href="https://play.google.com/store/apps/details?id=org.joinmastodon.android.sk"><img height="50" alt="Get it on Google Play" src="img/google-play-badge.png"></a>
|
|
||||||
|
|
||||||
<a href="#installation"><img height="50" alt="Get it on IzzyOnDroid" src="img/izzy-badge.png"></a>
|
|
||||||
|
|
||||||
> A fork of the [official Mastodon Android app](https://github.com/mastodon/mastodon-android) adding important features that are missing in the official app and possibly won’t ever be implemented, such as the federated timeline, unlisted posting and an image description viewer.
|
[](https://github.com/LucasGGamerM/moshidon/releases/latest/download/moshidon.apk)
|
||||||
|
|
||||||
|
[<img src="https://gitlab.com/IzzyOnDroid/repo/-/raw/master/assets/IzzyOnDroid.png"
|
||||||
|
alt="Get it on IzzyOnDroid"
|
||||||
|
height="80">](https://apt.izzysoft.de/fdroid/index/apk/org.joinmastodon.android.moshinda)
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
## Key features
|
## Key features
|
||||||
|
|
||||||
|
### **Material you theme support on Android 12+ devices!**
|
||||||
|
|
||||||
|
### **Show posts filtered with a warning!**
|
||||||
|
|
||||||
|
**Allows you to have filtered posts collapsed with a warning! As shown in the screenshots:**
|
||||||
|
|
||||||
|
Before | After
|
||||||
|
:-------------------------:|:-------------------------:
|
||||||
|
 | 
|
||||||
|
|
||||||
|
|
||||||
|
### **Color themes**
|
||||||
|
|
||||||
|
**Allows you to change theme within the app. Supports Purple, pink, green, blue, orange and yellow!**
|
||||||
|
|
||||||
### **Unlisted posting**
|
### **Unlisted posting**
|
||||||
|
|
||||||
**Allows you to post publicly without having your post show up in trends, hashtags or public timelines (i.e., in the tabs “Community”, “Federated” and “Posts”).**
|
**Allows you to post publicly without having your post show up in trends, hashtags or public timelines (i.e., in the tabs “Local”, “Community” and “Posts”).**
|
||||||
|
|
||||||
When posting with Unlisted visibility, your posts will still be publicly accessible in your profile. They will also be shown in people’s Home timelines, but only if they follow you or someone they follow reblogged/replied to your post.
|
When posting with Unlisted visibility, your posts will still be publicly accessible in your profile. They will also be shown in people’s Home timelines, but only if they follow you or someone they follow reposted/replied to your post.
|
||||||
|
|
||||||
The Mastodon documentation has some more information about [Unlisted posting](https://docs.joinmastodon.org/user/posting/#unlisted) and [Public timelines](https://docs.joinmastodon.org/user/network/#timelines).
|
The Mastodon documentation has some more information about [Unlisted posting](https://docs.joinmastodon.org/user/posting/#unlisted) and [Public timelines](https://docs.joinmastodon.org/user/network/#timelines).
|
||||||
|
|
||||||
@@ -31,12 +46,6 @@ Despite being one of the main features of federated social media, the Federated
|
|||||||
|
|
||||||
That’s one of the reasons why choosing a small, **well-moderated instance is important**. Instance admins and moderators should always make sure to ban abusive users and stop federating with instances who platform them. On well-moderated instances, the Federated timeline can be a welcoming place to meet new people!
|
That’s one of the reasons why choosing a small, **well-moderated instance is important**. Instance admins and moderators should always make sure to ban abusive users and stop federating with instances who platform them. On well-moderated instances, the Federated timeline can be a welcoming place to meet new people!
|
||||||
|
|
||||||
### **Draft and schedule posts**
|
|
||||||
|
|
||||||
**Allows for preparing a post and scheduling it to send it automatically at a specific time.**
|
|
||||||
|
|
||||||
You can create drafts, edit them, send them manually later or set a scheduled date. Drafts are technically saved as scheduled posts, so you can view and edit them from other apps that support scheduled posts. Scheduled posts are handled by your home instance, so they'll work even if you uninstall Megalodon.
|
|
||||||
|
|
||||||
### **Image description viewer**
|
### **Image description viewer**
|
||||||
|
|
||||||
**Allows you to quickly check whether an image or video has an alternative text attached to it.**
|
**Allows you to quickly check whether an image or video has an alternative text attached to it.**
|
||||||
@@ -49,71 +58,29 @@ This is important to **ensure the content you’re sharing is as accessible as p
|
|||||||
|
|
||||||
On the Fediverse, it’s quite common for people to pin posts they want others to read before following them. You can pin/unpin posts yourself by clicking the `⋯` button in the top right corner of your posts.
|
On the Fediverse, it’s quite common for people to pin posts they want others to read before following them. You can pin/unpin posts yourself by clicking the `⋯` button in the top right corner of your posts.
|
||||||
|
|
||||||
|
### **Bookmarks**
|
||||||
|
|
||||||
|
**They allow for quickly saving posts and viewing them through the Bookmarks button on the top right of your profile.**
|
||||||
|
|
||||||
|
To bookmark a post, press the button between the Favorite and Share buttons on the bottom of the post. Bookmarks are saved privately, so the post authors won’t know you saved their post – the list of bookmarked posts is only visible to you.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### IzzyOnDroid
|
**Press the download button above to download the APK. Open the downloaded file on your Android device to install it. Moshidon will automatically notify you about new updates inside the app.**
|
||||||
|
|
||||||
[apt.izzysoft.de/fdroid/index/apk/org.joinmastodon.android.sk](https://apt.izzysoft.de/fdroid/index/apk/org.joinmastodon.android.sk)
|
To install this app on your Android device, download the [latest release from GitHub](https://github.com/LucasGGamerM/moshidon/releases/latest/download/moshidon.apk) and open it. You might have to accept installing APK files from your browser when trying to install it. You can also take a look at all releases on the [Releases](https://github.com/LucasGGamerM/moshidon/releases) page.
|
||||||
|
|
||||||
<a href="#installation"><img height="50" alt="Get it on IzzyOnDroid" src="img/izzy-badge.png"></a>
|
Moshidon makes use of [Mastodon for Android](https://github.com/mastodon/mastodon-android)’s automatic update checker. Megalodon will check for new updates available on GitHub and offer to download and install them. You can also manually press “Check for updates” at the bottom of the settings page!
|
||||||
|
|
||||||
Note that you'll need to add Izzy's F-Droid repository to your F-Droid app first:
|
|
||||||
|
|
||||||
[`https://apt.izzysoft.de/fdroid/repo`](https://apt.izzysoft.de/fdroid/repo)
|
|
||||||
|
|
||||||
### Google Play Store
|
|
||||||
|
|
||||||
[play.google.com/store/apps/details?id=org.joinmastodon.android.sk](https://play.google.com/store/apps/details?id=org.joinmastodon.android.sk)
|
|
||||||
|
|
||||||
<a href="https://play.google.com/store/apps/details?id=org.joinmastodon.android.sk"><img height="50" alt="Get it on Google Play" src="img/google-play-badge.png"></a>
|
|
||||||
|
|
||||||
### F-Droid
|
|
||||||
|
|
||||||
**[F-Droid.org?](https://f-droid.org)** Not yet, sorry!
|
|
||||||
|
|
||||||
If you want, you can help me figure out if something's missing in the [Issue #47: F-Droid.org](https://github.com/sk22/megalodon/issues/47)
|
|
||||||
|
|
||||||
### Direct
|
|
||||||
|
|
||||||
Press the download button to download the APK. Open the downloaded file on your Android device to install it. Megalodon will automatically notify you about new updates inside the app.
|
|
||||||
|
|
||||||
[](https://github.com/sk22/megalodon/releases/latest/download/megalodon.apk)
|
|
||||||
|
|
||||||
You might have to accept installing APK files from your browser when trying to install it. You can also take a look at all releases on the [Releases](https://github.com/sk22/megalodon/releases) page.
|
|
||||||
|
|
||||||
Megalodon makes use of [Mastodon for Android](https://github.com/mastodon/mastodon-android)’s automatic update checker. Megalodon will check for new updates available on GitHub and offer to download and install them. You can also manually press “Check for updates” at the bottom of the settings page!
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
Moshidon is also available in [IzzyOnDroid repo](https://apt.izzysoft.de/fdroid/index/apk/org.joinmastodon.android.moshinda), compatible with all F-Droid clients. The APK provided here is the same as the one included in the Releases.
|
||||||
|
|
||||||
## Release variants
|
## Release variants
|
||||||
|
|
||||||
All downloads can be found on the [Releases](https://github.com/sk22/megalodon/releases) page.
|
All downloads can be found on the [Releases](https://github.com/LucasGGamerM/moshidon/releases) page.
|
||||||
|
|
||||||
**`megalodon.apk`**
|
**`moshidon.apk`**
|
||||||
|
|
||||||
Variant with an integrated updater. If you download Megalodon from here (and not from an app store), just download the regular `megalodon.apk`.
|
|
||||||
|
|
||||||
**`upstream-1234abc.apk`**
|
|
||||||
|
|
||||||
This is an **unmodified version** of the official [Mastodon for Android](https://github.com/mastodon/mastodon-android) app the respective Megalodon release is based on. Should you find any bugs in Megalodon (which you will), try to see if it occurs with this variant, too. The last 7 digits of the file name are important to know which version of the official app you're using.
|
|
||||||
|
|
||||||
<!-- **`megalodon-fdroid.apk`**
|
|
||||||
|
|
||||||
Variant without the integrated updater. This is the variant to be published to F-Droid.org where an integrated updater is not necessary. -->
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Contribution
|
|
||||||
|
|
||||||
### Translation
|
|
||||||
|
|
||||||
As with the source code, the translation is sourced from the official project, which you can contribute to on the official “**Mastodon for Android**” Crowdin project: https://crowdin.com/project/mastodon-for-android
|
|
||||||
|
|
||||||
There's also a handful of custom strings exclusive to this projects that would need to be translated. You can help translate **Megalodon** on Weblate: https://translate.codeberg.org/projects/megalodon/
|
|
||||||
|
|
||||||
[](https://translate.codeberg.org/engage/megalodon/)
|
|
||||||
|
|
||||||
|
Variant with an integrated updater. If you download Moshidon from here (and not from an app store), just download the regular `moshidon.apk`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -122,16 +89,23 @@ There's also a handful of custom strings exclusive to this projects that would n
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
* [Adding the ability to have filtered posts show with a warning](https://github.com/LucasGGamerM/moshidon/tree/feature/filters_again)
|
||||||
* [Add “Unlisted” as a post visibility option](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/enable-unlisted)
|
* [Add “Unlisted” as a post visibility option](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/enable-unlisted)
|
||||||
([Pull request](https://github.com/mastodon/mastodon-android/pull/103))
|
([Pull request](https://github.com/mastodon/mastodon-android/pull/103))
|
||||||
* [Add “Federation” tab and change Discover tab order](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/add-federated-timeline) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/8))
|
* Adding a useful private profile note box!*
|
||||||
|
* Auto hiding the compose button on scroll!*
|
||||||
|
* Adding the hability to remind yourself to add alt text to images!*
|
||||||
|
* An indicator for if an image has alt text or not*
|
||||||
|
* Adding the ability to have drafts!*
|
||||||
|
* Also adding the ability to view announcements from your instance!*
|
||||||
|
* Adding the ability to post for local timeline only (Only on instances that support it!)*
|
||||||
* [Add image description button and viewer](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/display-alt-text) ([Pull request](https://github.com/mastodon/mastodon-android/pull/129))
|
* [Add image description button and viewer](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/display-alt-text) ([Pull request](https://github.com/mastodon/mastodon-android/pull/129))
|
||||||
* [Implement pinning posts and displaying pinned posts](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/pin-posts) ([Pull request](https://github.com/mastodon/mastodon-android/pull/140))
|
* [Implement pinning posts and displaying pinned posts](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/pin-posts) ([Pull request](https://github.com/mastodon/mastodon-android/pull/140))
|
||||||
* [Implement deleting and re-drafting](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/delete-redraft) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/21))
|
* [Implement deleting and re-drafting](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/delete-redraft) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/21))
|
||||||
* [Implement a bookmark button and list](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/bookmarks) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/22))
|
* [Implement a bookmark button and list](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/bookmarks) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/22))
|
||||||
* [Add “Check for update” button in addition to integrated update checker](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/check-for-update-button)
|
* [Add “Check for update” button in addition to integrated update checker](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/check-for-update-button)
|
||||||
* [Add “Mark media as sensitive” option](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/mark-media-as-sensitive)
|
* [Add “Mark media as sensitive” option](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/mark-media-as-sensitive)
|
||||||
* [Add settings to hide replies and reblogs from the timeline](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/filter-home-timeline) ([Pull request](https://github.com/mastodon/mastodon-android/pull/317))
|
* [Add settings to hide replies and reposts from the timeline](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/filter-home-timeline) ([Pull request](https://github.com/mastodon/mastodon-android/pull/317))
|
||||||
* [Follow and unfollow hashtags](https://github.com/sk22/megalodon/commit/7d38f031f197aa6cefaf53e39d929538689c1e4e) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/233))
|
* [Follow and unfollow hashtags](https://github.com/sk22/megalodon/commit/7d38f031f197aa6cefaf53e39d929538689c1e4e) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/233))
|
||||||
* [Notification bell for posts](https://github.com/sk22/megalodon/commit/b166ca705eb9169025ef32bbe6315b42491b57ea) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/81))
|
* [Notification bell for posts](https://github.com/sk22/megalodon/commit/b166ca705eb9169025ef32bbe6315b42491b57ea) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/81))
|
||||||
* [Viewing lists and adding/removing users from lists](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:list-timeline-views) based on [@obstsalatschuessel](https://github.com/obstsalatschuessel)'s [Pull request](https://github.com/mastodon/mastodon-android/pull/286)
|
* [Viewing lists and adding/removing users from lists](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:list-timeline-views) based on [@obstsalatschuessel](https://github.com/obstsalatschuessel)'s [Pull request](https://github.com/mastodon/mastodon-android/pull/286)
|
||||||
@@ -141,23 +115,12 @@ There's also a handful of custom strings exclusive to this projects that would n
|
|||||||
* [Add notifications tab for posts](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/posts-notifications-tab)
|
* [Add notifications tab for posts](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/posts-notifications-tab)
|
||||||
* [Show visibility of original post when replying](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/display-reply-visibility)
|
* [Show visibility of original post when replying](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/display-reply-visibility)
|
||||||
* [Clickable reply/boost line above posts](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:clickable-boost-reply-line)
|
* [Clickable reply/boost line above posts](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:clickable-boost-reply-line)
|
||||||
* [Add push notification setting for post notifications](https://github.com/sk22/megalodon/commit/b190480d7739be47f23543d9e7644660f9b4b4ee)
|
* [Clickable reply line while replying to open original post](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/clickable-reply-line-compose)
|
||||||
* [Add option to allow voting for multiple options on polls](https://github.com/sk22/megalodon/commit/5b28468efd49387b4f8b83f142f3adf3104ca60c)
|
|
||||||
* [Add translate function](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/translate-button)
|
|
||||||
* [Add language selector](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/language-selector)
|
|
||||||
* [Implement deleting notifications](https://github.com/sk22/megalodon/commit/b0f9ce081f69f29ad59658fc00ca41372cd2677d) (disabled by default)
|
|
||||||
* [Long-click boost button to "quote" a post](https://github.com/sk22/megalodon/commit/b25a237c20c6a924ed4d9b357999867c3a32b32b)
|
|
||||||
* [Draft and schedule posts](https://github.com/sk22/megalodon/pull/217)
|
|
||||||
* [Display original post when replying](https://github.com/sk22/megalodon/commit/375f8ceb2747705fedf43686681cc0e0b812f899)
|
|
||||||
* [Display server announcements](https://github.com/sk22/megalodon/commit/84179bc207d6b69cc2a770a3c28fa0a39b0b54e8)
|
|
||||||
* [Create](https://github.com/sk22/megalodon/commit/294595513a45037359b31377aafc25ae5b58d8e7), [edit](https://github.com/sk22/megalodon/commit/d47797bf7ac8cff3f9ba1cfee219a1bb2af21da6) and [delete](https://github.com/sk22/megalodon/commit/54c29fd787fc2cd0dfd2787ad796b8190f795973) lists
|
|
||||||
* [Soft-blocking (by blocking and immediately unblocking)](https://github.com/sk22/megalodon/commit/e75d350b7a2709259e9fc5138e0e1f361bdb0972)
|
|
||||||
* [Pinnable custom timelines](https://github.com/sk22/megalodon/pull/338/commits)
|
|
||||||
* Support for local-only posts
|
|
||||||
|
|
||||||
|
|
||||||
### Behavior
|
### Behavior
|
||||||
|
|
||||||
|
* Adding a bottom option for the publish button, allowing for easier use on larger screens!
|
||||||
* [Make back button return to the home tab before exiting the app](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/back-returns-home) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/118))
|
* [Make back button return to the home tab before exiting the app](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/back-returns-home) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/118))
|
||||||
* [Always preserve content warnings when replying](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/always-preserve-cw) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/113))
|
* [Always preserve content warnings when replying](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/always-preserve-cw) ([Closes issue](https://github.com/mastodon/mastodon-android/issues/113))
|
||||||
* [Display full image when adding image description](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/compose-image-description-full-image) ([Pull request](https://github.com/mastodon/mastodon-android/pull/182))
|
* [Display full image when adding image description](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/compose-image-description-full-image) ([Pull request](https://github.com/mastodon/mastodon-android/pull/182))
|
||||||
@@ -165,20 +128,6 @@ There's also a handful of custom strings exclusive to this projects that would n
|
|||||||
* [Option to hide interaction numbers](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:settings/hide-interaction-numbers)
|
* [Option to hide interaction numbers](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:settings/hide-interaction-numbers)
|
||||||
* [Option to always reveal content warnings](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/cw-above-text)
|
* [Option to always reveal content warnings](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/cw-above-text)
|
||||||
* [Option to disable scrolling title bars](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:settings/disable-marquee)
|
* [Option to disable scrolling title bars](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:settings/disable-marquee)
|
||||||
* [No ellipsis for long poll answers](https://github.com/mastodon/mastodon-android/commit/c9aae828e2518adccdc092e41f8d1f0489636271)
|
|
||||||
* [Show poll vote button for multiple and single answer polls](https://github.com/mastodon/mastodon-android/commit/e14dfda2fdf32f0fa3043504ac5831683a87559a)
|
|
||||||
* [Show own vote after voting](https://github.com/mastodon/mastodon-android/commit/4ab9e25fec4fd9c10b7a8ddd1be522b3cc12cf28) ([Closes issue](https://github.com/mastodon/mastodon-android/commit/4ab9e25fec4fd9c10b7a8ddd1be522b3cc12cf28))
|
|
||||||
* [Make inline emoji search case-insensitive and don't only search from start of emoji names](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:better-inline-emoji-search) ([Pull request](https://github.com/mastodon/mastodon-android/pull/445))
|
|
||||||
* [Include subject line when sharing e.g. a website to Megalodon](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:external-share-include-subject)
|
|
||||||
* [Improve semantics for voting on polls (radio buttons and checkboxes)](https://github.com/sk22/megalodon/commit/6fd58c96827cb1d2da329cebdc170a1425dd18d7)
|
|
||||||
* [Copy post URL when long-pressing share button](https://github.com/sk22/megalodon/commit/ba36347f03278763ecec617b1ce57ba89db7be72)
|
|
||||||
* [Add option to disable swiping between tabs](https://github.com/sk22/megalodon/commit/1f20b21fc84bf006c1ec14bd2229cbfad5215ec8)
|
|
||||||
* [Resolve Fediverse links in the app](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/open-urls-in-app)
|
|
||||||
* [Preserve whitespaces in HTML](https://github.com/sk22/megalodon/commit/7d876bddc7a07d98f0fecbf62b13bdb9fcce3412)
|
|
||||||
* [Long-click to copy links](https://github.com/sk22/megalodon/commit/b32e32274923a94742a9926ef38785f746d41405)
|
|
||||||
* Improved filtering using Mastodon 4.0 API: [#202](https://github.com/sk22/megalodon/pull/202), [#212](https://github.com/sk22/megalodon/pull/212), [#255](https://github.com/sk22/megalodon/pull/255) by [@thiagojedi](https://github.com/thiagojedi)
|
|
||||||
* [Support admin notifications](https://github.com/sk22/megalodon/commit/c12a6eaee6b609bc53eb0a45d9199f37d5241801) and [notifications for edited reblogged posts](https://github.com/sk22/megalodon/commit/900e8fb2e9353002c16d15e06b78d2731e121601)
|
|
||||||
* [Android file opener added back in addition to image picker](https://github.com/sk22/megalodon/commit/3a6ace53d5ab01e28077c9c930cb6ed487b78031)
|
|
||||||
|
|
||||||
|
|
||||||
### Visual
|
### Visual
|
||||||
@@ -186,16 +135,6 @@ There's also a handful of custom strings exclusive to this projects that would n
|
|||||||
* [Custom extended footer redesign](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:compact-extended-footer)
|
* [Custom extended footer redesign](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:compact-extended-footer)
|
||||||
* [Improvements to the true black mode](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:true-black-improvements)
|
* [Improvements to the true black mode](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:true-black-improvements)
|
||||||
* [Profile header tweaks](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:ui/profile-header-tweaks)
|
* [Profile header tweaks](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:ui/profile-header-tweaks)
|
||||||
* [Custom color themes](https://github.com/sk22/megalodon/pull/124) by [@LucasGGamerM](https://github.com/LucasGGamerM)
|
|
||||||
* [Custom "megalodon" text logo](https://github.com/sk22/megalodon/commit/563afd487ca5c608cfbb00fa3909d3c27384acc0) by [@LucasGGamerM](https://github.com/LucasGGamerM)
|
|
||||||
* [Custom login screen](https://github.com/sk22/megalodon/commit/9bbf8c4618dbe13accaeb3b5482bf3fe88cac4c0)
|
|
||||||
* [More distinct filled boost icon](https://github.com/sk22/megalodon/commits/more-distinct-filled-boost-icon)
|
|
||||||
* Material You color theme by [@LucasGGamerM](https://github.com/LucasGGamerM)
|
|
||||||
* [Animations for interaction buttons](https://github.com/mastodon/mastodon-android/compare/master...sk22:megalodon:feature/animate-buttons)
|
|
||||||
* [Dedicated icons for different notification types](https://github.com/sk22/megalodon/pull/178) by [@florian-obernberger](https://github.com/florian-obernberger)
|
|
||||||
* Scale text according to system settings
|
|
||||||
* Header in timeline for followed hashtags
|
|
||||||
* [Indicator for missing alt texts](https://github.com/sk22/megalodon/commit/c0c276f03e793b78c478c17dfdef24a66ef7cedb)
|
|
||||||
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
@@ -212,4 +151,6 @@ This project is released under the [GPL-3 License](./LICENSE).
|
|||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
<a rel="me" href="https://floss.social/@megalodon">@megalodon<wbr>@floss.social</a>
|
[Official matrix chatroom:](https://matrix.to/#/#moshidon:matrix.org) https://matrix.to/#/#moshidon:matrix.org
|
||||||
|
|
||||||
|
<a rel="me" href="https://floss.social/@moshidon">@moshidon<wbr>@floss.social</a>
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
title: Megalodon
|
title: Moshidon
|
||||||
layout: default
|
layout: default
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Megalodon</title>
|
<title>Moshidon</title>
|
||||||
<link rel="icon" href="mastodon/src/main/res/mipmap-mdpi/ic_launcher_round.png">
|
<link rel="icon" href="mastodon/src/main/res/mipmap-mdpi/ic_launcher_round.png">
|
||||||
<link rel="me" href="https://floss.social/@mastodon">
|
<link rel="me" href="https://floss.social/@mastodon">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.1.0/github-markdown.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.1.0/github-markdown.min.css">
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ plugins {
|
|||||||
android {
|
android {
|
||||||
compileSdk 33
|
compileSdk 33
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
archivesBaseName = "megalodon"
|
archivesBaseName = "moshidon"
|
||||||
applicationId "org.joinmastodon.android.sk"
|
applicationId "org.joinmastodon.android.moshinda"
|
||||||
minSdk 23
|
minSdk 23
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 75
|
versionCode 93
|
||||||
versionName "1.1.5+fork.75"
|
versionName "1.1.4+fork.93.moshinda"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
resConfigs "ar-rSA", "be-rBY", "bn-rBD", "bs-rBA", "ca-rES", "cs-rCZ", "de-rDE", "el-rGR", "es-rES", "eu-rES", "fi-rFI", "fil-rPH", "fr-rFR", "ga-rIE", "gd-rGB", "gl-rES", "hi-rIN", "hr-rHR", "hu-rHU", "hy-rAM", "in-rID", "is-rIS", "it-rIT", "iw-rIL", "ja-rJP", "kab", "ko-rKR", "nl-rNL", "oc-rFR", "pl-rPL", "pt-rBR", "pt-rPT", "ro-rRO", "ru-rRU", "si-rLK", "sl-rSI", "sv-rSE", "th-rTH", "tr-rTR", "uk-rUA", "vi-rVN", "zh-rCN", "zh-rTW"
|
resConfigs "ar-rSA", "be-rBY", "bn-rBD", "bs-rBA", "ca-rES", "cs-rCZ", "de-rDE", "el-rGR", "es-rES", "eu-rES", "fi-rFI", "fil-rPH", "fr-rFR", "ga-rIE", "gd-rGB", "gl-rES", "hi-rIN", "hr-rHR", "hu-rHU", "hy-rAM", "in-rID", "is-rIS", "it-rIT", "iw-rIL", "ja-rJP", "kab", "ko-rKR", "nl-rNL", "oc-rFR", "pl-rPL", "pt-rBR", "pt-rPT", "ro-rRO", "ru-rRU", "si-rLK", "sl-rSI", "sv-rSE", "th-rTH", "tr-rTR", "uk-rUA", "vi-rVN", "zh-rCN", "zh-rTW"
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
mastodon/src/github/ic_launcher-playstore.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -115,7 +115,7 @@ public class GithubSelfUpdaterImpl extends GithubSelfUpdater{
|
|||||||
|
|
||||||
private void actuallyCheckForUpdates(){
|
private void actuallyCheckForUpdates(){
|
||||||
Request req=new Request.Builder()
|
Request req=new Request.Builder()
|
||||||
.url("https://api.github.com/repos/sk22/megalodon/releases")
|
.url("https://api.github.com/repos/LucasGGamerM/moshidon/releases")
|
||||||
.build();
|
.build();
|
||||||
Call call=MastodonAPIController.getHttpClient().newCall(req);
|
Call call=MastodonAPIController.getHttpClient().newCall(req);
|
||||||
try(Response resp=call.execute()){
|
try(Response resp=call.execute()){
|
||||||
@@ -153,7 +153,7 @@ public class GithubSelfUpdaterImpl extends GithubSelfUpdater{
|
|||||||
Log.d(TAG, "actuallyCheckForUpdates: new version: "+version);
|
Log.d(TAG, "actuallyCheckForUpdates: new version: "+version);
|
||||||
for(JsonElement el:obj.getAsJsonArray("assets")){
|
for(JsonElement el:obj.getAsJsonArray("assets")){
|
||||||
JsonObject asset=el.getAsJsonObject();
|
JsonObject asset=el.getAsJsonObject();
|
||||||
if("megalodon.apk".equals(asset.get("name").getAsString()) && "application/vnd.android.package-archive".equals(asset.get("content_type").getAsString()) && "uploaded".equals(asset.get("state").getAsString())){
|
if("moshidon.apk".equals(asset.get("name").getAsString()) && "application/vnd.android.package-archive".equals(asset.get("content_type").getAsString()) && "uploaded".equals(asset.get("state").getAsString())){
|
||||||
long size=asset.get("size").getAsLong();
|
long size=asset.get("size").getAsLong();
|
||||||
String url=asset.get("browser_download_url").getAsString();
|
String url=asset.get("browser_download_url").getAsString();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20">
|
||||||
|
<path android:pathData="M3.897 4.054L3.97 3.97c0.266-0.267 0.683-0.29 0.976-0.073L5.03 3.97 10 8.939l4.97-4.97c0.266-0.266 0.683-0.29 0.976-0.072L16.03 3.97c0.267 0.266 0.29 0.683 0.073 0.976L16.03 5.03 11.061 10l4.97 4.97c0.266 0.266 0.29 0.683 0.072 0.976L16.03 16.03c-0.266 0.267-0.683 0.29-0.976 0.073L14.97 16.03 10 11.061l-4.97 4.97c-0.266 0.266-0.683 0.29-0.976 0.072L3.97 16.03c-0.267-0.266-0.29-0.683-0.073-0.976L3.97 14.97 8.939 10l-4.97-4.97C3.704 4.764 3.68 4.347 3.898 4.054L3.97 3.97 3.897 4.054z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M22 6.5c0 3.038-2.462 5.5-5.5 5.5S11 9.538 11 6.5 13.462 1 16.5 1 22 3.462 22 6.5zm-7.146-2.354c-0.196-0.195-0.512-0.195-0.708 0-0.195 0.196-0.195 0.512 0 0.708L15.793 6.5l-1.647 1.646c-0.195 0.196-0.195 0.512 0 0.707 0.196 0.196 0.512 0.196 0.708 0L16.5 7.208l1.646 1.647c0.196 0.195 0.512 0.195 0.708 0 0.195-0.196 0.195-0.512 0-0.707L17.207 6.5l1.647-1.646c0.195-0.196 0.195-0.512 0-0.708-0.196-0.195-0.512-0.195-0.708 0L16.5 5.793l-1.646-1.647zM19.5 14v-1.732c0.551-0.287 1.056-0.651 1.5-1.078v7.56c0 1.733-1.357 3.15-3.066 3.245L17.75 22H6.25c-1.733 0-3.15-1.357-3.245-3.066L3 18.75V7.25C3 5.517 4.356 4.1 6.066 4.005L6.25 4h4.248c-0.198 0.474-0.34 0.977-0.422 1.5H6.25c-0.918 0-1.671 0.707-1.744 1.606L4.5 7.25V14H9c0.38 0 0.694 0.282 0.743 0.648L9.75 14.75C9.75 15.993 10.757 17 12 17c1.19 0 2.166-0.925 2.245-2.096l0.005-0.154c0-0.38 0.282-0.694 0.648-0.743L15 14h4.5zm-15 1.5v3.25c0 0.918 0.707 1.671 1.606 1.744L6.25 20.5h11.5c0.918 0 1.671-0.707 1.744-1.607L19.5 18.75V15.5h-3.825c-0.335 1.648-1.75 2.904-3.475 2.995L12 18.5c-1.747 0-3.215-1.195-3.632-2.812L8.325 15.5H4.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="28dp" android:height="28dp" android:viewportWidth="28" android:viewportHeight="28">
|
||||||
|
<path android:pathData="M26 7.5c0 3.59-2.91 6.5-6.5 6.5S13 11.09 13 7.5 15.91 1 19.5 1 26 3.91 26 7.5zm-9.146-3.354c-0.196-0.195-0.512-0.195-0.708 0-0.195 0.196-0.195 0.512 0 0.708L18.793 7.5l-2.647 2.646c-0.195 0.196-0.195 0.512 0 0.708 0.196 0.195 0.512 0.195 0.708 0L19.5 8.207l2.646 2.647c0.196 0.195 0.512 0.195 0.708 0 0.195-0.196 0.195-0.512 0-0.708L20.207 7.5l2.647-2.646c0.195-0.196 0.195-0.512 0-0.708-0.196-0.195-0.512-0.195-0.708 0L19.5 6.793l-2.646-2.647zM25 22.75V12.6c-0.443 0.476-0.947 0.896-1.5 1.245V16h-6l-0.102 0.007c-0.366 0.05-0.648 0.363-0.648 0.743 0 1.519-1.231 2.75-2.75 2.75s-2.75-1.231-2.75-2.75l-0.007-0.102C11.193 16.282 10.88 16 10.5 16h-6V7.25c0-0.966 0.784-1.75 1.75-1.75h6.02c0.145-0.525 0.345-1.028 0.595-1.5H6.25C4.455 4 3 5.455 3 7.25v15.5C3 24.545 4.455 26 6.25 26h15.5c1.795 0 3.25-1.455 3.25-3.25zm-20.5 0V17.5h5.316l0.041 0.204C10.291 19.592 11.982 21 14 21l0.215-0.005c1.994-0.1 3.627-1.574 3.969-3.495H23.5v5.25c0 0.966-0.784 1.75-1.75 1.75H6.25c-0.966 0-1.75-0.784-1.75-1.75z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20">
|
||||||
|
<path android:pathData="M10 2c4.418 0 8 3.582 8 8 0 2.706-1.142 4.5-3 4.5-1.226 0-2.14-0.781-2.62-2.09C11.784 13.393 10.781 14 9.5 14 7.36 14 6 12.307 6 10c0-2.337 1.313-4 3.5-4 1.052 0 1.901 0.385 2.5 1.044V6.5C12 6.224 12.224 6 12.5 6c0.245 0 0.45 0.177 0.492 0.41L13 6.5V10c0 2.223 0.813 3.5 2 3.5s2-1.277 2-3.5c0-3.866-3.134-7-7-7s-7 3.134-7 7 3.134 7 7 7c0.823 0 1.626-0.142 2.383-0.416 0.26-0.094 0.547 0.04 0.64 0.3 0.095 0.26-0.04 0.546-0.3 0.64C11.859 17.838 10.94 18 10 18c-4.418 0-8-3.582-8-8s3.582-8 8-8zM9.5 7C7.924 7 7 8.17 7 10c0 1.797 0.966 3 2.5 3s2.5-1.203 2.5-3c0-1.83-0.924-3-2.5-3z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M6.25 4.5C5.283 4.5 4.5 5.284 4.5 6.25v11.5c0 0.966 0.783 1.75 1.75 1.75h11.5c0.966 0 1.75-0.784 1.75-1.75v-4c0-0.414 0.335-0.75 0.75-0.75 0.414 0 0.75 0.336 0.75 0.75v4c0 1.795-1.456 3.25-3.25 3.25H6.25C4.455 21 3 19.545 3 17.75V6.25C3 4.455 4.455 3 6.25 3h4C10.664 3 11 3.336 11 3.75S10.664 4.5 10.25 4.5h-4zM13 3.75C13 3.336 13.335 3 13.75 3h6.5C20.664 3 21 3.336 21 3.75v6.5c0 0.414-0.336 0.75-0.75 0.75s-0.75-0.336-0.75-0.75V5.56l-5.22 5.22c-0.293 0.293-0.768 0.293-1.06 0-0.293-0.293-0.293-0.768 0-1.06l5.22-5.22h-4.69C13.335 4.5 13 4.164 13 3.75z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M8.502 11.5c0.554 0 1.002 0.448 1.002 1.002 0 0.553-0.448 1.002-1.002 1.002-0.553 0-1.002-0.449-1.002-1.002 0-0.554 0.449-1.003 1.002-1.003zM12 4.353v6.651h7.442L17.72 9.28c-0.267-0.266-0.29-0.683-0.073-0.977L17.72 8.22c0.266-0.266 0.683-0.29 0.976-0.072L18.78 8.22l2.997 2.998c0.266 0.266 0.29 0.682 0.073 0.976l-0.073 0.084-2.996 3.003c-0.293 0.294-0.767 0.294-1.06 0.002-0.267-0.266-0.292-0.683-0.075-0.977l0.073-0.084 1.713-1.717h-7.431L12 19.25c0 0.466-0.421 0.82-0.88 0.738l-8.5-1.501C2.26 18.424 2 18.112 2 17.748V5.75c0-0.368 0.266-0.681 0.628-0.74l8.5-1.396C11.585 3.539 12 3.89 12 4.354zm-1.5 0.883l-7 1.15v10.732l7 1.236V5.237zM13 18.5h0.765l0.102-0.007c0.366-0.05 0.649-0.364 0.648-0.744l-0.007-4.25H13v5zm0.002-8.502L13 8.726V5h0.745c0.38 0 0.693 0.281 0.743 0.647l0.007 0.101L14.502 10h-1.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M14.704 3.44C14.895 3.667 15 3.953 15 4.248V19.75c0 0.69-0.56 1.25-1.25 1.25-0.296 0-0.582-0.105-0.808-0.296l-4.967-4.206H4.25c-1.243 0-2.25-1.008-2.25-2.25v-4.5c0-1.243 1.007-2.25 2.25-2.25h3.725l4.968-4.204c0.526-0.446 1.315-0.38 1.761 0.147zM13.5 4.787l-4.975 4.21H4.25c-0.414 0-0.75 0.337-0.75 0.75v4.5c0 0.415 0.336 0.75 0.75 0.75h4.275L13.5 19.21V4.787z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="28dp" android:height="28dp" android:viewportWidth="28" android:viewportHeight="28">
|
||||||
|
<path android:pathData="M16.5 4.814c0-1.094-1.307-1.66-2.105-0.912l-4.937 4.63C9.134 8.836 8.706 9.005 8.261 9.005H5.25C3.455 9.005 2 10.46 2 12.255v3.492c0 1.795 1.455 3.25 3.25 3.25h3.012c0.444 0 0.872 0.17 1.196 0.473l4.937 4.626c0.799 0.748 2.105 0.182 2.105-0.912V4.814zm-6.016 4.812L15 5.39v17.216l-4.516-4.232c-0.602-0.564-1.397-0.878-2.222-0.878H5.25c-0.966 0-1.75-0.784-1.75-1.75v-3.492c0-0.966 0.784-1.75 1.75-1.75h3.011c0.826 0 1.62-0.314 2.223-0.88z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M3.28 2.22c-0.293-0.293-0.767-0.293-1.06 0-0.293 0.293-0.293 0.767 0 1.06L6.438 7.5H4.25C3.007 7.499 2 8.506 2 9.749v4.497c0 1.243 1.007 2.25 2.25 2.25h3.68c0.183 0 0.36 0.068 0.498 0.19l4.491 3.994C13.725 21.396 15 20.824 15 19.746V16.06l5.72 5.72c0.292 0.292 0.767 0.292 1.06 0 0.293-0.293 0.293-0.768 0-1.061L3.28 2.22zM13.5 14.56v4.629l-4.075-3.624c-0.412-0.366-0.944-0.569-1.495-0.569H4.25c-0.414 0-0.75-0.335-0.75-0.75V9.75C3.5 9.335 3.836 9 4.25 9h3.688l5.562 5.56zm0-9.753v5.511l1.5 1.5V4.25c0-1.079-1.274-1.65-2.08-0.934l-3.4 3.022 1.063 1.063L13.5 4.807zm3.641 9.152l1.138 1.138C18.741 14.163 19 13.111 19 12c0-1.203-0.304-2.338-0.84-3.328-0.198-0.364-0.653-0.5-1.017-0.303-0.364 0.197-0.5 0.653-0.303 1.017 0.42 0.777 0.66 1.666 0.66 2.614 0 0.691-0.127 1.351-0.359 1.96zm2.247 2.247l1.093 1.094C21.445 15.763 22 13.946 22 12c0-2.226-0.728-4.284-1.96-5.946-0.246-0.333-0.716-0.403-1.048-0.157-0.333 0.247-0.403 0.716-0.157 1.05C19.881 8.358 20.5 10.106 20.5 12c0 1.531-0.404 2.966-1.112 4.206z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="28dp" android:height="28dp" android:viewportWidth="28" android:viewportHeight="28">
|
||||||
|
<path android:pathData="M3.28 2.22c-0.293-0.293-0.767-0.293-1.06 0-0.293 0.293-0.293 0.767 0 1.06l5.724 5.725H5.25C3.455 9.005 2 10.46 2 12.255v3.492c0 1.795 1.455 3.25 3.25 3.25h3.012c0.444 0 0.872 0.17 1.196 0.473l4.937 4.626c0.799 0.748 2.105 0.182 2.105-0.912v-5.623l8.22 8.22c0.292 0.292 0.767 0.292 1.06 0 0.293-0.293 0.293-0.768 0-1.061L3.28 2.22zM15 16.06v6.547l-4.516-4.231c-0.602-0.565-1.397-0.879-2.222-0.879H5.25c-0.966 0-1.75-0.783-1.75-1.75v-3.492c0-0.966 0.784-1.75 1.75-1.75h3.011c0.35 0 0.693-0.056 1.02-0.164L15 16.061zm-4.378-8.62l1.061 1.061L15 5.392v6.427l1.5 1.5V4.814c0-1.094-1.307-1.66-2.105-0.912L10.622 7.44zm9.55 9.55l1.137 1.137C21.912 16.88 22.25 15.478 22.25 14c0-2.136-0.706-4.11-1.897-5.697-0.249-0.332-0.719-0.399-1.05-0.15-0.332 0.249-0.399 0.719-0.15 1.05C20.156 10.54 20.75 12.199 20.75 14c0 1.058-0.205 2.067-0.578 2.99zm2.803 2.803l1.095 1.096c1.224-2.008 1.93-4.366 1.93-6.89 0-3.35-1.245-6.414-3.298-8.747-0.274-0.31-0.747-0.341-1.058-0.068-0.311 0.274-0.342 0.748-0.068 1.059C23.396 8.313 24.5 11.027 24.5 14c0 2.107-0.554 4.084-1.525 5.793z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<application
|
<application
|
||||||
android:name=".MastodonApp"
|
android:name=".MastodonApp"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:label="@string/sk_app_name"
|
android:label="@string/mo_app_name"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:localeConfig="@xml/locales_config"
|
android:localeConfig="@xml/locales_config"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
<category android:name="android.intent.category.BROWSABLE"/>
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
<data android:scheme="megalodon-android-auth" android:host="callback"/>
|
<data android:scheme="moshidon-android-auth" android:host="callback"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".ExternalShareActivity" android:exported="true" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustResize">
|
<activity android:name=".ExternalShareActivity" android:exported="true" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustResize">
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 358 KiB After Width: | Height: | Size: 15 KiB |
@@ -4,6 +4,7 @@ import static org.joinmastodon.android.api.MastodonAPIController.gson;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
@@ -29,12 +30,14 @@ public class GlobalUserPreferences{
|
|||||||
public static boolean alwaysExpandContentWarnings;
|
public static boolean alwaysExpandContentWarnings;
|
||||||
public static boolean disableMarquee;
|
public static boolean disableMarquee;
|
||||||
public static boolean disableSwipe;
|
public static boolean disableSwipe;
|
||||||
|
public static boolean disableDividers;
|
||||||
public static boolean voteButtonForSingleChoice;
|
public static boolean voteButtonForSingleChoice;
|
||||||
public static boolean enableDeleteNotifications;
|
|
||||||
public static boolean translateButtonOpenedOnly;
|
|
||||||
public static boolean uniformNotificationIcon;
|
public static boolean uniformNotificationIcon;
|
||||||
|
public static boolean enableDeleteNotifications;
|
||||||
|
public static boolean relocatePublishButton;
|
||||||
public static boolean reduceMotion;
|
public static boolean reduceMotion;
|
||||||
public static boolean keepOnlyLatestNotification;
|
public static boolean keepOnlyLatestNotification;
|
||||||
|
public static boolean enableFabAutoHide;
|
||||||
public static boolean disableAltTextReminder;
|
public static boolean disableAltTextReminder;
|
||||||
public static boolean showAltIndicator;
|
public static boolean showAltIndicator;
|
||||||
public static boolean showNoAltIndicator;
|
public static boolean showNoAltIndicator;
|
||||||
@@ -54,6 +57,9 @@ public class GlobalUserPreferences{
|
|||||||
public static Set<String> accountsWithLocalOnlySupport;
|
public static Set<String> accountsWithLocalOnlySupport;
|
||||||
public static Set<String> accountsInGlitchMode;
|
public static Set<String> accountsInGlitchMode;
|
||||||
|
|
||||||
|
private final static Type recentEmojisType = new TypeToken<Map<String, Integer>>() {}.getType();
|
||||||
|
public static Map<String, Integer> recentEmojis;
|
||||||
|
|
||||||
private static SharedPreferences getPrefs(){
|
private static SharedPreferences getPrefs(){
|
||||||
return MastodonApp.context.getSharedPreferences("global", Context.MODE_PRIVATE);
|
return MastodonApp.context.getSharedPreferences("global", Context.MODE_PRIVATE);
|
||||||
}
|
}
|
||||||
@@ -73,16 +79,18 @@ public class GlobalUserPreferences{
|
|||||||
showBoosts=prefs.getBoolean("showBoosts", true);
|
showBoosts=prefs.getBoolean("showBoosts", true);
|
||||||
loadNewPosts=prefs.getBoolean("loadNewPosts", true);
|
loadNewPosts=prefs.getBoolean("loadNewPosts", true);
|
||||||
showNewPostsButton=prefs.getBoolean("showNewPostsButton", true);
|
showNewPostsButton=prefs.getBoolean("showNewPostsButton", true);
|
||||||
|
uniformNotificationIcon=prefs.getBoolean("uniformNotificationIcon", true);
|
||||||
showInteractionCounts=prefs.getBoolean("showInteractionCounts", false);
|
showInteractionCounts=prefs.getBoolean("showInteractionCounts", false);
|
||||||
alwaysExpandContentWarnings=prefs.getBoolean("alwaysExpandContentWarnings", false);
|
alwaysExpandContentWarnings=prefs.getBoolean("alwaysExpandContentWarnings", false);
|
||||||
disableMarquee=prefs.getBoolean("disableMarquee", false);
|
disableMarquee=prefs.getBoolean("disableMarquee", false);
|
||||||
disableSwipe=prefs.getBoolean("disableSwipe", false);
|
disableSwipe=prefs.getBoolean("disableSwipe", false);
|
||||||
|
disableDividers=prefs.getBoolean("disableDividers", true);
|
||||||
|
relocatePublishButton=prefs.getBoolean("relocatePublishButton", true);
|
||||||
voteButtonForSingleChoice=prefs.getBoolean("voteButtonForSingleChoice", true);
|
voteButtonForSingleChoice=prefs.getBoolean("voteButtonForSingleChoice", true);
|
||||||
enableDeleteNotifications=prefs.getBoolean("enableDeleteNotifications", false);
|
enableDeleteNotifications=prefs.getBoolean("enableDeleteNotifications", false);
|
||||||
translateButtonOpenedOnly=prefs.getBoolean("translateButtonOpenedOnly", false);
|
|
||||||
uniformNotificationIcon=prefs.getBoolean("uniformNotificationIcon", false);
|
|
||||||
reduceMotion=prefs.getBoolean("reduceMotion", false);
|
reduceMotion=prefs.getBoolean("reduceMotion", false);
|
||||||
keepOnlyLatestNotification=prefs.getBoolean("keepOnlyLatestNotification", false);
|
keepOnlyLatestNotification=prefs.getBoolean("keepOnlyLatestNotification", false);
|
||||||
|
enableFabAutoHide=prefs.getBoolean("enableFabAutoHide", true);
|
||||||
disableAltTextReminder=prefs.getBoolean("disableAltTextReminder", false);
|
disableAltTextReminder=prefs.getBoolean("disableAltTextReminder", false);
|
||||||
showAltIndicator=prefs.getBoolean("showAltIndicator", true);
|
showAltIndicator=prefs.getBoolean("showAltIndicator", true);
|
||||||
showNoAltIndicator=prefs.getBoolean("showNoAltIndicator", true);
|
showNoAltIndicator=prefs.getBoolean("showNoAltIndicator", true);
|
||||||
@@ -93,16 +101,22 @@ public class GlobalUserPreferences{
|
|||||||
spectatorMode=prefs.getBoolean("spectatorMode", false);
|
spectatorMode=prefs.getBoolean("spectatorMode", false);
|
||||||
publishButtonText=prefs.getString("publishButtonText", "");
|
publishButtonText=prefs.getString("publishButtonText", "");
|
||||||
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
|
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
|
||||||
recentLanguages=fromJson(prefs.getString("recentLanguages", null), recentLanguagesType, new HashMap<>());
|
recentLanguages=fromJson(prefs.getString("recentLanguages", "{}"), recentLanguagesType, new HashMap<>());
|
||||||
|
recentEmojis=fromJson(prefs.getString("recentEmojis", "{}"), recentEmojisType, new HashMap<>());
|
||||||
|
publishButtonText=prefs.getString("publishButtonText", "");
|
||||||
pinnedTimelines=fromJson(prefs.getString("pinnedTimelines", null), pinnedTimelinesType, new HashMap<>());
|
pinnedTimelines=fromJson(prefs.getString("pinnedTimelines", null), pinnedTimelinesType, new HashMap<>());
|
||||||
accountsWithLocalOnlySupport=prefs.getStringSet("accountsWithLocalOnlySupport", new HashSet<>());
|
accountsWithLocalOnlySupport=prefs.getStringSet("accountsWithLocalOnlySupport", new HashSet<>());
|
||||||
accountsInGlitchMode=prefs.getStringSet("accountsInGlitchMode", new HashSet<>());
|
accountsInGlitchMode=prefs.getStringSet("accountsInGlitchMode", new HashSet<>());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
color=ColorPreference.valueOf(prefs.getString("color", ColorPreference.PINK.name()));
|
if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S){
|
||||||
|
color=ColorPreference.valueOf(prefs.getString("color", ColorPreference.MATERIAL3.name()));
|
||||||
|
}else{
|
||||||
|
color=ColorPreference.valueOf(prefs.getString("color", ColorPreference.PURPLE.name()));
|
||||||
|
}
|
||||||
} catch (IllegalArgumentException|ClassCastException ignored) {
|
} catch (IllegalArgumentException|ClassCastException ignored) {
|
||||||
// invalid color name or color was previously saved as integer
|
// invalid color name or color was previously saved as integer
|
||||||
color=ColorPreference.PINK;
|
color=ColorPreference.PURPLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,11 +133,13 @@ public class GlobalUserPreferences{
|
|||||||
.putBoolean("alwaysExpandContentWarnings", alwaysExpandContentWarnings)
|
.putBoolean("alwaysExpandContentWarnings", alwaysExpandContentWarnings)
|
||||||
.putBoolean("disableMarquee", disableMarquee)
|
.putBoolean("disableMarquee", disableMarquee)
|
||||||
.putBoolean("disableSwipe", disableSwipe)
|
.putBoolean("disableSwipe", disableSwipe)
|
||||||
.putBoolean("enableDeleteNotifications", enableDeleteNotifications)
|
.putBoolean("disableDividers", disableDividers)
|
||||||
.putBoolean("translateButtonOpenedOnly", translateButtonOpenedOnly)
|
.putBoolean("relocatePublishButton", relocatePublishButton)
|
||||||
.putBoolean("uniformNotificationIcon", uniformNotificationIcon)
|
.putBoolean("uniformNotificationIcon", uniformNotificationIcon)
|
||||||
|
.putBoolean("enableDeleteNotifications", enableDeleteNotifications)
|
||||||
.putBoolean("reduceMotion", reduceMotion)
|
.putBoolean("reduceMotion", reduceMotion)
|
||||||
.putBoolean("keepOnlyLatestNotification", keepOnlyLatestNotification)
|
.putBoolean("keepOnlyLatestNotification", keepOnlyLatestNotification)
|
||||||
|
.putBoolean("enableFabAutoHide", enableFabAutoHide)
|
||||||
.putBoolean("disableAltTextReminder", disableAltTextReminder)
|
.putBoolean("disableAltTextReminder", disableAltTextReminder)
|
||||||
.putBoolean("showAltIndicator", showAltIndicator)
|
.putBoolean("showAltIndicator", showAltIndicator)
|
||||||
.putBoolean("showNoAltIndicator", showNoAltIndicator)
|
.putBoolean("showNoAltIndicator", showNoAltIndicator)
|
||||||
@@ -137,6 +153,7 @@ public class GlobalUserPreferences{
|
|||||||
.putString("color", color.name())
|
.putString("color", color.name())
|
||||||
.putString("recentLanguages", gson.toJson(recentLanguages))
|
.putString("recentLanguages", gson.toJson(recentLanguages))
|
||||||
.putString("pinnedTimelines", gson.toJson(pinnedTimelines))
|
.putString("pinnedTimelines", gson.toJson(pinnedTimelines))
|
||||||
|
.putString("recentEmojis", gson.toJson(recentEmojis))
|
||||||
.putStringSet("accountsWithLocalOnlySupport", accountsWithLocalOnlySupport)
|
.putStringSet("accountsWithLocalOnlySupport", accountsWithLocalOnlySupport)
|
||||||
.putStringSet("accountsInGlitchMode", accountsInGlitchMode)
|
.putStringSet("accountsInGlitchMode", accountsInGlitchMode)
|
||||||
.apply();
|
.apply();
|
||||||
@@ -150,7 +167,8 @@ public class GlobalUserPreferences{
|
|||||||
BLUE,
|
BLUE,
|
||||||
BROWN,
|
BROWN,
|
||||||
RED,
|
RED,
|
||||||
YELLOW
|
YELLOW,
|
||||||
|
NORD
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ThemePreference{
|
public enum ThemePreference{
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.joinmastodon.android.fragments.ProfileFragment;
|
|||||||
import org.joinmastodon.android.fragments.ThreadFragment;
|
import org.joinmastodon.android.fragments.ThreadFragment;
|
||||||
import org.joinmastodon.android.fragments.onboarding.AccountActivationFragment;
|
import org.joinmastodon.android.fragments.onboarding.AccountActivationFragment;
|
||||||
import org.joinmastodon.android.fragments.onboarding.CustomWelcomeFragment;
|
import org.joinmastodon.android.fragments.onboarding.CustomWelcomeFragment;
|
||||||
|
import org.joinmastodon.android.fragments.onboarding.CustomWelcomeFragment;
|
||||||
import org.joinmastodon.android.model.Notification;
|
import org.joinmastodon.android.model.Notification;
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
import org.joinmastodon.android.updater.GithubSelfUpdater;
|
import org.joinmastodon.android.updater.GithubSelfUpdater;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{
|
|||||||
private static final String TAG="PushNotificationReceive";
|
private static final String TAG="PushNotificationReceive";
|
||||||
|
|
||||||
public static final int NOTIFICATION_ID=178;
|
public static final int NOTIFICATION_ID=178;
|
||||||
|
private static final int SUMMARY_ID = 791;
|
||||||
private static int notificationId = 0;
|
private static int notificationId = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -98,6 +99,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{
|
|||||||
Account self=AccountSessionManager.getInstance().getAccount(accountID).self;
|
Account self=AccountSessionManager.getInstance().getAccount(accountID).self;
|
||||||
String accountName="@"+self.username+"@"+AccountSessionManager.getInstance().getAccount(accountID).domain;
|
String accountName="@"+self.username+"@"+AccountSessionManager.getInstance().getAccount(accountID).domain;
|
||||||
Notification.Builder builder;
|
Notification.Builder builder;
|
||||||
|
Notification.Builder summaryNotification;
|
||||||
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){
|
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){
|
||||||
boolean hasGroup=false;
|
boolean hasGroup=false;
|
||||||
List<NotificationChannelGroup> channelGroups=nm.getNotificationChannelGroups();
|
List<NotificationChannelGroup> channelGroups=nm.getNotificationChannelGroups();
|
||||||
@@ -120,21 +122,28 @@ public class PushNotificationReceiver extends BroadcastReceiver{
|
|||||||
nm.createNotificationChannels(channels);
|
nm.createNotificationChannels(channels);
|
||||||
}
|
}
|
||||||
builder=new Notification.Builder(context, accountID+"_"+pn.notificationType);
|
builder=new Notification.Builder(context, accountID+"_"+pn.notificationType);
|
||||||
|
// summaryNotification=new Notification.Builder(context, accountID);
|
||||||
}else{
|
}else{
|
||||||
builder=new Notification.Builder(context)
|
builder=new Notification.Builder(context)
|
||||||
.setPriority(Notification.PRIORITY_DEFAULT)
|
.setPriority(Notification.PRIORITY_DEFAULT)
|
||||||
.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE);
|
.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE);
|
||||||
|
summaryNotification=new Notification.Builder(context)
|
||||||
|
.setPriority(Notification.PRIORITY_DEFAULT)
|
||||||
|
.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE);
|
||||||
}
|
}
|
||||||
Drawable avatar=ImageCache.getInstance(context).get(new UrlImageLoaderRequest(pn.icon, V.dp(50), V.dp(50)));
|
Drawable avatar=ImageCache.getInstance(context).get(new UrlImageLoaderRequest(pn.icon, V.dp(50), V.dp(50)));
|
||||||
Intent contentIntent=new Intent(context, MainActivity.class);
|
Intent contentIntent=new Intent(context, MainActivity.class);
|
||||||
contentIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
contentIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
contentIntent.putExtra("fromNotification", true);
|
contentIntent.putExtra("fromNotification", true);
|
||||||
contentIntent.putExtra("accountID", accountID);
|
contentIntent.putExtra("accountID", accountID);
|
||||||
|
contentIntent.putExtra("notificationID", notificationId);
|
||||||
if(notification!=null){
|
if(notification!=null){
|
||||||
contentIntent.putExtra("notification", Parcels.wrap(notification));
|
contentIntent.putExtra("notification", Parcels.wrap(notification));
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.setContentTitle(pn.title)
|
builder.setContentTitle(pn.title)
|
||||||
.setContentText(pn.body)
|
.setContentText(pn.body)
|
||||||
|
.setContentTitle(pn.title)
|
||||||
.setStyle(new Notification.BigTextStyle().bigText(pn.body))
|
.setStyle(new Notification.BigTextStyle().bigText(pn.body))
|
||||||
.setSmallIcon(R.drawable.ic_ntf_logo)
|
.setSmallIcon(R.drawable.ic_ntf_logo)
|
||||||
.setContentIntent(PendingIntent.getActivity(context, notificationId, contentIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT))
|
.setContentIntent(PendingIntent.getActivity(context, notificationId, contentIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT))
|
||||||
@@ -142,7 +151,8 @@ public class PushNotificationReceiver extends BroadcastReceiver{
|
|||||||
.setShowWhen(true)
|
.setShowWhen(true)
|
||||||
.setCategory(Notification.CATEGORY_SOCIAL)
|
.setCategory(Notification.CATEGORY_SOCIAL)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setColor(context.getColor(R.color.primary_700));
|
.setColor(context.getColor(R.color.shortcut_icon_background))
|
||||||
|
.setGroup(accountID);
|
||||||
|
|
||||||
if (!GlobalUserPreferences.uniformNotificationIcon) {
|
if (!GlobalUserPreferences.uniformNotificationIcon) {
|
||||||
builder.setSmallIcon(switch (pn.notificationType) {
|
builder.setSmallIcon(switch (pn.notificationType) {
|
||||||
@@ -164,6 +174,9 @@ public class PushNotificationReceiver extends BroadcastReceiver{
|
|||||||
if(AccountSessionManager.getInstance().getLoggedInAccounts().size()>1){
|
if(AccountSessionManager.getInstance().getLoggedInAccounts().size()>1){
|
||||||
builder.setSubText(accountName);
|
builder.setSubText(accountName);
|
||||||
}
|
}
|
||||||
nm.notify(accountID, GlobalUserPreferences.keepOnlyLatestNotification ? NOTIFICATION_ID : notificationId++, builder.build());
|
|
||||||
|
notificationId++;
|
||||||
|
nm.notify(accountID, GlobalUserPreferences.keepOnlyLatestNotification ? NOTIFICATION_ID : notificationId, builder.build());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.joinmastodon.android.api.requests.accounts;
|
||||||
|
|
||||||
|
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||||
|
import org.joinmastodon.android.model.Relationship;
|
||||||
|
|
||||||
|
public class SetPrivateNote extends MastodonAPIRequest<Relationship>{
|
||||||
|
public SetPrivateNote(String id, String comment){
|
||||||
|
super(MastodonAPIRequest.HttpMethod.POST, "/accounts/"+id+"/note", Relationship.class);
|
||||||
|
Request req = new Request(comment);
|
||||||
|
setRequestBody(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class Request{
|
||||||
|
public String comment;
|
||||||
|
public Request(String comment){
|
||||||
|
this.comment=comment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.joinmastodon.android.api.requests.lists;
|
||||||
|
|
||||||
|
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class AddList extends MastodonAPIRequest<Object> {
|
||||||
|
public AddList(String listName){
|
||||||
|
super(HttpMethod.POST, "/lists", Object.class);
|
||||||
|
Request req = new Request();
|
||||||
|
req.title = listName;
|
||||||
|
setRequestBody(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Request{
|
||||||
|
public String title;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.joinmastodon.android.api.requests.lists;
|
||||||
|
|
||||||
|
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class EditListName extends MastodonAPIRequest<Object> {
|
||||||
|
public EditListName(String newListName, String listId){
|
||||||
|
super(HttpMethod.PUT, "/lists/"+listId, Object.class);
|
||||||
|
Request req = new Request();
|
||||||
|
req.title = newListName;
|
||||||
|
setRequestBody(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Request{
|
||||||
|
public String title;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package org.joinmastodon.android.api.requests.lists;
|
||||||
|
|
||||||
|
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RemoveList extends MastodonAPIRequest<Object> {
|
||||||
|
public RemoveList(String listId){
|
||||||
|
super(HttpMethod.DELETE, "/lists/"+listId, Object.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,9 +11,9 @@ public class CreateOAuthApp extends MastodonAPIRequest<Application>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class Request{
|
private static class Request{
|
||||||
public String clientName="Megalodon";
|
public String clientName="Moshidon";
|
||||||
public String redirectUris=AccountSessionManager.REDIRECT_URI;
|
public String redirectUris=AccountSessionManager.REDIRECT_URI;
|
||||||
public String scopes=AccountSessionManager.SCOPE;
|
public String scopes=AccountSessionManager.SCOPE;
|
||||||
public String website="https://sk22.github.io/megalodon";
|
public String website="https://github.com/LucasGGamerM/moshidon";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ import me.grishka.appkit.api.ErrorResponse;
|
|||||||
public class AccountSessionManager{
|
public class AccountSessionManager{
|
||||||
private static final String TAG="AccountSessionManager";
|
private static final String TAG="AccountSessionManager";
|
||||||
public static final String SCOPE="read write follow push";
|
public static final String SCOPE="read write follow push";
|
||||||
public static final String REDIRECT_URI="megalodon-android-auth://callback";
|
public static final String REDIRECT_URI="moshidon-android-auth://callback";
|
||||||
|
|
||||||
private static final AccountSessionManager instance=new AccountSessionManager();
|
private static final AccountSessionManager instance=new AccountSessionManager();
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ public class AccountSessionManager{
|
|||||||
.path("/oauth/authorize")
|
.path("/oauth/authorize")
|
||||||
.appendQueryParameter("response_type", "code")
|
.appendQueryParameter("response_type", "code")
|
||||||
.appendQueryParameter("client_id", result.clientId)
|
.appendQueryParameter("client_id", result.clientId)
|
||||||
.appendQueryParameter("redirect_uri", "megalodon-android-auth://callback")
|
.appendQueryParameter("redirect_uri", "moshidon-android-auth://callback")
|
||||||
.appendQueryParameter("scope", SCOPE)
|
.appendQueryParameter("scope", SCOPE)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ package org.joinmastodon.android.fragments;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.animation.TranslateAnimation;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.requests.accounts.GetAccountStatuses;
|
import org.joinmastodon.android.api.requests.accounts.GetAccountStatuses;
|
||||||
@@ -70,6 +74,7 @@ public class AccountTimelineFragment extends StatusListFragment{
|
|||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState){
|
public void onViewCreated(View view, Bundle savedInstanceState){
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
fab = ((ProfileFragment) getParentFragment()).getFab();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,9 +13,12 @@ import android.text.Layout;
|
|||||||
import android.text.StaticLayout;
|
import android.text.StaticLayout;
|
||||||
import android.text.TextPaint;
|
import android.text.TextPaint;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowInsets;
|
import android.view.WindowInsets;
|
||||||
|
import android.view.animation.TranslateAnimation;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.Toolbar;
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
@@ -31,6 +34,7 @@ import org.joinmastodon.android.model.Poll;
|
|||||||
import org.joinmastodon.android.model.Relationship;
|
import org.joinmastodon.android.model.Relationship;
|
||||||
import org.joinmastodon.android.model.Status;
|
import org.joinmastodon.android.model.Status;
|
||||||
import org.joinmastodon.android.ui.BetterItemAnimator;
|
import org.joinmastodon.android.ui.BetterItemAnimator;
|
||||||
|
import org.joinmastodon.android.model.DisplayItemsParent;
|
||||||
import org.joinmastodon.android.ui.PhotoLayoutHelper;
|
import org.joinmastodon.android.ui.PhotoLayoutHelper;
|
||||||
import org.joinmastodon.android.ui.TileGridLayoutManager;
|
import org.joinmastodon.android.ui.TileGridLayoutManager;
|
||||||
import org.joinmastodon.android.ui.displayitems.ExtendedFooterStatusDisplayItem;
|
import org.joinmastodon.android.ui.displayitems.ExtendedFooterStatusDisplayItem;
|
||||||
@@ -75,10 +79,13 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
|||||||
protected DisplayItemsAdapter adapter;
|
protected DisplayItemsAdapter adapter;
|
||||||
protected String accountID;
|
protected String accountID;
|
||||||
protected PhotoViewer currentPhotoViewer;
|
protected PhotoViewer currentPhotoViewer;
|
||||||
|
protected ImageButton fab;
|
||||||
|
protected int scrollDiff = 0;
|
||||||
protected HashMap<String, Account> knownAccounts=new HashMap<>();
|
protected HashMap<String, Account> knownAccounts=new HashMap<>();
|
||||||
protected HashMap<String, Relationship> relationships=new HashMap<>();
|
protected HashMap<String, Relationship> relationships=new HashMap<>();
|
||||||
protected Rect tmpRect=new Rect();
|
protected Rect tmpRect=new Rect();
|
||||||
protected ImageButton fab;
|
|
||||||
|
private final int THRESHHOLD = 800;
|
||||||
|
|
||||||
public BaseStatusListFragment(){
|
public BaseStatusListFragment(){
|
||||||
super(20);
|
super(20);
|
||||||
@@ -285,13 +292,53 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
|||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState){
|
public void onViewCreated(View view, Bundle savedInstanceState){
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
fab=view.findViewById(R.id.fab);
|
||||||
|
|
||||||
list.addOnScrollListener(new RecyclerView.OnScrollListener(){
|
list.addOnScrollListener(new RecyclerView.OnScrollListener(){
|
||||||
@Override
|
@Override
|
||||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy){
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy){
|
||||||
if(currentPhotoViewer!=null)
|
if(currentPhotoViewer!=null)
|
||||||
currentPhotoViewer.offsetView(-dx, -dy);
|
currentPhotoViewer.offsetView(-dx, -dy);
|
||||||
|
|
||||||
|
if (fab!=null && GlobalUserPreferences.enableFabAutoHide) {
|
||||||
|
// This piece of code should make it so that the fab is always visible if the status list scroll view is at the item at the top
|
||||||
|
if(list.getChildLayoutPosition(list.getChildAt(0)) < 1){
|
||||||
|
scrollDiff=THRESHHOLD+1;
|
||||||
|
}else{
|
||||||
|
if(dy > 0){
|
||||||
|
scrollDiff=0;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
if (dy > 0 && fab.getVisibility() == View.VISIBLE) {
|
||||||
|
TranslateAnimation animate = new TranslateAnimation(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
fab.getHeight() * 2);
|
||||||
|
animate.setDuration(300);
|
||||||
|
animate.setFillAfter(true);
|
||||||
|
fab.startAnimation(animate);
|
||||||
|
fab.setVisibility(View.INVISIBLE);
|
||||||
|
scrollDiff = 0;
|
||||||
|
} else if (dy < 0 && fab.getVisibility() != View.VISIBLE) {
|
||||||
|
if (scrollDiff > THRESHHOLD) {
|
||||||
|
fab.setVisibility(View.VISIBLE);
|
||||||
|
TranslateAnimation animate = new TranslateAnimation(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
fab.getHeight() * 2,
|
||||||
|
0);
|
||||||
|
animate.setDuration(300);
|
||||||
|
animate.setFillAfter(true);
|
||||||
|
fab.startAnimation(animate);
|
||||||
|
scrollDiff = 0;
|
||||||
|
} else {
|
||||||
|
scrollDiff += Math.abs(dy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}});
|
||||||
list.addItemDecoration(new StatusListItemDecoration());
|
list.addItemDecoration(new StatusListItemDecoration());
|
||||||
((UsableRecyclerView)list).setSelectorBoundsProvider(new UsableRecyclerView.SelectorBoundsProvider(){
|
((UsableRecyclerView)list).setSelectorBoundsProvider(new UsableRecyclerView.SelectorBoundsProvider(){
|
||||||
private Rect tmpRect=new Rect();
|
private Rect tmpRect=new Rect();
|
||||||
@@ -730,7 +777,7 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
|||||||
private int currentMediaHiddenLayoutsWidth=0;
|
private int currentMediaHiddenLayoutsWidth=0;
|
||||||
|
|
||||||
{
|
{
|
||||||
dividerPaint.setColor(UiUtils.getThemeColor(getActivity(), R.attr.colorPollVoted));
|
dividerPaint.setColor(UiUtils.getThemeColor(getActivity(), GlobalUserPreferences.disableDividers ? R.attr.colorWindowBackground : R.attr.colorPollVoted));
|
||||||
dividerPaint.setStyle(Paint.Style.STROKE);
|
dividerPaint.setStyle(Paint.Style.STROKE);
|
||||||
dividerPaint.setStrokeWidth(V.dp(1));
|
dividerPaint.setStrokeWidth(V.dp(1));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package org.joinmastodon.android.fragments;
|
package org.joinmastodon.android.fragments;
|
||||||
|
|
||||||
|
import static android.os.ext.SdkExtensions.getExtensionVersion;
|
||||||
|
|
||||||
import static org.joinmastodon.android.GlobalUserPreferences.recentLanguages;
|
import static org.joinmastodon.android.GlobalUserPreferences.recentLanguages;
|
||||||
import static org.joinmastodon.android.api.requests.statuses.CreateStatus.DRAFTS_AFTER_INSTANT;
|
import static org.joinmastodon.android.api.requests.statuses.CreateStatus.DRAFTS_AFTER_INSTANT;
|
||||||
import static org.joinmastodon.android.api.requests.statuses.CreateStatus.getDraftInstant;
|
import static org.joinmastodon.android.api.requests.statuses.CreateStatus.getDraftInstant;
|
||||||
@@ -235,10 +237,14 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
private String language, encoding;
|
private String language, encoding;
|
||||||
private MastodonLanguage.LanguageResolver languageResolver;
|
private MastodonLanguage.LanguageResolver languageResolver;
|
||||||
|
|
||||||
|
private int navigationBarColorBefore;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState){
|
public void onCreate(Bundle savedInstanceState){
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setRetainInstance(true);
|
setRetainInstance(true);
|
||||||
|
navigationBarColorBefore = getActivity().getWindow().getNavigationBarColor();
|
||||||
|
getActivity().getWindow().setNavigationBarColor(UiUtils.getThemeColor(getActivity(), R.attr.colorBackgroundLightest));
|
||||||
|
|
||||||
accountID=getArguments().getString("account");
|
accountID=getArguments().getString("account");
|
||||||
AccountSession session=AccountSessionManager.getInstance().getAccount(accountID);
|
AccountSession session=AccountSessionManager.getInstance().getAccount(accountID);
|
||||||
@@ -283,6 +289,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
UiUtils.removeCallbacks(updateUploadEtaRunnable);
|
UiUtils.removeCallbacks(updateUploadEtaRunnable);
|
||||||
updateUploadEtaRunnable=null;
|
updateUploadEtaRunnable=null;
|
||||||
}
|
}
|
||||||
|
getActivity().getWindow().setNavigationBarColor(navigationBarColorBefore);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -300,10 +307,25 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
emojiKeyboard.setListener(this::onCustomEmojiClick);
|
emojiKeyboard.setListener(this::onCustomEmojiClick);
|
||||||
|
|
||||||
View view=inflater.inflate(R.layout.fragment_compose, container, false);
|
View view=inflater.inflate(R.layout.fragment_compose, container, false);
|
||||||
|
|
||||||
|
if(GlobalUserPreferences.relocatePublishButton){
|
||||||
|
publishButton=view.findViewById(R.id.publish);
|
||||||
|
// publishButton.setText(editingStatus==null || redraftStatus ? R.string.publish : R.string.save);
|
||||||
|
publishButton.setEllipsize(TextUtils.TruncateAt.END);
|
||||||
|
publishButton.setOnClickListener(this::onPublishClick);
|
||||||
|
publishButton.setSingleLine(true);
|
||||||
|
publishButton.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
draftsBtn=view.findViewById(R.id.drafts_btn);
|
||||||
|
draftsBtn.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
charCounter=view.findViewById(R.id.char_counter);
|
||||||
|
charCounter.setVisibility(View.VISIBLE);
|
||||||
|
charCounter.setText(String.valueOf(charLimit));
|
||||||
|
}
|
||||||
|
|
||||||
mainEditText=view.findViewById(R.id.toot_text);
|
mainEditText=view.findViewById(R.id.toot_text);
|
||||||
mainEditTextWrap=view.findViewById(R.id.toot_text_wrap);
|
mainEditTextWrap=view.findViewById(R.id.toot_text_wrap);
|
||||||
charCounter=view.findViewById(R.id.char_counter);
|
|
||||||
charCounter.setText(String.valueOf(charLimit));
|
|
||||||
scrollView=view.findViewById(R.id.scroll_view);
|
scrollView=view.findViewById(R.id.scroll_view);
|
||||||
|
|
||||||
selfName=view.findViewById(R.id.self_name);
|
selfName=view.findViewById(R.id.self_name);
|
||||||
@@ -692,6 +714,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
replyText.setOnClickListener(v->{
|
replyText.setOnClickListener(v->{
|
||||||
scrollView.smoothScrollTo(0, 0);
|
scrollView.smoothScrollTo(0, 0);
|
||||||
});
|
});
|
||||||
|
replyText.setOnClickListener(v->{
|
||||||
|
scrollView.smoothScrollTo(0, 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
ArrayList<String> mentions=new ArrayList<>();
|
ArrayList<String> mentions=new ArrayList<>();
|
||||||
String ownID=AccountSessionManager.getInstance().getAccount(accountID).self.id;
|
String ownID=AccountSessionManager.getInstance().getAccount(accountID).self.id;
|
||||||
@@ -787,7 +813,20 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
item.setActionView(wrap);
|
item.setActionView(wrap);
|
||||||
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||||
|
|
||||||
|
if(!GlobalUserPreferences.relocatePublishButton){
|
||||||
|
publishButton = wrap.findViewById(R.id.publish_btn);
|
||||||
|
publishButton.setOnClickListener(this::onPublishClick);
|
||||||
|
publishButton.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
draftsBtn = wrap.findViewById(R.id.drafts_btn);
|
draftsBtn = wrap.findViewById(R.id.drafts_btn);
|
||||||
|
draftsBtn.setVisibility(View.VISIBLE);
|
||||||
|
}else{
|
||||||
|
charCounter = wrap.findViewById(R.id.char_counter);
|
||||||
|
charCounter.setVisibility(View.VISIBLE);
|
||||||
|
charCounter.setText(String.valueOf(charLimit));
|
||||||
|
}
|
||||||
|
|
||||||
|
// draftsBtn = wrap.findViewById(R.id.drafts_btn);
|
||||||
draftOptionsPopup = new PopupMenu(getContext(), draftsBtn);
|
draftOptionsPopup = new PopupMenu(getContext(), draftsBtn);
|
||||||
draftOptionsPopup.inflate(R.menu.compose_more);
|
draftOptionsPopup.inflate(R.menu.compose_more);
|
||||||
draftMenuItem = draftOptionsPopup.getMenu().findItem(R.id.draft);
|
draftMenuItem = draftOptionsPopup.getMenu().findItem(R.id.draft);
|
||||||
@@ -804,12 +843,11 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
});
|
});
|
||||||
UiUtils.enablePopupMenuIcons(getContext(), draftOptionsPopup);
|
UiUtils.enablePopupMenuIcons(getContext(), draftOptionsPopup);
|
||||||
|
|
||||||
publishButton = wrap.findViewById(R.id.publish_btn);
|
|
||||||
languageButton = wrap.findViewById(R.id.language_btn);
|
languageButton = wrap.findViewById(R.id.language_btn);
|
||||||
sendProgress = wrap.findViewById(R.id.send_progress);
|
sendProgress = wrap.findViewById(R.id.send_progress);
|
||||||
sendError = wrap.findViewById(R.id.send_error);
|
sendError = wrap.findViewById(R.id.send_error);
|
||||||
|
|
||||||
publishButton.setOnClickListener(this::onPublishClick);
|
|
||||||
draftsBtn.setOnClickListener(v-> draftOptionsPopup.show());
|
draftsBtn.setOnClickListener(v-> draftOptionsPopup.show());
|
||||||
draftsBtn.setOnTouchListener(draftOptionsPopup.getDragToOpenListener());
|
draftsBtn.setOnTouchListener(draftOptionsPopup.getDragToOpenListener());
|
||||||
updateScheduledAt(scheduledAt != null ? scheduledAt : scheduledStatus != null ? scheduledStatus.scheduledAt : null);
|
updateScheduledAt(scheduledAt != null ? scheduledAt : scheduledStatus != null ? scheduledStatus.scheduledAt : null);
|
||||||
@@ -945,6 +983,9 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
|
|
||||||
private void resetPublishButtonText() {
|
private void resetPublishButtonText() {
|
||||||
int publishText = editingStatus==null || redraftStatus ? R.string.publish : R.string.save;
|
int publishText = editingStatus==null || redraftStatus ? R.string.publish : R.string.save;
|
||||||
|
if(GlobalUserPreferences.relocatePublishButton){
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (publishText == R.string.publish && !GlobalUserPreferences.publishButtonText.isEmpty()) {
|
if (publishText == R.string.publish && !GlobalUserPreferences.publishButtonText.isEmpty()) {
|
||||||
publishButton.setText(GlobalUserPreferences.publishButtonText);
|
publishButton.setText(GlobalUserPreferences.publishButtonText);
|
||||||
} else {
|
} else {
|
||||||
@@ -967,7 +1008,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
nonDoneAttachmentCount++;
|
nonDoneAttachmentCount++;
|
||||||
}
|
}
|
||||||
publishButton.setEnabled((trimmedCharCount>0 || !attachments.isEmpty()) && charCount<=charLimit && nonDoneAttachmentCount==0 && (pollOptions.isEmpty() || nonEmptyPollOptionsCount>1));
|
publishButton.setEnabled((trimmedCharCount>0 || !attachments.isEmpty()) && charCount<=charLimit && nonDoneAttachmentCount==0 && (pollOptions.isEmpty() || nonEmptyPollOptionsCount>1));
|
||||||
sendError.setVisibility(View.GONE);
|
// sendError.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onCustomEmojiClick(Emoji emoji){
|
private void onCustomEmojiClick(Emoji emoji){
|
||||||
@@ -983,8 +1024,19 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onPublishClick(View v){
|
private void onPublishClick(View v){
|
||||||
|
if (!attachments.isEmpty()
|
||||||
|
&& statusVisibility != StatusPrivacy.DIRECT
|
||||||
|
&& !attachments.stream().allMatch(attachment -> attachment.description != null && !attachment.description.isBlank())) {
|
||||||
|
new M3AlertDialogBuilder(getActivity())
|
||||||
|
.setTitle(R.string.mo_no_image_desc_title)
|
||||||
|
.setMessage(R.string.mo_no_image_desc)
|
||||||
|
.setNegativeButton(R.string.cancel, null)
|
||||||
|
.setPositiveButton(R.string.publish, (dialog, i)-> publish())
|
||||||
|
.show();
|
||||||
|
} else {
|
||||||
publish();
|
publish();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void publishErrorCallback(ErrorResponse error) {
|
private void publishErrorCallback(ErrorResponse error) {
|
||||||
wm.removeView(sendingOverlay);
|
wm.removeView(sendingOverlay);
|
||||||
@@ -1134,6 +1186,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if(editingStatus!=null && !redraftStatus){
|
if(editingStatus!=null && !redraftStatus){
|
||||||
new EditStatus(req, editingStatus.id)
|
new EditStatus(req, editingStatus.id)
|
||||||
.setCallback(resCallback)
|
.setCallback(resCallback)
|
||||||
@@ -1638,10 +1691,6 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
DraftMediaAttachment att=(DraftMediaAttachment) v.getTag();
|
DraftMediaAttachment att=(DraftMediaAttachment) v.getTag();
|
||||||
if(att.serverAttachment==null)
|
if(att.serverAttachment==null)
|
||||||
return;
|
return;
|
||||||
editMediaDescription(att);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void editMediaDescription(DraftMediaAttachment att) {
|
|
||||||
Bundle args=new Bundle();
|
Bundle args=new Bundle();
|
||||||
args.putString("account", accountID);
|
args.putString("account", accountID);
|
||||||
args.putString("attachment", att.serverAttachment.id);
|
args.putString("attachment", att.serverAttachment.id);
|
||||||
@@ -1799,9 +1848,15 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
scheduleDraftText.setText(R.string.sk_compose_draft);
|
scheduleDraftText.setText(R.string.sk_compose_draft);
|
||||||
scheduleDraftText.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_fluent_drafts_20_regular, 0, 0, 0);
|
scheduleDraftText.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_fluent_drafts_20_regular, 0, 0, 0);
|
||||||
scheduleDraftDismiss.setContentDescription(getString(R.string.sk_compose_no_draft));
|
scheduleDraftDismiss.setContentDescription(getString(R.string.sk_compose_no_draft));
|
||||||
draftsBtn.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_fluent_drafts_20_filled, 0, 0, 0);
|
draftsBtn.setCompoundDrawablesWithIntrinsicBounds(GlobalUserPreferences.relocatePublishButton ? R.drawable.ic_fluent_drafts_24_regular : R.drawable.ic_fluent_drafts_20_filled, 0, 0, 0);
|
||||||
|
|
||||||
|
if(GlobalUserPreferences.relocatePublishButton){
|
||||||
|
publishButton.setCompoundDrawablesWithIntrinsicBounds(scheduledStatus != null && scheduledStatus.scheduledAt.isAfter(DRAFTS_AFTER_INSTANT)
|
||||||
|
? R.drawable.ic_fluent_save_24_selector : R.drawable.ic_fluent_drafts_24_selector, 0, 0, 0);
|
||||||
|
}else{
|
||||||
publishButton.setText(scheduledStatus != null && scheduledStatus.scheduledAt.isAfter(DRAFTS_AFTER_INSTANT)
|
publishButton.setText(scheduledStatus != null && scheduledStatus.scheduledAt.isAfter(DRAFTS_AFTER_INSTANT)
|
||||||
? R.string.save : R.string.sk_draft);
|
? R.string.save : R.string.sk_draft);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
scheduleMenuItem.setVisible(false);
|
scheduleMenuItem.setVisible(false);
|
||||||
unscheduleMenuItem.setVisible(true);
|
unscheduleMenuItem.setVisible(true);
|
||||||
@@ -1811,12 +1866,21 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
scheduleDraftText.setText(R.string.sk_compose_scheduled);
|
scheduleDraftText.setText(R.string.sk_compose_scheduled);
|
||||||
scheduleDraftText.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
scheduleDraftText.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||||
scheduleDraftDismiss.setContentDescription(getString(R.string.sk_compose_no_schedule));
|
scheduleDraftDismiss.setContentDescription(getString(R.string.sk_compose_no_schedule));
|
||||||
draftsBtn.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_fluent_clock_20_filled, 0, 0, 0);
|
draftsBtn.setCompoundDrawablesWithIntrinsicBounds(GlobalUserPreferences.relocatePublishButton ? R.drawable.ic_fluent_clock_24_filled : R.drawable.ic_fluent_clock_20_filled, 0, 0, 0);
|
||||||
|
if(GlobalUserPreferences.relocatePublishButton)
|
||||||
|
{
|
||||||
|
publishButton.setCompoundDrawablesWithIntrinsicBounds(scheduledStatus != null && scheduledStatus.scheduledAt.isAfter(DRAFTS_AFTER_INSTANT)
|
||||||
|
? R.drawable.ic_fluent_save_24_selector : R.drawable.ic_fluent_clock_24_selector, 0, 0, 0);
|
||||||
|
}else{
|
||||||
publishButton.setText(scheduledStatus != null && scheduledStatus.scheduledAt.equals(scheduledAt)
|
publishButton.setText(scheduledStatus != null && scheduledStatus.scheduledAt.equals(scheduledAt)
|
||||||
? R.string.save : R.string.sk_schedule);
|
? R.string.save : R.string.sk_schedule);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
draftsBtn.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_fluent_clock_20_regular, 0, 0, 0);
|
draftsBtn.setCompoundDrawablesWithIntrinsicBounds(GlobalUserPreferences.relocatePublishButton ? R.drawable.ic_fluent_clock_24_regular : R.drawable.ic_fluent_clock_20_regular, 0, 0, 0);
|
||||||
|
if(GlobalUserPreferences.relocatePublishButton){
|
||||||
|
publishButton.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_fluent_send_24_selector, 0, 0, 0);
|
||||||
|
}
|
||||||
resetPublishButtonText();
|
resetPublishButtonText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2036,6 +2100,14 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
private void editMediaDescription(DraftMediaAttachment att) {
|
||||||
|
Bundle args=new Bundle();
|
||||||
|
args.putString("account", accountID);
|
||||||
|
args.putString("attachment", att.serverAttachment.id);
|
||||||
|
args.putParcelable("uri", att.uri);
|
||||||
|
args.putString("existingDescription", att.description);
|
||||||
|
Nav.goForResult(getActivity(), ComposeImageDescriptionFragment.class, args, IMAGE_DESCRIPTION_RESULT, this);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CharSequence getTitle(){
|
public CharSequence getTitle(){
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ import me.grishka.appkit.views.FragmentRootLinearLayout;
|
|||||||
|
|
||||||
public class HomeFragment extends AppKitFragment implements OnBackPressedListener{
|
public class HomeFragment extends AppKitFragment implements OnBackPressedListener{
|
||||||
private FragmentRootLinearLayout content;
|
private FragmentRootLinearLayout content;
|
||||||
|
|
||||||
private HomeTabFragment homeTabFragment;
|
private HomeTabFragment homeTabFragment;
|
||||||
|
|
||||||
|
// private HomeTimelineFragment homeTimelineFragment;
|
||||||
|
|
||||||
private NotificationsFragment notificationsFragment;
|
private NotificationsFragment notificationsFragment;
|
||||||
private DiscoverFragment searchFragment;
|
private DiscoverFragment searchFragment;
|
||||||
private ProfileFragment profileFragment;
|
private ProfileFragment profileFragment;
|
||||||
@@ -57,7 +61,7 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
public void onCreate(Bundle savedInstanceState){
|
public void onCreate(Bundle savedInstanceState){
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
accountID=getArguments().getString("account");
|
accountID=getArguments().getString("account");
|
||||||
setTitle(R.string.sk_app_name);
|
setTitle(R.string.mo_app_name);
|
||||||
|
|
||||||
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N)
|
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N)
|
||||||
setRetainInstance(true);
|
setRetainInstance(true);
|
||||||
@@ -65,8 +69,13 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
if(savedInstanceState==null){
|
if(savedInstanceState==null){
|
||||||
Bundle args=new Bundle();
|
Bundle args=new Bundle();
|
||||||
args.putString("account", accountID);
|
args.putString("account", accountID);
|
||||||
|
|
||||||
homeTabFragment=new HomeTabFragment();
|
homeTabFragment=new HomeTabFragment();
|
||||||
homeTabFragment.setArguments(args);
|
homeTabFragment.setArguments(args);
|
||||||
|
|
||||||
|
// homeTimelineFragment=new HomeTimelineFragment();
|
||||||
|
// homeTimelineFragment.setArguments(args);
|
||||||
|
|
||||||
args=new Bundle(args);
|
args=new Bundle(args);
|
||||||
args.putBoolean("noAutoLoad", true);
|
args.putBoolean("noAutoLoad", true);
|
||||||
searchFragment=new DiscoverFragment();
|
searchFragment=new DiscoverFragment();
|
||||||
@@ -116,6 +125,13 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
.add(R.id.fragment_wrap, profileFragment).hide(profileFragment)
|
.add(R.id.fragment_wrap, profileFragment).hide(profileFragment)
|
||||||
.commit();
|
.commit();
|
||||||
|
|
||||||
|
// getChildFragmentManager().beginTransaction()
|
||||||
|
// .add(R.id.fragment_wrap, homeTimelineFragment)
|
||||||
|
// .add(R.id.fragment_wrap, searchFragment).hide(searchFragment)
|
||||||
|
// .add(R.id.fragment_wrap, notificationsFragment).hide(notificationsFragment)
|
||||||
|
// .add(R.id.fragment_wrap, profileFragment).hide(profileFragment)
|
||||||
|
// .commit();
|
||||||
|
|
||||||
String defaultTab=getArguments().getString("tab");
|
String defaultTab=getArguments().getString("tab");
|
||||||
if("notifications".equals(defaultTab)){
|
if("notifications".equals(defaultTab)){
|
||||||
tabBar.selectTab(R.id.tab_notifications);
|
tabBar.selectTab(R.id.tab_notifications);
|
||||||
@@ -136,13 +152,21 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
@Override
|
@Override
|
||||||
public void onViewStateRestored(Bundle savedInstanceState){
|
public void onViewStateRestored(Bundle savedInstanceState){
|
||||||
super.onViewStateRestored(savedInstanceState);
|
super.onViewStateRestored(savedInstanceState);
|
||||||
|
|
||||||
if(savedInstanceState==null) return;
|
if(savedInstanceState==null) return;
|
||||||
|
|
||||||
|
// if(savedInstanceState==null || homeTimelineFragment!=null)
|
||||||
|
// return;
|
||||||
|
|
||||||
homeTabFragment=(HomeTabFragment) getChildFragmentManager().getFragment(savedInstanceState, "homeTabFragment");
|
homeTabFragment=(HomeTabFragment) getChildFragmentManager().getFragment(savedInstanceState, "homeTabFragment");
|
||||||
|
|
||||||
|
// homeTimelineFragment=(HomeTimelineFragment) getChildFragmentManager().getFragment(savedInstanceState, "homeTimelineFragment");
|
||||||
searchFragment=(DiscoverFragment) getChildFragmentManager().getFragment(savedInstanceState, "searchFragment");
|
searchFragment=(DiscoverFragment) getChildFragmentManager().getFragment(savedInstanceState, "searchFragment");
|
||||||
notificationsFragment=(NotificationsFragment) getChildFragmentManager().getFragment(savedInstanceState, "notificationsFragment");
|
notificationsFragment=(NotificationsFragment) getChildFragmentManager().getFragment(savedInstanceState, "notificationsFragment");
|
||||||
profileFragment=(ProfileFragment) getChildFragmentManager().getFragment(savedInstanceState, "profileFragment");
|
profileFragment=(ProfileFragment) getChildFragmentManager().getFragment(savedInstanceState, "profileFragment");
|
||||||
currentTab=savedInstanceState.getInt("selectedTab");
|
currentTab=savedInstanceState.getInt("selectedTab");
|
||||||
Fragment current=fragmentForTab(currentTab);
|
Fragment current=fragmentForTab(currentTab);
|
||||||
|
|
||||||
getChildFragmentManager().beginTransaction()
|
getChildFragmentManager().beginTransaction()
|
||||||
.hide(homeTabFragment)
|
.hide(homeTabFragment)
|
||||||
.hide(searchFragment)
|
.hide(searchFragment)
|
||||||
@@ -150,6 +174,14 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
.hide(profileFragment)
|
.hide(profileFragment)
|
||||||
.show(current)
|
.show(current)
|
||||||
.commit();
|
.commit();
|
||||||
|
|
||||||
|
// getChildFragmentManager().beginTransaction()
|
||||||
|
// .hide(homeTimelineFragment)
|
||||||
|
// .hide(searchFragment)
|
||||||
|
// .hide(notificationsFragment)
|
||||||
|
// .hide(profileFragment)
|
||||||
|
// .show(current)
|
||||||
|
// .commit();
|
||||||
maybeTriggerLoading(current);
|
maybeTriggerLoading(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +211,11 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
super.onApplyWindowInsets(insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(), 0, insets.getSystemWindowInsetRight(), insets.getSystemWindowInsetBottom()));
|
super.onApplyWindowInsets(insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(), 0, insets.getSystemWindowInsetRight(), insets.getSystemWindowInsetBottom()));
|
||||||
}
|
}
|
||||||
WindowInsets topOnlyInsets=insets.replaceSystemWindowInsets(0, insets.getSystemWindowInsetTop(), 0, 0);
|
WindowInsets topOnlyInsets=insets.replaceSystemWindowInsets(0, insets.getSystemWindowInsetTop(), 0, 0);
|
||||||
|
|
||||||
homeTabFragment.onApplyWindowInsets(topOnlyInsets);
|
homeTabFragment.onApplyWindowInsets(topOnlyInsets);
|
||||||
|
|
||||||
|
// homeTimelineFragment.onApplyWindowInsets(topOnlyInsets);
|
||||||
|
|
||||||
searchFragment.onApplyWindowInsets(topOnlyInsets);
|
searchFragment.onApplyWindowInsets(topOnlyInsets);
|
||||||
notificationsFragment.onApplyWindowInsets(topOnlyInsets);
|
notificationsFragment.onApplyWindowInsets(topOnlyInsets);
|
||||||
profileFragment.onApplyWindowInsets(topOnlyInsets);
|
profileFragment.onApplyWindowInsets(topOnlyInsets);
|
||||||
@@ -188,6 +224,9 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
private Fragment fragmentForTab(@IdRes int tab){
|
private Fragment fragmentForTab(@IdRes int tab){
|
||||||
if(tab==R.id.tab_home){
|
if(tab==R.id.tab_home){
|
||||||
return homeTabFragment;
|
return homeTabFragment;
|
||||||
|
|
||||||
|
// if(tab==R.id.tab_home){
|
||||||
|
// return homeTimelineFragment;
|
||||||
}else if(tab==R.id.tab_search){
|
}else if(tab==R.id.tab_search){
|
||||||
return searchFragment;
|
return searchFragment;
|
||||||
}else if(tab==R.id.tab_notifications){
|
}else if(tab==R.id.tab_notifications){
|
||||||
@@ -201,9 +240,18 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
private void onTabSelected(@IdRes int tab){
|
private void onTabSelected(@IdRes int tab){
|
||||||
Fragment newFragment=fragmentForTab(tab);
|
Fragment newFragment=fragmentForTab(tab);
|
||||||
if(tab==currentTab){
|
if(tab==currentTab){
|
||||||
if (tab == R.id.tab_search)
|
if(tab == R.id.tab_search){
|
||||||
searchFragment.onSelect();
|
if(newFragment instanceof ScrollableToTop scrollable)
|
||||||
else if(newFragment instanceof ScrollableToTop scrollable)
|
scrollable.scrollToTop();
|
||||||
|
searchFragment.selectSearch();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(newFragment instanceof ScrollableToTop scrollable)
|
||||||
|
scrollable.scrollToTop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(tab==currentTab && tab == R.id.tab_search){
|
||||||
|
if(newFragment instanceof ScrollableToTop scrollable)
|
||||||
scrollable.scrollToTop();
|
scrollable.scrollToTop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -240,6 +288,12 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
new AccountSwitcherSheet(getActivity()).show();
|
new AccountSwitcherSheet(getActivity()).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if(tab==R.id.tab_search){
|
||||||
|
onTabSelected(R.id.tab_search);
|
||||||
|
tabBar.selectTab(R.id.tab_search);
|
||||||
|
searchFragment.selectSearch();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,9 +316,15 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
public void onSaveInstanceState(Bundle outState){
|
public void onSaveInstanceState(Bundle outState){
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
outState.putInt("selectedTab", currentTab);
|
outState.putInt("selectedTab", currentTab);
|
||||||
|
|
||||||
if (homeTabFragment.isAdded()) getChildFragmentManager().putFragment(outState, "homeTabFragment", homeTabFragment);
|
if (homeTabFragment.isAdded()) getChildFragmentManager().putFragment(outState, "homeTabFragment", homeTabFragment);
|
||||||
if (searchFragment.isAdded()) getChildFragmentManager().putFragment(outState, "searchFragment", searchFragment);
|
if (searchFragment.isAdded()) getChildFragmentManager().putFragment(outState, "searchFragment", searchFragment);
|
||||||
if (notificationsFragment.isAdded()) getChildFragmentManager().putFragment(outState, "notificationsFragment", notificationsFragment);
|
if (notificationsFragment.isAdded()) getChildFragmentManager().putFragment(outState, "notificationsFragment", notificationsFragment);
|
||||||
if (profileFragment.isAdded()) getChildFragmentManager().putFragment(outState, "profileFragment", profileFragment);
|
if (profileFragment.isAdded()) getChildFragmentManager().putFragment(outState, "profileFragment", profileFragment);
|
||||||
|
|
||||||
|
// getChildFragmentManager().putFragment(outState, "homeTimelineFragment", homeTimelineFragment);
|
||||||
|
// getChildFragmentManager().putFragment(outState, "searchFragment", searchFragment);
|
||||||
|
// getChildFragmentManager().putFragment(outState, "notificationsFragment", notificationsFragment);
|
||||||
|
// getChildFragmentManager().putFragment(outState, "profileFragment", profileFragment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public class HomeTimelineFragment extends StatusListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<Status> filterPosts(List<Status> items) {
|
private List<Status> filterPosts(List<Status> items) {
|
||||||
|
// This is the function I must use to solve the filters thing for real
|
||||||
return items.stream().filter(i ->
|
return items.stream().filter(i ->
|
||||||
(GlobalUserPreferences.showReplies || i.inReplyToId == null) &&
|
(GlobalUserPreferences.showReplies || i.inReplyToId == null) &&
|
||||||
(GlobalUserPreferences.showBoosts || i.reblog == null)
|
(GlobalUserPreferences.showBoosts || i.reblog == null)
|
||||||
@@ -102,24 +103,24 @@ public class HomeTimelineFragment extends StatusListFragment {
|
|||||||
@Override
|
@Override
|
||||||
protected void onHidden(){
|
protected void onHidden(){
|
||||||
super.onHidden();
|
super.onHidden();
|
||||||
if(!data.isEmpty()){
|
// if(!data.isEmpty()){
|
||||||
String topPostID=displayItems.get(Math.max(0, list.getChildAdapterPosition(list.getChildAt(0))-getMainAdapterOffset())).parentID;
|
// String topPostID=displayItems.get(list.getChildAdapterPosition(list.getChildAt(0))-getMainAdapterOffset()).parentID;
|
||||||
if(!topPostID.equals(lastSavedMarkerID)){
|
// if(!topPostID.equals(lastSavedMarkerID)){
|
||||||
lastSavedMarkerID=topPostID;
|
// lastSavedMarkerID=topPostID;
|
||||||
new SaveMarkers(topPostID, null)
|
// new SaveMarkers(topPostID, null)
|
||||||
.setCallback(new Callback<>(){
|
// .setCallback(new Callback<>(){
|
||||||
@Override
|
// @Override
|
||||||
public void onSuccess(SaveMarkers.Response result){
|
// public void onSuccess(SaveMarkers.Response result){
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError(ErrorResponse error){
|
// public void onError(ErrorResponse error){
|
||||||
lastSavedMarkerID=null;
|
// lastSavedMarkerID=null;
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
.exec(accountID);
|
// .exec(accountID);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStatusCreated(StatusCreatedEvent ev){
|
public void onStatusCreated(StatusCreatedEvent ev){
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
|||||||
private FrameLayout[] tabViews;
|
private FrameLayout[] tabViews;
|
||||||
private TabLayoutMediator tabLayoutMediator;
|
private TabLayoutMediator tabLayoutMediator;
|
||||||
|
|
||||||
private NotificationsListFragment allNotificationsFragment, mentionsFragment;
|
private NotificationsListFragment allNotificationsFragment, mentionsFragment, postsFragment;
|
||||||
|
|
||||||
private String accountID;
|
private String accountID;
|
||||||
|
|
||||||
@@ -102,14 +102,14 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
|||||||
|
|
||||||
tabLayout=view.findViewById(R.id.tabbar);
|
tabLayout=view.findViewById(R.id.tabbar);
|
||||||
pager=view.findViewById(R.id.pager);
|
pager=view.findViewById(R.id.pager);
|
||||||
UiUtils.reduceSwipeSensitivity(pager);
|
|
||||||
|
|
||||||
tabViews=new FrameLayout[2];
|
tabViews=new FrameLayout[3];
|
||||||
for(int i=0;i<tabViews.length;i++){
|
for(int i=0;i<tabViews.length;i++){
|
||||||
FrameLayout tabView=new FrameLayout(getActivity());
|
FrameLayout tabView=new FrameLayout(getActivity());
|
||||||
tabView.setId(switch(i){
|
tabView.setId(switch(i){
|
||||||
case 0 -> R.id.notifications_all;
|
case 0 -> R.id.notifications_all;
|
||||||
case 1 -> R.id.notifications_mentions;
|
case 1 -> R.id.notifications_mentions;
|
||||||
|
case 2 -> R.id.notifications_posts;
|
||||||
default -> throw new IllegalStateException("Unexpected value: "+i);
|
default -> throw new IllegalStateException("Unexpected value: "+i);
|
||||||
});
|
});
|
||||||
tabView.setVisibility(View.GONE);
|
tabView.setVisibility(View.GONE);
|
||||||
@@ -119,18 +119,6 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
|||||||
|
|
||||||
tabLayout.setTabTextSize(V.dp(16));
|
tabLayout.setTabTextSize(V.dp(16));
|
||||||
tabLayout.setTabTextColors(UiUtils.getThemeColor(getActivity(), R.attr.colorTabInactive), UiUtils.getThemeColor(getActivity(), android.R.attr.textColorPrimary));
|
tabLayout.setTabTextColors(UiUtils.getThemeColor(getActivity(), R.attr.colorTabInactive), UiUtils.getThemeColor(getActivity(), android.R.attr.textColorPrimary));
|
||||||
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
|
||||||
@Override
|
|
||||||
public void onTabSelected(TabLayout.Tab tab) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabUnselected(TabLayout.Tab tab) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabReselected(TabLayout.Tab tab) {
|
|
||||||
scrollToTop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
pager.setOffscreenPageLimit(4);
|
pager.setOffscreenPageLimit(4);
|
||||||
pager.setUserInputEnabled(!GlobalUserPreferences.disableSwipe);
|
pager.setUserInputEnabled(!GlobalUserPreferences.disableSwipe);
|
||||||
@@ -161,9 +149,15 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
|||||||
mentionsFragment=new NotificationsListFragment();
|
mentionsFragment=new NotificationsListFragment();
|
||||||
mentionsFragment.setArguments(args);
|
mentionsFragment.setArguments(args);
|
||||||
|
|
||||||
|
args=new Bundle(args);
|
||||||
|
args.putBoolean("onlyPosts", true);
|
||||||
|
postsFragment=new NotificationsListFragment();
|
||||||
|
postsFragment.setArguments(args);
|
||||||
|
|
||||||
getChildFragmentManager().beginTransaction()
|
getChildFragmentManager().beginTransaction()
|
||||||
.add(R.id.notifications_all, allNotificationsFragment)
|
.add(R.id.notifications_all, allNotificationsFragment)
|
||||||
.add(R.id.notifications_mentions, mentionsFragment)
|
.add(R.id.notifications_mentions, mentionsFragment)
|
||||||
|
.add(R.id.notifications_posts, postsFragment)
|
||||||
.commit();
|
.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,6 +167,7 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
|||||||
tab.setText(switch(position){
|
tab.setText(switch(position){
|
||||||
case 0 -> R.string.all_notifications;
|
case 0 -> R.string.all_notifications;
|
||||||
case 1 -> R.string.mentions;
|
case 1 -> R.string.mentions;
|
||||||
|
case 2 -> R.string.posts;
|
||||||
default -> throw new IllegalStateException("Unexpected value: "+position);
|
default -> throw new IllegalStateException("Unexpected value: "+position);
|
||||||
});
|
});
|
||||||
tab.view.textView.setAllCaps(true);
|
tab.view.textView.setAllCaps(true);
|
||||||
@@ -187,7 +182,6 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
|||||||
new GetFollowRequests(null, 1).setCallback(new Callback<>() {
|
new GetFollowRequests(null, 1).setCallback(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(HeaderPaginationList<Account> accounts) {
|
public void onSuccess(HeaderPaginationList<Account> accounts) {
|
||||||
if (getActivity() == null) return;
|
|
||||||
getToolbar().getMenu().findItem(R.id.follow_requests).setVisible(!accounts.isEmpty());
|
getToolbar().getMenu().findItem(R.id.follow_requests).setVisible(!accounts.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,13 +210,13 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
|||||||
protected void updateToolbar(){
|
protected void updateToolbar(){
|
||||||
super.updateToolbar();
|
super.updateToolbar();
|
||||||
getToolbar().setOutlineProvider(null);
|
getToolbar().setOutlineProvider(null);
|
||||||
getToolbar().setOnClickListener(v->scrollToTop());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private NotificationsListFragment getFragmentForPage(int page){
|
private NotificationsListFragment getFragmentForPage(int page){
|
||||||
return switch(page){
|
return switch(page){
|
||||||
case 0 -> allNotificationsFragment;
|
case 0 -> allNotificationsFragment;
|
||||||
case 1 -> mentionsFragment;
|
case 1 -> mentionsFragment;
|
||||||
|
case 2 -> postsFragment;
|
||||||
default -> throw new IllegalStateException("Unexpected value: "+page);
|
default -> throw new IllegalStateException("Unexpected value: "+page);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -243,7 +237,7 @@ public class NotificationsFragment extends MastodonToolbarFragment implements Sc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount(){
|
public int getItemCount(){
|
||||||
return 2;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class PinnableStatusListFragment extends StatusListFragment {
|
public abstract class PinnableStatusListFragment extends StatusListFragment {
|
||||||
|
protected boolean pinnedUpdated;
|
||||||
protected List<TimelineDefinition> pinnedTimelines;
|
protected List<TimelineDefinition> pinnedTimelines;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -53,7 +54,7 @@ public abstract class PinnableStatusListFragment extends StatusListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void togglePin(MenuItem pin) {
|
protected void togglePin(MenuItem pin) {
|
||||||
onPinnedUpdated(true);
|
pinnedUpdated = true;
|
||||||
getToolbar().performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK);
|
getToolbar().performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK);
|
||||||
TimelineDefinition def = makeTimelineDefinition();
|
TimelineDefinition def = makeTimelineDefinition();
|
||||||
boolean pinned = isPinned();
|
boolean pinned = isPinned();
|
||||||
@@ -65,5 +66,17 @@ public abstract class PinnableStatusListFragment extends StatusListFragment {
|
|||||||
updatePinButton(pin);
|
updatePinButton(pin);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPinnedUpdated(boolean pinned) {}
|
protected Bundle getResultArgs() {
|
||||||
|
return new Bundle();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
Bundle resultArgs = getResultArgs();
|
||||||
|
if (pinnedUpdated) {
|
||||||
|
resultArgs.putBoolean("pinnedUpdated", true);
|
||||||
|
setResult(true, resultArgs);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.joinmastodon.android.fragments;
|
package org.joinmastodon.android.fragments;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
@@ -12,11 +13,23 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowInsets;
|
import android.view.WindowInsets;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
|
import org.joinmastodon.android.api.requests.accounts.SetPrivateNote;
|
||||||
import org.joinmastodon.android.model.AccountField;
|
import org.joinmastodon.android.model.AccountField;
|
||||||
|
import org.joinmastodon.android.model.Relationship;
|
||||||
import org.joinmastodon.android.ui.BetterItemAnimator;
|
import org.joinmastodon.android.ui.BetterItemAnimator;
|
||||||
import org.joinmastodon.android.ui.text.CustomEmojiSpan;
|
import org.joinmastodon.android.ui.text.CustomEmojiSpan;
|
||||||
import org.joinmastodon.android.ui.utils.SimpleTextWatcher;
|
import org.joinmastodon.android.ui.utils.SimpleTextWatcher;
|
||||||
@@ -26,11 +39,8 @@ import org.joinmastodon.android.ui.views.LinkedTextView;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import me.grishka.appkit.api.Callback;
|
||||||
import androidx.annotation.Nullable;
|
import me.grishka.appkit.api.ErrorResponse;
|
||||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import me.grishka.appkit.fragments.WindowInsetsAwareFragment;
|
import me.grishka.appkit.fragments.WindowInsetsAwareFragment;
|
||||||
import me.grishka.appkit.imageloader.ImageLoaderRecyclerAdapter;
|
import me.grishka.appkit.imageloader.ImageLoaderRecyclerAdapter;
|
||||||
import me.grishka.appkit.imageloader.ImageLoaderViewHolder;
|
import me.grishka.appkit.imageloader.ImageLoaderViewHolder;
|
||||||
@@ -46,6 +56,11 @@ public class ProfileAboutFragment extends Fragment implements WindowInsetsAwareF
|
|||||||
private static final int MAX_FIELDS=4;
|
private static final int MAX_FIELDS=4;
|
||||||
|
|
||||||
public UsableRecyclerView list;
|
public UsableRecyclerView list;
|
||||||
|
public FrameLayout noteWrap;
|
||||||
|
public EditText noteEdit;
|
||||||
|
private String accountID;
|
||||||
|
private String profileAccountID;
|
||||||
|
private String note;
|
||||||
private List<AccountField> fields=Collections.emptyList();
|
private List<AccountField> fields=Collections.emptyList();
|
||||||
private AboutAdapter adapter;
|
private AboutAdapter adapter;
|
||||||
private Paint dividerPaint=new Paint();
|
private Paint dividerPaint=new Paint();
|
||||||
@@ -64,11 +79,49 @@ public class ProfileAboutFragment extends Fragment implements WindowInsetsAwareF
|
|||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setNote(String note, String accountID, String profileAccountID){
|
||||||
|
this.note=note;
|
||||||
|
this.accountID=accountID;
|
||||||
|
this.profileAccountID=profileAccountID;
|
||||||
|
// noteWrap.setVisibility(View.VISIBLE);
|
||||||
|
// noteEdit.setVisibility(View.VISIBLE);
|
||||||
|
// noteEdit.setText(note);
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState){
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState){
|
||||||
list=new UsableRecyclerView(getActivity());
|
View view = inflater.inflate(R.layout.fragment_profile_about, null);
|
||||||
list.setId(R.id.list);
|
|
||||||
|
noteEdit = view.findViewById(R.id.note_edit);
|
||||||
|
noteWrap = view.findViewById(R.id.note_edit_wrap);
|
||||||
|
ImageButton noteEditConfirm = view.findViewById(R.id.note_edit_confirm);
|
||||||
|
|
||||||
|
|
||||||
|
noteEdit.setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
|
if (hasFocus) {
|
||||||
|
noteEditConfirm.setVisibility(View.VISIBLE);
|
||||||
|
noteEditConfirm.animate()
|
||||||
|
.alpha(1.0f)
|
||||||
|
.setDuration(700);
|
||||||
|
} else {
|
||||||
|
noteEditConfirm.animate()
|
||||||
|
.alpha(0.0f)
|
||||||
|
.setDuration(700);
|
||||||
|
noteEditConfirm.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
noteEditConfirm.setOnClickListener((v -> {
|
||||||
|
if (!noteEdit.getText().toString().trim().equals(note)) {
|
||||||
|
savePrivateNote();
|
||||||
|
}
|
||||||
|
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||||
|
imm.hideSoftInputFromWindow(this.getView().getRootView().getWindowToken(), 0);
|
||||||
|
noteEdit.clearFocus();
|
||||||
|
}));
|
||||||
|
|
||||||
|
list = view.findViewById(R.id.list);
|
||||||
list.setItemAnimator(new BetterItemAnimator());
|
list.setItemAnimator(new BetterItemAnimator());
|
||||||
list.setDrawSelectorOnTop(true);
|
list.setDrawSelectorOnTop(true);
|
||||||
list.setLayoutManager(new LinearLayoutManager(getActivity()));
|
list.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
@@ -95,8 +148,20 @@ public class ProfileAboutFragment extends Fragment implements WindowInsetsAwareF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return list;
|
return view;
|
||||||
}
|
}
|
||||||
|
private void savePrivateNote(){
|
||||||
|
new SetPrivateNote(profileAccountID, noteEdit.getText().toString()).setCallback(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Relationship result) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(ErrorResponse result) {
|
||||||
|
Toast.makeText(getActivity(), getString(R.string.mo_personal_note_update_failed), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}).exec(accountID);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void enterEditMode(List<AccountField> editableFields){
|
public void enterEditMode(List<AccountField> editableFields){
|
||||||
isInEditMode=true;
|
isInEditMode=true;
|
||||||
|
|||||||
@@ -19,26 +19,36 @@ import android.os.Bundle;
|
|||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.style.ImageSpan;
|
import android.text.style.ImageSpan;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ViewOutlineProvider;
|
import android.view.ViewOutlineProvider;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.WindowInsets;
|
import android.view.WindowInsets;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.view.animation.TranslateAnimation;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
import android.widget.Toolbar;
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
import androidx.viewpager2.widget.ViewPager2;
|
||||||
|
|
||||||
import org.joinmastodon.android.GlobalUserPreferences;
|
import org.joinmastodon.android.GlobalUserPreferences;
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.requests.accounts.GetAccountByID;
|
import org.joinmastodon.android.api.requests.accounts.GetAccountByID;
|
||||||
@@ -46,6 +56,7 @@ import org.joinmastodon.android.api.requests.accounts.GetAccountRelationships;
|
|||||||
import org.joinmastodon.android.api.requests.accounts.GetAccountStatuses;
|
import org.joinmastodon.android.api.requests.accounts.GetAccountStatuses;
|
||||||
import org.joinmastodon.android.api.requests.accounts.GetOwnAccount;
|
import org.joinmastodon.android.api.requests.accounts.GetOwnAccount;
|
||||||
import org.joinmastodon.android.api.requests.accounts.SetAccountFollowed;
|
import org.joinmastodon.android.api.requests.accounts.SetAccountFollowed;
|
||||||
|
import org.joinmastodon.android.api.requests.accounts.SetPrivateNote;
|
||||||
import org.joinmastodon.android.api.requests.accounts.UpdateAccountCredentials;
|
import org.joinmastodon.android.api.requests.accounts.UpdateAccountCredentials;
|
||||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.fragments.account_list.FollowerListFragment;
|
import org.joinmastodon.android.fragments.account_list.FollowerListFragment;
|
||||||
@@ -131,6 +142,9 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
private TextView followsYouView;
|
private TextView followsYouView;
|
||||||
private ViewGroup rolesView;
|
private ViewGroup rolesView;
|
||||||
|
|
||||||
|
public FrameLayout noteWrap;
|
||||||
|
public EditText noteEdit;
|
||||||
|
private String note;
|
||||||
private Account account;
|
private Account account;
|
||||||
private String accountID;
|
private String accountID;
|
||||||
private Relationship relationship;
|
private Relationship relationship;
|
||||||
@@ -142,10 +156,11 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
private Uri editNewAvatar, editNewCover;
|
private Uri editNewAvatar, editNewCover;
|
||||||
private String profileAccountID;
|
private String profileAccountID;
|
||||||
private boolean refreshing;
|
private boolean refreshing;
|
||||||
private View fab;
|
private ImageButton fab;
|
||||||
private WindowInsets childInsets;
|
private WindowInsets childInsets;
|
||||||
private PhotoViewer currentPhotoViewer;
|
private PhotoViewer currentPhotoViewer;
|
||||||
private boolean editModeLoading;
|
private boolean editModeLoading;
|
||||||
|
protected int scrollDiff = 0;
|
||||||
|
|
||||||
private static final int MAX_FIELDS=4;
|
private static final int MAX_FIELDS=4;
|
||||||
|
|
||||||
@@ -211,6 +226,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
followingCount=content.findViewById(R.id.following_count);
|
followingCount=content.findViewById(R.id.following_count);
|
||||||
followingLabel=content.findViewById(R.id.following_label);
|
followingLabel=content.findViewById(R.id.following_label);
|
||||||
followingBtn=content.findViewById(R.id.following_btn);
|
followingBtn=content.findViewById(R.id.following_btn);
|
||||||
|
|
||||||
postsCount=content.findViewById(R.id.posts_count);
|
postsCount=content.findViewById(R.id.posts_count);
|
||||||
postsLabel=content.findViewById(R.id.posts_label);
|
postsLabel=content.findViewById(R.id.posts_label);
|
||||||
postsBtn=content.findViewById(R.id.posts_btn);
|
postsBtn=content.findViewById(R.id.posts_btn);
|
||||||
@@ -229,6 +245,10 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
list=content.findViewById(R.id.metadata);
|
list=content.findViewById(R.id.metadata);
|
||||||
rolesView=content.findViewById(R.id.roles);
|
rolesView=content.findViewById(R.id.roles);
|
||||||
|
|
||||||
|
noteEdit = content.findViewById(R.id.note_edit);
|
||||||
|
noteWrap = content.findViewById(R.id.note_edit_wrap);
|
||||||
|
Button noteEditConfirm = content.findViewById(R.id.note_edit_confirm);
|
||||||
|
|
||||||
avatar.setOutlineProvider(new ViewOutlineProvider(){
|
avatar.setOutlineProvider(new ViewOutlineProvider(){
|
||||||
@Override
|
@Override
|
||||||
public void getOutline(View view, Outline outline){
|
public void getOutline(View view, Outline outline){
|
||||||
@@ -237,6 +257,49 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
});
|
});
|
||||||
avatar.setClipToOutline(true);
|
avatar.setClipToOutline(true);
|
||||||
|
|
||||||
|
noteEdit.setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
|
if (hasFocus) {
|
||||||
|
fab.setVisibility(View.INVISIBLE);
|
||||||
|
TranslateAnimation animate = new TranslateAnimation(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
fab.getHeight() * 2);
|
||||||
|
animate.setDuration(300);
|
||||||
|
animate.setFillAfter(true);
|
||||||
|
fab.startAnimation(animate);
|
||||||
|
|
||||||
|
noteEditConfirm.setVisibility(View.VISIBLE);
|
||||||
|
noteEditConfirm.animate()
|
||||||
|
.alpha(1.0f)
|
||||||
|
.setDuration(700);
|
||||||
|
} else {
|
||||||
|
fab.setVisibility(View.VISIBLE);
|
||||||
|
TranslateAnimation animate = new TranslateAnimation(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
fab.getHeight() * 2,
|
||||||
|
0);
|
||||||
|
animate.setDuration(300);
|
||||||
|
animate.setFillAfter(true);
|
||||||
|
fab.startAnimation(animate);
|
||||||
|
|
||||||
|
noteEditConfirm.animate()
|
||||||
|
.alpha(0.0f)
|
||||||
|
.setDuration(700);
|
||||||
|
noteEditConfirm.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
noteEditConfirm.setOnClickListener((v -> {
|
||||||
|
if (!noteEdit.getText().toString().trim().equals(note)) {
|
||||||
|
savePrivateNote();
|
||||||
|
}
|
||||||
|
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||||
|
imm.hideSoftInputFromWindow(this.getView().getRootView().getWindowToken(), 0);
|
||||||
|
noteEdit.clearFocus();
|
||||||
|
}));
|
||||||
|
|
||||||
FrameLayout sizeWrapper=new FrameLayout(getActivity()){
|
FrameLayout sizeWrapper=new FrameLayout(getActivity()){
|
||||||
@Override
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){
|
||||||
@@ -336,6 +399,25 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
return sizeWrapper;
|
return sizeWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setNote(String note){
|
||||||
|
this.note=note;
|
||||||
|
noteWrap.setVisibility(View.VISIBLE);
|
||||||
|
noteEdit.setVisibility(View.VISIBLE);
|
||||||
|
noteEdit.setText(note);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void savePrivateNote(){
|
||||||
|
new SetPrivateNote(profileAccountID, noteEdit.getText().toString()).setCallback(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Relationship result) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(ErrorResponse result) {
|
||||||
|
Toast.makeText(getActivity(), getString(R.string.mo_personal_note_update_failed), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}).exec(accountID);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doLoadData(){
|
protected void doLoadData(){
|
||||||
currentRequest=new GetAccountByID(profileAccountID)
|
currentRequest=new GetAccountByID(profileAccountID)
|
||||||
@@ -373,6 +455,11 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh(){
|
public void onRefresh(){
|
||||||
|
if(isInEditMode){
|
||||||
|
refreshing=false;
|
||||||
|
refreshLayout.setRefreshing(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(refreshing)
|
if(refreshing)
|
||||||
return;
|
return;
|
||||||
refreshing=true;
|
refreshing=true;
|
||||||
@@ -497,6 +584,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
|
|
||||||
boolean isSelf=AccountSessionManager.getInstance().isSelf(accountID, account);
|
boolean isSelf=AccountSessionManager.getInstance().isSelf(accountID, account);
|
||||||
|
|
||||||
|
|
||||||
if(account.locked){
|
if(account.locked){
|
||||||
ssb=new SpannableStringBuilder("@");
|
ssb=new SpannableStringBuilder("@");
|
||||||
ssb.append(account.acct);
|
ssb.append(account.acct);
|
||||||
@@ -510,6 +598,19 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
lock.setTint(username.getCurrentTextColor());
|
lock.setTint(username.getCurrentTextColor());
|
||||||
ssb.append(getString(R.string.manually_approves_followers), new ImageSpan(lock, ImageSpan.ALIGN_BASELINE), 0);
|
ssb.append(getString(R.string.manually_approves_followers), new ImageSpan(lock, ImageSpan.ALIGN_BASELINE), 0);
|
||||||
username.setText(ssb);
|
username.setText(ssb);
|
||||||
|
}else if(account.bot){
|
||||||
|
ssb=new SpannableStringBuilder("@");
|
||||||
|
ssb.append(account.acct);
|
||||||
|
if(isSelf){
|
||||||
|
ssb.append('@');
|
||||||
|
ssb.append(AccountSessionManager.getInstance().getAccount(accountID).domain);
|
||||||
|
}
|
||||||
|
ssb.append(" ");
|
||||||
|
Drawable botIcon=username.getResources().getDrawable(R.drawable.ic_bot, getActivity().getTheme()).mutate();
|
||||||
|
botIcon.setBounds(0, 0, botIcon.getIntrinsicWidth(), botIcon.getIntrinsicHeight());
|
||||||
|
botIcon.setTint(username.getCurrentTextColor());
|
||||||
|
ssb.append(getString(R.string.manually_approves_followers), new ImageSpan(botIcon, ImageSpan.ALIGN_BASELINE), 0);
|
||||||
|
username.setText(ssb);
|
||||||
}else{
|
}else{
|
||||||
// noinspection SetTextI18n
|
// noinspection SetTextI18n
|
||||||
username.setText('@'+account.acct+(isSelf ? ('@'+AccountSessionManager.getInstance().getAccount(accountID).domain) : ""));
|
username.setText('@'+account.acct+(isSelf ? ('@'+AccountSessionManager.getInstance().getAccount(accountID).domain) : ""));
|
||||||
@@ -521,6 +622,8 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
bio.setVisibility(View.VISIBLE);
|
bio.setVisibility(View.VISIBLE);
|
||||||
bio.setText(parsedBio);
|
bio.setText(parsedBio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
followersCount.setText(UiUtils.abbreviateNumber(account.followersCount));
|
followersCount.setText(UiUtils.abbreviateNumber(account.followersCount));
|
||||||
followingCount.setText(UiUtils.abbreviateNumber(account.followingCount));
|
followingCount.setText(UiUtils.abbreviateNumber(account.followingCount));
|
||||||
postsCount.setText(UiUtils.abbreviateNumber(account.statusesCount));
|
postsCount.setText(UiUtils.abbreviateNumber(account.statusesCount));
|
||||||
@@ -598,7 +701,11 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
if(relationship==null && !isOwnProfile)
|
if(relationship==null && !isOwnProfile)
|
||||||
return;
|
return;
|
||||||
inflater.inflate(isOwnProfile ? R.menu.profile_own : R.menu.profile, menu);
|
inflater.inflate(isOwnProfile ? R.menu.profile_own : R.menu.profile, menu);
|
||||||
UiUtils.enableOptionsMenuIcons(getActivity(), menu, R.id.bookmarks, R.id.followed_hashtags);
|
if(isOwnProfile){
|
||||||
|
UiUtils.enableOptionsMenuIcons(getActivity(), menu, R.id.scheduled, R.id.bookmarks, R.id.favorites);
|
||||||
|
}else{
|
||||||
|
UiUtils.enableOptionsMenuIcons(getActivity(), menu, R.id.bookmarks, R.id.followed_hashtags, R.id.favorites, R.id.scheduled);
|
||||||
|
}
|
||||||
menu.findItem(R.id.share).setTitle(getString(R.string.share_user, account.getShortUsername()));
|
menu.findItem(R.id.share).setTitle(getString(R.string.share_user, account.getShortUsername()));
|
||||||
if(isOwnProfile)
|
if(isOwnProfile)
|
||||||
return;
|
return;
|
||||||
@@ -731,9 +838,17 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
notifyProgress.setIndeterminateTintList(notifyButton.getTextColors());
|
notifyProgress.setIndeterminateTintList(notifyButton.getTextColors());
|
||||||
followsYouView.setVisibility(relationship.followedBy ? View.VISIBLE : View.GONE);
|
followsYouView.setVisibility(relationship.followedBy ? View.VISIBLE : View.GONE);
|
||||||
notifyButton.setSelected(relationship.notifying);
|
notifyButton.setSelected(relationship.notifying);
|
||||||
|
if (!isOwnProfile) {
|
||||||
|
setNote(relationship.note);
|
||||||
|
// aboutFragment.setNote(relationship.note, accountID, profileAccountID);
|
||||||
|
}
|
||||||
notifyButton.setContentDescription(getString(relationship.notifying ? R.string.sk_user_post_notifications_on : R.string.sk_user_post_notifications_off, '@'+account.username));
|
notifyButton.setContentDescription(getString(relationship.notifying ? R.string.sk_user_post_notifications_on : R.string.sk_user_post_notifications_off, '@'+account.username));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImageButton getFab() {
|
||||||
|
return fab;
|
||||||
|
}
|
||||||
|
|
||||||
private void onScrollChanged(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY){
|
private void onScrollChanged(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY){
|
||||||
int topBarsH=getToolbar().getHeight()+statusBarHeight;
|
int topBarsH=getToolbar().getHeight()+statusBarHeight;
|
||||||
if(scrollY>avatarBorder.getTop()-topBarsH){
|
if(scrollY>avatarBorder.getTop()-topBarsH){
|
||||||
@@ -764,6 +879,36 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
if(currentPhotoViewer!=null){
|
if(currentPhotoViewer!=null){
|
||||||
currentPhotoViewer.offsetView(0, oldScrollY-scrollY);
|
currentPhotoViewer.offsetView(0, oldScrollY-scrollY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dy = scrollY - oldScrollY;
|
||||||
|
|
||||||
|
if (dy > 0 && fab.getVisibility() == View.VISIBLE) {
|
||||||
|
TranslateAnimation animate = new TranslateAnimation(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
fab.getHeight() * 2);
|
||||||
|
animate.setDuration(300);
|
||||||
|
animate.setFillAfter(true);
|
||||||
|
fab.startAnimation(animate);
|
||||||
|
fab.setVisibility(View.INVISIBLE);
|
||||||
|
scrollDiff = 0;
|
||||||
|
} else if (dy < 0 && fab.getVisibility() != View.VISIBLE) {
|
||||||
|
if (scrollDiff > 400) {
|
||||||
|
fab.setVisibility(View.VISIBLE);
|
||||||
|
TranslateAnimation animate = new TranslateAnimation(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
fab.getHeight() * 2,
|
||||||
|
0);
|
||||||
|
animate.setDuration(300);
|
||||||
|
animate.setFillAfter(true);
|
||||||
|
fab.startAnimation(animate);
|
||||||
|
scrollDiff = 0;
|
||||||
|
} else {
|
||||||
|
scrollDiff += Math.abs(dy);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Fragment getFragmentForPage(int page){
|
private Fragment getFragmentForPage(int page){
|
||||||
@@ -957,6 +1102,9 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBackPressed(){
|
public boolean onBackPressed(){
|
||||||
|
if(noteEdit.hasFocus()) {
|
||||||
|
savePrivateNote();
|
||||||
|
}
|
||||||
if(isInEditMode){
|
if(isInEditMode){
|
||||||
exitEditMode();
|
exitEditMode();
|
||||||
return true;
|
return true;
|
||||||
@@ -1207,6 +1355,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
|
|
||||||
private class EditableAboutViewHolder extends BaseViewHolder {
|
private class EditableAboutViewHolder extends BaseViewHolder {
|
||||||
private EditText title;
|
private EditText title;
|
||||||
|
private boolean titleHasFocus, valueHasFocus;
|
||||||
private EditText value;
|
private EditText value;
|
||||||
|
|
||||||
public EditableAboutViewHolder(){
|
public EditableAboutViewHolder(){
|
||||||
@@ -1218,7 +1367,19 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
title.addTextChangedListener(new SimpleTextWatcher(e->item.name=e.toString()));
|
title.addTextChangedListener(new SimpleTextWatcher(e->item.name=e.toString()));
|
||||||
|
title.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
titleHasFocus = hasFocus;
|
||||||
|
}
|
||||||
|
});
|
||||||
value.addTextChangedListener(new SimpleTextWatcher(e->item.value=e.toString()));
|
value.addTextChangedListener(new SimpleTextWatcher(e->item.value=e.toString()));
|
||||||
|
value.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
valueHasFocus = hasFocus;
|
||||||
|
}
|
||||||
|
});
|
||||||
findViewById(R.id.remove_row_btn).setOnClickListener(this::onRemoveRowClick);
|
findViewById(R.id.remove_row_btn).setOnClickListener(this::onRemoveRowClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1229,6 +1390,10 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onRemoveRowClick(View v){
|
private void onRemoveRowClick(View v){
|
||||||
|
if(titleHasFocus || valueHasFocus){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int pos=getAbsoluteAdapterPosition();
|
int pos=getAbsoluteAdapterPosition();
|
||||||
metadataListData.remove(pos);
|
metadataListData.remove(pos);
|
||||||
adapter.notifyItemRemoved(pos);
|
adapter.notifyItemRemoved(pos);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import org.joinmastodon.android.api.requests.statuses.CreateStatus;
|
|||||||
import org.joinmastodon.android.api.requests.statuses.GetScheduledStatuses;
|
import org.joinmastodon.android.api.requests.statuses.GetScheduledStatuses;
|
||||||
import org.joinmastodon.android.events.ScheduledStatusCreatedEvent;
|
import org.joinmastodon.android.events.ScheduledStatusCreatedEvent;
|
||||||
import org.joinmastodon.android.events.ScheduledStatusDeletedEvent;
|
import org.joinmastodon.android.events.ScheduledStatusDeletedEvent;
|
||||||
|
import org.joinmastodon.android.model.Filter;
|
||||||
import org.joinmastodon.android.model.HeaderPaginationList;
|
import org.joinmastodon.android.model.HeaderPaginationList;
|
||||||
import org.joinmastodon.android.model.ScheduledStatus;
|
import org.joinmastodon.android.model.ScheduledStatus;
|
||||||
import org.joinmastodon.android.model.Status;
|
import org.joinmastodon.android.model.Status;
|
||||||
@@ -79,7 +80,7 @@ public class ScheduledStatusListFragment extends BaseStatusListFragment<Schedule
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<StatusDisplayItem> buildDisplayItems(ScheduledStatus s) {
|
protected List<StatusDisplayItem> buildDisplayItems(ScheduledStatus s) {
|
||||||
return StatusDisplayItem.buildItems(this, s.toStatus(), accountID, s, knownAccounts, false, false, null, true);
|
return StatusDisplayItem.buildItems(this, s.toStatus(), accountID, s, knownAccounts, false, false, null, true, Filter.FilterContext.HOME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import android.view.WindowInsets;
|
|||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.animation.LinearInterpolator;
|
import android.view.animation.LinearInterpolator;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
@@ -55,7 +57,6 @@ import org.joinmastodon.android.model.PushSubscription;
|
|||||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||||
import org.joinmastodon.android.ui.OutlineProviders;
|
import org.joinmastodon.android.ui.OutlineProviders;
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
import org.joinmastodon.android.ui.views.TextInputFrameLayout;
|
|
||||||
import org.joinmastodon.android.updater.GithubSelfUpdater;
|
import org.joinmastodon.android.updater.GithubSelfUpdater;
|
||||||
import org.parceler.Parcels;
|
import org.parceler.Parcels;
|
||||||
|
|
||||||
@@ -113,6 +114,21 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
items.add(new HeaderItem(R.string.settings_theme));
|
items.add(new HeaderItem(R.string.settings_theme));
|
||||||
items.add(themeItem=new ThemeItem());
|
items.add(themeItem=new ThemeItem());
|
||||||
items.add(new SwitchItem(R.string.theme_true_black, R.drawable.ic_fluent_dark_theme_24_regular, GlobalUserPreferences.trueBlackTheme, this::onTrueBlackThemeChanged));
|
items.add(new SwitchItem(R.string.theme_true_black, R.drawable.ic_fluent_dark_theme_24_regular, GlobalUserPreferences.trueBlackTheme, this::onTrueBlackThemeChanged));
|
||||||
|
items.add(new SwitchItem(R.string.sk_disable_marquee, R.drawable.ic_fluent_text_more_24_regular, GlobalUserPreferences.disableMarquee, i->{
|
||||||
|
GlobalUserPreferences.disableMarquee=i.checked;
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
}));
|
||||||
|
items.add(new SwitchItem(R.string.sk_settings_uniform_icon_for_notifications, R.drawable.ic_ntf_logo, GlobalUserPreferences.uniformNotificationIcon, i->{
|
||||||
|
GlobalUserPreferences.uniformNotificationIcon=i.checked;
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
}));
|
||||||
|
items.add(new SwitchItem(R.string.sk_settings_reduce_motion, R.drawable.ic_fluent_star_emphasis_24_regular, GlobalUserPreferences.reduceMotion, i->{
|
||||||
|
GlobalUserPreferences.reduceMotion=i.checked;
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
needAppRestart=true;
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
items.add(new ButtonItem(R.string.sk_settings_color_palette, R.drawable.ic_fluent_color_24_regular, b->{
|
items.add(new ButtonItem(R.string.sk_settings_color_palette, R.drawable.ic_fluent_color_24_regular, b->{
|
||||||
PopupMenu popupMenu=new PopupMenu(getActivity(), b, Gravity.CENTER_HORIZONTAL);
|
PopupMenu popupMenu=new PopupMenu(getActivity(), b, Gravity.CENTER_HORIZONTAL);
|
||||||
popupMenu.inflate(R.menu.color_palettes);
|
popupMenu.inflate(R.menu.color_palettes);
|
||||||
@@ -129,20 +145,29 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
case BROWN -> R.string.sk_color_palette_brown;
|
case BROWN -> R.string.sk_color_palette_brown;
|
||||||
case RED -> R.string.sk_color_palette_red;
|
case RED -> R.string.sk_color_palette_red;
|
||||||
case YELLOW -> R.string.sk_color_palette_yellow;
|
case YELLOW -> R.string.sk_color_palette_yellow;
|
||||||
|
case NORD -> R.string.mo_color_palette_nord;
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
items.add(new ButtonItem(R.string.sk_settings_publish_button_text, R.drawable.ic_fluent_send_24_regular, b->{
|
items.add(new ButtonItem(R.string.sk_settings_publish_button_text, R.drawable.ic_fluent_send_24_regular, b-> {
|
||||||
updatePublishText(b);
|
updatePublishText(b);
|
||||||
|
if (GlobalUserPreferences.relocatePublishButton) {
|
||||||
b.setOnClickListener(l->{
|
b.setOnClickListener(l -> {
|
||||||
TextInputFrameLayout input = new TextInputFrameLayout(
|
Toast.makeText(getActivity(), R.string.mo_disable_relocate_publish_button_to_enable_customization,
|
||||||
getContext(),
|
Toast.LENGTH_LONG).show();
|
||||||
getString(R.string.publish),
|
});
|
||||||
GlobalUserPreferences.publishButtonText.trim()
|
} else {
|
||||||
);
|
b.setOnClickListener(l -> {
|
||||||
new M3AlertDialogBuilder(getContext()).setTitle(R.string.sk_settings_publish_button_text_title).setView(input)
|
FrameLayout inputWrap = new FrameLayout(getContext());
|
||||||
|
EditText input = new EditText(getContext());
|
||||||
|
input.setHint(R.string.publish);
|
||||||
|
input.setText(GlobalUserPreferences.publishButtonText.trim());
|
||||||
|
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
|
params.setMargins(V.dp(16), V.dp(4), V.dp(16), V.dp(16));
|
||||||
|
input.setLayoutParams(params);
|
||||||
|
inputWrap.addView(input);
|
||||||
|
new M3AlertDialogBuilder(getContext()).setTitle(R.string.sk_settings_publish_button_text_title).setView(inputWrap)
|
||||||
.setPositiveButton(R.string.save, (d, which) -> {
|
.setPositiveButton(R.string.save, (d, which) -> {
|
||||||
GlobalUserPreferences.publishButtonText = input.getEditText().getText().toString().trim();
|
GlobalUserPreferences.publishButtonText = input.getText().toString().trim();
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
updatePublishText(b);
|
updatePublishText(b);
|
||||||
})
|
})
|
||||||
@@ -151,21 +176,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
updatePublishText(b);
|
updatePublishText(b);
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.cancel, (d, which) -> {})
|
.setNegativeButton(R.string.cancel, (d, which) -> {
|
||||||
|
})
|
||||||
.show();
|
.show();
|
||||||
});
|
});}
|
||||||
}));
|
|
||||||
items.add(new SwitchItem(R.string.sk_settings_uniform_icon_for_notifications, R.drawable.ic_ntf_logo, GlobalUserPreferences.uniformNotificationIcon, i->{
|
|
||||||
GlobalUserPreferences.uniformNotificationIcon=i.checked;
|
|
||||||
GlobalUserPreferences.save();
|
|
||||||
}));
|
|
||||||
items.add(new SwitchItem(R.string.sk_disable_marquee, R.drawable.ic_fluent_text_more_24_regular, GlobalUserPreferences.disableMarquee, i->{
|
|
||||||
GlobalUserPreferences.disableMarquee=i.checked;
|
|
||||||
GlobalUserPreferences.save();
|
|
||||||
}));
|
|
||||||
items.add(new SwitchItem(R.string.sk_settings_reduce_motion, R.drawable.ic_fluent_star_emphasis_24_regular, GlobalUserPreferences.reduceMotion, i->{
|
|
||||||
GlobalUserPreferences.reduceMotion=i.checked;
|
|
||||||
GlobalUserPreferences.save();
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
items.add(new HeaderItem(R.string.settings_behavior));
|
items.add(new HeaderItem(R.string.settings_behavior));
|
||||||
@@ -195,8 +209,19 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
needAppRestart=true;
|
needAppRestart=true;
|
||||||
}));
|
}));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_disable_alt_text_reminder, R.drawable.ic_fluent_image_alt_text_24_regular, GlobalUserPreferences.disableAltTextReminder, i->{
|
// items.add(new SwitchItem(R.string.sk_settings_show_differentiated_notification_icons, R.drawable.ic_ntf_logo, GlobalUserPreferences.showUniformPushNoticationIcons, this::onNotificationStyleChanged));
|
||||||
GlobalUserPreferences.disableAltTextReminder=i.checked;
|
items.add(new SwitchItem(R.string.mo_disable_dividers, R.drawable.ic_fluent_timeline_24_regular, GlobalUserPreferences.disableDividers, i->{
|
||||||
|
GlobalUserPreferences.disableDividers=i.checked;
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
needAppRestart=true;
|
||||||
|
}));
|
||||||
|
items.add(new SwitchItem(R.string.mo_hide_compose_button_while_scrolling_setting, R.drawable.ic_fluent_edit_24_regular, GlobalUserPreferences.enableFabAutoHide, i->{
|
||||||
|
GlobalUserPreferences.enableFabAutoHide =i.checked;
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
needAppRestart=true;
|
||||||
|
}));
|
||||||
|
items.add(new SwitchItem(R.string.mo_relocate_publish_button, R.drawable.ic_fluent_arrow_autofit_down_24_regular, GlobalUserPreferences.relocatePublishButton, i->{
|
||||||
|
GlobalUserPreferences.relocatePublishButton=i.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_single_notification, R.drawable.ic_fluent_convert_range_24_regular, GlobalUserPreferences.keepOnlyLatestNotification, i->{
|
items.add(new SwitchItem(R.string.sk_settings_single_notification, R.drawable.ic_fluent_convert_range_24_regular, GlobalUserPreferences.keepOnlyLatestNotification, i->{
|
||||||
@@ -227,13 +252,15 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
if (list.findViewHolderForAdapterPosition(items.indexOf(showNewPostsButtonItem)) instanceof SwitchViewHolder svh) svh.rebind();
|
if (list.findViewHolderForAdapterPosition(items.indexOf(showNewPostsButtonItem)) instanceof SwitchViewHolder svh) svh.rebind();
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
items.add(showNewPostsButtonItem = new SwitchItem(R.string.sk_settings_see_new_posts_button, R.drawable.ic_fluent_arrow_up_24_regular, GlobalUserPreferences.showNewPostsButton, i->{
|
items.add(showNewPostsButtonItem = new SwitchItem(R.string.sk_settings_show_new_posts_button, R.drawable.ic_fluent_arrow_up_24_regular, GlobalUserPreferences.showNewPostsButton, i->{
|
||||||
GlobalUserPreferences.showNewPostsButton=i.checked;
|
GlobalUserPreferences.showNewPostsButton=i.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
items.add(new SwitchItem(R.string.sk_settings_show_alt_indicator, R.drawable.ic_fluent_scan_text_24_regular, GlobalUserPreferences.showAltIndicator, i->{
|
items.add(new SwitchItem(R.string.sk_settings_show_alt_indicator, R.drawable.ic_fluent_scan_text_24_regular, GlobalUserPreferences.showAltIndicator, i->{
|
||||||
GlobalUserPreferences.showAltIndicator=i.checked;
|
GlobalUserPreferences.showAltIndicator=i.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
|
needAppRestart=true;
|
||||||
}));
|
}));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_show_no_alt_indicator, R.drawable.ic_fluent_important_24_regular, GlobalUserPreferences.showNoAltIndicator, i->{
|
items.add(new SwitchItem(R.string.sk_settings_show_no_alt_indicator, R.drawable.ic_fluent_important_24_regular, GlobalUserPreferences.showNoAltIndicator, i->{
|
||||||
GlobalUserPreferences.showNoAltIndicator=i.checked;
|
GlobalUserPreferences.showNoAltIndicator=i.checked;
|
||||||
@@ -248,15 +275,12 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
needAppRestart=true;
|
needAppRestart=true;
|
||||||
}));
|
}));
|
||||||
items.add(new SwitchItem(R.string.sk_settings_translate_only_opened, R.drawable.ic_fluent_translate_24_regular, GlobalUserPreferences.translateButtonOpenedOnly, i->{
|
// items.add(new SwitchItem(R.string.sk_settings_translate_only_opened, R.drawable.ic_fluent_translate_24_regular, GlobalUserPreferences.translateButtonOpenedOnly, i->{
|
||||||
GlobalUserPreferences.translateButtonOpenedOnly=i.checked;
|
// GlobalUserPreferences.translateButtonOpenedOnly=i.checked;
|
||||||
GlobalUserPreferences.save();
|
// GlobalUserPreferences.save();
|
||||||
needAppRestart=true;
|
// needAppRestart=true;
|
||||||
}));
|
// }));
|
||||||
boolean translationAvailable = instance.v2 != null && instance.v2.configuration.translation != null && instance.v2.configuration.translation.enabled;
|
|
||||||
items.add(new SmallTextItem(getString(translationAvailable ?
|
|
||||||
R.string.sk_settings_translation_availability_note_available :
|
|
||||||
R.string.sk_settings_translation_availability_note_unavailable, instanceName)));
|
|
||||||
|
|
||||||
items.add(new HeaderItem(R.string.settings_notifications));
|
items.add(new HeaderItem(R.string.settings_notifications));
|
||||||
items.add(notificationPolicyItem=new NotificationPolicyItem());
|
items.add(notificationPolicyItem=new NotificationPolicyItem());
|
||||||
@@ -315,9 +339,27 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
glitchModeItem.enabled = GlobalUserPreferences.accountsWithLocalOnlySupport.contains(accountID);
|
glitchModeItem.enabled = GlobalUserPreferences.accountsWithLocalOnlySupport.contains(accountID);
|
||||||
items.add(new SmallTextItem(getString(R.string.sk_settings_glitch_mode_explanation)));
|
items.add(new SmallTextItem(getString(R.string.sk_settings_glitch_mode_explanation)));
|
||||||
|
|
||||||
|
|
||||||
|
boolean translationAvailable = instance.v2 != null && instance.v2.configuration.translation != null && instance.v2.configuration.translation.enabled;
|
||||||
|
items.add(new SmallTextItem(getString(translationAvailable ?
|
||||||
|
R.string.sk_settings_translation_availability_note_available :
|
||||||
|
R.string.sk_settings_translation_availability_note_unavailable, instance.title)));
|
||||||
|
|
||||||
|
|
||||||
items.add(new HeaderItem(R.string.sk_settings_about));
|
items.add(new HeaderItem(R.string.sk_settings_about));
|
||||||
items.add(new TextItem(R.string.sk_settings_contribute, ()->UiUtils.launchWebBrowser(getActivity(), "https://github.com/sk22/megalodon"), R.drawable.ic_fluent_open_24_regular));
|
|
||||||
items.add(new TextItem(R.string.sk_settings_donate, ()->UiUtils.launchWebBrowser(getActivity(), "https://ko-fi.com/xsk22"), R.drawable.ic_fluent_heart_24_regular));
|
if (GithubSelfUpdater.needSelfUpdating()) {
|
||||||
|
checkForUpdateItem = new TextItem(R.string.sk_check_for_update, GithubSelfUpdater.getInstance()::checkForUpdates);
|
||||||
|
items.add(checkForUpdateItem);
|
||||||
|
items.add(new SwitchItem(R.string.sk_updater_enable_pre_releases, 0, GlobalUserPreferences.enablePreReleases, i->{
|
||||||
|
GlobalUserPreferences.enablePreReleases=i.checked;
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
items.add(new TextItem(R.string.mo_settings_contribute, ()->UiUtils.launchWebBrowser(getActivity(), "https://github.com/LucasGGamerM/moshidon"), R.drawable.ic_fluent_open_24_regular));
|
||||||
|
items.add(new TextItem(R.string.sk_settings_donate, ()->UiUtils.launchWebBrowser(getActivity(), "https://github.com/sponsors/LucasGGamerM"), R.drawable.ic_fluent_heart_24_regular));
|
||||||
|
|
||||||
LruCache<?, ?> cache = imageCache == null ? null : imageCache.getLruCache();
|
LruCache<?, ?> cache = imageCache == null ? null : imageCache.getLruCache();
|
||||||
clearImageCacheItem = new TextItem(R.string.settings_clear_cache, UiUtils.formatFileSize(getContext(), cache != null ? cache.size() : 0, true), this::clearImageCache, 0);
|
clearImageCacheItem = new TextItem(R.string.settings_clear_cache, UiUtils.formatFileSize(getContext(), cache != null ? cache.size() : 0, true), this::clearImageCache, 0);
|
||||||
items.add(clearImageCacheItem);
|
items.add(clearImageCacheItem);
|
||||||
@@ -325,14 +367,12 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
GlobalUserPreferences.recentLanguages.remove(accountID);
|
GlobalUserPreferences.recentLanguages.remove(accountID);
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
})));
|
})));
|
||||||
if (GithubSelfUpdater.needSelfUpdating()) {
|
|
||||||
items.add(new SwitchItem(R.string.sk_updater_enable_pre_releases, 0, GlobalUserPreferences.enablePreReleases, i->{
|
items.add(new TextItem(R.string.mo_clear_recent_emoji, ()-> {
|
||||||
GlobalUserPreferences.enablePreReleases=i.checked;
|
GlobalUserPreferences.recentEmojis.clear();
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
}));
|
}));
|
||||||
checkForUpdateItem = new TextItem(R.string.sk_check_for_update, GithubSelfUpdater.getInstance()::checkForUpdates);
|
// items.add(new TextItem(R.string.log_out, this::confirmLogOut));
|
||||||
items.add(checkForUpdateItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(BuildConfig.DEBUG){
|
if(BuildConfig.DEBUG){
|
||||||
items.add(new RedHeaderItem("Debug options"));
|
items.add(new RedHeaderItem("Debug options"));
|
||||||
@@ -347,7 +387,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
items.add(new FooterItem(getString(R.string.sk_settings_app_version, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)));
|
items.add(new FooterItem(getString(R.string.mo_settings_app_version, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePublishText(Button btn) {
|
private void updatePublishText(Button btn) {
|
||||||
@@ -435,6 +475,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
else if (id == R.id.brown_color) pref = ColorPreference.BROWN;
|
else if (id == R.id.brown_color) pref = ColorPreference.BROWN;
|
||||||
else if (id == R.id.red_color) pref = ColorPreference.RED;
|
else if (id == R.id.red_color) pref = ColorPreference.RED;
|
||||||
else if (id == R.id.yellow_color) pref = ColorPreference.YELLOW;
|
else if (id == R.id.yellow_color) pref = ColorPreference.YELLOW;
|
||||||
|
else if (id == R.id.nord_color) pref = ColorPreference.NORD;
|
||||||
|
|
||||||
if (pref == null) return false;
|
if (pref == null) return false;
|
||||||
|
|
||||||
@@ -444,6 +485,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void onTrueBlackThemeChanged(SwitchItem item){
|
private void onTrueBlackThemeChanged(SwitchItem item){
|
||||||
GlobalUserPreferences.trueBlackTheme=item.checked;
|
GlobalUserPreferences.trueBlackTheme=item.checked;
|
||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
@@ -510,6 +552,12 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
needUpdateNotificationSettings=true;
|
needUpdateNotificationSettings=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onNotificationStyleChanged(SwitchItem item){
|
||||||
|
GlobalUserPreferences.uniformNotificationIcon=item.checked;
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void onNotificationsPolicyChanged(PushSubscription.Policy policy){
|
private void onNotificationsPolicyChanged(PushSubscription.Policy policy){
|
||||||
PushSubscription subscription=getPushSubscription();
|
PushSubscription subscription=getPushSubscription();
|
||||||
PushSubscription.Policy prevPolicy=subscription.policy;
|
PushSubscription.Policy prevPolicy=subscription.policy;
|
||||||
@@ -679,6 +727,13 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ColorPicker extends Item{
|
||||||
|
@Override
|
||||||
|
public int getViewType(){
|
||||||
|
return 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static class ThemeItem extends Item{
|
private static class ThemeItem extends Item{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -932,6 +987,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ButtonViewHolder extends BindableViewHolder<ButtonItem>{
|
private class ButtonViewHolder extends BindableViewHolder<ButtonItem>{
|
||||||
private final Button button;
|
private final Button button;
|
||||||
private final ImageView icon;
|
private final ImageView icon;
|
||||||
@@ -1095,10 +1151,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
if (state == GithubSelfUpdater.UpdateState.CHECKING) return;
|
if (state == GithubSelfUpdater.UpdateState.CHECKING) return;
|
||||||
GithubSelfUpdater.UpdateInfo info=updater.getUpdateInfo();
|
GithubSelfUpdater.UpdateInfo info=updater.getUpdateInfo();
|
||||||
if(state!=GithubSelfUpdater.UpdateState.DOWNLOADED){
|
if(state!=GithubSelfUpdater.UpdateState.DOWNLOADED){
|
||||||
text.setText(getString(R.string.sk_update_available, info.version));
|
text.setText(getString(R.string.mo_update_available, info.version));
|
||||||
button.setText(getString(R.string.download_update, UiUtils.formatFileSize(getActivity(), info.size, false)));
|
button.setText(getString(R.string.download_update, UiUtils.formatFileSize(getActivity(), info.size, false)));
|
||||||
}else{
|
}else{
|
||||||
text.setText(getString(R.string.sk_update_ready, info.version));
|
text.setText(getString(R.string.mo_update_ready, info.version));
|
||||||
button.setText(R.string.install_update);
|
button.setText(R.string.install_update);
|
||||||
}
|
}
|
||||||
if(state==GithubSelfUpdater.UpdateState.DOWNLOADING){
|
if(state==GithubSelfUpdater.UpdateState.DOWNLOADING){
|
||||||
@@ -1115,6 +1171,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
|||||||
progress.removeCallbacks(progressUpdater);
|
progress.removeCallbacks(progressUpdater);
|
||||||
}
|
}
|
||||||
changelog.setText(info.changelog);
|
changelog.setText(info.changelog);
|
||||||
|
// changelog.setText(getString(R.string.sk_changelog, info.changelog));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateProgress(){
|
private void updateProgress(){
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.view.View;
|
|||||||
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.requests.statuses.GetStatusEditHistory;
|
import org.joinmastodon.android.api.requests.statuses.GetStatusEditHistory;
|
||||||
|
import org.joinmastodon.android.model.Filter;
|
||||||
import org.joinmastodon.android.model.Status;
|
import org.joinmastodon.android.model.Status;
|
||||||
import org.joinmastodon.android.ui.displayitems.ReblogOrReplyLineStatusDisplayItem;
|
import org.joinmastodon.android.ui.displayitems.ReblogOrReplyLineStatusDisplayItem;
|
||||||
import org.joinmastodon.android.ui.displayitems.StatusDisplayItem;
|
import org.joinmastodon.android.ui.displayitems.StatusDisplayItem;
|
||||||
@@ -55,7 +56,7 @@ public class StatusEditHistoryFragment extends StatusListFragment{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<StatusDisplayItem> buildDisplayItems(Status s){
|
protected List<StatusDisplayItem> buildDisplayItems(Status s){
|
||||||
List<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, s, accountID, s, knownAccounts, true, false, null);
|
List<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, s, accountID, s, knownAccounts, true, false, null, Filter.FilterContext.HOME);
|
||||||
int idx=data.indexOf(s);
|
int idx=data.indexOf(s);
|
||||||
if(idx>=0){
|
if(idx>=0){
|
||||||
String date=UiUtils.DATE_TIME_FORMATTER.format(s.createdAt.atZone(ZoneId.systemDefault()));
|
String date=UiUtils.DATE_TIME_FORMATTER.format(s.createdAt.atZone(ZoneId.systemDefault()));
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.joinmastodon.android.fragments.discover;
|
package org.joinmastodon.android.fragments.discover;
|
||||||
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
|
import android.app.FragmentTransaction;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
@@ -17,10 +18,11 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import org.joinmastodon.android.BuildConfig;
|
||||||
import org.joinmastodon.android.GlobalUserPreferences;
|
import org.joinmastodon.android.GlobalUserPreferences;
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.fragments.IsOnTop;
|
|
||||||
import org.joinmastodon.android.fragments.ScrollableToTop;
|
import org.joinmastodon.android.fragments.ScrollableToTop;
|
||||||
|
import org.joinmastodon.android.fragments.ListTimelinesFragment;
|
||||||
import org.joinmastodon.android.ui.SimpleViewHolder;
|
import org.joinmastodon.android.ui.SimpleViewHolder;
|
||||||
import org.joinmastodon.android.ui.tabs.TabLayout;
|
import org.joinmastodon.android.ui.tabs.TabLayout;
|
||||||
import org.joinmastodon.android.ui.tabs.TabLayoutMediator;
|
import org.joinmastodon.android.ui.tabs.TabLayoutMediator;
|
||||||
@@ -36,7 +38,7 @@ import me.grishka.appkit.fragments.BaseRecyclerFragment;
|
|||||||
import me.grishka.appkit.fragments.OnBackPressedListener;
|
import me.grishka.appkit.fragments.OnBackPressedListener;
|
||||||
import me.grishka.appkit.utils.V;
|
import me.grishka.appkit.utils.V;
|
||||||
|
|
||||||
public class DiscoverFragment extends AppKitFragment implements ScrollableToTop, OnBackPressedListener, IsOnTop {
|
public class DiscoverFragment extends AppKitFragment implements ScrollableToTop, OnBackPressedListener{
|
||||||
|
|
||||||
private TabLayout tabLayout;
|
private TabLayout tabLayout;
|
||||||
private ViewPager2 pager;
|
private ViewPager2 pager;
|
||||||
@@ -53,10 +55,15 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
private DiscoverNewsFragment newsFragment;
|
private DiscoverNewsFragment newsFragment;
|
||||||
private DiscoverAccountsFragment accountsFragment;
|
private DiscoverAccountsFragment accountsFragment;
|
||||||
private SearchFragment searchFragment;
|
private SearchFragment searchFragment;
|
||||||
|
private LocalTimelineFragment localTimelineFragment;
|
||||||
|
private FederatedTimelineFragment federatedTimelineFragment;
|
||||||
|
private ListTimelinesFragment listTimelinesFragment;
|
||||||
|
|
||||||
private String accountID;
|
private String accountID;
|
||||||
private Runnable searchDebouncer=this::onSearchChangedDebounced;
|
private Runnable searchDebouncer=this::onSearchChangedDebounced;
|
||||||
|
|
||||||
|
// private final boolean noFederated = !GlobalUserPreferences.showFederatedTimeline;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState){
|
public void onCreate(Bundle savedInstanceState){
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -74,9 +81,22 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
tabLayout=view.findViewById(R.id.tabbar);
|
tabLayout=view.findViewById(R.id.tabbar);
|
||||||
pager=view.findViewById(R.id.pager);
|
pager=view.findViewById(R.id.pager);
|
||||||
|
|
||||||
|
// tabViews=new FrameLayout[noFederated ? 5 : 6];
|
||||||
tabViews=new FrameLayout[4];
|
tabViews=new FrameLayout[4];
|
||||||
for(int i=0;i<tabViews.length;i++){
|
for(int i=0;i<tabViews.length;i++){
|
||||||
FrameLayout tabView=new FrameLayout(getActivity());
|
FrameLayout tabView=new FrameLayout(getActivity());
|
||||||
|
|
||||||
|
/// int switchIndex = noFederated && i > 0 ? i + 1 : i;
|
||||||
|
// tabView.setId(switch(switchIndex){
|
||||||
|
// case 0 -> R.id.discover_local_timeline;
|
||||||
|
// case 1 -> R.id.discover_federated_timeline;
|
||||||
|
// case 2 -> R.id.discover_hashtags;
|
||||||
|
// case 3 -> R.id.discover_posts;
|
||||||
|
// case 4 -> R.id.discover_news;
|
||||||
|
// case 5 -> R.id.discover_users;
|
||||||
|
// default -> throw new IllegalStateException("Unexpected value: "+switchIndex);
|
||||||
|
// });
|
||||||
|
|
||||||
tabView.setId(switch(i){
|
tabView.setId(switch(i){
|
||||||
case 0 -> R.id.discover_hashtags;
|
case 0 -> R.id.discover_hashtags;
|
||||||
case 1 -> R.id.discover_posts;
|
case 1 -> R.id.discover_posts;
|
||||||
@@ -84,6 +104,7 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
case 3 -> R.id.discover_users;
|
case 3 -> R.id.discover_users;
|
||||||
default -> throw new IllegalStateException("Unexpected value: "+i);
|
default -> throw new IllegalStateException("Unexpected value: "+i);
|
||||||
});
|
});
|
||||||
|
|
||||||
tabView.setVisibility(View.GONE);
|
tabView.setVisibility(View.GONE);
|
||||||
view.addView(tabView); // needed so the fragment manager will have somewhere to restore the tab fragment
|
view.addView(tabView); // needed so the fragment manager will have somewhere to restore the tab fragment
|
||||||
tabViews[i]=tabView;
|
tabViews[i]=tabView;
|
||||||
@@ -109,7 +130,7 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(hashtagsFragment==null){
|
if(localTimelineFragment==null || hashtagsFragment==null){
|
||||||
Bundle args=new Bundle();
|
Bundle args=new Bundle();
|
||||||
args.putString("account", accountID);
|
args.putString("account", accountID);
|
||||||
args.putBoolean("__is_tab", true);
|
args.putBoolean("__is_tab", true);
|
||||||
@@ -126,6 +147,27 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
accountsFragment=new DiscoverAccountsFragment();
|
accountsFragment=new DiscoverAccountsFragment();
|
||||||
accountsFragment.setArguments(args);
|
accountsFragment.setArguments(args);
|
||||||
|
|
||||||
|
localTimelineFragment=new LocalTimelineFragment();
|
||||||
|
localTimelineFragment.setArguments(args);
|
||||||
|
|
||||||
|
// listTimelinesFragment=new ListTimelinesFragment();
|
||||||
|
// listTimelinesFragment.setArguments(args);
|
||||||
|
//
|
||||||
|
// FragmentTransaction transaction = getChildFragmentManager().beginTransaction()
|
||||||
|
// .add(R.id.discover_posts, postsFragment)
|
||||||
|
// .add(R.id.discover_local_timeline, localTimelineFragment)
|
||||||
|
// .add(R.id.discover_hashtags, hashtagsFragment)
|
||||||
|
// .add(R.id.discover_news, newsFragment)
|
||||||
|
// .add(R.id.discover_users, accountsFragment)
|
||||||
|
// .add(R.id.discover_lists, listTimelinesFragment);
|
||||||
|
//
|
||||||
|
// if (!noFederated) {
|
||||||
|
// federatedTimelineFragment=new FederatedTimelineFragment();
|
||||||
|
// federatedTimelineFragment.setArguments(args);
|
||||||
|
// transaction.add(R.id.discover_federated_timeline, federatedTimelineFragment);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// transaction.commit();
|
||||||
|
|
||||||
getChildFragmentManager().beginTransaction()
|
getChildFragmentManager().beginTransaction()
|
||||||
.add(R.id.discover_posts, postsFragment)
|
.add(R.id.discover_posts, postsFragment)
|
||||||
@@ -138,6 +180,21 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
tabLayoutMediator=new TabLayoutMediator(tabLayout, pager, new TabLayoutMediator.TabConfigurationStrategy(){
|
tabLayoutMediator=new TabLayoutMediator(tabLayout, pager, new TabLayoutMediator.TabConfigurationStrategy(){
|
||||||
@Override
|
@Override
|
||||||
public void onConfigureTab(@NonNull TabLayout.Tab tab, int position){
|
public void onConfigureTab(@NonNull TabLayout.Tab tab, int position){
|
||||||
|
|
||||||
|
// if (noFederated && position > 0) position++;
|
||||||
|
|
||||||
|
// tab.setText(switch(position){
|
||||||
|
// case 0 -> R.string.local_timeline;
|
||||||
|
// case 1 -> R.string.sk_federated_timeline;
|
||||||
|
// case 2 -> R.string.sk_list_timelines;
|
||||||
|
// case 3 -> R.string.hashtags;
|
||||||
|
// case 4 -> R.string.posts;
|
||||||
|
// case 5 -> R.string.news;
|
||||||
|
// case 6 -> R.string.for_you;
|
||||||
|
//
|
||||||
|
// default -> throw new IllegalStateException("Unexpected value: "+position);
|
||||||
|
// });
|
||||||
|
|
||||||
tab.setText(switch(position){
|
tab.setText(switch(position){
|
||||||
case 0 -> R.string.hashtags;
|
case 0 -> R.string.hashtags;
|
||||||
case 1 -> R.string.posts;
|
case 1 -> R.string.posts;
|
||||||
@@ -227,26 +284,12 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOnTop() {
|
|
||||||
return searchActive ? searchFragment.isOnTop()
|
|
||||||
: ((IsOnTop)getFragmentForPage(pager.getCurrentItem())).isOnTop();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onSelect() {
|
|
||||||
if (isOnTop()) selectSearch();
|
|
||||||
else scrollToTop();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void selectSearch() {
|
|
||||||
searchEdit.requestFocus();
|
|
||||||
onSearchEditFocusChanged(searchEdit, true);
|
|
||||||
getActivity().getSystemService(InputMethodManager.class).showSoftInput(searchEdit, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void loadData(){
|
public void loadData(){
|
||||||
if(hashtagsFragment!=null && !hashtagsFragment.loaded && !hashtagsFragment.dataLoading)
|
if(hashtagsFragment!=null && !hashtagsFragment.loaded && !hashtagsFragment.dataLoading)
|
||||||
hashtagsFragment.loadData();
|
hashtagsFragment.loadData();
|
||||||
|
|
||||||
|
// if(localTimelineFragment!=null && !localTimelineFragment.loaded && !localTimelineFragment.dataLoading)
|
||||||
|
// localTimelineFragment.loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onSearchEditFocusChanged(View v, boolean hasFocus){
|
private void onSearchEditFocusChanged(View v, boolean hasFocus){
|
||||||
@@ -281,6 +324,19 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Fragment getFragmentForPage(int page){
|
private Fragment getFragmentForPage(int page){
|
||||||
|
// if (noFederated && page > 0) page++;
|
||||||
|
|
||||||
|
// return switch(page){
|
||||||
|
// case 0 -> localTimelineFragment;
|
||||||
|
// case 1 -> federatedTimelineFragment;
|
||||||
|
// case 2 -> hashtagsFragment;
|
||||||
|
// case 3 -> postsFragment;
|
||||||
|
// case 4 -> newsFragment;
|
||||||
|
// case 5 -> accountsFragment;
|
||||||
|
// case 6 -> listTimelinesFragment;
|
||||||
|
// default -> throw new IllegalStateException("Unexpected value: "+page);
|
||||||
|
// };
|
||||||
|
|
||||||
return switch(page){
|
return switch(page){
|
||||||
case 0 -> hashtagsFragment;
|
case 0 -> hashtagsFragment;
|
||||||
case 1 -> postsFragment;
|
case 1 -> postsFragment;
|
||||||
@@ -342,4 +398,10 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void selectSearch(){
|
||||||
|
searchEdit.requestFocus();
|
||||||
|
onSearchEditFocusChanged(searchEdit, true);
|
||||||
|
getActivity().getSystemService(InputMethodManager.class).showSoftInput(searchEdit, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,6 @@ public class FederatedTimelineFragment extends StatusListFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState){
|
public void onViewCreated(View view, Bundle savedInstanceState){
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
bannerHelper.maybeAddBanner(contentWrap);
|
// bannerHelper.maybeAddBanner(contentWrap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import org.joinmastodon.android.R;
|
|||||||
import org.joinmastodon.android.api.requests.search.GetSearchResults;
|
import org.joinmastodon.android.api.requests.search.GetSearchResults;
|
||||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||||
import org.joinmastodon.android.fragments.IsOnTop;
|
|
||||||
import org.joinmastodon.android.fragments.ProfileFragment;
|
import org.joinmastodon.android.fragments.ProfileFragment;
|
||||||
import org.joinmastodon.android.fragments.ThreadFragment;
|
import org.joinmastodon.android.fragments.ThreadFragment;
|
||||||
import org.joinmastodon.android.model.Account;
|
import org.joinmastodon.android.model.Account;
|
||||||
|
import org.joinmastodon.android.model.Filter;
|
||||||
import org.joinmastodon.android.model.Hashtag;
|
import org.joinmastodon.android.model.Hashtag;
|
||||||
import org.joinmastodon.android.model.SearchResult;
|
import org.joinmastodon.android.model.SearchResult;
|
||||||
import org.joinmastodon.android.model.SearchResults;
|
import org.joinmastodon.android.model.SearchResults;
|
||||||
@@ -38,10 +38,11 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import me.grishka.appkit.Nav;
|
import me.grishka.appkit.Nav;
|
||||||
import me.grishka.appkit.api.Callback;
|
import me.grishka.appkit.api.Callback;
|
||||||
import me.grishka.appkit.api.ErrorResponse;
|
import me.grishka.appkit.api.ErrorResponse;
|
||||||
|
import me.grishka.appkit.api.SimpleCallback;
|
||||||
import me.grishka.appkit.utils.MergeRecyclerAdapter;
|
import me.grishka.appkit.utils.MergeRecyclerAdapter;
|
||||||
import me.grishka.appkit.utils.V;
|
import me.grishka.appkit.utils.V;
|
||||||
|
|
||||||
public class SearchFragment extends BaseStatusListFragment<SearchResult> implements IsOnTop {
|
public class SearchFragment extends BaseStatusListFragment<SearchResult>{
|
||||||
private String currentQuery;
|
private String currentQuery;
|
||||||
private List<StatusDisplayItem> prevDisplayItems;
|
private List<StatusDisplayItem> prevDisplayItems;
|
||||||
private EnumSet<SearchResult.Type> currentFilter=EnumSet.allOf(SearchResult.Type.class);
|
private EnumSet<SearchResult.Type> currentFilter=EnumSet.allOf(SearchResult.Type.class);
|
||||||
@@ -80,7 +81,7 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
|||||||
return switch(s.type){
|
return switch(s.type){
|
||||||
case ACCOUNT -> Collections.singletonList(new AccountStatusDisplayItem(s.id, this, s.account));
|
case ACCOUNT -> Collections.singletonList(new AccountStatusDisplayItem(s.id, this, s.account));
|
||||||
case HASHTAG -> Collections.singletonList(new HashtagStatusDisplayItem(s.id, this, s.hashtag));
|
case HASHTAG -> Collections.singletonList(new HashtagStatusDisplayItem(s.id, this, s.hashtag));
|
||||||
case STATUS -> StatusDisplayItem.buildItems(this, s.status, accountID, s, knownAccounts, false, true, null);
|
case STATUS -> StatusDisplayItem.buildItems(this, s.status, accountID, s, knownAccounts, false, true, null, Filter.FilterContext.PUBLIC);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +185,7 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UiUtils.updateList(prevDisplayItems, displayItems, list, adapter, (i1, i2)->i1.parentID.equals(i2.parentID) && i1.index==i2.index && i1.getType()==i2.getType());
|
UiUtils.updateList(prevDisplayItems, displayItems, list, adapter, (i1, i2)->i1.parentID.equals(i2.parentID) && i1.index==i2.index && i1.getType()==i2.getType());
|
||||||
boolean recent=isInRecentMode() && !displayItems.isEmpty();
|
boolean recent=isInRecentMode();
|
||||||
if(recent!=headerAdapter.isVisible())
|
if(recent!=headerAdapter.isVisible())
|
||||||
headerAdapter.setVisible(recent);
|
headerAdapter.setVisible(recent);
|
||||||
imgLoader.forceUpdateImages();
|
imgLoader.forceUpdateImages();
|
||||||
@@ -310,11 +311,6 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult> impleme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOnTop() {
|
|
||||||
return isRecyclerViewOnTop(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface ProgressVisibilityListener{
|
public interface ProgressVisibilityListener{
|
||||||
void onProgressVisibilityChanged(boolean visible);
|
void onProgressVisibilityChanged(boolean visible);
|
||||||
|
|||||||
@@ -96,9 +96,9 @@ public class AccountActivationFragment extends ToolbarFragment{
|
|||||||
view.setBackgroundColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
view.setBackgroundColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected void onUpdateToolbar(){
|
protected void onUpdateToolbar(){
|
||||||
super.onUpdateToolbar();
|
// super.onUpdateToolbar();
|
||||||
getToolbar().setBackground(null);
|
getToolbar().setBackground(null);
|
||||||
getToolbar().setElevation(0);
|
getToolbar().setElevation(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,8 +140,8 @@ public class CustomWelcomeFragment extends InstanceCatalogFragment {
|
|||||||
headerView.findViewById(R.id.separator).setVisibility(View.GONE);
|
headerView.findViewById(R.id.separator).setVisibility(View.GONE);
|
||||||
headerView.findViewById(R.id.timestamp).setVisibility(View.GONE);
|
headerView.findViewById(R.id.timestamp).setVisibility(View.GONE);
|
||||||
headerView.findViewById(R.id.unread_indicator).setVisibility(View.GONE);
|
headerView.findViewById(R.id.unread_indicator).setVisibility(View.GONE);
|
||||||
((TextView) headerView.findViewById(R.id.username)).setText(R.string.sk_app_username);
|
((TextView) headerView.findViewById(R.id.username)).setText(R.string.mo_app_username);
|
||||||
((TextView) headerView.findViewById(R.id.name)).setText(R.string.sk_app_name);
|
((TextView) headerView.findViewById(R.id.name)).setText(R.string.mo_app_name);
|
||||||
((ImageView) headerView.findViewById(R.id.avatar)).setImageDrawable(getActivity().getDrawable(R.mipmap.ic_launcher));
|
((ImageView) headerView.findViewById(R.id.avatar)).setImageDrawable(getActivity().getDrawable(R.mipmap.ic_launcher));
|
||||||
((FragmentStackActivity) getActivity()).invalidateSystemBarColors(this);
|
((FragmentStackActivity) getActivity()).invalidateSystemBarColors(this);
|
||||||
|
|
||||||
|
|||||||
@@ -106,13 +106,13 @@ public class InstanceChooserLoginFragment extends InstanceCatalogFragment{
|
|||||||
.execNoAuth("");
|
.execNoAuth("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected void onUpdateToolbar(){
|
// protected void onUpdateToolbar(){
|
||||||
super.onUpdateToolbar();
|
// super.onUpdateToolbar();
|
||||||
Toolbar toolbar=getToolbar();
|
// Toolbar toolbar=getToolbar();
|
||||||
toolbar.setElevation(0);
|
// toolbar.setElevation(0);
|
||||||
toolbar.setBackground(null);
|
// toolbar.setBackground(null);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected RecyclerView.Adapter getAdapter(){
|
protected RecyclerView.Adapter getAdapter(){
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class InstanceRulesFragment extends ToolbarFragment{
|
|||||||
adapter.addAdapter(new SingleViewRecyclerAdapter(headerView));
|
adapter.addAdapter(new SingleViewRecyclerAdapter(headerView));
|
||||||
adapter.addAdapter(new ItemsAdapter());
|
adapter.addAdapter(new ItemsAdapter());
|
||||||
list.setAdapter(adapter);
|
list.setAdapter(adapter);
|
||||||
list.addItemDecoration(new DividerItemDecoration(getActivity(), R.attr.colorPollVoted, 1, 56, 0, DividerItemDecoration.NOT_FIRST));
|
list.addItemDecoration(new DividerItemDecoration(getActivity(), R.attr.colorM3SurfaceVariant, 1, 56, 0, DividerItemDecoration.NOT_FIRST));
|
||||||
|
|
||||||
btn=view.findViewById(R.id.btn_next);
|
btn=view.findViewById(R.id.btn_next);
|
||||||
btn.setOnClickListener(v->onButtonClick());
|
btn.setOnClickListener(v->onButtonClick());
|
||||||
@@ -84,8 +84,8 @@ public class InstanceRulesFragment extends ToolbarFragment{
|
|||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState){
|
public void onViewCreated(View view, Bundle savedInstanceState){
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
// setStatusBarColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
setStatusBarColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
||||||
// view.setBackgroundColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
view.setBackgroundColor(UiUtils.getThemeColor(getActivity(), R.attr.colorM3Background));
|
||||||
list.addOnScrollListener(onScrollListener=new ElevationOnScrollListener((FragmentRootLinearLayout) view, buttonBar, getToolbar()));
|
list.addOnScrollListener(onScrollListener=new ElevationOnScrollListener((FragmentRootLinearLayout) view, buttonBar, getToolbar()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.joinmastodon.android.api.requests.accounts.GetAccountStatuses;
|
|||||||
import org.joinmastodon.android.events.FinishReportFragmentsEvent;
|
import org.joinmastodon.android.events.FinishReportFragmentsEvent;
|
||||||
import org.joinmastodon.android.fragments.StatusListFragment;
|
import org.joinmastodon.android.fragments.StatusListFragment;
|
||||||
import org.joinmastodon.android.model.Account;
|
import org.joinmastodon.android.model.Account;
|
||||||
|
import org.joinmastodon.android.model.Filter;
|
||||||
import org.joinmastodon.android.model.Status;
|
import org.joinmastodon.android.model.Status;
|
||||||
import org.joinmastodon.android.ui.PhotoLayoutHelper;
|
import org.joinmastodon.android.ui.PhotoLayoutHelper;
|
||||||
import org.joinmastodon.android.ui.displayitems.AudioStatusDisplayItem;
|
import org.joinmastodon.android.ui.displayitems.AudioStatusDisplayItem;
|
||||||
@@ -238,7 +239,7 @@ public class ReportAddPostsChoiceFragment extends StatusListFragment{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<StatusDisplayItem> buildDisplayItems(Status s){
|
protected List<StatusDisplayItem> buildDisplayItems(Status s){
|
||||||
List<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, s, accountID, s, knownAccounts, true, false, null);
|
List<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, s, accountID, s, knownAccounts, true, false, null, Filter.FilterContext.HOME);
|
||||||
for(StatusDisplayItem item:items){
|
for(StatusDisplayItem item:items){
|
||||||
if(item instanceof ImageStatusDisplayItem isdi){
|
if(item instanceof ImageStatusDisplayItem isdi){
|
||||||
isdi.horizontalInset=V.dp(40+32);
|
isdi.horizontalInset=V.dp(40+32);
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ public class Filter extends BaseModel{
|
|||||||
@RequiredField
|
@RequiredField
|
||||||
public String id;
|
public String id;
|
||||||
@RequiredField
|
@RequiredField
|
||||||
public String phrase;
|
|
||||||
public String title;
|
public String title;
|
||||||
|
@RequiredField
|
||||||
|
public String phrase;
|
||||||
public transient EnumSet<FilterContext> context=EnumSet.noneOf(FilterContext.class);
|
public transient EnumSet<FilterContext> context=EnumSet.noneOf(FilterContext.class);
|
||||||
public Instant expiresAt;
|
public Instant expiresAt;
|
||||||
public boolean irreversible;
|
public boolean irreversible;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class Status extends BaseModel implements DisplayItemsParent{
|
|||||||
public Instant createdAt;
|
public Instant createdAt;
|
||||||
@RequiredField
|
@RequiredField
|
||||||
public Account account;
|
public Account account;
|
||||||
// @RequiredField
|
// @RequiredField
|
||||||
public String content;
|
public String content;
|
||||||
@RequiredField
|
@RequiredField
|
||||||
public StatusPrivacy visibility;
|
public StatusPrivacy visibility;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import org.joinmastodon.android.api.requests.oauth.RevokeOauthToken;
|
|||||||
import org.joinmastodon.android.api.session.AccountSession;
|
import org.joinmastodon.android.api.session.AccountSession;
|
||||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.fragments.onboarding.CustomWelcomeFragment;
|
import org.joinmastodon.android.fragments.onboarding.CustomWelcomeFragment;
|
||||||
|
import org.joinmastodon.android.fragments.onboarding.CustomWelcomeFragment;
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package org.joinmastodon.android.ui;
|
package org.joinmastodon.android.ui;
|
||||||
|
|
||||||
|
import static org.joinmastodon.android.GlobalUserPreferences.recentEmojis;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.res.TypedArray;
|
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.drawable.Animatable;
|
import android.graphics.drawable.Animatable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
@@ -12,8 +13,13 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.squareup.otto.Subscribe;
|
import com.squareup.otto.Subscribe;
|
||||||
|
|
||||||
|
import org.joinmastodon.android.GlobalUserPreferences;
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.events.EmojiUpdatedEvent;
|
import org.joinmastodon.android.events.EmojiUpdatedEvent;
|
||||||
@@ -21,13 +27,13 @@ import org.joinmastodon.android.model.Emoji;
|
|||||||
import org.joinmastodon.android.model.EmojiCategory;
|
import org.joinmastodon.android.model.EmojiCategory;
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import me.grishka.appkit.imageloader.ImageLoaderRecyclerAdapter;
|
import me.grishka.appkit.imageloader.ImageLoaderRecyclerAdapter;
|
||||||
import me.grishka.appkit.imageloader.ImageLoaderViewHolder;
|
import me.grishka.appkit.imageloader.ImageLoaderViewHolder;
|
||||||
import me.grishka.appkit.imageloader.ListImageLoaderWrapper;
|
import me.grishka.appkit.imageloader.ListImageLoaderWrapper;
|
||||||
@@ -40,6 +46,9 @@ import me.grishka.appkit.utils.V;
|
|||||||
import me.grishka.appkit.views.UsableRecyclerView;
|
import me.grishka.appkit.views.UsableRecyclerView;
|
||||||
|
|
||||||
public class CustomEmojiPopupKeyboard extends PopupKeyboard{
|
public class CustomEmojiPopupKeyboard extends PopupKeyboard{
|
||||||
|
//determines how many emoji need to be clicked, before it disappears from the recent emojis
|
||||||
|
private static final int NEW_RECENT_VALUE=15;
|
||||||
|
|
||||||
private List<EmojiCategory> emojis;
|
private List<EmojiCategory> emojis;
|
||||||
private UsableRecyclerView list;
|
private UsableRecyclerView list;
|
||||||
private ListImageLoaderWrapper imgLoader;
|
private ListImageLoaderWrapper imgLoader;
|
||||||
@@ -82,6 +91,17 @@ public class CustomEmojiPopupKeyboard extends PopupKeyboard{
|
|||||||
list.setLayoutManager(lm);
|
list.setLayoutManager(lm);
|
||||||
imgLoader=new ListImageLoaderWrapper(activity, list, new RecyclerViewDelegate(list), null);
|
imgLoader=new ListImageLoaderWrapper(activity, list, new RecyclerViewDelegate(list), null);
|
||||||
|
|
||||||
|
// inject category with last used emojis
|
||||||
|
if (!recentEmojis.isEmpty()) {
|
||||||
|
List<Emoji> allAvailableEmojis = emojis.stream().flatMap(category -> category.emojis.stream()).collect(Collectors.toList());
|
||||||
|
List<Emoji> recentEmojiList = new ArrayList<>();
|
||||||
|
for (String emojiCode : recentEmojis.keySet().stream().sorted(Comparator.comparingInt(GlobalUserPreferences.recentEmojis::get).reversed()).collect(Collectors.toList())) {
|
||||||
|
Optional<Emoji> element = allAvailableEmojis.stream().filter(e -> e.shortcode.equals(emojiCode)).findFirst();
|
||||||
|
element.ifPresent(recentEmojiList::add);
|
||||||
|
}
|
||||||
|
emojis.add(0, new EmojiCategory(activity.getString(R.string.mo_emoji_recent), recentEmojiList));
|
||||||
|
}
|
||||||
|
|
||||||
for(EmojiCategory category:emojis)
|
for(EmojiCategory category:emojis)
|
||||||
adapter.addAdapter(new SingleCategoryAdapter(category));
|
adapter.addAdapter(new SingleCategoryAdapter(category));
|
||||||
list.setAdapter(adapter);
|
list.setAdapter(adapter);
|
||||||
@@ -100,6 +120,11 @@ public class CustomEmojiPopupKeyboard extends PopupKeyboard{
|
|||||||
list.setBackgroundColor(UiUtils.getThemeColor(activity, android.R.attr.colorBackground));
|
list.setBackgroundColor(UiUtils.getThemeColor(activity, android.R.attr.colorBackground));
|
||||||
list.setSelector(null);
|
list.setSelector(null);
|
||||||
|
|
||||||
|
//remove recently used afterwards, it would get duplicated otherwise
|
||||||
|
if (!recentEmojis.isEmpty()) {
|
||||||
|
emojis.remove(0);
|
||||||
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +132,19 @@ public class CustomEmojiPopupKeyboard extends PopupKeyboard{
|
|||||||
this.listener=listener;
|
this.listener=listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void increaseEmojiCount(Emoji emoji) {
|
||||||
|
Integer usageCount = recentEmojis.get(emoji.shortcode);
|
||||||
|
if (usageCount != null) {
|
||||||
|
recentEmojis.put(emoji.shortcode, usageCount + 1);
|
||||||
|
} else {
|
||||||
|
recentEmojis.put(emoji.shortcode, NEW_RECENT_VALUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
recentEmojis.entrySet().removeIf(e -> e.getValue() <= 0);
|
||||||
|
recentEmojis.replaceAll((k, v) -> v - 1);
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onEmojiUpdated(EmojiUpdatedEvent ev){
|
public void onEmojiUpdated(EmojiUpdatedEvent ev){
|
||||||
@@ -203,6 +241,7 @@ public class CustomEmojiPopupKeyboard extends PopupKeyboard{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(){
|
public void onClick(){
|
||||||
|
increaseEmojiCount(item);
|
||||||
listener.accept(item);
|
listener.accept(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import android.app.AlertDialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
|
||||||
|
|
||||||
import me.grishka.appkit.utils.V;
|
import me.grishka.appkit.utils.V;
|
||||||
|
|
||||||
@@ -32,16 +31,8 @@ public class M3AlertDialogBuilder extends AlertDialog.Builder{
|
|||||||
if(titleID!=0){
|
if(titleID!=0){
|
||||||
View title=alert.findViewById(titleID);
|
View title=alert.findViewById(titleID);
|
||||||
if(title!=null){
|
if(title!=null){
|
||||||
int iconID=getContext().getResources().getIdentifier("icon", "id", "android");
|
|
||||||
int alertTitleID=getContext().getResources().getIdentifier("alertTitle", "id", "android");
|
|
||||||
if (alertTitleID != 0 && iconID != 0) {
|
|
||||||
ImageView icon = title.findViewById(iconID);
|
|
||||||
if (icon.getDrawable() != null) {
|
|
||||||
title.findViewById(alertTitleID).setPadding(V.dp(8), 0, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int pad=V.dp(24);
|
int pad=V.dp(24);
|
||||||
title.setPadding(pad, pad, pad, V.dp(12));
|
title.setPadding(pad, pad, pad, V.dp(18));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int titleDividerID=getContext().getResources().getIdentifier("titleDividerNoCustom", "id", "android");
|
int titleDividerID=getContext().getResources().getIdentifier("titleDividerNoCustom", "id", "android");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.joinmastodon.android.ui.displayitems;
|
package org.joinmastodon.android.ui.displayitems;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -9,6 +10,7 @@ import android.widget.SeekBar;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.joinmastodon.android.AudioPlayerService;
|
import org.joinmastodon.android.AudioPlayerService;
|
||||||
|
import org.joinmastodon.android.MastodonApp;
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||||
import org.joinmastodon.android.model.Attachment;
|
import org.joinmastodon.android.model.Attachment;
|
||||||
@@ -103,6 +105,7 @@ public class AudioStatusDisplayItem extends StatusDisplayItem{
|
|||||||
}else{
|
}else{
|
||||||
seekBar.setEnabled(false);
|
seekBar.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPlayPauseClick(View v){
|
private void onPlayPauseClick(View v){
|
||||||
@@ -126,6 +129,10 @@ public class AudioStatusDisplayItem extends StatusDisplayItem{
|
|||||||
lastKnownPositionTime=SystemClock.uptimeMillis();
|
lastKnownPositionTime=SystemClock.uptimeMillis();
|
||||||
this.playing=playing;
|
this.playing=playing;
|
||||||
playPauseBtn.setImageResource(playing ? R.drawable.ic_fluent_pause_circle_24_filled : R.drawable.ic_fluent_play_circle_24_filled);
|
playPauseBtn.setImageResource(playing ? R.drawable.ic_fluent_pause_circle_24_filled : R.drawable.ic_fluent_play_circle_24_filled);
|
||||||
|
playPauseBtn.setContentDescription(MastodonApp.context.getResources().getString(playing ? R.string.pause : R.string.play));
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
playPauseBtn.setTooltipText(playPauseBtn.getContentDescription());
|
||||||
|
}
|
||||||
if(!playing){
|
if(!playing){
|
||||||
lastRemainingSeconds=-1;
|
lastRemainingSeconds=-1;
|
||||||
time.setText(formatDuration((int) item.attachment.getDuration()));
|
time.setText(formatDuration((int) item.attachment.getDuration()));
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import android.view.ViewGroup;
|
|||||||
import android.view.accessibility.AccessibilityNodeInfo;
|
import android.view.accessibility.AccessibilityNodeInfo;
|
||||||
import android.view.animation.AlphaAnimation;
|
import android.view.animation.AlphaAnimation;
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
|
import android.view.animation.AnimationSet;
|
||||||
|
import android.view.animation.BounceInterpolator;
|
||||||
|
import android.view.animation.RotateAnimation;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@@ -58,6 +61,8 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
|
|||||||
private final TextView reply, boost, favorite, bookmark;
|
private final TextView reply, boost, favorite, bookmark;
|
||||||
private final ImageView share;
|
private final ImageView share;
|
||||||
private static final Animation opacityOut, opacityIn;
|
private static final Animation opacityOut, opacityIn;
|
||||||
|
private static AnimationSet animSet;
|
||||||
|
|
||||||
|
|
||||||
private View touchingView = null;
|
private View touchingView = null;
|
||||||
private boolean longClickPerformed = false;
|
private boolean longClickPerformed = false;
|
||||||
@@ -86,6 +91,15 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
|
|||||||
opacityIn = new AlphaAnimation(0.55f, 1);
|
opacityIn = new AlphaAnimation(0.55f, 1);
|
||||||
opacityIn.setDuration(400);
|
opacityIn.setDuration(400);
|
||||||
opacityIn.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
opacityIn.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
||||||
|
Animation spin = new RotateAnimation(0, 360,
|
||||||
|
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
|
||||||
|
0.5f);
|
||||||
|
|
||||||
|
animSet = new AnimationSet(true);
|
||||||
|
animSet.setInterpolator(CubicBezierInterpolator.DEFAULT);
|
||||||
|
animSet.addAnimation(spin);
|
||||||
|
animSet.addAnimation(opacityIn);
|
||||||
|
animSet.setDuration(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Holder(Activity activity, ViewGroup parent){
|
public Holder(Activity activity, ViewGroup parent){
|
||||||
@@ -139,6 +153,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
|
|||||||
bookmark.setSelected(item.status.bookmarked);
|
bookmark.setSelected(item.status.bookmarked);
|
||||||
boost.setEnabled(item.status.visibility==StatusPrivacy.PUBLIC || item.status.visibility==StatusPrivacy.UNLISTED || item.status.visibility==StatusPrivacy.LOCAL
|
boost.setEnabled(item.status.visibility==StatusPrivacy.PUBLIC || item.status.visibility==StatusPrivacy.UNLISTED || item.status.visibility==StatusPrivacy.LOCAL
|
||||||
|| (item.status.visibility==StatusPrivacy.PRIVATE && item.status.account.id.equals(AccountSessionManager.getInstance().getAccount(item.accountID).self.id)));
|
|| (item.status.visibility==StatusPrivacy.PRIVATE && item.status.account.id.equals(AccountSessionManager.getInstance().getAccount(item.accountID).self.id)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindButton(TextView btn, long count){
|
private void bindButton(TextView btn, long count){
|
||||||
@@ -296,7 +311,15 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
|
|||||||
private void onFavoriteClick(View v){
|
private void onFavoriteClick(View v){
|
||||||
favorite.setSelected(!item.status.favourited);
|
favorite.setSelected(!item.status.favourited);
|
||||||
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setFavorited(item.status, !item.status.favourited, r->{
|
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setFavorited(item.status, !item.status.favourited, r->{
|
||||||
|
if (item.status.favourited) {
|
||||||
|
if(GlobalUserPreferences.reduceMotion){
|
||||||
v.startAnimation(opacityIn);
|
v.startAnimation(opacityIn);
|
||||||
|
}else{
|
||||||
|
v.startAnimation(animSet);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
v.startAnimation(opacityIn);
|
||||||
|
}
|
||||||
bindButton(favorite, r.favouritesCount);
|
bindButton(favorite, r.favouritesCount);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.text.style.ImageSpan;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.util.TypedValue;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.SubMenu;
|
import android.view.SubMenu;
|
||||||
@@ -140,7 +143,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
|||||||
public static class Holder extends StatusDisplayItem.Holder<HeaderStatusDisplayItem> implements ImageLoaderViewHolder{
|
public static class Holder extends StatusDisplayItem.Holder<HeaderStatusDisplayItem> implements ImageLoaderViewHolder{
|
||||||
private final TextView name, username, timestamp, extraText, separator;
|
private final TextView name, username, timestamp, extraText, separator;
|
||||||
private final View collapseBtn;
|
private final View collapseBtn;
|
||||||
private final ImageView avatar, more, visibility, deleteNotification, unreadIndicator, collapseBtnIcon;
|
private final ImageView avatar, more, visibility, deleteNotification, unreadIndicator, collapseBtnIcon,botIcon;
|
||||||
private final PopupMenu optionsMenu;
|
private final PopupMenu optionsMenu;
|
||||||
private Relationship relationship;
|
private Relationship relationship;
|
||||||
private APIRequest<?> currentRelationshipRequest;
|
private APIRequest<?> currentRelationshipRequest;
|
||||||
@@ -165,6 +168,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
|||||||
unreadIndicator=findViewById(R.id.unread_indicator);
|
unreadIndicator=findViewById(R.id.unread_indicator);
|
||||||
collapseBtn=findViewById(R.id.collapse_btn);
|
collapseBtn=findViewById(R.id.collapse_btn);
|
||||||
collapseBtnIcon=findViewById(R.id.collapse_btn_icon);
|
collapseBtnIcon=findViewById(R.id.collapse_btn_icon);
|
||||||
|
botIcon=findViewById(R.id.bot_icon);
|
||||||
extraText=findViewById(R.id.extra_text);
|
extraText=findViewById(R.id.extra_text);
|
||||||
avatar.setOnClickListener(this::onAvaClick);
|
avatar.setOnClickListener(this::onAvaClick);
|
||||||
avatar.setOutlineProvider(roundCornersOutline);
|
avatar.setOutlineProvider(roundCornersOutline);
|
||||||
@@ -179,7 +183,9 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
|||||||
collapseBtn.setOnClickListener(l -> item.parentFragment.onToggleExpanded(item.status, getItemID()));
|
collapseBtn.setOnClickListener(l -> item.parentFragment.onToggleExpanded(item.status, getItemID()));
|
||||||
|
|
||||||
optionsMenu=new PopupMenu(activity, more);
|
optionsMenu=new PopupMenu(activity, more);
|
||||||
|
|
||||||
optionsMenu.inflate(R.menu.post);
|
optionsMenu.inflate(R.menu.post);
|
||||||
|
|
||||||
optionsMenu.setOnMenuItemClickListener(menuItem->{
|
optionsMenu.setOnMenuItemClickListener(menuItem->{
|
||||||
Account account=item.user;
|
Account account=item.user;
|
||||||
int id=menuItem.getItemId();
|
int id=menuItem.getItemId();
|
||||||
@@ -277,11 +283,29 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
|||||||
args.putString("profileDisplayUsername", account.getDisplayUsername());
|
args.putString("profileDisplayUsername", account.getDisplayUsername());
|
||||||
Nav.go(item.parentFragment.getActivity(), ListTimelinesFragment.class, args);
|
Nav.go(item.parentFragment.getActivity(), ListTimelinesFragment.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!item.status.filterRevealed){
|
||||||
|
this.itemView.setVisibility(View.GONE);
|
||||||
|
ViewGroup.LayoutParams params = this.itemView.getLayoutParams();
|
||||||
|
params.height = 0;
|
||||||
|
params.width = 0;
|
||||||
|
this.itemView.setLayoutParams(params);
|
||||||
|
// item.parentFragment.notifyItemsChanged(this.getAbsoluteAdapterPosition());
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
UiUtils.enablePopupMenuIcons(activity, optionsMenu);
|
UiUtils.enablePopupMenuIcons(activity, optionsMenu);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public void setFilteredShown(){
|
||||||
|
// this.itemView.setVisibility(View.VISIBLE);
|
||||||
|
// params = this.itemView.getLayoutParams();
|
||||||
|
// params.height = 0;
|
||||||
|
// params.width = 0;
|
||||||
|
// this.itemView.setLayoutParams(params);
|
||||||
|
// }
|
||||||
|
|
||||||
private void populateAccountsMenu(Menu menu) {
|
private void populateAccountsMenu(Menu menu) {
|
||||||
List<AccountSession> sessions=AccountSessionManager.getInstance().getLoggedInAccounts();
|
List<AccountSession> sessions=AccountSessionManager.getInstance().getLoggedInAccounts();
|
||||||
sessions.stream().filter(s -> !s.getID().equals(item.accountID)).forEach(s -> {
|
sessions.stream().filter(s -> !s.getID().equals(item.accountID)).forEach(s -> {
|
||||||
@@ -297,6 +321,8 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
|
|||||||
public void onBind(HeaderStatusDisplayItem item){
|
public void onBind(HeaderStatusDisplayItem item){
|
||||||
name.setText(item.parsedName);
|
name.setText(item.parsedName);
|
||||||
username.setText('@'+item.user.acct);
|
username.setText('@'+item.user.acct);
|
||||||
|
botIcon.setVisibility(item.user.bot ? View.VISIBLE : View.GONE);
|
||||||
|
botIcon.setColorFilter(username.getCurrentTextColor());
|
||||||
separator.setVisibility(View.VISIBLE);
|
separator.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
if (item.scheduledStatus!=null)
|
if (item.scheduledStatus!=null)
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public class LinkCardStatusDisplayItem extends StatusDisplayItem{
|
|||||||
|
|
||||||
photo.setImageDrawable(null);
|
photo.setImageDrawable(null);
|
||||||
if(item.imgRequest!=null){
|
if(item.imgRequest!=null){
|
||||||
|
crossfadeDrawable.setSize(card.width, card.height);
|
||||||
if (card.width > 0) {
|
if (card.width > 0) {
|
||||||
// akkoma servers don't provide width and height
|
// akkoma servers don't provide width and height
|
||||||
crossfadeDrawable.setSize(card.width, card.height);
|
crossfadeDrawable.setSize(card.width, card.height);
|
||||||
@@ -104,3 +105,4 @@ public class LinkCardStatusDisplayItem extends StatusDisplayItem{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{
|
|||||||
if (visibilityText != 0) text.setContentDescription(item.text + " (" + ctx.getString(visibilityText) + ")");
|
if (visibilityText != 0) text.setContentDescription(item.text + " (" + ctx.getString(visibilityText) + ")");
|
||||||
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.N)
|
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.N)
|
||||||
UiUtils.fixCompoundDrawableTintOnAndroid6(text);
|
UiUtils.fixCompoundDrawableTintOnAndroid6(text);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
|
import org.joinmastodon.android.api.session.AccountSession;
|
||||||
import org.joinmastodon.android.api.session.AccountSessionManager;
|
import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||||
import org.joinmastodon.android.fragments.HashtagTimelineFragment;
|
import org.joinmastodon.android.fragments.HashtagTimelineFragment;
|
||||||
@@ -146,11 +147,12 @@ public abstract class StatusDisplayItem{
|
|||||||
}
|
}
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderStatusDisplayItem header;
|
HeaderStatusDisplayItem header;
|
||||||
items.add(header=new HeaderStatusDisplayItem(parentID, statusForContent.account, statusForContent.createdAt, fragment, accountID, statusForContent, null, notification, scheduledStatus));
|
items.add(header=new HeaderStatusDisplayItem(parentID, statusForContent.account, statusForContent.createdAt, fragment, accountID, statusForContent, null, notification, scheduledStatus));
|
||||||
if(!TextUtils.isEmpty(statusForContent.content))
|
if(!TextUtils.isEmpty(statusForContent.content)){
|
||||||
items.add(new TextStatusDisplayItem(parentID, HtmlParser.parse(statusForContent.content, statusForContent.emojis, statusForContent.mentions, statusForContent.tags, accountID), fragment, statusForContent, disableTranslate));
|
items.add(new TextStatusDisplayItem(parentID, HtmlParser.parse(statusForContent.content, statusForContent.emojis, statusForContent.mentions, statusForContent.tags, accountID), fragment, statusForContent, disableTranslate));
|
||||||
else
|
} else
|
||||||
header.needBottomPadding=true;
|
header.needBottomPadding=true;
|
||||||
List<Attachment> imageAttachments=statusForContent.mediaAttachments.stream().filter(att->att.type.isImage()).collect(Collectors.toList());
|
List<Attachment> imageAttachments=statusForContent.mediaAttachments.stream().filter(att->att.type.isImage()).collect(Collectors.toList());
|
||||||
if(!imageAttachments.isEmpty()){
|
if(!imageAttachments.isEmpty()){
|
||||||
@@ -182,9 +184,11 @@ public abstract class StatusDisplayItem{
|
|||||||
}
|
}
|
||||||
if(addFooter){
|
if(addFooter){
|
||||||
items.add(new FooterStatusDisplayItem(parentID, fragment, statusForContent, accountID));
|
items.add(new FooterStatusDisplayItem(parentID, fragment, statusForContent, accountID));
|
||||||
if(status.hasGapAfter && !(fragment instanceof ThreadFragment))
|
if(status.hasGapAfter && !(fragment instanceof ThreadFragment)){
|
||||||
items.add(new GapStatusDisplayItem(parentID, fragment));
|
items.add(new GapStatusDisplayItem(parentID, fragment));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int i=1;
|
int i=1;
|
||||||
for(StatusDisplayItem item:items){
|
for(StatusDisplayItem item:items){
|
||||||
item.inset=inset;
|
item.inset=inset;
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ public class TextStatusDisplayItem extends StatusDisplayItem{
|
|||||||
translateEnabled &&
|
translateEnabled &&
|
||||||
!item.status.visibility.isLessVisibleThan(StatusPrivacy.UNLISTED) &&
|
!item.status.visibility.isLessVisibleThan(StatusPrivacy.UNLISTED) &&
|
||||||
item.status.language != null &&
|
item.status.language != null &&
|
||||||
(item.session.preferences == null || !item.status.language.equalsIgnoreCase(item.session.preferences.postingDefaultLanguage))))
|
(item.session.preferences == null || !item.status.language.equalsIgnoreCase(item.session.preferences.postingDefaultLanguage))));
|
||||||
&& (!GlobalUserPreferences.translateButtonOpenedOnly || item.textSelectable);
|
// && (!GlobalUserPreferences.translateButtonOpenedOnly || item.textSelectable);
|
||||||
translateWrap.setVisibility(translateVisible ? View.VISIBLE : View.GONE);
|
translateWrap.setVisibility(translateVisible ? View.VISIBLE : View.GONE);
|
||||||
translateButton.setText(item.translated ? R.string.sk_translate_show_original : R.string.sk_translate_post);
|
translateButton.setText(item.translated ? R.string.sk_translate_show_original : R.string.sk_translate_post);
|
||||||
translateInfo.setText(item.translated ? itemView.getResources().getString(R.string.sk_translated_using, isBottomText ? "bottom-java" : item.translation.provider) : "");
|
translateInfo.setText(item.translated ? itemView.getResources().getString(R.string.sk_translated_using, isBottomText ? "bottom-java" : item.translation.provider) : "");
|
||||||
|
|||||||
@@ -3,23 +3,29 @@ package org.joinmastodon.android.ui.displayitems;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||||
import org.joinmastodon.android.model.Status;
|
import org.joinmastodon.android.model.Status;
|
||||||
|
import org.joinmastodon.android.ui.drawables.SawtoothTearDrawable;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
// Mind the gap!
|
||||||
public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{
|
public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{
|
||||||
public boolean loading;
|
public boolean loading;
|
||||||
public final Status status;
|
public final Status status;
|
||||||
public List<StatusDisplayItem> filteredItems;
|
public ArrayList<StatusDisplayItem> filteredItems;
|
||||||
|
|
||||||
public WarningFilteredStatusDisplayItem(String parentID, BaseStatusListFragment<?> parentFragment, Status status, List<StatusDisplayItem> filteredItems){
|
public WarningFilteredStatusDisplayItem(String parentID, BaseStatusListFragment parentFragment, Status status, ArrayList<StatusDisplayItem> items){
|
||||||
super(parentID, parentFragment);
|
super(parentID, parentFragment);
|
||||||
this.status=status;
|
this.status=status;
|
||||||
this.filteredItems = filteredItems;
|
this.filteredItems = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -29,24 +35,28 @@ public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{
|
|||||||
|
|
||||||
public static class Holder extends StatusDisplayItem.Holder<WarningFilteredStatusDisplayItem>{
|
public static class Holder extends StatusDisplayItem.Holder<WarningFilteredStatusDisplayItem>{
|
||||||
public final View warningWrap;
|
public final View warningWrap;
|
||||||
|
public final Button showBtn;
|
||||||
public final TextView text;
|
public final TextView text;
|
||||||
public List<StatusDisplayItem> filteredItems;
|
public ArrayList<StatusDisplayItem> filteredItems;
|
||||||
|
|
||||||
public Holder(Context context, ViewGroup parent) {
|
public Holder(Context context, ViewGroup parent){
|
||||||
super(context, R.layout.display_item_filter_warning, parent);
|
super(context, R.layout.display_item_warning, parent);
|
||||||
warningWrap=findViewById(R.id.warning_wrap);
|
warningWrap=findViewById(R.id.warning_wrap);
|
||||||
|
showBtn=findViewById(R.id.reveal_btn);
|
||||||
|
showBtn.setOnClickListener(i -> item.parentFragment.onWarningClick(this));
|
||||||
text=findViewById(R.id.text);
|
text=findViewById(R.id.text);
|
||||||
|
// itemView.setOnClickListener(v->item.parentFragment.onRevealFilteredClick(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBind(WarningFilteredStatusDisplayItem item) {
|
public void onBind(WarningFilteredStatusDisplayItem item){
|
||||||
filteredItems = item.filteredItems;
|
filteredItems = item.filteredItems;
|
||||||
text.setText(item.parentFragment.getString(R.string.sk_filtered, item.status.filtered.get(item.status.filtered.size() -1).filter.title));
|
text.setText(item.parentFragment.getString(R.string.mo_filtered, item.status.filtered.get(item.status.filtered.size() -1).filter.title));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick() {
|
public void onClick(){
|
||||||
item.parentFragment.onWarningClick(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public class ClickableLinksDelegate {
|
|||||||
if (selectedSpan != null) selectedSpan.onLongClick(view);
|
if (selectedSpan != null) selectedSpan.onLongClick(view);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
public ClickableLinksDelegate(TextView view) {
|
public ClickableLinksDelegate(TextView view) {
|
||||||
this.view=view;
|
this.view=view;
|
||||||
hlPaint=new Paint();
|
hlPaint=new Paint();
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package org.joinmastodon.android.ui.text;
|
package org.joinmastodon.android.ui.text;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.text.TextPaint;
|
import android.text.TextPaint;
|
||||||
import android.text.style.CharacterStyle;
|
import android.text.style.CharacterStyle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
@@ -47,7 +49,14 @@ public class LinkSpan extends CharacterStyle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onLongClick(View view) {
|
public void onLongClick(View view) {
|
||||||
UiUtils.copyText(view, getType() == Type.URL ? link : text);
|
if (getType() == Type.URL) {
|
||||||
|
Intent shareIntent = new Intent(Intent.ACTION_SEND)
|
||||||
|
.setType("text/plain")
|
||||||
|
.putExtra(Intent.EXTRA_TEXT, link);
|
||||||
|
view.getContext().startActivity(Intent.createChooser(shareIntent, null));
|
||||||
|
} else {
|
||||||
|
UiUtils.copyText(view, text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLink(){
|
public String getLink(){
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ public class ColorPalette {
|
|||||||
ColorPreference.BLUE, new ColorPalette(R.style.ColorPalette_Blue),
|
ColorPreference.BLUE, new ColorPalette(R.style.ColorPalette_Blue),
|
||||||
ColorPreference.BROWN, new ColorPalette(R.style.ColorPalette_Brown),
|
ColorPreference.BROWN, new ColorPalette(R.style.ColorPalette_Brown),
|
||||||
ColorPreference.RED, new ColorPalette(R.style.ColorPalette_Red),
|
ColorPreference.RED, new ColorPalette(R.style.ColorPalette_Red),
|
||||||
ColorPreference.YELLOW, new ColorPalette(R.style.ColorPalette_Yellow)
|
ColorPreference.YELLOW, new ColorPalette(R.style.ColorPalette_Yellow),
|
||||||
|
ColorPreference.NORD, new ColorPalette(R.style.ColorPalette_Nord)
|
||||||
);
|
);
|
||||||
|
|
||||||
private @StyleRes int base;
|
private @StyleRes int base;
|
||||||
|
|||||||
@@ -130,48 +130,47 @@ import me.grishka.appkit.imageloader.requests.UrlImageLoaderRequest;
|
|||||||
import me.grishka.appkit.utils.V;
|
import me.grishka.appkit.utils.V;
|
||||||
import okhttp3.MediaType;
|
import okhttp3.MediaType;
|
||||||
|
|
||||||
public class UiUtils {
|
public class UiUtils{
|
||||||
private static Handler mainHandler = new Handler(Looper.getMainLooper());
|
private static Handler mainHandler=new Handler(Looper.getMainLooper());
|
||||||
private static final DateTimeFormatter DATE_FORMATTER_SHORT_WITH_YEAR = DateTimeFormatter.ofPattern("d MMM uuuu"), DATE_FORMATTER_SHORT = DateTimeFormatter.ofPattern("d MMM");
|
private static final DateTimeFormatter DATE_FORMATTER_SHORT_WITH_YEAR=DateTimeFormatter.ofPattern("d MMM uuuu"), DATE_FORMATTER_SHORT=DateTimeFormatter.ofPattern("d MMM");
|
||||||
public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG, FormatStyle.SHORT);
|
public static final DateTimeFormatter DATE_TIME_FORMATTER=DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG, FormatStyle.SHORT);
|
||||||
|
|
||||||
private UiUtils() {
|
private UiUtils(){}
|
||||||
}
|
|
||||||
|
|
||||||
public static void launchWebBrowser(Context context, String url) {
|
public static void launchWebBrowser(Context context, String url){
|
||||||
try {
|
try{
|
||||||
if (GlobalUserPreferences.useCustomTabs) {
|
if(GlobalUserPreferences.useCustomTabs){
|
||||||
new CustomTabsIntent.Builder()
|
new CustomTabsIntent.Builder()
|
||||||
.setShowTitle(true)
|
.setShowTitle(true)
|
||||||
.build()
|
.build()
|
||||||
.launchUrl(context, Uri.parse(url));
|
.launchUrl(context, Uri.parse(url));
|
||||||
} else {
|
}else{
|
||||||
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
|
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
|
||||||
}
|
}
|
||||||
} catch (ActivityNotFoundException x) {
|
}catch(ActivityNotFoundException x){
|
||||||
Toast.makeText(context, R.string.no_app_to_handle_action, Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, R.string.no_app_to_handle_action, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String formatRelativeTimestamp(Context context, Instant instant) {
|
public static String formatRelativeTimestamp(Context context, Instant instant){
|
||||||
long t = instant.toEpochMilli();
|
long t=instant.toEpochMilli();
|
||||||
long now = System.currentTimeMillis();
|
long now=System.currentTimeMillis();
|
||||||
long diff = now - t;
|
long diff=now-t;
|
||||||
if (diff < 1000L) {
|
if(diff<1000L){
|
||||||
return context.getString(R.string.time_now);
|
return context.getString(R.string.time_now);
|
||||||
} else if (diff < 60_000L) {
|
}else if(diff<60_000L){
|
||||||
return context.getString(R.string.time_seconds, diff / 1000L);
|
return context.getString(R.string.time_seconds, diff/1000L);
|
||||||
} else if (diff < 3600_000L) {
|
}else if(diff<3600_000L){
|
||||||
return context.getString(R.string.time_minutes, diff / 60_000L);
|
return context.getString(R.string.time_minutes, diff/60_000L);
|
||||||
} else if (diff < 3600_000L * 24L) {
|
}else if(diff<3600_000L*24L){
|
||||||
return context.getString(R.string.time_hours, diff / 3600_000L);
|
return context.getString(R.string.time_hours, diff/3600_000L);
|
||||||
} else {
|
}else{
|
||||||
int days = (int) (diff / (3600_000L * 24L));
|
int days=(int)(diff/(3600_000L*24L));
|
||||||
if (days > 30) {
|
if(days>30){
|
||||||
ZonedDateTime dt = instant.atZone(ZoneId.systemDefault());
|
ZonedDateTime dt=instant.atZone(ZoneId.systemDefault());
|
||||||
if (dt.getYear() == ZonedDateTime.now().getYear()) {
|
if(dt.getYear()==ZonedDateTime.now().getYear()){
|
||||||
return DATE_FORMATTER_SHORT.format(dt);
|
return DATE_FORMATTER_SHORT.format(dt);
|
||||||
} else {
|
}else{
|
||||||
return DATE_FORMATTER_SHORT_WITH_YEAR.format(dt);
|
return DATE_FORMATTER_SHORT_WITH_YEAR.format(dt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,220 +178,224 @@ public class UiUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String formatRelativeTimestampAsMinutesAgo(Context context, Instant instant) {
|
public static int alphaBlendColors(int color1, int color2, float alpha) {
|
||||||
long t = instant.toEpochMilli();
|
float alpha0 = 1f - alpha;
|
||||||
long now = System.currentTimeMillis();
|
int r = Math.round(((color1 >> 16) & 0xFF) * alpha0 + ((color2 >> 16) & 0xFF) * alpha);
|
||||||
long diff = now - t;
|
int g = Math.round(((color1 >> 8) & 0xFF) * alpha0 + ((color2 >> 8) & 0xFF) * alpha);
|
||||||
if (diff < 1000L) {
|
int b = Math.round((color1 & 0xFF) * alpha0 + (color2 & 0xFF) * alpha);
|
||||||
|
return 0xFF000000 | (r << 16) | (g << 8) | b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String formatRelativeTimestampAsMinutesAgo(Context context, Instant instant){
|
||||||
|
long t=instant.toEpochMilli();
|
||||||
|
long now=System.currentTimeMillis();
|
||||||
|
long diff=now-t;
|
||||||
|
if(diff<1000L){
|
||||||
return context.getString(R.string.time_just_now);
|
return context.getString(R.string.time_just_now);
|
||||||
} else if (diff < 60_000L) {
|
}else if(diff<60_000L){
|
||||||
int secs = (int) (diff / 1000L);
|
int secs=(int)(diff/1000L);
|
||||||
return context.getResources().getQuantityString(R.plurals.x_seconds_ago, secs, secs);
|
return context.getResources().getQuantityString(R.plurals.x_seconds_ago, secs, secs);
|
||||||
} else if (diff < 3600_000L) {
|
}else if(diff<3600_000L){
|
||||||
int mins = (int) (diff / 60_000L);
|
int mins=(int)(diff/60_000L);
|
||||||
return context.getResources().getQuantityString(R.plurals.x_minutes_ago, mins, mins);
|
return context.getResources().getQuantityString(R.plurals.x_minutes_ago, mins, mins);
|
||||||
} else {
|
}else{
|
||||||
return DATE_TIME_FORMATTER.format(instant.atZone(ZoneId.systemDefault()));
|
return DATE_TIME_FORMATTER.format(instant.atZone(ZoneId.systemDefault()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String formatTimeLeft(Context context, Instant instant) {
|
public static String formatTimeLeft(Context context, Instant instant){
|
||||||
long t = instant.toEpochMilli();
|
long t=instant.toEpochMilli();
|
||||||
long now = System.currentTimeMillis();
|
long now=System.currentTimeMillis();
|
||||||
long diff = t - now;
|
long diff=t-now;
|
||||||
if (diff < 60_000L) {
|
if(diff<60_000L){
|
||||||
int secs = (int) (diff / 1000L);
|
int secs=(int)(diff/1000L);
|
||||||
return context.getResources().getQuantityString(R.plurals.x_seconds_left, secs, secs);
|
return context.getResources().getQuantityString(R.plurals.x_seconds_left, secs, secs);
|
||||||
} else if (diff < 3600_000L) {
|
}else if(diff<3600_000L){
|
||||||
int mins = (int) (diff / 60_000L);
|
int mins=(int)(diff/60_000L);
|
||||||
return context.getResources().getQuantityString(R.plurals.x_minutes_left, mins, mins);
|
return context.getResources().getQuantityString(R.plurals.x_minutes_left, mins, mins);
|
||||||
} else if (diff < 3600_000L * 24L) {
|
}else if(diff<3600_000L*24L){
|
||||||
int hours = (int) (diff / 3600_000L);
|
int hours=(int)(diff/3600_000L);
|
||||||
return context.getResources().getQuantityString(R.plurals.x_hours_left, hours, hours);
|
return context.getResources().getQuantityString(R.plurals.x_hours_left, hours, hours);
|
||||||
} else {
|
}else{
|
||||||
int days = (int) (diff / (3600_000L * 24L));
|
int days=(int)(diff/(3600_000L*24L));
|
||||||
return context.getResources().getQuantityString(R.plurals.x_days_left, days, days);
|
return context.getResources().getQuantityString(R.plurals.x_days_left, days, days);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("DefaultLocale")
|
@SuppressLint("DefaultLocale")
|
||||||
public static String abbreviateNumber(int n) {
|
public static String abbreviateNumber(int n){
|
||||||
if (n < 1000) {
|
if(n<1000){
|
||||||
return String.format("%,d", n);
|
return String.format("%,d", n);
|
||||||
} else if (n < 1_000_000) {
|
}else if(n<1_000_000){
|
||||||
float a = n / 1000f;
|
float a=n/1000f;
|
||||||
return a > 99f ? String.format("%,dK", (int) Math.floor(a)) : String.format("%,.1fK", a);
|
return a>99f ? String.format("%,dK", (int)Math.floor(a)) : String.format("%,.1fK", a);
|
||||||
} else {
|
}else{
|
||||||
float a = n / 1_000_000f;
|
float a=n/1_000_000f;
|
||||||
return a > 99f ? String.format("%,dM", (int) Math.floor(a)) : String.format("%,.1fM", n / 1_000_000f);
|
return a>99f ? String.format("%,dM", (int)Math.floor(a)) : String.format("%,.1fM", n/1_000_000f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("DefaultLocale")
|
@SuppressLint("DefaultLocale")
|
||||||
public static String abbreviateNumber(long n) {
|
public static String abbreviateNumber(long n){
|
||||||
if (n < 1_000_000_000L)
|
if(n<1_000_000_000L)
|
||||||
return abbreviateNumber((int) n);
|
return abbreviateNumber((int)n);
|
||||||
|
|
||||||
double a = n / 1_000_000_000.0;
|
double a=n/1_000_000_000.0;
|
||||||
return a > 99f ? String.format("%,dB", (int) Math.floor(a)) : String.format("%,.1fB", n / 1_000_000_000.0);
|
return a>99f ? String.format("%,dB", (int)Math.floor(a)) : String.format("%,.1fB", n/1_000_000_000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Android 6.0 has a bug where start and end compound drawables don't get tinted.
|
* Android 6.0 has a bug where start and end compound drawables don't get tinted.
|
||||||
* This works around it by setting the tint colors directly to the drawables.
|
* This works around it by setting the tint colors directly to the drawables.
|
||||||
*
|
|
||||||
* @param textView
|
* @param textView
|
||||||
*/
|
*/
|
||||||
public static void fixCompoundDrawableTintOnAndroid6(TextView textView) {
|
public static void fixCompoundDrawableTintOnAndroid6(TextView textView){
|
||||||
Drawable[] drawables = textView.getCompoundDrawablesRelative();
|
Drawable[] drawables=textView.getCompoundDrawablesRelative();
|
||||||
for (int i = 0; i < drawables.length; i++) {
|
for(int i=0;i<drawables.length;i++){
|
||||||
if (drawables[i] != null) {
|
if(drawables[i]!=null){
|
||||||
Drawable tinted = drawables[i].mutate();
|
Drawable tinted=drawables[i].mutate();
|
||||||
tinted.setTintList(textView.getTextColors());
|
tinted.setTintList(textView.getTextColors());
|
||||||
drawables[i] = tinted;
|
drawables[i]=tinted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
textView.setCompoundDrawablesRelative(drawables[0], drawables[1], drawables[2], drawables[3]);
|
textView.setCompoundDrawablesRelative(drawables[0], drawables[1], drawables[2], drawables[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void runOnUiThread(Runnable runnable) {
|
public static void runOnUiThread(Runnable runnable){
|
||||||
mainHandler.post(runnable);
|
mainHandler.post(runnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void runOnUiThread(Runnable runnable, long delay) {
|
public static void runOnUiThread(Runnable runnable, long delay){
|
||||||
mainHandler.postDelayed(runnable, delay);
|
mainHandler.postDelayed(runnable, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void removeCallbacks(Runnable runnable) {
|
public static void removeCallbacks(Runnable runnable){
|
||||||
mainHandler.removeCallbacks(runnable);
|
mainHandler.removeCallbacks(runnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Linear interpolation between {@code startValue} and {@code endValue} by {@code fraction}. */
|
||||||
* Linear interpolation between {@code startValue} and {@code endValue} by {@code fraction}.
|
|
||||||
*/
|
|
||||||
public static int lerp(int startValue, int endValue, float fraction) {
|
public static int lerp(int startValue, int endValue, float fraction) {
|
||||||
return startValue + Math.round(fraction * (endValue - startValue));
|
return startValue + Math.round(fraction * (endValue - startValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFileName(Uri uri) {
|
public static String getFileName(Uri uri){
|
||||||
if (uri.getScheme().equals("content")) {
|
if(uri.getScheme().equals("content")){
|
||||||
try (Cursor cursor = MastodonApp.context.getContentResolver().query(uri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null)) {
|
try(Cursor cursor=MastodonApp.context.getContentResolver().query(uri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null)){
|
||||||
cursor.moveToFirst();
|
cursor.moveToFirst();
|
||||||
String name = cursor.getString(0);
|
String name=cursor.getString(0);
|
||||||
if (name != null)
|
if(name!=null)
|
||||||
return name;
|
return name;
|
||||||
} catch (Throwable ignore) {
|
}catch(Throwable ignore){}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return uri.getLastPathSegment();
|
return uri.getLastPathSegment();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String formatFileSize(Context context, long size, boolean atLeastKB) {
|
public static String formatFileSize(Context context, long size, boolean atLeastKB){
|
||||||
if (size < 1024 && !atLeastKB) {
|
if(size<1024 && !atLeastKB){
|
||||||
return context.getString(R.string.file_size_bytes, size);
|
return context.getString(R.string.file_size_bytes, size);
|
||||||
} else if (size < 1024 * 1024) {
|
}else if(size<1024*1024){
|
||||||
return context.getString(R.string.file_size_kb, size / 1024.0);
|
return context.getString(R.string.file_size_kb, size/1024.0);
|
||||||
} else if (size < 1024 * 1024 * 1024) {
|
}else if(size<1024*1024*1024){
|
||||||
return context.getString(R.string.file_size_mb, size / (1024.0 * 1024.0));
|
return context.getString(R.string.file_size_mb, size/(1024.0*1024.0));
|
||||||
} else {
|
}else{
|
||||||
return context.getString(R.string.file_size_gb, size / (1024.0 * 1024.0 * 1024.0));
|
return context.getString(R.string.file_size_gb, size/(1024.0*1024.0*1024.0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MediaType getFileMediaType(File file) {
|
public static MediaType getFileMediaType(File file){
|
||||||
String name = file.getName();
|
String name=file.getName();
|
||||||
return MediaType.parse(MimeTypeMap.getSingleton().getMimeTypeFromExtension(name.substring(name.lastIndexOf('.') + 1)));
|
return MediaType.parse(MimeTypeMap.getSingleton().getMimeTypeFromExtension(name.substring(name.lastIndexOf('.')+1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadCustomEmojiInTextView(TextView view) {
|
public static void loadCustomEmojiInTextView(TextView view){
|
||||||
CharSequence _text = view.getText();
|
CharSequence _text=view.getText();
|
||||||
if (!(_text instanceof Spanned))
|
if(!(_text instanceof Spanned))
|
||||||
return;
|
return;
|
||||||
Spanned text = (Spanned) _text;
|
Spanned text=(Spanned)_text;
|
||||||
CustomEmojiSpan[] spans = text.getSpans(0, text.length(), CustomEmojiSpan.class);
|
CustomEmojiSpan[] spans=text.getSpans(0, text.length(), CustomEmojiSpan.class);
|
||||||
if (spans.length == 0)
|
if(spans.length==0)
|
||||||
return;
|
return;
|
||||||
int emojiSize = V.dp(20);
|
int emojiSize=V.dp(20);
|
||||||
Map<Emoji, List<CustomEmojiSpan>> spansByEmoji = Arrays.stream(spans).collect(Collectors.groupingBy(s -> s.emoji));
|
Map<Emoji, List<CustomEmojiSpan>> spansByEmoji=Arrays.stream(spans).collect(Collectors.groupingBy(s->s.emoji));
|
||||||
for (Map.Entry<Emoji, List<CustomEmojiSpan>> emoji : spansByEmoji.entrySet()) {
|
for(Map.Entry<Emoji, List<CustomEmojiSpan>> emoji:spansByEmoji.entrySet()){
|
||||||
ViewImageLoader.load(new ViewImageLoader.Target() {
|
ViewImageLoader.load(new ViewImageLoader.Target(){
|
||||||
@Override
|
@Override
|
||||||
public void setImageDrawable(Drawable d) {
|
public void setImageDrawable(Drawable d){
|
||||||
if (d == null)
|
if(d==null)
|
||||||
return;
|
return;
|
||||||
for (CustomEmojiSpan span : emoji.getValue()) {
|
for(CustomEmojiSpan span:emoji.getValue()){
|
||||||
span.setDrawable(d);
|
span.setDrawable(d);
|
||||||
}
|
}
|
||||||
view.invalidate();
|
view.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView() {
|
public View getView(){
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}, null, new UrlImageLoaderRequest(emoji.getKey().url, emojiSize, emojiSize), null, false, true);
|
}, null, new UrlImageLoaderRequest(emoji.getKey().url, emojiSize, emojiSize), null, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getThemeColor(Context context, @AttrRes int attr) {
|
public static int getThemeColor(Context context, @AttrRes int attr){
|
||||||
TypedArray ta = context.obtainStyledAttributes(new int[]{attr});
|
TypedArray ta=context.obtainStyledAttributes(new int[]{attr});
|
||||||
int color = ta.getColor(0, 0xff00ff00);
|
int color=ta.getColor(0, 0xff00ff00);
|
||||||
ta.recycle();
|
ta.recycle();
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void openProfileByID(Context context, String selfID, String id) {
|
public static void openProfileByID(Context context, String selfID, String id){
|
||||||
Bundle args = new Bundle();
|
Bundle args=new Bundle();
|
||||||
args.putString("account", selfID);
|
args.putString("account", selfID);
|
||||||
args.putString("profileAccountID", id);
|
args.putString("profileAccountID", id);
|
||||||
Nav.go((Activity) context, ProfileFragment.class, args);
|
Nav.go((Activity)context, ProfileFragment.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void openHashtagTimeline(Context context, String accountID, String hashtag, @Nullable Boolean following) {
|
public static void openHashtagTimeline(Context context, String accountID, String hashtag, @Nullable Boolean following){
|
||||||
Bundle args = new Bundle();
|
Bundle args=new Bundle();
|
||||||
args.putString("account", accountID);
|
args.putString("account", accountID);
|
||||||
args.putString("hashtag", hashtag);
|
args.putString("hashtag", hashtag);
|
||||||
if (following != null) args.putBoolean("following", following);
|
if (following != null) args.putBoolean("following", following);
|
||||||
Nav.go((Activity) context, HashtagTimelineFragment.class, args);
|
Nav.go((Activity)context, HashtagTimelineFragment.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showConfirmationAlert(Context context, @StringRes int title, @StringRes int message, @StringRes int confirmButton, Runnable onConfirmed) {
|
public static void showConfirmationAlert(Context context, @StringRes int title, @StringRes int message, @StringRes int confirmButton, Runnable onConfirmed){
|
||||||
showConfirmationAlert(context, title, message, confirmButton, 0, onConfirmed);
|
showConfirmationAlert(context, title, message, confirmButton, 0, onConfirmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showConfirmationAlert(Context context, @StringRes int title, @StringRes int message, @StringRes int confirmButton, @DrawableRes int icon, Runnable onConfirmed) {
|
public static void showConfirmationAlert(Context context, @StringRes int title, @StringRes int message, @StringRes int confirmButton, @DrawableRes int icon, Runnable onConfirmed){
|
||||||
showConfirmationAlert(context, context.getString(title), context.getString(message), context.getString(confirmButton), icon, onConfirmed);
|
showConfirmationAlert(context, context.getString(title), context.getString(message), context.getString(confirmButton), icon, onConfirmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showConfirmationAlert(Context context, CharSequence title, CharSequence message, CharSequence confirmButton, int icon, Runnable onConfirmed) {
|
public static void showConfirmationAlert(Context context, CharSequence title, CharSequence message, CharSequence confirmButton, int icon, Runnable onConfirmed){
|
||||||
new M3AlertDialogBuilder(context)
|
new M3AlertDialogBuilder(context)
|
||||||
.setTitle(title)
|
.setTitle(title)
|
||||||
.setMessage(message)
|
.setMessage(message)
|
||||||
.setPositiveButton(confirmButton, (dlg, i) -> onConfirmed.run())
|
.setPositiveButton(confirmButton, (dlg, i)->onConfirmed.run())
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.setIcon(icon)
|
.setIcon(icon)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void confirmToggleBlockUser(Activity activity, String accountID, Account account, boolean currentlyBlocked, Consumer<Relationship> resultCallback) {
|
public static void confirmToggleBlockUser(Activity activity, String accountID, Account account, boolean currentlyBlocked, Consumer<Relationship> resultCallback){
|
||||||
showConfirmationAlert(activity, activity.getString(currentlyBlocked ? R.string.confirm_unblock_title : R.string.confirm_block_title),
|
showConfirmationAlert(activity, activity.getString(currentlyBlocked ? R.string.confirm_unblock_title : R.string.confirm_block_title),
|
||||||
activity.getString(currentlyBlocked ? R.string.confirm_unblock : R.string.confirm_block, account.displayName),
|
activity.getString(currentlyBlocked ? R.string.confirm_unblock : R.string.confirm_block, account.displayName),
|
||||||
activity.getString(currentlyBlocked ? R.string.do_unblock : R.string.do_block),
|
activity.getString(currentlyBlocked ? R.string.do_unblock : R.string.do_block),
|
||||||
R.drawable.ic_fluent_person_prohibited_28_regular,
|
R.drawable.ic_fluent_person_prohibited_28_regular,
|
||||||
() -> {
|
()->{
|
||||||
new SetAccountBlocked(account.id, !currentlyBlocked)
|
new SetAccountBlocked(account.id, !currentlyBlocked)
|
||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Relationship result) {
|
public void onSuccess(Relationship result){
|
||||||
if (activity == null) return;
|
if (activity == null) return;
|
||||||
resultCallback.accept(result);
|
resultCallback.accept(result);
|
||||||
if (!currentlyBlocked) {
|
if(!currentlyBlocked){
|
||||||
E.post(new RemoveAccountPostsEvent(accountID, account.id, false));
|
E.post(new RemoveAccountPostsEvent(accountID, account.id, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(ErrorResponse error) {
|
public void onError(ErrorResponse error){
|
||||||
error.showToast(activity);
|
error.showToast(activity);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -401,7 +404,7 @@ public class UiUtils {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void confirmSoftBlockUser(Activity activity, String accountID, Account account, Consumer<Relationship> resultCallback) {
|
public static void confirmSoftBlockUser(Activity activity, String accountID, Account account, Consumer<Relationship> resultCallback){
|
||||||
showConfirmationAlert(activity,
|
showConfirmationAlert(activity,
|
||||||
activity.getString(R.string.sk_remove_follower),
|
activity.getString(R.string.sk_remove_follower),
|
||||||
activity.getString(R.string.sk_remove_follower_confirm, account.displayName),
|
activity.getString(R.string.sk_remove_follower_confirm, account.displayName),
|
||||||
@@ -434,21 +437,21 @@ public class UiUtils {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void confirmToggleBlockDomain(Activity activity, String accountID, String domain, boolean currentlyBlocked, Runnable resultCallback) {
|
public static void confirmToggleBlockDomain(Activity activity, String accountID, String domain, boolean currentlyBlocked, Runnable resultCallback){
|
||||||
showConfirmationAlert(activity, activity.getString(currentlyBlocked ? R.string.confirm_unblock_domain_title : R.string.confirm_block_domain_title),
|
showConfirmationAlert(activity, activity.getString(currentlyBlocked ? R.string.confirm_unblock_domain_title : R.string.confirm_block_domain_title),
|
||||||
activity.getString(currentlyBlocked ? R.string.confirm_unblock : R.string.confirm_block, domain),
|
activity.getString(currentlyBlocked ? R.string.confirm_unblock : R.string.confirm_block, domain),
|
||||||
activity.getString(currentlyBlocked ? R.string.do_unblock : R.string.do_block),
|
activity.getString(currentlyBlocked ? R.string.do_unblock : R.string.do_block),
|
||||||
R.drawable.ic_fluent_shield_28_regular,
|
R.drawable.ic_fluent_shield_28_regular,
|
||||||
() -> {
|
()->{
|
||||||
new SetDomainBlocked(domain, !currentlyBlocked)
|
new SetDomainBlocked(domain, !currentlyBlocked)
|
||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Object result) {
|
public void onSuccess(Object result){
|
||||||
resultCallback.run();
|
resultCallback.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(ErrorResponse error) {
|
public void onError(ErrorResponse error){
|
||||||
error.showToast(activity);
|
error.showToast(activity);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -457,24 +460,24 @@ public class UiUtils {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void confirmToggleMuteUser(Activity activity, String accountID, Account account, boolean currentlyMuted, Consumer<Relationship> resultCallback) {
|
public static void confirmToggleMuteUser(Activity activity, String accountID, Account account, boolean currentlyMuted, Consumer<Relationship> resultCallback){
|
||||||
showConfirmationAlert(activity, activity.getString(currentlyMuted ? R.string.confirm_unmute_title : R.string.confirm_mute_title),
|
showConfirmationAlert(activity, activity.getString(currentlyMuted ? R.string.confirm_unmute_title : R.string.confirm_mute_title),
|
||||||
activity.getString(currentlyMuted ? R.string.confirm_unmute : R.string.confirm_mute, account.displayName),
|
activity.getString(currentlyMuted ? R.string.confirm_unmute : R.string.confirm_mute, account.displayName),
|
||||||
activity.getString(currentlyMuted ? R.string.do_unmute : R.string.do_mute),
|
activity.getString(currentlyMuted ? R.string.do_unmute : R.string.do_mute),
|
||||||
currentlyMuted ? R.drawable.ic_fluent_speaker_0_28_regular : R.drawable.ic_fluent_speaker_off_28_regular,
|
currentlyMuted ? R.drawable.ic_fluent_speaker_0_28_regular : R.drawable.ic_fluent_speaker_off_28_regular,
|
||||||
() -> {
|
()->{
|
||||||
new SetAccountMuted(account.id, !currentlyMuted)
|
new SetAccountMuted(account.id, !currentlyMuted)
|
||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Relationship result) {
|
public void onSuccess(Relationship result){
|
||||||
resultCallback.accept(result);
|
resultCallback.accept(result);
|
||||||
if (!currentlyMuted) {
|
if(!currentlyMuted){
|
||||||
E.post(new RemoveAccountPostsEvent(accountID, account.id, false));
|
E.post(new RemoveAccountPostsEvent(accountID, account.id, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(ErrorResponse error) {
|
public void onError(ErrorResponse error){
|
||||||
error.showToast(activity);
|
error.showToast(activity);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -482,28 +485,27 @@ public class UiUtils {
|
|||||||
.exec(accountID);
|
.exec(accountID);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
public static void confirmDeletePost(Activity activity, String accountID, Status status, Consumer<Status> resultCallback){
|
||||||
public static void confirmDeletePost(Activity activity, String accountID, Status status, Consumer<Status> resultCallback) {
|
|
||||||
confirmDeletePost(activity, accountID, status, resultCallback, false);
|
confirmDeletePost(activity, accountID, status, resultCallback, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void confirmDeletePost(Activity activity, String accountID, Status status, Consumer<Status> resultCallback, boolean forRedraft) {
|
public static void confirmDeletePost(Activity activity, String accountID, Status status, Consumer<Status> resultCallback, boolean forRedraft){
|
||||||
showConfirmationAlert(activity,
|
showConfirmationAlert(activity,
|
||||||
forRedraft ? R.string.sk_confirm_delete_and_redraft_title : R.string.confirm_delete_title,
|
forRedraft ? R.string.sk_confirm_delete_and_redraft_title : R.string.confirm_delete_title,
|
||||||
forRedraft ? R.string.sk_confirm_delete_and_redraft : R.string.confirm_delete,
|
forRedraft ? R.string.sk_confirm_delete_and_redraft : R.string.confirm_delete,
|
||||||
forRedraft ? R.string.sk_delete_and_redraft : R.string.delete,
|
forRedraft ? R.string.sk_delete_and_redraft : R.string.delete,
|
||||||
forRedraft ? R.drawable.ic_fluent_arrow_clockwise_28_regular : R.drawable.ic_fluent_delete_28_regular,
|
forRedraft ? R.drawable.ic_fluent_arrow_clockwise_28_regular : R.drawable.ic_fluent_delete_28_regular,
|
||||||
() -> new DeleteStatus(status.id)
|
() -> new DeleteStatus(status.id)
|
||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Status result) {
|
public void onSuccess(Status result){
|
||||||
resultCallback.accept(result);
|
resultCallback.accept(result);
|
||||||
AccountSessionManager.getInstance().getAccount(accountID).getCacheController().deleteStatus(status.id);
|
AccountSessionManager.getInstance().getAccount(accountID).getCacheController().deleteStatus(status.id);
|
||||||
E.post(new StatusDeletedEvent(status.id, accountID));
|
E.post(new StatusDeletedEvent(status.id, accountID));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(ErrorResponse error) {
|
public void onError(ErrorResponse error){
|
||||||
error.showToast(activity);
|
error.showToast(activity);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -512,7 +514,7 @@ public class UiUtils {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void confirmDeleteScheduledPost(Activity activity, String accountID, ScheduledStatus status, Runnable resultCallback) {
|
public static void confirmDeleteScheduledPost(Activity activity, String accountID, ScheduledStatus status, Runnable resultCallback){
|
||||||
boolean isDraft = status.scheduledAt.isAfter(CreateStatus.DRAFTS_AFTER_INSTANT);
|
boolean isDraft = status.scheduledAt.isAfter(CreateStatus.DRAFTS_AFTER_INSTANT);
|
||||||
showConfirmationAlert(activity,
|
showConfirmationAlert(activity,
|
||||||
isDraft ? R.string.sk_confirm_delete_draft_title : R.string.sk_confirm_delete_scheduled_post_title,
|
isDraft ? R.string.sk_confirm_delete_draft_title : R.string.sk_confirm_delete_scheduled_post_title,
|
||||||
@@ -520,15 +522,15 @@ public class UiUtils {
|
|||||||
R.string.delete,
|
R.string.delete,
|
||||||
R.drawable.ic_fluent_delete_28_regular,
|
R.drawable.ic_fluent_delete_28_regular,
|
||||||
() -> new DeleteStatus.Scheduled(status.id)
|
() -> new DeleteStatus.Scheduled(status.id)
|
||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Object o) {
|
public void onSuccess(Object o){
|
||||||
resultCallback.run();
|
resultCallback.run();
|
||||||
E.post(new ScheduledStatusDeletedEvent(status.id, accountID));
|
E.post(new ScheduledStatusDeletedEvent(status.id, accountID));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(ErrorResponse error) {
|
public void onError(ErrorResponse error){
|
||||||
error.showToast(activity);
|
error.showToast(activity);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -537,13 +539,13 @@ public class UiUtils {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void confirmPinPost(Activity activity, String accountID, Status status, boolean pinned, Consumer<Status> resultCallback) {
|
public static void confirmPinPost(Activity activity, String accountID, Status status, boolean pinned, Consumer<Status> resultCallback){
|
||||||
showConfirmationAlert(activity,
|
showConfirmationAlert(activity,
|
||||||
pinned ? R.string.sk_confirm_pin_post_title : R.string.sk_confirm_unpin_post_title,
|
pinned ? R.string.sk_confirm_pin_post_title : R.string.sk_confirm_unpin_post_title,
|
||||||
pinned ? R.string.sk_confirm_pin_post : R.string.sk_confirm_unpin_post,
|
pinned ? R.string.sk_confirm_pin_post : R.string.sk_confirm_unpin_post,
|
||||||
pinned ? R.string.sk_pin_post : R.string.sk_unpin_post,
|
pinned ? R.string.sk_pin_post : R.string.sk_unpin_post,
|
||||||
pinned ? R.drawable.ic_fluent_pin_28_regular : R.drawable.ic_fluent_pin_off_28_regular,
|
pinned ? R.drawable.ic_fluent_pin_28_regular : R.drawable.ic_fluent_pin_off_28_regular,
|
||||||
() -> {
|
()->{
|
||||||
new SetStatusPinned(status.id, pinned)
|
new SetStatusPinned(status.id, pinned)
|
||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -606,42 +608,42 @@ public class UiUtils {
|
|||||||
.exec(accountID));
|
.exec(accountID));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setRelationshipToActionButton(Relationship relationship, Button button) {
|
public static void setRelationshipToActionButton(Relationship relationship, Button button){
|
||||||
setRelationshipToActionButton(relationship, button, false);
|
setRelationshipToActionButton(relationship, button, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setRelationshipToActionButton(Relationship relationship, Button button, boolean keepText) {
|
public static void setRelationshipToActionButton(Relationship relationship, Button button, boolean keepText){
|
||||||
CharSequence textBefore = keepText ? button.getText() : null;
|
CharSequence textBefore = keepText ? button.getText() : null;
|
||||||
boolean secondaryStyle;
|
boolean secondaryStyle;
|
||||||
if (relationship.blocking) {
|
if(relationship.blocking){
|
||||||
button.setText(R.string.button_blocked);
|
button.setText(R.string.button_blocked);
|
||||||
secondaryStyle = true;
|
secondaryStyle=true;
|
||||||
} else if (relationship.blockedBy) {
|
}else if(relationship.blockedBy){
|
||||||
button.setText(R.string.button_follow);
|
button.setText(R.string.button_follow);
|
||||||
secondaryStyle = false;
|
secondaryStyle=false;
|
||||||
} else if (relationship.requested) {
|
}else if(relationship.requested){
|
||||||
button.setText(R.string.button_follow_pending);
|
button.setText(R.string.button_follow_pending);
|
||||||
secondaryStyle = true;
|
secondaryStyle=true;
|
||||||
} else if (!relationship.following) {
|
}else if(!relationship.following){
|
||||||
button.setText(relationship.followedBy ? R.string.follow_back : R.string.button_follow);
|
button.setText(relationship.followedBy ? R.string.follow_back : R.string.button_follow);
|
||||||
secondaryStyle = false;
|
secondaryStyle=false;
|
||||||
} else {
|
}else{
|
||||||
button.setText(R.string.button_following);
|
button.setText(R.string.button_following);
|
||||||
secondaryStyle = true;
|
secondaryStyle=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keepText) button.setText(textBefore);
|
if (keepText) button.setText(textBefore);
|
||||||
|
|
||||||
button.setEnabled(!relationship.blockedBy);
|
button.setEnabled(!relationship.blockedBy);
|
||||||
int attr = secondaryStyle ? R.attr.secondaryButtonStyle : android.R.attr.buttonStyle;
|
int attr=secondaryStyle ? R.attr.secondaryButtonStyle : android.R.attr.buttonStyle;
|
||||||
TypedArray ta = button.getContext().obtainStyledAttributes(new int[]{attr});
|
TypedArray ta=button.getContext().obtainStyledAttributes(new int[]{attr});
|
||||||
int styleRes = ta.getResourceId(0, 0);
|
int styleRes=ta.getResourceId(0, 0);
|
||||||
ta.recycle();
|
ta.recycle();
|
||||||
ta = button.getContext().obtainStyledAttributes(styleRes, new int[]{android.R.attr.background});
|
ta=button.getContext().obtainStyledAttributes(styleRes, new int[]{android.R.attr.background});
|
||||||
button.setBackground(ta.getDrawable(0));
|
button.setBackground(ta.getDrawable(0));
|
||||||
ta.recycle();
|
ta.recycle();
|
||||||
ta = button.getContext().obtainStyledAttributes(styleRes, new int[]{android.R.attr.textColor});
|
ta=button.getContext().obtainStyledAttributes(styleRes, new int[]{android.R.attr.textColor});
|
||||||
if (relationship.blocking)
|
if(relationship.blocking)
|
||||||
button.setTextColor(button.getResources().getColorStateList(R.color.error_600));
|
button.setTextColor(button.getResources().getColorStateList(R.color.error_600));
|
||||||
else
|
else
|
||||||
button.setTextColor(ta.getColorStateList(0));
|
button.setTextColor(ta.getColorStateList(0));
|
||||||
@@ -656,7 +658,7 @@ public class UiUtils {
|
|||||||
public void onSuccess(Relationship result) {
|
public void onSuccess(Relationship result) {
|
||||||
resultCallback.accept(result);
|
resultCallback.accept(result);
|
||||||
progressCallback.accept(false);
|
progressCallback.accept(false);
|
||||||
Toast.makeText(activity, activity.getString(result.notifying ? R.string.sk_user_post_notifications_on : R.string.sk_user_post_notifications_off, '@' + account.username), Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, activity.getString(result.notifying ? R.string.sk_user_post_notifications_on : R.string.sk_user_post_notifications_off, '@'+account.username), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -702,23 +704,23 @@ public class UiUtils {
|
|||||||
public static void performAccountAction(Activity activity, Account account, String accountID, Relationship relationship, Button button, Consumer<Boolean> progressCallback, Consumer<Relationship> resultCallback) {
|
public static void performAccountAction(Activity activity, Account account, String accountID, Relationship relationship, Button button, Consumer<Boolean> progressCallback, Consumer<Relationship> resultCallback) {
|
||||||
if (relationship.blocking) {
|
if (relationship.blocking) {
|
||||||
confirmToggleBlockUser(activity, accountID, account, true, resultCallback);
|
confirmToggleBlockUser(activity, accountID, account, true, resultCallback);
|
||||||
} else if (relationship.muting) {
|
}else if(relationship.muting){
|
||||||
confirmToggleMuteUser(activity, accountID, account, true, resultCallback);
|
confirmToggleMuteUser(activity, accountID, account, true, resultCallback);
|
||||||
} else {
|
}else{
|
||||||
progressCallback.accept(true);
|
progressCallback.accept(true);
|
||||||
new SetAccountFollowed(account.id, !relationship.following && !relationship.requested, true, false)
|
new SetAccountFollowed(account.id, !relationship.following && !relationship.requested, true, false)
|
||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Relationship result) {
|
public void onSuccess(Relationship result){
|
||||||
resultCallback.accept(result);
|
resultCallback.accept(result);
|
||||||
progressCallback.accept(false);
|
progressCallback.accept(false);
|
||||||
if (!result.following) {
|
if(!result.following){
|
||||||
E.post(new RemoveAccountPostsEvent(accountID, account.id, true));
|
E.post(new RemoveAccountPostsEvent(accountID, account.id, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(ErrorResponse error) {
|
public void onError(ErrorResponse error){
|
||||||
error.showToast(activity);
|
error.showToast(activity);
|
||||||
progressCallback.accept(false);
|
progressCallback.accept(false);
|
||||||
}
|
}
|
||||||
@@ -748,8 +750,7 @@ public class UiUtils {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(Relationship rel) {
|
public void onSuccess(Relationship rel) {
|
||||||
E.post(new FollowRequestHandledEvent(accountID, false, account, rel));
|
E.post(new FollowRequestHandledEvent(accountID, false, account, rel));
|
||||||
if (notificationID != null)
|
if (notificationID != null) E.post(new NotificationDeletedEvent(notificationID));
|
||||||
E.post(new NotificationDeletedEvent(notificationID));
|
|
||||||
resultCallback.accept(rel);
|
resultCallback.accept(rel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -762,34 +763,34 @@ public class UiUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> void updateList(List<T> oldList, List<T> newList, RecyclerView list, RecyclerView.Adapter<?> adapter, BiPredicate<T, T> areItemsSame) {
|
public static <T> void updateList(List<T> oldList, List<T> newList, RecyclerView list, RecyclerView.Adapter<?> adapter, BiPredicate<T, T> areItemsSame){
|
||||||
// Save topmost item position and offset because for some reason RecyclerView would scroll the list to weird places when you insert items at the top
|
// Save topmost item position and offset because for some reason RecyclerView would scroll the list to weird places when you insert items at the top
|
||||||
int topItem, topItemOffset;
|
int topItem, topItemOffset;
|
||||||
if (list.getChildCount() == 0) {
|
if(list.getChildCount()==0){
|
||||||
topItem = topItemOffset = 0;
|
topItem=topItemOffset=0;
|
||||||
} else {
|
}else{
|
||||||
View child = list.getChildAt(0);
|
View child=list.getChildAt(0);
|
||||||
topItem = list.getChildAdapterPosition(child);
|
topItem=list.getChildAdapterPosition(child);
|
||||||
topItemOffset = child.getTop();
|
topItemOffset=child.getTop();
|
||||||
}
|
}
|
||||||
DiffUtil.calculateDiff(new DiffUtil.Callback() {
|
DiffUtil.calculateDiff(new DiffUtil.Callback(){
|
||||||
@Override
|
@Override
|
||||||
public int getOldListSize() {
|
public int getOldListSize(){
|
||||||
return oldList.size();
|
return oldList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getNewListSize() {
|
public int getNewListSize(){
|
||||||
return newList.size();
|
return newList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
|
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition){
|
||||||
return areItemsSame.test(oldList.get(oldItemPosition), newList.get(newItemPosition));
|
return areItemsSame.test(oldList.get(oldItemPosition), newList.get(newItemPosition));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
|
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}).dispatchUpdatesTo(adapter);
|
}).dispatchUpdatesTo(adapter);
|
||||||
@@ -797,80 +798,77 @@ public class UiUtils {
|
|||||||
list.scrollBy(0, topItemOffset);
|
list.scrollBy(0, topItemOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Bitmap getBitmapFromDrawable(Drawable d) {
|
public static Bitmap getBitmapFromDrawable(Drawable d){
|
||||||
if (d instanceof BitmapDrawable)
|
if(d instanceof BitmapDrawable)
|
||||||
return ((BitmapDrawable) d).getBitmap();
|
return ((BitmapDrawable) d).getBitmap();
|
||||||
Bitmap bitmap = Bitmap.createBitmap(d.getIntrinsicWidth(), d.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
|
Bitmap bitmap=Bitmap.createBitmap(d.getIntrinsicWidth(), d.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
|
||||||
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
|
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
|
||||||
d.draw(new Canvas(bitmap));
|
d.draw(new Canvas(bitmap));
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void insetPopupMenuIcon(Context context, MenuItem item) {
|
public static void insetPopupMenuIcon(Context context, MenuItem item) {
|
||||||
ColorStateList iconTint = ColorStateList.valueOf(UiUtils.getThemeColor(context, android.R.attr.textColorSecondary));
|
ColorStateList iconTint=ColorStateList.valueOf(UiUtils.getThemeColor(context, android.R.attr.textColorSecondary));
|
||||||
insetPopupMenuIcon(item, iconTint);
|
insetPopupMenuIcon(item, iconTint);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void insetPopupMenuIcon(MenuItem item, ColorStateList iconTint) {
|
public static void insetPopupMenuIcon(MenuItem item, ColorStateList iconTint) {
|
||||||
Drawable icon = item.getIcon().mutate();
|
Drawable icon=item.getIcon().mutate();
|
||||||
if (Build.VERSION.SDK_INT >= 26) item.setIconTintList(iconTint);
|
if(Build.VERSION.SDK_INT>=26) item.setIconTintList(iconTint);
|
||||||
else icon.setTintList(iconTint);
|
else icon.setTintList(iconTint);
|
||||||
icon = new InsetDrawable(icon, V.dp(8), 0, V.dp(8), 0);
|
icon=new InsetDrawable(icon, V.dp(8), 0, V.dp(8), 0);
|
||||||
item.setIcon(icon);
|
item.setIcon(icon);
|
||||||
SpannableStringBuilder ssb = new SpannableStringBuilder(item.getTitle());
|
SpannableStringBuilder ssb=new SpannableStringBuilder(item.getTitle());
|
||||||
item.setTitle(ssb);
|
item.setTitle(ssb);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void resetPopupItemTint(MenuItem item) {
|
public static void resetPopupItemTint(MenuItem item) {
|
||||||
if (Build.VERSION.SDK_INT >= 26) {
|
if(Build.VERSION.SDK_INT>=26) {
|
||||||
item.setIconTintList(null);
|
item.setIconTintList(null);
|
||||||
} else {
|
} else {
|
||||||
Drawable icon = item.getIcon().mutate();
|
Drawable icon=item.getIcon().mutate();
|
||||||
icon.setTintList(null);
|
icon.setTintList(null);
|
||||||
item.setIcon(icon);
|
item.setIcon(icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void enableOptionsMenuIcons(Context context, Menu menu, @IdRes int... asAction) {
|
public static void enableOptionsMenuIcons(Context context, Menu menu, @IdRes int... asAction) {
|
||||||
if (menu.getClass().getSimpleName().equals("MenuBuilder")) {
|
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||||
try {
|
try {
|
||||||
Method m = menu.getClass().getDeclaredMethod("setOptionalIconsVisible", Boolean.TYPE);
|
Method m = menu.getClass().getDeclaredMethod("setOptionalIconsVisible", Boolean.TYPE);
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
m.invoke(menu, true);
|
m.invoke(menu, true);
|
||||||
enableMenuIcons(context, menu, asAction);
|
enableMenuIcons(context, menu, asAction);
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
}
|
||||||
|
catch(Exception ignored){}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void enableMenuIcons(Context context, Menu m, @IdRes int... exclude) {
|
public static void enableMenuIcons(Context context, Menu m, @IdRes int... exclude) {
|
||||||
ColorStateList iconTint = ColorStateList.valueOf(UiUtils.getThemeColor(context, android.R.attr.textColorSecondary));
|
ColorStateList iconTint=ColorStateList.valueOf(UiUtils.getThemeColor(context, android.R.attr.textColorSecondary));
|
||||||
for (int i = 0; i < m.size(); i++) {
|
for(int i=0;i<m.size();i++){
|
||||||
MenuItem item = m.getItem(i);
|
MenuItem item=m.getItem(i);
|
||||||
SubMenu subMenu = item.getSubMenu();
|
SubMenu subMenu = item.getSubMenu();
|
||||||
if (subMenu != null) enableMenuIcons(context, subMenu, exclude);
|
if (subMenu != null) enableMenuIcons(context, subMenu, exclude);
|
||||||
if (item.getIcon() == null || Arrays.stream(exclude).anyMatch(id -> id == item.getItemId()))
|
if (item.getIcon() == null || Arrays.stream(exclude).anyMatch(id -> id == item.getItemId())) continue;
|
||||||
continue;
|
|
||||||
insetPopupMenuIcon(item, iconTint);
|
insetPopupMenuIcon(item, iconTint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void enablePopupMenuIcons(Context context, PopupMenu menu) {
|
public static void enablePopupMenuIcons(Context context, PopupMenu menu){
|
||||||
Menu m = menu.getMenu();
|
Menu m=menu.getMenu();
|
||||||
if (Build.VERSION.SDK_INT >= 29) {
|
if(Build.VERSION.SDK_INT>=29){
|
||||||
menu.setForceShowIcon(true);
|
menu.setForceShowIcon(true);
|
||||||
} else {
|
}else{
|
||||||
try {
|
try{
|
||||||
Method setOptionalIconsVisible = m.getClass().getDeclaredMethod("setOptionalIconsVisible", boolean.class);
|
Method setOptionalIconsVisible=m.getClass().getDeclaredMethod("setOptionalIconsVisible", boolean.class);
|
||||||
setOptionalIconsVisible.setAccessible(true);
|
setOptionalIconsVisible.setAccessible(true);
|
||||||
setOptionalIconsVisible.invoke(m, true);
|
setOptionalIconsVisible.invoke(m, true);
|
||||||
} catch (Exception ignore) {
|
}catch(Exception ignore){}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
enableMenuIcons(context, m);
|
enableMenuIcons(context, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setUserPreferredTheme(Context context) {
|
public static void setUserPreferredTheme(Context context){
|
||||||
context.setTheme(switch (theme) {
|
context.setTheme(switch (theme) {
|
||||||
case LIGHT -> R.style.Theme_Mastodon_Light;
|
case LIGHT -> R.style.Theme_Mastodon_Light;
|
||||||
case DARK -> trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack : R.style.Theme_Mastodon_Dark;
|
case DARK -> trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack : R.style.Theme_Mastodon_Dark;
|
||||||
@@ -880,11 +878,10 @@ public class UiUtils {
|
|||||||
ColorPalette palette = ColorPalette.palettes.get(GlobalUserPreferences.color);
|
ColorPalette palette = ColorPalette.palettes.get(GlobalUserPreferences.color);
|
||||||
if (palette != null) palette.apply(context);
|
if (palette != null) palette.apply(context);
|
||||||
}
|
}
|
||||||
|
public static boolean isDarkTheme(){
|
||||||
public static boolean isDarkTheme() {
|
if(theme==GlobalUserPreferences.ThemePreference.AUTO)
|
||||||
if (theme == GlobalUserPreferences.ThemePreference.AUTO)
|
return (MastodonApp.context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK)==Configuration.UI_MODE_NIGHT_YES;
|
||||||
return (MastodonApp.context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
|
return theme==GlobalUserPreferences.ThemePreference.DARK;
|
||||||
return theme == GlobalUserPreferences.ThemePreference.DARK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://mastodon.foo.bar/@User
|
// https://mastodon.foo.bar/@User
|
||||||
@@ -911,8 +908,7 @@ public class UiUtils {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uri.getQuery() != null || uri.getFragment() != null || uri.getPath() == null)
|
if (uri.getQuery() != null || uri.getFragment() != null || uri.getPath() == null) return false;
|
||||||
return false;
|
|
||||||
|
|
||||||
String it = uri.getPath();
|
String it = uri.getPath();
|
||||||
return it.matches("^/@[^/]+$") ||
|
return it.matches("^/@[^/]+$") ||
|
||||||
@@ -937,8 +933,8 @@ public class UiUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void pickAccount(Context context, String exceptFor, @StringRes int titleRes, @DrawableRes int iconRes, Consumer<AccountSession> sessionConsumer, Consumer<AlertDialog.Builder> transformDialog) {
|
public static void pickAccount(Context context, String exceptFor, @StringRes int titleRes, @DrawableRes int iconRes, Consumer<AccountSession> sessionConsumer, Consumer<AlertDialog.Builder> transformDialog) {
|
||||||
List<AccountSession> sessions = AccountSessionManager.getInstance().getLoggedInAccounts()
|
List<AccountSession> sessions=AccountSessionManager.getInstance().getLoggedInAccounts()
|
||||||
.stream().filter(s -> !s.getID().equals(exceptFor)).collect(Collectors.toList());
|
.stream().filter(s->!s.getID().equals(exceptFor)).collect(Collectors.toList());
|
||||||
|
|
||||||
AlertDialog.Builder builder = new M3AlertDialogBuilder(context)
|
AlertDialog.Builder builder = new M3AlertDialogBuilder(context)
|
||||||
.setItems(
|
.setItems(
|
||||||
@@ -1013,8 +1009,7 @@ public class UiUtils {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(SearchResults results) {
|
public void onSuccess(SearchResults results) {
|
||||||
if (!results.statuses.isEmpty()) statusConsumer.accept(results.statuses.get(0));
|
if (!results.statuses.isEmpty()) statusConsumer.accept(results.statuses.get(0));
|
||||||
else
|
else Toast.makeText(context, R.string.sk_resource_not_found, Toast.LENGTH_SHORT).show();
|
||||||
Toast.makeText(context, R.string.sk_resource_not_found, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1022,7 +1017,7 @@ public class UiUtils {
|
|||||||
error.showToast(context);
|
error.showToast(context);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.wrapProgress((Activity) context, R.string.loading, true,
|
.wrapProgress((Activity)context, R.string.loading, true,
|
||||||
d -> transformDialogForLookup(context, targetAccountID, null, d))
|
d -> transformDialogForLookup(context, targetAccountID, null, d))
|
||||||
.exec(targetAccountID);
|
.exec(targetAccountID);
|
||||||
}
|
}
|
||||||
@@ -1046,28 +1041,28 @@ public class UiUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void openURL(Context context, String accountID, String url, boolean launchBrowser) {
|
public static void openURL(Context context, String accountID, String url, boolean launchBrowser){
|
||||||
Uri uri = Uri.parse(url);
|
Uri uri=Uri.parse(url);
|
||||||
List<String> path = uri.getPathSegments();
|
List<String> path=uri.getPathSegments();
|
||||||
if (accountID != null && "https".equals(uri.getScheme())) {
|
if(accountID!=null && "https".equals(uri.getScheme())){
|
||||||
if (path.size() == 2 && path.get(0).matches("^@[a-zA-Z0-9_]+$") && path.get(1).matches("^[0-9]+$") && AccountSessionManager.getInstance().getAccount(accountID).domain.equalsIgnoreCase(uri.getAuthority())) {
|
if(path.size()==2 && path.get(0).matches("^@[a-zA-Z0-9_]+$") && path.get(1).matches("^[0-9]+$") && AccountSessionManager.getInstance().getAccount(accountID).domain.equalsIgnoreCase(uri.getAuthority())){
|
||||||
new GetStatusByID(path.get(1))
|
new GetStatusByID(path.get(1))
|
||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Status result) {
|
public void onSuccess(Status result){
|
||||||
Bundle args = new Bundle();
|
Bundle args=new Bundle();
|
||||||
args.putString("account", accountID);
|
args.putString("account", accountID);
|
||||||
args.putParcelable("status", Parcels.wrap(result));
|
args.putParcelable("status", Parcels.wrap(result));
|
||||||
Nav.go((Activity) context, ThreadFragment.class, args);
|
Nav.go((Activity) context, ThreadFragment.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(ErrorResponse error) {
|
public void onError(ErrorResponse error){
|
||||||
error.showToast(context);
|
error.showToast(context);
|
||||||
if (launchBrowser) launchWebBrowser(context, url);
|
if (launchBrowser) launchWebBrowser(context, url);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.wrapProgress((Activity) context, R.string.loading, true,
|
.wrapProgress((Activity)context, R.string.loading, true,
|
||||||
d -> transformDialogForLookup(context, accountID, url, d))
|
d -> transformDialogForLookup(context, accountID, url, d))
|
||||||
.exec(accountID);
|
.exec(accountID);
|
||||||
return;
|
return;
|
||||||
@@ -1076,7 +1071,7 @@ public class UiUtils {
|
|||||||
.setCallback(new Callback<>() {
|
.setCallback(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(SearchResults results) {
|
public void onSuccess(SearchResults results) {
|
||||||
Bundle args = new Bundle();
|
Bundle args=new Bundle();
|
||||||
args.putString("account", accountID);
|
args.putString("account", accountID);
|
||||||
if (!results.statuses.isEmpty()) {
|
if (!results.statuses.isEmpty()) {
|
||||||
args.putParcelable("status", Parcels.wrap(results.statuses.get(0)));
|
args.putParcelable("status", Parcels.wrap(results.statuses.get(0)));
|
||||||
@@ -1086,8 +1081,7 @@ public class UiUtils {
|
|||||||
Nav.go((Activity) context, ProfileFragment.class, args);
|
Nav.go((Activity) context, ProfileFragment.class, args);
|
||||||
} else {
|
} else {
|
||||||
if (launchBrowser) launchWebBrowser(context, url);
|
if (launchBrowser) launchWebBrowser(context, url);
|
||||||
else
|
else Toast.makeText(context, R.string.sk_resource_not_found, Toast.LENGTH_SHORT).show();
|
||||||
Toast.makeText(context, R.string.sk_resource_not_found, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1097,7 +1091,7 @@ public class UiUtils {
|
|||||||
if (launchBrowser) launchWebBrowser(context, url);
|
if (launchBrowser) launchWebBrowser(context, url);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.wrapProgress((Activity) context, R.string.loading, true,
|
.wrapProgress((Activity)context, R.string.loading, true,
|
||||||
d -> transformDialogForLookup(context, accountID, url, d))
|
d -> transformDialogForLookup(context, accountID, url, d))
|
||||||
.exec(accountID);
|
.exec(accountID);
|
||||||
return;
|
return;
|
||||||
@@ -1109,45 +1103,36 @@ public class UiUtils {
|
|||||||
public static void copyText(View v, String text) {
|
public static void copyText(View v, String text) {
|
||||||
Context context = v.getContext();
|
Context context = v.getContext();
|
||||||
context.getSystemService(ClipboardManager.class).setPrimaryClip(ClipData.newPlainText(null, text));
|
context.getSystemService(ClipboardManager.class).setPrimaryClip(ClipData.newPlainText(null, text));
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU || UiUtils.isMIUI()) { // Android 13+ SystemUI shows its own thing when you put things into the clipboard
|
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.TIRAMISU || UiUtils.isMIUI()){ // Android 13+ SystemUI shows its own thing when you put things into the clipboard
|
||||||
Toast.makeText(context, R.string.text_copied, Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, R.string.text_copied, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
v.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK);
|
v.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getSystemProperty(String key) {
|
private static String getSystemProperty(String key){
|
||||||
try {
|
try{
|
||||||
Class<?> props = Class.forName("android.os.SystemProperties");
|
Class<?> props=Class.forName("android.os.SystemProperties");
|
||||||
Method get = props.getMethod("get", String.class);
|
Method get=props.getMethod("get", String.class);
|
||||||
return (String) get.invoke(null, key);
|
return (String)get.invoke(null, key);
|
||||||
} catch (Exception ignore) {
|
}catch(Exception ignore){}
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isMIUI() {
|
public static boolean isMIUI(){
|
||||||
return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.code"));
|
return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.code"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int alphaBlendColors(int color1, int color2, float alpha) {
|
public static boolean pickAccountForCompose(Activity activity, String accountID, String prefilledText){
|
||||||
float alpha0 = 1f - alpha;
|
|
||||||
int r = Math.round(((color1 >> 16) & 0xFF) * alpha0 + ((color2 >> 16) & 0xFF) * alpha);
|
|
||||||
int g = Math.round(((color1 >> 8) & 0xFF) * alpha0 + ((color2 >> 8) & 0xFF) * alpha);
|
|
||||||
int b = Math.round((color1 & 0xFF) * alpha0 + (color2 & 0xFF) * alpha);
|
|
||||||
return 0xFF000000 | (r << 16) | (g << 8) | b;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean pickAccountForCompose(Activity activity, String accountID, String prefilledText) {
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
if (prefilledText != null) args.putString("prefilledText", prefilledText);
|
if (prefilledText != null) args.putString("prefilledText", prefilledText);
|
||||||
return pickAccountForCompose(activity, accountID, args);
|
return pickAccountForCompose(activity, accountID, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean pickAccountForCompose(Activity activity, String accountID) {
|
public static boolean pickAccountForCompose(Activity activity, String accountID){
|
||||||
return pickAccountForCompose(activity, accountID, (String) null);
|
return pickAccountForCompose(activity, accountID, (String) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean pickAccountForCompose(Activity activity, String accountID, Bundle args) {
|
public static boolean pickAccountForCompose(Activity activity, String accountID, Bundle args){
|
||||||
if (AccountSessionManager.getInstance().getLoggedInAccounts().size() > 1) {
|
if (AccountSessionManager.getInstance().getLoggedInAccounts().size() > 1) {
|
||||||
UiUtils.pickAccount(activity, accountID, 0, 0, session -> {
|
UiUtils.pickAccount(activity, accountID, 0, 0, session -> {
|
||||||
args.putString("account", session.getID());
|
args.putString("account", session.getID());
|
||||||
@@ -1159,6 +1144,15 @@ public class UiUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public static String getVisibilityText(Status status) {
|
||||||
|
// return MastodonApp.context.getString(switch (status.visibility) {
|
||||||
|
// case PUBLIC -> R.string.visibility_public;
|
||||||
|
// case UNLISTED -> R.string.sk_visibility_unlisted;
|
||||||
|
// case PRIVATE -> R.string.visibility_followers_only;
|
||||||
|
// case DIRECT -> R.string.visibility_private;;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
// https://github.com/tuskyapp/Tusky/pull/3148
|
// https://github.com/tuskyapp/Tusky/pull/3148
|
||||||
public static void reduceSwipeSensitivity(ViewPager2 pager) {
|
public static void reduceSwipeSensitivity(ViewPager2 pager) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ public abstract class GithubSelfUpdater{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class UpdateInfo{
|
public static class UpdateInfo{
|
||||||
public String version;
|
|
||||||
public String changelog;
|
public String changelog;
|
||||||
|
public String version;
|
||||||
public long size;
|
public long size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:color="@color/bookmark_selected" android:state_selected="true"/>
|
<item android:color="?bookmark_selected" android:state_selected="true"/>
|
||||||
<item android:color="?android:textColorSecondary"/>
|
<item android:color="?android:textColorSecondary"/>
|
||||||
</selector>
|
</selector>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:color="?colorButtonBackgroundSecondaryDarkOnLight" android:state_enabled="true"/>
|
<item android:color="?colorBackgroundLightest" android:state_enabled="true"/>
|
||||||
<item android:color="?colorButtonBackgroundSecondaryDarkOnLightDisabled"/>
|
<item android:color="?android:colorBackground"/>
|
||||||
</selector>
|
</selector>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:color="?colorButtonTextPrimaryLightOnDark" android:state_enabled="true"/>
|
<item android:color="@color/black" android:state_enabled="true"/>
|
||||||
<item android:color="?colorButtonTextPrimaryLightOnDarkDisabled"/>
|
<item android:color="?colorTabInactive"/>
|
||||||
</selector>
|
</selector>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:color="@color/favorite_selected" android:state_selected="true"/>
|
<item android:color="?favorite_selected" android:state_selected="true"/>
|
||||||
<item android:color="?android:textColorSecondary"/>
|
<item android:color="?android:textColorSecondary"/>
|
||||||
</selector>
|
</selector>
|
||||||
6
mastodon/src/main/res/color/translate_icon.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="?android:colorAccent" android:state_selected="true"/>
|
||||||
|
<item android:color="?android:textColorSecondary" android:state_enabled="true"/>
|
||||||
|
<item android:color="?colorSecondary"/>
|
||||||
|
</selector>
|
||||||
22
mastodon/src/main/res/drawable-anydpi-v24/ic_ntf_logo.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="#FFFFFF">
|
||||||
|
<group android:scaleX="0.9699526"
|
||||||
|
android:scaleY="0.9699526"
|
||||||
|
android:translateX="0.96"
|
||||||
|
android:translateY="6.925208">
|
||||||
|
<path
|
||||||
|
android:pathData="m3.639,-0c-1.097,0 -1.983,0.387 -2.658,1.141 -0.655,0.754 -0.981,1.771 -0.981,3.053l0,6.27L2.482,10.464L2.482,4.378c0,-1.284 0.539,-1.935 1.618,-1.935 1.192,0 1.791,0.773 1.791,2.3l0,3.331l2.468,0l0,-3.331c0,-1.527 0.598,-2.3 1.791,-2.3 1.078,0 1.618,0.651 1.618,1.935l0,6.085l2.482,0l0,-6.27c0,-1.281 -0.326,-2.299 -0.981,-3.053 -0.676,-0.754 -1.56,-1.141 -2.658,-1.141 -1.27,0 -2.232,0.488 -2.868,1.466L7.125,2.504 6.506,1.466C5.87,0.488 4.909,-0 3.639,-0Z"
|
||||||
|
android:strokeWidth="0.796"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="m18.947,10.464q-1.113,0 -1.986,-0.493 -0.873,-0.507 -1.366,-1.366 -0.479,-0.873 -0.479,-1.958 0,-1.07 0.479,-1.944 0.493,-0.873 1.366,-1.366 0.873,-0.507 1.986,-0.507 1.099,0 1.972,0.507 0.873,0.493 1.352,1.366 0.493,0.873 0.493,1.944 0,1.085 -0.493,1.958 -0.479,0.859 -1.352,1.366 -0.873,0.493 -1.972,0.493zM18.947,8.759q0.535,0 0.986,-0.254 0.451,-0.254 0.718,-0.732 0.268,-0.479 0.268,-1.127 0,-0.634 -0.268,-1.113 -0.268,-0.479 -0.718,-0.732 -0.451,-0.254 -0.986,-0.254 -0.535,0 -0.986,0.254 -0.451,0.254 -0.732,0.732 -0.268,0.479 -0.268,1.113 0,0.634 0.268,1.127 0.282,0.479 0.732,0.732 0.451,0.254 0.986,0.254z"
|
||||||
|
android:strokeWidth="0.687"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
BIN
mastodon/src/main/res/drawable-hdpi/ic_ntf_logo.png
Normal file
|
After Width: | Height: | Size: 405 B |
BIN
mastodon/src/main/res/drawable-mdpi/ic_ntf_logo.png
Normal file
|
After Width: | Height: | Size: 295 B |
@@ -1,5 +1,18 @@
|
|||||||
<vector android:height="108dp" android:viewportHeight="320"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:viewportWidth="320" android:width="108dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
<path android:fillColor="#fff" android:pathData="M166.45,143.88c-4.6,-0.61 -9.13,5 -10.12,12.53s1.93,14.12 6.53,14.72 9.13,-5 10.12,-12.53S171.05,144.48 166.45,143.88ZM166.53,164.39a3.65,3.65 0,1 1,2 -4.78A3.66,3.66 0,0 1,166.53 164.39Z"/>
|
android:width="108dp"
|
||||||
<path android:fillColor="#fff" android:pathData="M233.41,296.2c-0.41,-7.41 -1.13,-14.84 -1.84,-22.24l-0.24,-2.52c0,-0.18 0,-0.36 -0.05,-0.54 -0.11,-1.1 -0.21,-2.19 -0.31,-3.29q-0.54,-5.83 -1,-11.72 -0.71,-8.82 -1.37,-17.7 -0.24,-3 -0.46,-5.91c-0.63,-7.89 -1.29,-15.8 -2.09,-23.68 -1.13,-11.06 -2.54,-22.09 -4.49,-33a6.62,6.62 0,0 0,-0.9 0.48c-8.37,5.44 -14.27,29.16 -17.82,37.65a1.24,1.24 0,0 1,-2.37 -0.36c-0.09,-0.92 -0.16,-1.83 -0.21,-2.75l2.78,-1.79 -2.91,-2.2c0,-0.23 0,-0.45 0,-0.68v-0.48c0,-0.26 0,-0.51 0,-0.77l2.71,-1.72 -2.58,-3c0,-0.62 0.05,-1.25 0.09,-1.87l3.57,-1 -3.19,-3.83c0.05,-0.58 0.12,-1.16 0.18,-1.74l4.77,-1.39 -4,-4.46 0.24,-1.5 5.55,-1.61 -4.54,-4c0.08,-0.4 0.17,-0.8 0.26,-1.2l5,-1.44 -3.93,-3.22c0.08,-0.34 0.15,-0.69 0.23,-1l6.51,-1.89 -4.68,-5.41c0.07,-0.25 0.14,-0.5 0.22,-0.75l5.89,-0.82 -3.72,-5.48 0.3,-0.69 5.59,1.21 -3.33,-5.65c0.18,-0.3 0.37,-0.59 0.55,-0.88l5.95,0.95 -2.68,-5 0,0c-1.39,-6.49 -6.72,-19.33 -6.72,-19.33a62.21,62.21 0,0 0,-5.78 -11.48c-9.59,-15.31 -27.16,-28.64 -44.56,-28.64a32.59,32.59 0,0 0,-7.59 0.89c-17.93,4.31 -32.31,24.52 -40.65,39.83 -9.37,17.22 -14.3,36.39 -18.8,55.34 -6.77,28.47 -10.5,57.56 -13.22,86.66 -2.25,24 -10,50.88 14.49,65.32 11.22,6.6 24.36,10.79 37.17,12.9a98,98 0,0 0,16 1.15c4.72,0 9.45,-0.22 14.16,-0.44l49.8,-2.29c0.72,0 1.46,-0.06 2.21,-0.06 4,0 8.15,0.65 10.26,3.85 0.25,-2.66 -2.08,-7 -4.86,-11.6l5.7,-1.29c0.15,-4.58 0.6,-8 2.5,-5.38 0.93,1.29 2.19,2.73 3.78,2.54 1.86,-0.23 2.65,-2.45 3,-4.3C234,319.42 234.06,307.82 233.41,296.2ZM158.81,334.39c-4.45,0.2 -9.06,0.42 -13.47,0.42a83.24,83.24 0,0 1,-13.54 -0.95c-12,-2 -23.1,-5.8 -32,-11 -5.66,-3.33 -8.42,-7.32 -9.52,-13.75 -1.25,-7.35 -0.11,-16.53 1.1,-26.24 0.45,-3.59 0.91,-7.3 1.26,-11 3.25,-34.69 7.22,-60.78 12.88,-84.59 4.38,-18.42 9,-36.24 17.39,-51.64 9.79,-18 21.37,-30.11 31,-32.42a17.66,17.66 0,0 1,4.08 -0.47c6.64,0 14.53,3.54 21.63,9.71 6.86,6 12.19,13.64 14.36,20.64 -5.36,13.5 -10.52,31.41 -12.51,44.37 -5.36,34.75 -9,99.6 -7.6,156.26Z"/>
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<group android:scaleX="2.5091188"
|
||||||
|
android:scaleY="2.5091188">
|
||||||
|
<path
|
||||||
|
android:pathData="m13.779,16.29c-1.097,0 -1.983,0.387 -2.658,1.141 -0.655,0.754 -0.981,1.771 -0.981,3.053l0,6.27L12.622,26.754L12.622,20.668c0,-1.284 0.539,-1.935 1.618,-1.935 1.192,0 1.791,0.773 1.791,2.3l0,3.331l2.468,0l0,-3.331c0,-1.527 0.598,-2.3 1.791,-2.3 1.078,0 1.618,0.651 1.618,1.935l0,6.085l2.482,0l0,-6.27c0,-1.281 -0.326,-2.299 -0.981,-3.053 -0.676,-0.754 -1.56,-1.141 -2.658,-1.141 -1.27,0 -2.232,0.488 -2.868,1.466L17.265,18.794 16.646,17.756C16.01,16.778 15.049,16.29 13.779,16.29Z"
|
||||||
|
android:strokeWidth="0.796"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="m29.087,26.754q-1.113,0 -1.986,-0.493 -0.873,-0.507 -1.366,-1.366 -0.479,-0.873 -0.479,-1.958 0,-1.07 0.479,-1.944 0.493,-0.873 1.366,-1.366 0.873,-0.507 1.986,-0.507 1.099,0 1.972,0.507 0.873,0.493 1.352,1.366 0.493,0.873 0.493,1.944 0,1.085 -0.493,1.958 -0.479,0.859 -1.352,1.366 -0.873,0.493 -1.972,0.493zM29.087,25.049q0.535,0 0.986,-0.254 0.451,-0.254 0.718,-0.732 0.268,-0.479 0.268,-1.127 0,-0.634 -0.268,-1.113 -0.268,-0.479 -0.718,-0.732 -0.451,-0.254 -0.986,-0.254 -0.535,0 -0.986,0.254 -0.451,0.254 -0.732,0.732 -0.268,0.479 -0.268,1.113 0,0.634 0.268,1.127 0.282,0.479 0.732,0.732 0.451,0.254 0.986,0.254z"
|
||||||
|
android:strokeWidth="0.687"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
</group>
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
BIN
mastodon/src/main/res/drawable-xhdpi/ic_ntf_logo.png
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
mastodon/src/main/res/drawable-xxhdpi/ic_ntf_logo.png
Normal file
|
After Width: | Height: | Size: 902 B |
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M6.78 4.78c0.293-0.293 0.293-0.767 0-1.06-0.293-0.293-0.767-0.293-1.06 0L3.75 5.69 3.28 5.22c-0.293-0.293-0.767-0.293-1.06 0-0.293 0.293-0.293 0.767 0 1.06l1 1c0.293 0.293 0.767 0.293 1.06 0l2.5-2.5zm14.47 13.227H9.75l-0.102 0.007C9.282 18.064 9 18.377 9 18.757c0 0.414 0.336 0.75 0.75 0.75h11.5l0.102-0.007C21.718 19.45 22 19.137 22 18.757c0-0.414-0.336-0.75-0.75-0.75zm0-6.507H9.75l-0.102 0.007C9.282 11.557 9 11.87 9 12.25 9 12.664 9.336 13 9.75 13h11.5l0.102-0.007C21.718 12.943 22 12.63 22 12.25c0-0.414-0.336-0.75-0.75-0.75zm0-6.5H9.75L9.648 5.007C9.282 5.057 9 5.37 9 5.75 9 6.164 9.336 6.5 9.75 6.5h11.5l0.102-0.007C21.718 6.443 22 6.13 22 5.75 22 5.336 21.664 5 21.25 5zM6.78 17.78c0.293-0.293 0.293-0.767 0-1.06-0.293-0.293-0.767-0.293-1.06 0l-1.97 1.97-0.47-0.47c-0.293-0.293-0.767-0.293-1.06 0-0.293 0.293-0.293 0.767 0 1.06l1 1c0.293 0.293 0.767 0.293 1.06 0l2.5-2.5zm0-7.56c0.293 0.293 0.293 0.767 0 1.06l-2.5 2.5c-0.293 0.293-0.767 0.293-1.06 0l-1-1c-0.293-0.293-0.293-0.767 0-1.06 0.293-0.293 0.767-0.293 1.06 0l0.47 0.47 1.97-1.97c0.293-0.293 0.767-0.293 1.06 0z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
5
mastodon/src/main/res/drawable/bg_note_edit.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="?colorBackgroundLightest"/>
|
||||||
|
<corners android:radius="10dp"/>
|
||||||
|
</shape>
|
||||||
6
mastodon/src/main/res/drawable/ic_bot.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="16dp" android:height="16dp" android:viewportWidth="16" android:viewportHeight="16">
|
||||||
|
<group android:translateX="-2" android:translateY="-1">
|
||||||
|
<path android:pathData="M14.69 11.503c1 0 1.81 0.81 1.81 1.81v0.689h-0.005c-0.034 0.78-0.248 1.757-1.123 2.555C14.416 17.43 12.765 18 10 18c-2.766 0-4.416-0.57-5.372-1.443-0.875-0.798-1.089-1.776-1.123-2.555H3.5v-0.69c0-0.999 0.81-1.809 1.81-1.809h9.38zM6.5 3C5.672 3 5 3.672 5 4.5v4C5 9.328 5.672 10 6.5 10h7c0.828 0 1.5-0.672 1.5-1.5v-4C15 3.672 14.328 3 13.5 3h-3V2.5C10.5 2.191 10.276 2 10 2S9.5 2.23 9.5 2.5V3h-3zM7 6.5c0-0.552 0.448-1 1-1s1 0.448 1 1-0.448 1-1 1-1-0.448-1-1zm4 0c0-0.552 0.448-1 1-1s1 0.448 1 1-0.448 1-1 1-1-0.448-1-1z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M13.22 17.219c-0.267 0.266-0.29 0.683-0.073 0.976l0.073 0.084 2.367 2.37C15.713 20.859 15.963 21 16.251 21c0.252 0 0.475-0.109 0.611-0.276l0.053-0.075 2.367-2.37 0.073-0.084c0.193-0.26 0.196-0.619 0.007-0.882l-0.08-0.094-0.084-0.073c-0.261-0.193-0.62-0.196-0.883-0.007l-0.094 0.08L17 18.44V3.656l-0.007-0.089C16.943 3.247 16.63 3 16.25 3s-0.694 0.247-0.743 0.567L15.5 3.657V18.44l-1.22-1.221-0.084-0.073c-0.293-0.218-0.71-0.193-0.976 0.073zm-6.97 2.789C5.007 20.008 4 19 4 17.758v-11.5c0-1.243 1.007-2.25 2.25-2.25h6c0.414 0 0.75 0.336 0.75 0.75s-0.336 0.75-0.75 0.75h-6c-0.414 0-0.75 0.336-0.75 0.75v11.5c0 0.414 0.336 0.75 0.75 0.75h4c0.414 0 0.75 0.336 0.75 0.75s-0.336 0.75-0.75 0.75h-4z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M7.47 12.28l0.084 0.073c0.294 0.218 0.71 0.193 0.977-0.073l2.72-2.72v6.69l0.007 0.102C11.308 16.718 11.62 17 12 17l0.101-0.006c0.367-0.05 0.649-0.364 0.649-0.744V9.56l2.72 2.722 0.084 0.072c0.294 0.218 0.71 0.194 0.977-0.072 0.293-0.293 0.293-0.768 0-1.06l-4-4.002-0.084-0.073c-0.294-0.218-0.71-0.194-0.977 0.073l-4 4-0.073 0.085c-0.218 0.293-0.194 0.71 0.072 0.976zM22.001 12c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10zm-18.5 0c0-4.694 3.806-8.5 8.5-8.5s8.5 3.806 8.5 8.5-3.806 8.5-8.5 8.5-8.5-3.806-8.5-8.5z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="16dp"
|
||||||
|
android:height="16dp"
|
||||||
|
android:viewportWidth="16"
|
||||||
|
android:viewportHeight="16">
|
||||||
|
<path
|
||||||
|
android:pathData="M11.754,9.203C12.551,9.203 13.199,9.852 13.199,10.648L13.199,11.203L13.195,11.203C13.168,11.824 12.996,12.605 12.297,13.246C11.531,13.945 10.211,14.398 8,14.398C5.789,14.398 4.469,13.945 3.703,13.246C3.004,12.605 2.832,11.824 2.805,11.203L2.801,11.203L2.801,10.648C2.801,9.852 3.449,9.203 4.246,9.203ZM5.199,2.398C4.539,2.398 4,2.938 4,3.602L4,6.801C4,7.461 4.539,8 5.199,8L10.801,8C11.461,8 12,7.461 12,6.801L12,3.602C12,2.938 11.461,2.398 10.801,2.398L8.398,2.398C8.398,2.398 8.398,2.246 8.398,2C8.398,1.754 8.223,1.602 8,1.602C7.777,1.602 7.602,1.785 7.602,2C7.602,2.215 7.602,2.398 7.602,2.398ZM5.602,5.199C5.602,4.758 5.957,4.398 6.398,4.398C6.844,4.398 7.199,4.758 7.199,5.199C7.199,5.641 6.844,6 6.398,6C5.957,6 5.602,5.641 5.602,5.199ZM8.801,5.199C8.801,4.758 9.156,4.398 9.602,4.398C10.043,4.398 10.398,4.758 10.398,5.199C10.398,5.641 10.043,6 9.602,6C9.156,6 8.801,5.641 8.801,5.199ZM8.801,5.199"
|
||||||
|
android:fillColor="?android:textColorPrimary" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20">
|
||||||
|
<path android:pathData="M14.69 11.503c1 0 1.81 0.81 1.81 1.81v0.689h-0.005c-0.034 0.78-0.248 1.757-1.123 2.555C14.416 17.43 12.765 18 10 18c-2.766 0-4.416-0.57-5.372-1.443-0.875-0.798-1.089-1.776-1.123-2.555H3.5v-0.69c0-0.999 0.81-1.809 1.81-1.809h9.38zM6.5 3C5.672 3 5 3.672 5 4.5v4C5 9.328 5.672 10 6.5 10h7c0.828 0 1.5-0.672 1.5-1.5v-4C15 3.672 14.328 3 13.5 3h-3V2.5C10.5 2.191 10.276 2 10 2S9.5 2.23 9.5 2.5V3h-3zM7 6.5c0-0.552 0.448-1 1-1s1 0.448 1 1-0.448 1-1 1-1-0.448-1-1zm4 0c0-0.552 0.448-1 1-1s1 0.448 1 1-0.448 1-1 1-1-0.448-1-1z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="20dp"
|
||||||
|
android:height="20dp"
|
||||||
|
android:viewportWidth="20"
|
||||||
|
android:viewportHeight="20">
|
||||||
|
<path
|
||||||
|
android:pathData="M12,5.5C11.448,5.5 11,5.948 11,6.5C11,7.052 11.448,7.5 12,7.5C12.552,7.5 13,7.052 13,6.5C13,5.948 12.552,5.5 12,5.5ZM7,6.5C7,5.948 7.448,5.5 8,5.5C8.552,5.5 9,5.948 9,6.5C9,7.052 8.552,7.5 8,7.5C7.448,7.5 7,7.052 7,6.5ZM10.5,2.5C10.5,2.224 10.276,2 10,2C9.724,2 9.5,2.224 9.5,2.5V3H6.5C5.672,3 5,3.672 5,4.5V8.5C5,9.328 5.672,10 6.5,10H13.5C14.328,10 15,9.328 15,8.5V4.5C15,3.672 14.328,3 13.5,3H10.5V2.5ZM6.5,4H13.5C13.776,4 14,4.224 14,4.5V8.5C14,8.776 13.776,9 13.5,9H6.5C6.224,9 6,8.776 6,8.5V4.5C6,4.224 6.224,4 6.5,4ZM10.25,17.998C12.866,17.965 14.445,17.403 15.372,16.557C16.247,15.759 16.461,14.781 16.495,14.002H16.5V13.312C16.5,12.313 15.69,11.503 14.691,11.503H11.5V11.5H8.5V11.503H5.309C4.31,11.503 3.5,12.313 3.5,13.312V14.002H3.505C3.539,14.781 3.753,15.759 4.628,16.557C5.555,17.403 7.134,17.965 9.75,17.998V18H10.25V17.998ZM5.309,12.503H14.691C15.138,12.503 15.5,12.865 15.5,13.312V13.75C15.5,14.44 15.369,15.206 14.698,15.819C14.01,16.446 12.66,17 10,17C7.339,17 5.99,16.446 5.302,15.819C4.631,15.206 4.5,14.44 4.5,13.75V13.312C4.5,12.865 4.862,12.503 5.309,12.503Z"
|
||||||
|
android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="20dp"
|
||||||
|
android:height="20dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M17.753,14a2.25,2.25 0,0 1,2.25 2.25v0.905a3.75,3.75 0,0 1,-1.307 2.846C17.13,21.345 14.89,22 12,22c-2.89,0 -5.128,-0.656 -6.691,-2a3.75,3.75 0,0 1,-1.306 -2.843v-0.908A2.25,2.25 0,0 1,6.253 14h11.5ZM11.898,2.008 L12,2a0.75,0.75 0,0 1,0.743 0.648l0.007,0.102L12.75,3.5h3.5a2.25,2.25 0,0 1,2.25 2.25v4.505a2.25,2.25 0,0 1,-2.25 2.25h-8.5a2.25,2.25 0,0 1,-2.25 -2.25L5.5,5.75A2.25,2.25 0,0 1,7.75 3.5h3.5v-0.749a0.75,0.75 0,0 1,0.648 -0.743L12,2l-0.102,0.007ZM9.75,6.5a1.25,1.25 0,1 0,0 2.5,1.25 1.25,0 0,0 0,-2.5ZM14.243,6.5a1.25,1.25 0,1 0,0 2.499,1.25 1.25,0 0,0 0,-2.499Z"
|
||||||
|
android:fillColor="?android:textColorPrimary"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M15.25 13.5h-4c-0.414 0-0.75-0.336-0.75-0.75v-6C10.5 6.336 10.836 6 11.25 6S12 6.336 12 6.75V12h3.25c0.414 0 0.75 0.336 0.75 0.75s-0.336 0.75-0.75 0.75zM12 2C6.478 2 2 6.478 2 12s4.478 10 10 10 10-4.478 10-10S17.522 2 12 2z" android:fillColor="?colorButtonText"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/ic_fluent_clock_24_filled_enabled" android:state_enabled="true"/>
|
||||||
|
<item android:drawable="@drawable/ic_fluent_clock_24_regular"/>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/fluent_default_icon_tint"
|
||||||
|
android:pathData="M12,1.996C7.852,1.996 4.5,5.341 4.5,9.496L4.5,13.594L3.129,16.752A1.251,1.251 0,0 0,4.275 18.5L9,18.5L9.006,18.68A3,3 0,0 0,15 18.502L19.736,18.5A1.25,1.25 0,0 0,20.881 16.75L19.5,13.594L19.5,12.668A6.5,6.5 0,0 1,18 12.955L18,13.906L19.354,17L4.656,17L6,13.906L6,9.496C6,6.253 8.549,3.631 11.754,3.502A6.5,6.5 0,0 1,12.793 2.051A7.49,7.49 0,0 0,12 1.996zM13.5,18.5L13.494,18.646A1.5,1.5 0,0 1,10.5 18.502L13.5,18.5z" />
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/fluent_default_icon_tint"
|
||||||
|
android:pathData="m17.5,2.189a4.311,4.311 0,1 0,4.282 3.809c-0.04,-0.35 0.213,-0.687 0.565,-0.687 0.306,0 0.576,0.213 0.612,0.517A5.5,5.5 0,1 1,20.918 2.191V1.891a0.595,0.595 0,1 1,1.19 0v1.604l0.02,0.031h-0.02V3.675A0.595,0.595 0,0 1,21.513 4.27h-1.784a0.595,0.595 0,1 1,0 -1.189h0.396a4.292,4.292 0,0 0,-2.626 -0.892z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M13.94 5l5.061 5.06L9.063 20c-0.277 0.277-0.621 0.477-1 0.58l-5.115 1.395c-0.56 0.153-1.073-0.361-0.92-0.921l1.394-5.116c0.103-0.377 0.303-0.722 0.58-0.999L13.94 5zm-7.414 6l-1.5 1.5H2.75C2.337 12.5 2 12.165 2 11.75 2 11.336 2.337 11 2.75 11h3.775zm14.352-8.174l0.153 0.144 0.145 0.153c1.25 1.405 1.203 3.56-0.145 4.908L20.061 9 15 3.94l0.97-0.97c1.348-1.348 3.503-1.396 4.908-0.144zM10.526 7l-1.5 1.5H2.75C2.337 8.5 2 8.165 2 7.75 2 7.336 2.337 7 2.75 7h7.775zm4-4l-1.5 1.5H2.75C2.337 4.5 2 4.165 2 3.75 2 3.336 2.337 3 2.75 3h11.775z" android:fillColor="?colorButtonText"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/ic_fluent_drafts_24_filled_enabled" android:state_enabled="true"/>
|
||||||
|
<item android:drawable="@drawable/ic_fluent_drafts_24_regular"/>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="28dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="28dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M3,5v14h17L20,5L3,5zM7,7v2L5,9L5,7h2zM5,13v-2h2v2L5,13zM5,15h2v2L5,17v-2zM18,17L9,17v-2h9v2zM18,13L9,13v-2h9v2zM18,9L9,9L9,7h9v2z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="20dp"
|
||||||
|
android:height="20dp"
|
||||||
|
android:viewportWidth="20"
|
||||||
|
android:viewportHeight="20">
|
||||||
|
<path
|
||||||
|
android:pathData="M7.5,7C7.224,7 7,7.224 7,7.5C7,7.776 7.224,8 7.5,8H12.5C12.776,8 13,7.776 13,7.5C13,7.224 12.776,7 12.5,7H7.5ZM7,10.5C7,10.224 7.224,10 7.5,10H12.5C12.776,10 13,10.224 13,10.5C13,10.776 12.776,11 12.5,11H7.5C7.224,11 7,10.776 7,10.5ZM7.5,13C7.224,13 7,13.224 7,13.5C7,13.776 7.224,14 7.5,14H9.5C9.776,14 10,13.776 10,13.5C10,13.224 9.776,13 9.5,13H7.5ZM6.5,2C6.224,2 6,2.224 6,2.5V3H5.5C4.672,3 4,3.672 4,4.5V16.5C4,17.328 4.672,18 5.5,18H11.5C11.633,18 11.76,17.947 11.854,17.854L15.854,13.854C15.947,13.76 16,13.633 16,13.5V4.5C16,3.672 15.328,3 14.5,3H14V2.5C14,2.224 13.776,2 13.5,2C13.224,2 13,2.224 13,2.5V3H10.5V2.5C10.5,2.224 10.276,2 10,2C9.724,2 9.5,2.224 9.5,2.5V3H7V2.5C7,2.224 6.776,2 6.5,2ZM14.5,4C14.776,4 15,4.224 15,4.5V13H12.5C11.672,13 11,13.672 11,14.5V17H5.5C5.224,17 5,16.776 5,16.5V4.5C5,4.224 5.224,4 5.5,4H14.5ZM14.293,14L12,16.293V14.5C12,14.224 12.224,14 12.5,14H14.293Z"
|
||||||
|
android:fillColor="#212121"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M6.75,3H5.75C4.231,3 3,4.231 3,5.75V18.25C3,19.769 4.231,21 5.75,21H6V15C6,13.757 7.007,12.75 8.25,12.75H15.75C16.993,12.75 18,13.757 18,15V21H18.25C19.769,21 21,19.769 21,18.25V8.286C21,7.424 20.658,6.597 20.048,5.987L18.013,3.952C17.411,3.351 16.599,3.009 15.75,3V7.5C15.75,8.743 14.743,9.75 13.5,9.75H9C7.757,9.75 6.75,8.743 6.75,7.5V3ZM14.25,3V7.5C14.25,7.914 13.914,8.25 13.5,8.25H9C8.586,8.25 8.25,7.914 8.25,7.5V3H14.25ZM16.5,21V15C16.5,14.586 16.164,14.25 15.75,14.25H8.25C7.836,14.25 7.5,14.586 7.5,15V21H16.5Z"
|
||||||
|
android:fillColor="?colorButtonText"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M3,5.75C3,4.231 4.231,3 5.75,3H15.715C16.576,3 17.403,3.342 18.013,3.952L20.048,5.987C20.658,6.597 21,7.424 21,8.286V18.25C21,19.769 19.769,21 18.25,21H5.75C4.231,21 3,19.769 3,18.25V5.75ZM5.75,4.5C5.06,4.5 4.5,5.06 4.5,5.75V18.25C4.5,18.94 5.06,19.5 5.75,19.5H6V14.25C6,13.007 7.007,12 8.25,12H15.75C16.993,12 18,13.007 18,14.25V19.5H18.25C18.94,19.5 19.5,18.94 19.5,18.25V8.286C19.5,7.821 19.316,7.376 18.987,7.048L16.952,5.013C16.692,4.752 16.358,4.583 16,4.523V7.25C16,8.493 14.993,9.5 13.75,9.5H9.25C8.007,9.5 7,8.493 7,7.25V4.5H5.75ZM16.5,19.5V14.25C16.5,13.836 16.164,13.5 15.75,13.5H8.25C7.836,13.5 7.5,13.836 7.5,14.25V19.5H16.5ZM8.5,4.5V7.25C8.5,7.664 8.836,8 9.25,8H13.75C14.164,8 14.5,7.664 14.5,7.25V4.5H8.5Z"
|
||||||
|
android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/ic_fluent_save_24_filled" android:state_enabled="true"/>
|
||||||
|
<item android:drawable="@drawable/ic_fluent_save_24_regular"/>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M5.694 12L2.299 3.27C2.063 2.664 2.655 2.083 3.241 2.29l0.093 0.039 18 9c0.518 0.259 0.55 0.968 0.097 1.284l-0.097 0.058-18 9c-0.583 0.291-1.216-0.245-1.065-0.848l0.03-0.095L5.694 12 2.299 3.27 5.694 12zM4.402 4.54l2.61 6.71h6.627c0.38 0 0.693 0.282 0.743 0.648L14.389 12c0 0.38-0.282 0.693-0.649 0.743l-0.1 0.007H7.01l-2.609 6.71L19.322 12 4.401 4.54z" android:fillColor="?colorButtonText"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/ic_fluent_send_24_enabled" android:state_activated="true"/>
|
||||||
|
<item android:drawable="@drawable/ic_fluent_send_24_enabled" android:state_checked="true"/>
|
||||||
|
<item android:drawable="@drawable/ic_fluent_send_24_enabled" android:state_selected="true"/>
|
||||||
|
<item android:drawable="@drawable/ic_fluent_send_24_enabled" android:state_enabled="true"/>
|
||||||
|
<item android:drawable="@drawable/ic_fluent_send_24_regular"/>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
|
<path android:pathData="M15 4.25c0-1.08-1.274-1.651-2.08-0.935L8.427 7.31C8.29 7.43 8.113 7.499 7.93 7.499H4.25C3.007 7.498 2 8.504 2 9.748v4.497c0 1.243 1.007 2.25 2.25 2.25h3.68c0.183 0 0.36 0.067 0.498 0.19l4.491 3.993C13.725 21.396 15 20.824 15 19.745V4.25zM9.425 8.43L13.5 4.806v14.382l-4.075-3.623c-0.412-0.367-0.944-0.569-1.495-0.569H4.25c-0.414 0-0.75-0.336-0.75-0.75V9.748c0-0.414 0.336-0.75 0.75-0.75h3.68c0.55 0 1.083-0.202 1.495-0.568zm9.567-2.533c0.332-0.247 0.802-0.177 1.049 0.156C21.27 7.715 22 9.773 22 12s-0.728 4.285-1.96 5.947c-0.246 0.333-0.716 0.403-1.048 0.156-0.333-0.246-0.403-0.716-0.157-1.049C19.881 15.641 20.5 13.893 20.5 12c0-1.893-0.619-3.64-1.665-5.053-0.246-0.333-0.176-0.803 0.157-1.05zm-1.849 2.472c0.364-0.197 0.82-0.062 1.017 0.302C18.696 9.662 19 10.796 19 12c0 1.203-0.304 2.337-0.84 3.328-0.198 0.364-0.653 0.5-1.017 0.302-0.364-0.197-0.5-0.652-0.303-1.016 0.42-0.777 0.66-1.667 0.66-2.615 0-0.947-0.24-1.837-0.66-2.614-0.197-0.364-0.061-0.819 0.303-1.016z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||||
|
</vector>
|
||||||