mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-07-23 12:00:31 +03:00
Compare commits
1376 commits
Author | SHA1 | Date | |
---|---|---|---|
|
cf022002c5 | ||
|
4b4b6c49b2 | ||
|
49cc9a187e | ||
|
b954708e3a | ||
|
0fcd1c6d4b | ||
|
1c2c6f404a | ||
|
2e33cd58f5 | ||
|
c5e096728e | ||
|
b0c11f5c2c | ||
|
c0b6bbd4ea | ||
|
442e27760a | ||
|
d514c7b8d6 | ||
|
5b843291a7 | ||
|
8a9b0d897f | ||
|
e051bec7a0 | ||
|
6a74a35efe | ||
|
723771e464 | ||
|
b1b3c5230c | ||
|
764e3a1762 | ||
|
a71fa29f72 | ||
|
cb2c811970 | ||
|
bc81e32720 | ||
|
a79121a8dd | ||
|
293a811392 | ||
|
1df2cba3d0 | ||
|
5e2e91df3d | ||
|
b06a5731bd | ||
|
dfe30f9bfb | ||
|
477b2bfc3b | ||
|
e6a8a45e03 | ||
|
e93d6660f1 | ||
|
65383b8787 | ||
|
5d78347d3f | ||
|
02a066a253 | ||
|
749aefe858 | ||
|
15e10958b8 | ||
|
a12e2910c5 | ||
|
7e6d0a5c6e | ||
|
e9ce3bd664 | ||
|
7dc61b8aaf | ||
|
ebdaa79c81 | ||
|
d8abb4213e | ||
|
b77d87ccb1 | ||
|
c611438172 | ||
|
7aa02a8b15 | ||
|
e1da85235d | ||
|
cca71af7c2 | ||
|
c83acd6b17 | ||
|
df50f40843 | ||
|
d6e78e78ba | ||
|
cbea08af24 | ||
|
db984a485f | ||
|
a09d08b826 | ||
|
200488fa6a | ||
|
18ae76c6f7 | ||
|
7e2b3d0c8f | ||
|
e889b19673 | ||
|
e1cb74911a | ||
|
1f4503cd96 | ||
|
5a51c48302 | ||
|
c821c96396 | ||
|
1374bfdca9 | ||
|
5f83abff97 | ||
|
e69c46661d | ||
|
66f2bd4639 | ||
|
96fa8abbfa | ||
|
9216c86658 | ||
|
786a4bc846 | ||
|
b06fc3e952 | ||
|
4ea7e592a2 | ||
|
36d4c6dc11 | ||
|
caba5201f9 | ||
|
4ea99e4385 | ||
|
cb0bac8ff6 | ||
|
1d77fd9106 | ||
|
6e932b6fd8 | ||
|
d044d1d36f | ||
|
bbd9c909b7 | ||
|
ea6cb35b73 | ||
|
fd00042f4d | ||
|
dd2a4dcf28 | ||
|
78a4b51e4e | ||
|
c465858eaa | ||
|
7747a99585 | ||
|
75283ef507 | ||
|
e60d5e9882 | ||
|
a9386d6927 | ||
|
cc234a6aee | ||
|
a5c6a60a20 | ||
|
d8a417983a | ||
|
df27c45434 | ||
|
6d5dbb2585 | ||
|
578c9b3d66 | ||
|
fb932b293f | ||
|
3bde1ae578 | ||
|
78fccc9578 | ||
|
1be12f1fe1 | ||
|
4fefda1f68 | ||
|
59952c8203 | ||
|
fdc2cb07c8 | ||
|
a8b16b1956 | ||
|
edbe7689bf | ||
|
c4cf8f58a1 | ||
|
d1e8a6ce43 | ||
|
7547d4e681 | ||
|
b99d55e5ff | ||
|
b57de8254c | ||
|
0d9f46c66c | ||
|
45f573bce1 | ||
|
1b72a95658 | ||
|
8db458704c | ||
|
14a3ad5a8e | ||
|
5cf8332024 | ||
|
4baadfba17 | ||
|
c2683995a1 | ||
|
89355894fc | ||
|
7baab31549 | ||
|
59c05e35fd | ||
|
3cd35a4ea0 | ||
|
ab6c56d922 | ||
|
991f15c832 | ||
|
5fe2d1ec0d | ||
|
6a238d970f | ||
|
470663884f | ||
|
a2e23ae14a | ||
|
89a5ca001c | ||
|
3ac1e85a9c | ||
|
eb276ba874 | ||
|
d7774cc5f6 | ||
|
c41caddcf5 | ||
|
dc486381ff | ||
|
c542f97df0 | ||
|
42b4793b14 | ||
|
0ffc7c0440 | ||
|
8f53e6f503 | ||
|
5bea4662cb | ||
|
6d7faa996d | ||
|
19f5e4c801 | ||
|
16fb7dcc1f | ||
|
e7b9fd9f1d | ||
|
97f9c78073 | ||
|
c8c1e5e75b | ||
|
d901a50bba | ||
|
78a0c23e34 | ||
|
c69cf6e295 | ||
|
98a8ac0df3 | ||
|
90a6297c8f | ||
|
1981876fac | ||
|
fed33cf600 | ||
|
02d6ef3bf5 | ||
|
7bcb8dc9fb | ||
|
462f13f492 | ||
|
5dfdb99c06 | ||
|
62951a4a3a | ||
|
27a9199e05 | ||
|
62fe2cde10 | ||
|
f4a5c31f8f | ||
|
d0835834f7 | ||
|
40a7d6f29b | ||
|
2f663d1bd9 | ||
|
5f509bb481 | ||
|
7121cca1f1 | ||
|
19d64a778f | ||
|
f7ca327572 | ||
|
aedfaaddbc | ||
|
db17df93f0 | ||
|
67c455f057 | ||
|
b961145575 | ||
|
3f12ad0f2d | ||
|
e83b4d1acf | ||
|
4387cac67f | ||
|
6aa3fd738a | ||
|
f48753c780 | ||
|
969d4457d0 | ||
|
fec6b8510e | ||
|
9f57e77d77 | ||
|
f3ae0a6cea | ||
|
f2ad02bbda | ||
|
cb947a7d3c | ||
|
7bdc67f922 | ||
|
504816e21c | ||
|
152d70e4d7 | ||
|
3ba4b64952 | ||
|
d3ec23fad5 | ||
|
4160a4be1b | ||
|
c982e5a452 | ||
|
5b8d589598 | ||
|
0590458738 | ||
|
2e66b1dad6 | ||
|
59dc4a5a9f | ||
|
8ddb02ddeb | ||
|
b46eed26ba | ||
|
1b711d03eb | ||
|
9fbdfc3db0 | ||
|
9f79620d58 | ||
|
6f3433da03 | ||
|
6f26a55ae8 | ||
|
07b7347417 | ||
|
a9c50ab41f | ||
|
524fb7dd2a | ||
|
58aecf8db9 | ||
|
657b63b201 | ||
|
f7ac237d6c | ||
|
5cb3b43eeb | ||
|
1d5d874415 | ||
|
66b117b81f | ||
|
97db978c8a | ||
|
721d18669a | ||
|
71c183d8a7 | ||
|
aa0ad9d57e | ||
|
1bf44bad10 | ||
|
5b3bbee285 | ||
|
238f31e3fc | ||
|
88c18cc487 | ||
|
0d2ae2eedf | ||
|
a63175ff7d | ||
|
9001676971 | ||
|
ef6319b735 | ||
|
e14d2c143a | ||
|
b0cc06a3e5 | ||
|
90da257037 | ||
|
916fe40381 | ||
|
4c23100021 | ||
|
440fb41f1c | ||
|
41d98b88d2 | ||
|
d9cdfc88e9 | ||
|
3a571b8a22 | ||
|
b51ba4d88b | ||
|
a71bf2c6f3 | ||
|
97d803e97f | ||
|
0b29f2ec0a | ||
|
de9c4f902f | ||
|
95a344b3c2 | ||
|
170a5dfd06 | ||
|
f35e75572f | ||
|
7cb1e2d920 | ||
|
0fad05c049 | ||
|
94ea385aff | ||
|
ab30fc7bf2 | ||
|
f16b415f7a | ||
|
65dea8bf56 | ||
|
f266b582df | ||
|
deef87ef9d | ||
|
827124b79b | ||
|
ea677dc7c6 | ||
|
325fbf8f5f | ||
|
592be1f057 | ||
|
28021b5047 | ||
|
52138618bd | ||
|
7b2e44c407 | ||
|
acc9f84533 | ||
|
8f641c4071 | ||
|
82122e2269 | ||
|
da81d15771 | ||
|
fe714aca0b | ||
|
5e21096f8c | ||
|
2049abff1e | ||
|
848d015fd8 | ||
|
01109c3842 | ||
|
cbed45da29 | ||
|
f8ebd3435d | ||
|
020be16f11 | ||
|
35cd1b7b3e | ||
|
0eb3552c3c | ||
|
8d3621dbe7 | ||
|
03cc39d2e1 | ||
|
b913f49918 | ||
|
661c373a05 | ||
|
fae30e63a8 | ||
|
eb40866ea2 | ||
|
c6494d7e04 | ||
|
e0b8b60fed | ||
|
cdb0890fac | ||
|
b5902d7ac8 | ||
|
885e8eb5d8 | ||
|
0cfb1b1eae | ||
|
ee89abe16f | ||
|
310d6bf4aa | ||
|
f94251776b | ||
|
d98ba21957 | ||
|
02a9e26f2c | ||
|
55098c50f1 | ||
|
8c0b5032ec | ||
|
d28a114650 | ||
|
90a42c6e04 | ||
|
9068a60b99 | ||
|
efc8d9d502 | ||
|
4c3e8b48dd | ||
|
23b6aa4c2b | ||
|
acff2ae390 | ||
|
98adcc1abd | ||
|
6d47a8736e | ||
|
ec60b63c68 | ||
|
b26b10c651 | ||
|
f93533f95b | ||
|
ef50b5261a | ||
|
04e18c7518 | ||
|
a2338c5fca | ||
|
7087f80c9c | ||
|
8512db5c01 | ||
|
5f53cb39bd | ||
|
e3a862abff | ||
|
a20f583dee | ||
|
efbfbfbc2f | ||
|
8a408c4925 | ||
|
5aa8cd909f | ||
|
2ddc0540a8 | ||
|
ef83f58648 | ||
|
91a2d61fd0 | ||
|
f3265b439a | ||
|
1ca3670cb4 | ||
|
5f5cf2e3e5 | ||
|
37d319215c | ||
|
661b7fb2b0 | ||
|
1a0131e05a | ||
|
b034f6731a | ||
|
cb96f0df44 | ||
|
f39ba15194 | ||
|
8b42c6d2b6 | ||
|
753cd5743b | ||
|
39c7157b9f | ||
|
2d38090964 | ||
|
daf1ff37ff | ||
|
759de7bca0 | ||
|
031c842ba7 | ||
|
7e78b5da6e | ||
|
7d9d2346cc | ||
|
92eb1ea3d1 | ||
|
c49fe7901a | ||
|
fc24e63319 | ||
|
97e30e00b4 | ||
|
38a630a4e5 | ||
|
a8e362273c | ||
|
318a566e76 | ||
|
96a43a7c32 | ||
|
dd0a432b02 | ||
|
4d29a2baf8 | ||
|
c9325d5a53 | ||
|
04e8f7318c | ||
|
37428d8e24 | ||
|
0914fd1166 | ||
|
3799bf4a48 | ||
|
992df41002 | ||
|
a965922dd7 | ||
|
89eaa0ea3c | ||
|
370fb94e21 | ||
|
c4ad7ff87a | ||
|
86c7ea4021 | ||
|
ff6a0c2298 | ||
|
7c50126dd4 | ||
|
6ad9567215 | ||
|
e7203e1b4c | ||
|
b84ac60239 | ||
|
7fb987a22b | ||
|
d47c5c44c0 | ||
|
9590a58b3c | ||
|
7369158e29 | ||
|
8d3111b6ab | ||
|
cbdb950e27 | ||
|
263d332f37 | ||
|
ec40bf1a5e | ||
|
a6ee4cb684 | ||
|
36d29c9765 | ||
|
ca126dfc1e | ||
|
4620ebe7ff | ||
|
4c39cc28a9 | ||
|
3de3192797 | ||
|
601c1e4bb3 | ||
|
5b4199a570 | ||
|
f3e4e9d177 | ||
|
0df166518f | ||
|
0fdb76cd83 | ||
|
2ea1c52202 | ||
|
d8eee9a010 | ||
|
822eb59051 | ||
|
de326c7292 | ||
|
a2c8b36b95 | ||
|
9ed18854ca | ||
|
7e6cc8ddf8 | ||
|
2597425643 | ||
|
7ab3bbbf98 | ||
|
36c0816835 | ||
|
317e565b67 | ||
|
0afe1d61ef | ||
|
0e0fa784d1 | ||
|
368d04e8e7 | ||
|
379992a836 | ||
|
affa6623c3 | ||
|
9dd6cc630f | ||
|
e9581dfb0a | ||
|
bf73c2c5ec | ||
|
8b566f8157 | ||
|
20705ef917 | ||
|
520cdd0524 | ||
|
308a8e8cfb | ||
|
df311466e8 | ||
|
7581218888 | ||
|
e027f70665 | ||
|
275f8dfcf4 | ||
|
cf7ef6ca19 | ||
|
69fea8d8e3 | ||
|
17fd8850fc | ||
|
58cc356ea1 | ||
|
b5f8d492a4 | ||
|
ad40cc7d4d | ||
|
c4963f525a | ||
|
c511cab2bb | ||
|
29073ebd0f | ||
|
c17d5b42b2 | ||
|
83d2fb85f0 | ||
|
04347c10f1 | ||
|
b3b327f60a | ||
|
93ac90156f | ||
|
c82f171e07 | ||
|
a7b2a705f5 | ||
|
437fd6d0bd | ||
|
59d0a98729 | ||
|
3a13c0635f | ||
|
b9b381a780 | ||
|
38b72e7732 | ||
|
86e8e639a3 | ||
|
9907717638 | ||
|
f49fdfa2b9 | ||
|
91941a562d | ||
|
11361f50a6 | ||
|
963e10eb04 | ||
|
7e82ec918a | ||
|
639297df1d | ||
|
b54f7ddaf5 | ||
|
db4e48eb50 | ||
|
43697263a8 | ||
|
a3efb1ddad | ||
|
c201b1b918 | ||
|
a0e4472ef2 | ||
|
9e7e100009 | ||
|
01d57755c2 | ||
|
2ecd51230f | ||
|
f87c63acec | ||
|
53b8f9e159 | ||
|
c89df20a25 | ||
|
26d51caaf8 | ||
|
b943309dd2 | ||
|
ff026e260a | ||
|
70405221ea | ||
|
d0fb1b09dc | ||
|
28ca138e43 | ||
|
ecd25badf7 | ||
|
13946fe56e | ||
|
2bc6ba97f9 | ||
|
29867ceaec | ||
|
54771716f0 | ||
|
acc1bcd183 | ||
|
d6a69ee982 | ||
|
4b3bb1f073 | ||
|
a9cd58ceab | ||
|
71de62a838 | ||
|
6ba902607c | ||
|
70f754040c | ||
|
d4819a19b7 | ||
|
2f11eaf315 | ||
|
096dc6e98c | ||
|
227d2ef58b | ||
|
3b677fa0a1 | ||
|
1b9d7fdb75 | ||
|
c44330d291 | ||
|
8832e89539 | ||
|
9a8d359592 | ||
|
57decc15bd | ||
|
4b051a42ae | ||
|
6b75118926 | ||
|
ec44a6e4f3 | ||
|
3bda4b3f79 | ||
|
0400f316e6 | ||
|
27436916ee | ||
|
4055f1b8c5 | ||
|
40251607e5 | ||
|
bdbfd005fa | ||
|
1ad956e965 | ||
|
44f1a4faa0 | ||
|
5ecc2a5521 | ||
|
275f3d78b6 | ||
|
1274d83ee1 | ||
|
bba6a2edf1 | ||
|
5f0435e447 | ||
|
63ceca066f | ||
|
7c5f1dccab | ||
|
d5aaa94045 | ||
|
394d72bd01 | ||
|
7ab24d900b | ||
|
773322b60a | ||
|
ccce81c49c | ||
|
eb89b0a8b2 | ||
|
067fc68402 | ||
|
dc72d9a8b0 | ||
|
18b3f0cb26 | ||
|
b16ecbbe72 | ||
|
e18db746a0 | ||
|
a2c865a4b7 | ||
|
4de9b0bd85 | ||
|
c778c71306 | ||
|
596c546cce | ||
|
d2535fd2f8 | ||
|
4204f658d7 | ||
|
dd119449f3 | ||
|
fec7039fbe | ||
|
5692573d9c | ||
|
1e03a039b8 | ||
|
6d411a5033 | ||
|
dd2c1c5bef | ||
|
af149351b8 | ||
|
a1a6005ca0 | ||
|
afc9b4712c | ||
|
542d26d88d | ||
|
8953a930a0 | ||
|
e248fc65bf | ||
|
76d5ed41e9 | ||
|
bf6830deb3 | ||
|
1f2e6c4327 | ||
|
886b74c171 | ||
|
246bc7e557 | ||
|
aa45683a4f | ||
|
9d1435c1b5 | ||
|
1a237e00c3 | ||
|
fbf2d72f5d | ||
|
169b00af30 | ||
|
018b2b218e | ||
|
a399ce674b | ||
|
a9e17fb5d6 | ||
|
892bb521e5 | ||
|
e20fdafaa5 | ||
|
7e36abb24d | ||
|
e3d2e4a8a8 | ||
|
82a7a845f6 | ||
|
7bca968aff | ||
|
4d66a3f9a8 | ||
|
2d9104c352 | ||
|
c40f6c3330 | ||
|
56bbb7f9ac | ||
|
6b03aef11b | ||
|
68b2c72414 | ||
|
1c01c018a0 | ||
|
aeb45f0bcf | ||
|
b75d274fe8 | ||
|
eade00b0ba | ||
|
bc8215b817 | ||
|
381d217bd5 | ||
|
318b869b6a | ||
|
336fe936e8 | ||
|
16686e88eb | ||
|
e589e2549d | ||
|
504e30c44a | ||
|
09a8b6c43c | ||
|
b052547cc4 | ||
|
08c1ba943b | ||
|
85e462e276 | ||
|
0d4cde5a45 | ||
|
1ff15b0f93 | ||
|
2edfd8c945 | ||
|
2e20e78b7f | ||
|
8040a06300 | ||
|
ad3be92890 | ||
|
0a14ea4b2f | ||
|
310f3f5eda | ||
|
57c66b541e | ||
|
6d7173a487 | ||
|
e16bfcbe1a | ||
|
36e258adb3 | ||
|
951b3bcb06 | ||
|
60301948b0 | ||
|
268ed75fc0 | ||
|
a1370693fb | ||
|
fcc323af2a | ||
|
38f7760261 | ||
|
d1f9378a11 | ||
|
25c237f0a8 | ||
|
d60900e2f9 | ||
|
0b24f02bf4 | ||
|
893b060a5f | ||
|
bc3b07d774 | ||
|
b5d7ce2de0 | ||
|
1c2db9362a | ||
|
bc0d25c826 | ||
|
f7714fa738 | ||
|
fadf3fb788 | ||
|
6ee9601e23 | ||
|
6b876158d5 | ||
|
8b8e163151 | ||
|
1c529c52e1 | ||
|
daf3e08995 | ||
|
90aff02e2d | ||
|
24fbf41d08 | ||
|
7554238052 | ||
|
2f60a6496f | ||
|
1b12ee4962 | ||
|
712c4254ce | ||
|
3fe9a4ec0c | ||
|
1387a6f2a9 | ||
|
5aae22483f | ||
|
520a36946a | ||
|
ace3dc089e | ||
|
b6cbd8ea74 | ||
|
4ce92e67b1 | ||
|
0fe27e5a76 | ||
|
6149faee1d | ||
|
dade64750d | ||
|
0064db72a1 | ||
|
bee3d772d5 | ||
|
47441c3e05 | ||
|
f7fc376482 | ||
|
082ecce9be | ||
|
85f8adbd76 | ||
|
58de6a86f5 | ||
|
4ebe2a2719 | ||
|
5b805ca9a9 | ||
|
6314e6c24a | ||
|
3148d5f9b2 | ||
|
21c193db90 | ||
|
cc21471244 | ||
|
6d9bdb183c | ||
|
1858deffd3 | ||
|
9b6161d8fe | ||
|
3282f9f1db | ||
|
3fa91ed7dc | ||
|
be18db0649 | ||
|
06e8640219 | ||
|
ec9ccf8adf | ||
|
d25751972e | ||
|
197702b461 | ||
|
a9712d45b3 | ||
|
4711d5fd23 | ||
|
0861becc56 | ||
|
739912fd60 | ||
|
c895b1c4af | ||
|
0ea5791fbd | ||
|
bfc362ef62 | ||
|
f5bfb3e250 | ||
|
cfad7131d2 | ||
|
f0324038e3 | ||
|
0982e1bb38 | ||
|
eb0ecd7583 | ||
|
0d949f8dd6 | ||
|
e6b34dd622 | ||
|
5cca26e0c4 | ||
|
25e42fc7da | ||
|
9225ec35b5 | ||
|
4a07e7c5b8 | ||
|
4c911705ab | ||
|
cf01ee77e1 | ||
|
e50a267309 | ||
|
90e45a2763 | ||
|
3e033f517d | ||
|
f361cc568a | ||
|
1fd2515806 | ||
|
e9cb3c52ff | ||
|
6071e0bd23 | ||
|
00b5da0fe2 | ||
|
facb376676 | ||
|
ddc0dda209 | ||
|
809a064e9f | ||
|
6e653693e7 | ||
|
6ae6ff8484 | ||
|
655cfa0e75 | ||
|
b3458e2888 | ||
|
12ff7e09a6 | ||
|
1423aa37f7 | ||
|
9f57fda4ec | ||
|
caaa791760 | ||
|
ec50416a8b | ||
|
61ff1608f8 | ||
|
6185597436 | ||
|
f4155f9c43 | ||
|
484824d75f | ||
|
14127fd203 | ||
|
b6659de483 | ||
|
ac6d9f430e | ||
|
d7d5f286f5 | ||
|
86dc5d2f13 | ||
|
dbc118064c | ||
|
392efd2c0c | ||
|
63e444ffb5 | ||
|
a441ce8ff4 | ||
|
57860793ff | ||
|
ceebe74ec1 | ||
|
5f3ca62393 | ||
|
95e4952012 | ||
|
0b6c1d6504 | ||
|
c5e35b6b48 | ||
|
e735947362 | ||
|
b8c96e872f | ||
|
5204974688 | ||
|
b62982074a | ||
|
8f90cbbbe9 | ||
|
36b28a4483 | ||
|
ce92f23c50 | ||
|
1bc12d3202 | ||
|
2e4c3bf119 | ||
|
185479287c | ||
|
a9da1752b2 | ||
|
23cce968f8 | ||
|
dd83e86382 | ||
|
c43fe177b5 | ||
|
14515e6ba6 | ||
|
d017952ffe | ||
|
6bbf10ae7d | ||
|
c0f1b3859f | ||
|
30f3ab8dca | ||
|
14bd5e9750 | ||
|
6805c214bc | ||
|
23aec94de7 | ||
|
50e88b3f86 | ||
|
c646e9136c | ||
|
8b1d7d11fe | ||
|
12c4e0465e | ||
|
c1343f0ef0 | ||
|
72df83cbb3 | ||
|
8949bc660e | ||
|
f11a5c544e | ||
|
f528fd3e6e | ||
|
15034de546 | ||
|
ad70a1cf2f | ||
|
b7e05d48d4 | ||
|
802b3b0926 | ||
|
cff4c96a04 | ||
|
fc643162fb | ||
|
1b80aa8df5 | ||
|
c63ae5df4f | ||
|
1965d196ae | ||
|
28ee0550ae | ||
|
a759640448 | ||
|
705e413661 | ||
|
d299c7020d | ||
|
8cffef92a5 | ||
|
c1b256f150 | ||
|
2137604cec | ||
|
bf200e6745 | ||
|
c530749a46 | ||
|
eec448491f | ||
|
92d52bbecf | ||
|
302b3e47d4 | ||
![]() |
ed9563d380 | ||
![]() |
49cd05ee35 | ||
|
4c00aa9a2e | ||
|
be54c49918 | ||
|
9b91ebf317 | ||
|
ac24e25da0 | ||
|
e07cb78d65 | ||
|
11559ac68a | ||
|
cf4d418cd0 | ||
|
68b9b03ec7 | ||
|
3d0d68d9f5 | ||
|
5a804fd892 | ||
|
c9a86aae01 | ||
|
147917fc58 | ||
|
c017558984 | ||
|
65b9015d51 | ||
|
24486ae041 | ||
|
243039151a | ||
|
e66ca47198 | ||
|
d2b1ebe725 | ||
|
a7fdad7f77 | ||
|
6e16a645c8 | ||
|
e00a3c6717 | ||
|
ba0fc54cbc | ||
|
e954fd860a | ||
|
6790158ed9 | ||
|
7825e06f69 | ||
|
1a3d95ef30 | ||
|
f37bf1df53 | ||
|
72d2082638 | ||
|
aa5db1cc99 | ||
|
bbb47626ce | ||
|
ac290dec2b | ||
|
1ed657eb55 | ||
|
4d2fa93632 | ||
|
7488ee0914 | ||
|
eda23bd3b0 | ||
|
cf4b156863 | ||
|
022d27ecb4 | ||
|
9e0d44824a | ||
|
27ad666554 | ||
|
a43a97d960 | ||
|
fcef89f0c9 | ||
|
bf447d823e | ||
|
44752cc329 | ||
|
28501e7929 | ||
|
8c60348939 | ||
|
332ae125ac | ||
|
3588a8b76e | ||
|
0acdca0d99 | ||
|
d59c16217e | ||
|
e06222733c | ||
|
870eeeb834 | ||
|
958e4f6aa5 | ||
|
0daee80325 | ||
|
c1575fbf5f | ||
|
40cb45b2da | ||
|
923fc1f8eb | ||
|
c1540d0267 | ||
|
47b46423c0 | ||
|
23f85768c4 | ||
|
879e8840ad | ||
|
26760c8e15 | ||
|
49c5f864a7 | ||
|
c7f6fefc7f | ||
|
fbd2bcb418 | ||
|
e332df17a4 | ||
|
bbba486be1 | ||
|
ce607226d9 | ||
|
629ae3b9d3 | ||
|
6d983a74de | ||
|
f364a08bbc | ||
|
c4c45139d6 | ||
|
401d43acfc | ||
|
237801f56c | ||
|
7fdebf20f1 | ||
|
ad178f3cd0 | ||
|
cbd1332213 | ||
|
7cfe2cbecf | ||
|
58f193e71b | ||
|
5ca288a04b | ||
|
c331cbeb26 | ||
|
12b7663653 | ||
|
a53ac333e3 | ||
|
04355116f4 | ||
|
9375abffd3 | ||
|
f6483c0ccb | ||
|
7e86d9377f | ||
|
3861a7b6e4 | ||
|
443ff2d299 | ||
|
b9026e2ac0 | ||
|
719665a2d8 | ||
|
37838681da | ||
|
cb2ede287d | ||
|
88da62b8e8 | ||
|
3858220937 | ||
|
be8943163a | ||
|
9b26ae718a | ||
|
ba0843ecc6 | ||
|
3860fef6b8 | ||
|
0093d3d27a | ||
|
3ba8b94850 | ||
|
c348816809 | ||
|
c839e82633 | ||
|
c5179274af | ||
|
45b1c0bb31 | ||
|
07bb58730a | ||
|
d9238fffa0 | ||
|
147bc2b709 | ||
|
8076e353d2 | ||
|
8e9be690c3 | ||
|
d5181ce222 | ||
|
64ad6a4ba6 | ||
|
0fcc2e5898 | ||
|
f072a618ee | ||
|
d6a335ec25 | ||
|
667b1c7a0b | ||
|
6d2edeea29 | ||
|
857a8960bb | ||
|
269a36217b | ||
|
4ef04c0dfa | ||
|
1e51e9e7d4 | ||
|
d0c4a02c5a | ||
|
dd9571c228 | ||
|
98eab21995 | ||
|
811b265022 | ||
|
b217e3647e | ||
|
103f030f6b | ||
|
917f33334c | ||
|
a013c160b7 | ||
|
1513f4b667 | ||
|
a1b08b8edc | ||
|
fdbb3b04f3 | ||
|
8ffd5b3a19 | ||
|
5ff9727431 | ||
|
c90b832811 | ||
|
4a8d20ed6b | ||
|
45078b10b0 | ||
|
75139a8523 | ||
|
7743de24d2 | ||
|
2f9addb788 | ||
|
b89671c08a | ||
|
dca3e444d7 | ||
|
67678ab6f9 | ||
|
1c3e060715 | ||
|
7a7cebc5ce | ||
|
77755e0c93 | ||
|
8d264a3af4 | ||
|
f9c36f81ae | ||
|
efc5c7012c | ||
|
15416b8c5a | ||
|
6345fe6adb | ||
|
7930cdf838 | ||
|
7763d2f5f1 | ||
|
7d1f245340 | ||
|
5d97d75a13 | ||
|
3da5cdf703 | ||
|
b6a8df9410 | ||
|
f698b414a5 | ||
|
a8f8f33a74 | ||
|
47b767e8ce | ||
|
9fd701b102 | ||
|
327fac5f5a | ||
|
0a9c5162ca | ||
|
f082611b02 | ||
|
f95f7b2dfc | ||
|
9703133ad2 | ||
|
d3b0ccf3d5 | ||
|
f0ef62183e | ||
|
79337d7b7d | ||
|
b1d59592bd | ||
|
38fb341f38 | ||
|
2d2e1787d9 | ||
|
979739cc21 | ||
|
740ce71ac9 | ||
|
fd4133d962 | ||
|
1dcb500c7f | ||
|
5fbc9d54b3 | ||
|
d95e48ef86 | ||
|
462a9a1d44 | ||
|
ffe7dbf1dd | ||
|
dddef9706d | ||
|
d3c44489f3 | ||
|
739183de9c | ||
|
4dfc9b9f68 | ||
|
82133c114e | ||
|
e28b3fcf76 | ||
|
7bb0193211 | ||
|
82c7aed836 | ||
|
20c797520e | ||
|
569e4c680e | ||
|
50f5f15c6f | ||
|
ba1aa01d46 | ||
|
3746673f9d | ||
|
0383007451 | ||
|
fdd39704ef | ||
|
25c372280f | ||
|
ddde78f5b9 | ||
|
bbcc9244e3 | ||
|
d79c09c692 | ||
|
f6af6f9519 | ||
|
f045f71337 | ||
|
cd40704d0f | ||
|
ac9eb64368 | ||
|
6261eadeb7 | ||
|
95ad3d687c | ||
|
f41fdc1ea5 | ||
|
8b560b5916 | ||
|
6e87baff6f | ||
|
621e59eae5 | ||
|
1b88633887 | ||
|
bc27445103 | ||
|
6b589fc9f6 | ||
|
5af213ca48 | ||
|
f3165acd64 | ||
|
da67ec0e03 | ||
|
047916cf9c | ||
|
26074ae7b7 | ||
|
915841aa04 | ||
|
6a1a144ca3 | ||
|
22b43db39b | ||
|
09e00cbbee | ||
|
b5f0cc3097 | ||
|
aeddaf6462 | ||
|
64c5bffbfa | ||
|
0af1a9071b | ||
|
70d4434d36 | ||
|
7c1d5a4830 | ||
|
7f9d6ca2d5 | ||
|
62f84f5637 | ||
|
426658695e | ||
|
68d9abea67 | ||
|
8c74343843 | ||
|
ca3142046b | ||
|
7e2c9ab4a2 | ||
|
e8e7527094 | ||
|
6e15bc93d1 | ||
|
9a08f5eb5f | ||
|
2687f85935 | ||
|
8548e6f098 | ||
|
b77239b874 | ||
|
a8ffbcae29 | ||
|
5782fe9da6 | ||
|
70a66ae4cd | ||
|
be7a9105a0 | ||
|
97da17773e | ||
|
ddc59156ea | ||
|
827acad36d | ||
|
e22d063a1e | ||
|
caee0ad276 | ||
|
f616b7df0e | ||
|
275d941afd | ||
|
7675543a31 | ||
|
84814d3291 | ||
|
e1c833fcd6 | ||
|
0dc1fcf341 | ||
|
d3984bc06b | ||
|
74b107f1d3 | ||
|
c04a51f3b7 | ||
|
a13b7d9f80 | ||
|
86c899f007 | ||
|
6019f5129b | ||
|
6fb6d295d4 | ||
|
39bac4e8f8 | ||
|
dc9b31b4eb | ||
|
c89cabdcb4 | ||
|
f2c42de0ca | ||
|
f40d2d7424 | ||
|
3ffda44c1d | ||
|
8a0f104992 | ||
|
688f5d8a9a | ||
|
5c2e1c4a4b | ||
|
2f984aa848 | ||
|
16ad17aebb | ||
|
39ca6e01b0 | ||
|
cea9abbc5b | ||
|
a7c76e80a0 | ||
|
a655cab7ae | ||
|
c5b7bac8f8 | ||
|
1ca468314e | ||
|
82dd3c82a6 | ||
|
1e998cc103 | ||
|
5d7d6568e1 | ||
|
7195f03501 | ||
|
545fbe588c | ||
|
97a527ab52 | ||
|
b981d2899e | ||
|
b9af6ee60b | ||
|
5d5f2f9c9a | ||
|
19348ce031 | ||
|
ffb71f816f | ||
|
c815a66be3 | ||
|
34c81cec76 | ||
|
737ba73cea | ||
|
a47cbf80cd | ||
|
83fc8a46f8 | ||
|
976a27229e | ||
|
a1a1a4fecb | ||
|
2049f3c61d | ||
|
dc4186aead | ||
|
22836dca4f | ||
|
791fa4a082 | ||
|
215bc11b62 | ||
|
e008afa42f | ||
|
8efef5112b | ||
|
3bdce72d58 | ||
|
8c49260a67 | ||
|
e013dc96c0 | ||
|
89190e5b86 | ||
|
4ae5e73b76 | ||
|
2757f47cc2 | ||
|
a9e2576774 | ||
|
878c4a0a92 | ||
|
9edba3bbec | ||
|
bc70576a63 | ||
|
187d20cc15 | ||
|
0bd1a8e5de | ||
|
740b42d5d3 | ||
|
c403dc14f9 | ||
|
17b26de808 | ||
|
5aad4db2a4 | ||
|
6581caf589 | ||
|
7f25fe3745 | ||
|
a4ec09dc61 | ||
|
8079a213f7 | ||
|
c72d3432ee | ||
|
12decaea76 | ||
|
10cb858a6d | ||
|
b3f820d840 | ||
|
28d91cce16 | ||
|
a9dda8f263 | ||
|
777ed0a673 | ||
|
4b1b48c235 | ||
|
67b9e8c7d0 | ||
|
dfcaed080b | ||
|
e00bd1e7c3 | ||
|
3e90ac4b9e | ||
|
4d92dc1f42 | ||
|
c29a2bd07b | ||
|
c001b83fb4 | ||
|
4b8563fe7e | ||
|
4eb4c6eea5 | ||
|
5e4298c566 | ||
|
bbf40df10e | ||
|
f9ad08f52b | ||
|
7c32605e85 | ||
|
4feb4659a3 | ||
|
0a1c4f766d | ||
|
9f4fb208a0 | ||
|
dec4dd85a8 | ||
|
0405e1e29f | ||
|
4be8132bbf | ||
|
b63c1d9a9c | ||
|
d89c16b3ea | ||
|
00a2f0b67a | ||
|
acadb3c6db | ||
|
5483c48d38 | ||
|
8bc3ecfb4f | ||
|
4fad5a1614 | ||
|
6b85100236 | ||
|
979354dc75 | ||
|
11547c56a8 | ||
|
9560bc6680 | ||
|
25a72471a1 | ||
|
7ce644e922 | ||
|
a6c17512cc | ||
|
817b4d1838 | ||
|
2b2a3dbc99 | ||
|
3ac1abb2d2 | ||
|
eb861cdaa0 | ||
|
5fb9a1d05a | ||
|
159ddaea80 | ||
|
16962a127e | ||
8e12dffb69 | |||
|
3952b1caf1 | ||
|
578161d604 | ||
|
6434b154b4 | ||
|
b12f9f2ded | ||
|
f372d3d44d | ||
|
66d4b84d89 | ||
|
215be31021 | ||
|
aa892f2fb9 | ||
|
56cd4f38eb | ||
|
abc301b7dd | ||
|
29995fc219 | ||
|
a3a3d9350e | ||
|
34a8a4ee85 | ||
|
70783bb532 | ||
|
413d11b3c3 | ||
|
8686d16db6 | ||
|
4106802f4a | ||
|
c2e15c2bfb | ||
|
37bc798e38 | ||
|
5c73717373 | ||
|
4837afcfb0 | ||
|
810b2e9864 | ||
|
2fcb02ea4f | ||
|
3db9d22e48 | ||
|
f817fd0797 | ||
|
8bbac74334 | ||
|
fd13861603 | ||
|
8177ffd4f3 | ||
|
82d85168d5 | ||
|
4721b185aa | ||
|
8e9cb798b7 | ||
|
e204faed0e | ||
|
d78235cb11 | ||
|
1af2ba3822 | ||
|
ad28ddd6b2 | ||
|
97ba87aba7 | ||
|
7603db8ce0 | ||
|
663e33466d | ||
|
cbed3f1ae1 | ||
|
8bdaf8d410 | ||
|
6595af849e | ||
|
4111d00025 | ||
|
f75d8258f4 | ||
|
7a11e156a5 | ||
|
8977990fea | ||
|
bc44a9be15 | ||
|
88d9bf4629 | ||
|
65706e727c | ||
|
b64fd393e9 | ||
|
2b300ceae4 | ||
|
6e4bb95dda | ||
|
440ad039be | ||
|
4c89a855c6 | ||
|
0ca53b75d2 | ||
|
91eb579e2c | ||
|
1aad4f07df | ||
|
335842c8a2 | ||
|
c10d078add | ||
|
67cdceb90e | ||
|
ddbd3f8684 | ||
|
4ae8011eff | ||
|
d61dbb0315 | ||
|
3c13bf7199 | ||
|
b19cd7c0c9 | ||
|
17438f6f5c | ||
|
f05ab805ff | ||
|
212cd9d54e | ||
|
f4437b6955 | ||
|
e8950f03ae | ||
|
0e16cb1730 | ||
|
67cfa9cf01 | ||
|
7bdf2aa1ad | ||
|
44676707f0 | ||
|
d9e92b13b6 | ||
|
833ea5d0c3 | ||
|
04c5f32c53 | ||
|
93d5995ec1 | ||
|
d679d1fb73 | ||
|
f8b0ed7f18 | ||
|
d83f787956 | ||
|
b958e24dc9 | ||
|
e61de6eb1d | ||
|
b89212a4f6 | ||
|
c37d8ab34f | ||
|
ca5b37edfe | ||
|
408e51c0a6 | ||
|
9fd834eb44 | ||
|
58f3d01c87 | ||
|
de46b38991 | ||
|
926caf2f3f | ||
|
8bbe897483 | ||
|
59ba9134e7 | ||
|
83e68742be | ||
|
9a38da9475 | ||
|
c8d0931d8e | ||
|
4d643ae28f | ||
|
33b8dd36e4 | ||
|
25d3803e69 | ||
|
7b08bf77bf | ||
|
3f1af73b0e | ||
|
a22dd088a5 | ||
|
e88c53d950 | ||
|
a160d3e212 | ||
|
dacfba7043 | ||
|
9683fee1e6 | ||
|
575329586f | ||
|
a866f5524a | ||
|
654f7850de | ||
|
b52ab37aed | ||
|
554335aa6e | ||
|
96abece6da | ||
|
8103bf4a16 | ||
|
e4affdc9d7 | ||
|
90a6a6ceaa | ||
|
a97448438a | ||
|
557e973fca | ||
|
98385aa706 | ||
|
7119c12467 | ||
|
3d1d9534be | ||
|
b94c08d029 | ||
|
42cf16b545 | ||
|
bebe315b08 | ||
|
6a359bbbf8 | ||
|
42bdcaf6b6 | ||
|
27641128c3 | ||
|
be0a85cb3a | ||
|
f11c0e3d58 | ||
|
58e7346f71 | ||
|
fc34de1da4 | ||
|
bf8543bc77 | ||
|
8b26deb064 | ||
|
6ef2683e5e | ||
|
e0b12ab0e2 | ||
|
5ce553f8cf | ||
|
44ff9225bc | ||
|
206d5c7e74 | ||
|
50698f7325 | ||
|
6e8381396f | ||
|
e87a347354 | ||
|
7b071eb9eb | ||
|
77fbebf4a7 | ||
|
c09a7a3c2b | ||
|
1b429a31a2 | ||
|
82a5bfebb4 | ||
|
4c5232039a | ||
|
74afdc0a7a | ||
|
1de94be096 | ||
|
5c6745dacc | ||
|
66161f4eb3 | ||
|
d77dd2c349 | ||
|
e9571221be | ||
|
a33ddf3e51 | ||
|
84073c8df4 | ||
|
1e9b701f58 | ||
|
b48d7adaed | ||
|
b6a4fb03fc | ||
|
05dfc73d94 | ||
|
850805b562 | ||
|
bf5e092f7d | ||
|
f2799e939c | ||
|
ff6244883a | ||
|
13fa111394 | ||
|
f8e22c4a9d | ||
|
fdec78fd61 | ||
|
2e262e3156 | ||
|
3d11a064bd | ||
|
688ff330db | ||
|
4ded712634 | ||
|
a7a8cb6c90 | ||
|
c2d270696d | ||
|
47c66185a3 | ||
|
b83ffa4dcf | ||
|
c994ccca0c | ||
|
d3bb4a285b | ||
|
5b4f7d70b6 | ||
|
e50c0fa9fe | ||
|
0da6ff2c0c | ||
|
f72e9cb26f | ||
|
60bafb2d32 | ||
|
d103844496 | ||
|
e134d23594 | ||
|
7bc983d345 | ||
|
255eeac0a5 | ||
|
3b30708954 | ||
|
e0e2f7789b | ||
|
ef5a211f57 | ||
|
939023b71e | ||
|
89c30f16f0 | ||
|
f8641a953a | ||
|
a1f97d7cfa | ||
|
21abe0e297 | ||
|
d5c51e6dca | ||
|
25ad71080e | ||
|
4584630883 | ||
|
5733eed8bc | ||
|
e0deba141a | ||
|
1a66bd5d89 | ||
|
72a79766b8 | ||
|
7751646d50 | ||
|
97e15dd37f | ||
|
ce9d4c2cd3 | ||
|
3ab25e3333 | ||
|
80f6fb2382 | ||
|
1768a85cbd | ||
|
eaecabe7b7 | ||
|
ae7394888d | ||
|
27423a6ab5 | ||
|
a5d1e8efe0 | ||
|
3a8f037be5 | ||
|
f5b0eacfab | ||
|
0740f6399b | ||
|
8dfd55fe10 | ||
|
3046a8a391 | ||
|
ef8bf95c28 | ||
|
7e1a8c1af3 | ||
|
7c9b67584d | ||
|
fda91e7d3d | ||
|
dcbaa32aa2 | ||
|
71c7d0a1fa | ||
|
b1d9d3016f | ||
|
447ad45fc6 | ||
|
d3f721f7cc | ||
|
107ac13e15 | ||
|
d70c285bea | ||
|
bb2b66ce6a | ||
|
849967fe97 | ||
|
bb68512502 | ||
|
ae31abaa3b | ||
|
80927bfa9c | ||
|
1ef01af199 | ||
|
d5a5f08727 | ||
|
e03c02cc35 | ||
|
c37f4bb643 | ||
|
098e2d87ec | ||
|
fd6d487060 | ||
|
af10d647b9 | ||
|
31025af9ab | ||
|
8162e3f171 | ||
|
316e750004 | ||
|
edc4f1357e | ||
|
ac503cdf0c | ||
|
bc8dfec325 | ||
|
39f248e0a6 | ||
|
f966874550 | ||
|
7704e15e31 | ||
|
b0e01e5bf1 | ||
|
4ec8496124 | ||
|
b54c36627c | ||
|
884e8d35de | ||
|
8154c3425e | ||
|
7e76d68466 | ||
|
a01ffab237 | ||
|
d97a78362c | ||
|
4ccd299fda | ||
|
1fe0701342 | ||
|
902d5176ff | ||
|
0a2effe591 | ||
|
e6139c129f | ||
|
fafb7dc301 | ||
|
1a8108d5e0 | ||
|
466da9a0b3 | ||
|
da122028c9 | ||
|
000552c090 |
2322 changed files with 91380 additions and 16832 deletions
|
@ -36,6 +36,5 @@ Android version:
|
||||||
|
|
||||||
|
|
||||||
<!-- If you read our contributing advice -->
|
<!-- If you read our contributing advice -->
|
||||||
[ ] - I read
|
- [ ] I read the [contributing page](https://codeberg.org/tom79/Fedilab/src/branch/main/CONTRIBUTING.md)
|
||||||
the [contributing page](https://codeberg.org/tom79/Fedilab/src/branch/main/CONTRIBUTING.md)
|
|
||||||
|
|
||||||
|
|
|
@ -22,5 +22,4 @@ labels:
|
||||||
|
|
||||||
|
|
||||||
<!-- If you read our contributing advice -->
|
<!-- If you read our contributing advice -->
|
||||||
[ ] - I read
|
- [ ] I read the [contributing page](https://codeberg.org/tom79/Fedilab/src/branch/main/CONTRIBUTING.md)
|
||||||
the [contributing page](https://codeberg.org/tom79/Fedilab/src/branch/main/CONTRIBUTING.md)
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ CONTRIBUTING
|
||||||
|
|
||||||
### Localizations:
|
### Localizations:
|
||||||
|
|
||||||
Fedilab works only with [Weblate]https://hosted.weblate.org/projects/fedilab), which offers nice
|
Fedilab works only with [Weblate](https://hosted.weblate.org/projects/fedilab), which offers nice
|
||||||
tools for helping in translations. New translations will be automatically merged in a branch.
|
tools for helping in translations. New translations will be automatically merged in a branch.
|
||||||
|
|
||||||
If you're submiting a merge request and your work adds new strings to the app, make sure they only
|
If you're submiting a merge request and your work adds new strings to the app, make sure they only
|
||||||
|
|
44
README.md
44
README.md
|
@ -1,24 +1,46 @@
|
||||||
[](https://hosted.weblate.org/engage/fedilab/)
|
|
||||||
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
||||||
|
|
||||||
# Fedilab is a multi-accounts client for Mastodon, Pleroma, Friendica and Pixelfed
|
<img src="src/fdroid/fastlane/metadata/android/en/images/icon.png" width="100"/>
|
||||||
|
|
||||||
## Donate
|
# Fedilab
|
||||||
|
A multi-accounts client for Mastodon, Pleroma, Friendica and Pixelfed
|
||||||
|
|
||||||
[<img alt="Donate using Liberapay" src="https://img.shields.io/liberapay/patrons/tom79.svg?logo=liberapay"/>](https://liberapay.com/tom79/donate)
|
|
||||||
|
|
||||||
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
||||||
|
[](https://hosted.weblate.org/engage/fedilab/)
|
||||||
|
[](https://f-droid.org/app/fr.gouv.etalab.mastodon)
|
||||||
|
[](https://liberapay.com/tom79/donate)
|
||||||
|
[](https://opencollective.com/fedilab)
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|
<img src="src/fdroid/fastlane/metadata/android/en/images/phoneScreenshots/1.png" width="150"/>
|
||||||
|
|
||||||
|
<img src="src/fdroid/fastlane/metadata/android/en/images/phoneScreenshots/2.png" width="150"/>
|
||||||
|
|
||||||
|
<img src="src/fdroid/fastlane/metadata/android/en/images/phoneScreenshots/4.png" width="150"/>
|
||||||
|
|
||||||
|
<img src="src/fdroid/fastlane/metadata/android/en/images/phoneScreenshots/7.png" width="150"/>
|
||||||
|
|
||||||
## Download
|
## Download
|
||||||
|
|
||||||
[<img alt='Get it on Google Play' src='./images/get-it-on-play.png' height="80"/>](https://play.google.com/store/apps/details?id=app.fedilab.android)
|
[<img alt='Get it on F-Droid' src='./images/get-it-on-fdroid.png' height="80"/>](https://f-droid.org/app/fr.gouv.etalab.mastodon) [<img alt='Get it on Google Play' src='./images/get-it-on-play.png' height="80"/>](https://play.google.com/store/apps/details?id=app.fedilab.android)
|
||||||
[<img alt='Get it on F-Droid' src='./images/get-it-on-fdroid.png' height="80"/>](https://f-droid.org/app/fr.gouv.etalab.mastodon)
|
|
||||||
<img src='https://img.shields.io/f-droid/v/fr.gouv.etalab.mastodon?include_prereleases' />
|
## Translate
|
||||||
|
|
||||||
|
- [Weblate](https://hosted.weblate.org/engage/fedilab/)
|
||||||
|
|
||||||
|
## Donate
|
||||||
|
|
||||||
|
- [Liberapay](https://liberapay.com/tom79/donate)
|
||||||
|
- [Open Collective](https://opencollective.com/fedilab)
|
||||||
|
- [More...](https://fedilab.app/page/donations/)
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
[WIKI](https://fedilab.app/wiki/home/)
|
- [Wiki](https://wiki.fedilab.app)
|
||||||
|
- [Releases + Changelogs](https://codeberg.org/tom79/Fedilab/releases)
|
||||||
|
|
||||||
[Release notes](https://codeberg.org/tom79/Fedilab/tags)
|
## Contact
|
||||||
|
- Fedi:<br>[toot.fedilab.app/@apps](https://toot.fedilab.app/@apps)
|
||||||
|
|
||||||
Lead developer: [toot.fedilab.app/@apps](https://toot.fedilab.app/@apps)
|
|
||||||
|
|
||||||
|
|
154
app/build.gradle
154
app/build.gradle
|
@ -8,13 +8,13 @@ plugins {
|
||||||
}
|
}
|
||||||
def flavor
|
def flavor
|
||||||
android {
|
android {
|
||||||
compileSdk 33
|
compileSdk 34
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 33
|
targetSdk 34
|
||||||
versionCode 462
|
versionCode 534
|
||||||
versionName "3.14.0"
|
versionName "3.33.1"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
|
@ -25,12 +25,13 @@ android {
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
applicationIdSuffix '.debug'
|
applicationIdSuffix '.debug'
|
||||||
|
pseudoLocalesEnabled true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
coreLibraryDesugaringEnabled true
|
coreLibraryDesugaringEnabled true
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_17
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
productFlavors {
|
productFlavors {
|
||||||
fdroid {
|
fdroid {
|
||||||
|
@ -46,16 +47,11 @@ android {
|
||||||
flavor = "playstore"
|
flavor = "playstore"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lintOptions {
|
|
||||||
checkReleaseBuilds false
|
|
||||||
abortOnError false
|
|
||||||
}
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
viewBinding true
|
viewBinding true
|
||||||
}
|
}
|
||||||
sourceSets {
|
sourceSets {
|
||||||
playstore {
|
playstore {
|
||||||
manifest.srcFile "src/playstore/AndroidManifest.xml"
|
|
||||||
java.srcDirs = ['src/main/java', 'src/playstore/java']
|
java.srcDirs = ['src/main/java', 'src/playstore/java']
|
||||||
res.srcDirs = ['src/main/res', 'src/playstore/res']
|
res.srcDirs = ['src/main/res', 'src/playstore/res']
|
||||||
}
|
}
|
||||||
|
@ -63,12 +59,39 @@ android {
|
||||||
java.srcDirs = ['src/main/java', 'src/fdroid/java']
|
java.srcDirs = ['src/main/java', 'src/fdroid/java']
|
||||||
res.srcDirs = ['src/main/res', 'src/fdroid/res']
|
res.srcDirs = ['src/main/res', 'src/fdroid/res']
|
||||||
}
|
}
|
||||||
|
main {
|
||||||
|
res.srcDirs = [
|
||||||
|
'src/main/res/layouts/mastodon',
|
||||||
|
'src/main/res/layouts/peertube',
|
||||||
|
'src/main/res/layouts',
|
||||||
|
|
||||||
|
'src/main/res/drawables/mastodon',
|
||||||
|
'src/main/res/drawables/peertube',
|
||||||
|
'src/main/res/drawables',
|
||||||
|
|
||||||
|
'src/main/res/menus/mastodon',
|
||||||
|
'src/main/res/menus/peertube',
|
||||||
|
'src/main/res/menus',
|
||||||
|
|
||||||
|
'src/main/res/values',
|
||||||
|
|
||||||
|
'src/main/res'
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
configurations {
|
configurations {
|
||||||
|
cleanedAnnotations
|
||||||
|
implementation.exclude group: 'org.jetbrains', module: 'annotations'
|
||||||
all {
|
all {
|
||||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
|
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
namespace 'app.fedilab.android'
|
||||||
|
lint {
|
||||||
|
abortOnError false
|
||||||
|
checkReleaseBuilds false
|
||||||
|
}
|
||||||
|
buildToolsVersion '35.0.0'
|
||||||
}
|
}
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -77,70 +100,115 @@ allprojects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':autoimageslider')
|
implementation 'org.unifiedpush.android:connector:3.0.9'
|
||||||
implementation 'androidx.appcompat:appcompat:1.5.1'
|
|
||||||
|
|
||||||
implementation 'com.google.android.material:material:1.7.0'
|
playstoreImplementation('org.unifiedpush.android:embedded-fcm-distributor:3.0.0')
|
||||||
|
|
||||||
implementation 'com.jaredrummler:colorpicker:1.1.0'
|
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||||
|
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
implementation 'com.google.android.material:material:1.10.0'
|
||||||
implementation "com.google.code.gson:gson:2.9.1"
|
|
||||||
|
|
||||||
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
|
||||||
|
implementation "com.google.code.gson:gson:2.10.1"
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-simplexml:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-simplexml:2.9.0'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
implementation 'androidx.preference:preference:1.2.0'
|
implementation 'androidx.preference:preference:1.2.1'
|
||||||
implementation "org.conscrypt:conscrypt-android:2.5.2"
|
implementation "org.conscrypt:conscrypt-android:2.5.2"
|
||||||
implementation 'com.vanniktech:emoji-one:0.6.0'
|
implementation 'com.vanniktech:emoji-one:0.6.0'
|
||||||
implementation 'com.github.GrenderG:Toasty:1.5.2'
|
implementation 'com.github.GrenderG:Toasty:1.5.2'
|
||||||
implementation 'org.framagit.tom79:SparkButton:1.0.13'
|
|
||||||
implementation "com.github.bumptech.glide:glide:4.14.2"
|
implementation "com.github.bumptech.glide:glide:4.14.2"
|
||||||
implementation "com.github.bumptech.glide:okhttp3-integration:4.14.2"
|
implementation "com.github.bumptech.glide:okhttp3-integration:4.14.2"
|
||||||
|
implementation("com.github.bumptech.glide:recyclerview-integration:4.14.2") {
|
||||||
|
// Excludes the support library because it's already included by Glide.
|
||||||
|
transitive = false
|
||||||
|
}
|
||||||
|
|
||||||
implementation "org.jsoup:jsoup:1.15.1"
|
implementation "org.jsoup:jsoup:1.18.1"
|
||||||
|
|
||||||
implementation 'com.github.mergehez:ArgPlayer:v3.1'
|
implementation 'com.github.mergehez:ArgPlayer:v3.1'
|
||||||
|
|
||||||
|
implementation project(':autoimageslider')
|
||||||
implementation project(path: ':mytransl')
|
implementation project(path: ':mytransl')
|
||||||
implementation project(path: ':ratethisapp')
|
implementation project(path: ':ratethisapp')
|
||||||
|
implementation project(path: ':sparkbutton')
|
||||||
|
implementation project(path: ':colorPicker')
|
||||||
|
implementation project(path: ':mathjaxandroid')
|
||||||
|
implementation project(path: ':doubletapplayerview')
|
||||||
|
|
||||||
implementation 'com.burhanrashid52:photoeditor:1.5.1'
|
implementation 'com.burhanrashid52:photoeditor:1.5.1'
|
||||||
implementation("com.vanniktech:android-image-cropper:4.3.3")
|
implementation("com.vanniktech:android-image-cropper:4.3.3")
|
||||||
annotationProcessor "com.github.bumptech.glide:compiler:4.12.0"
|
annotationProcessor "com.github.bumptech.glide:compiler:4.12.0"
|
||||||
implementation 'jp.wasabeef:glide-transformations:4.3.0'
|
implementation 'jp.wasabeef:glide-transformations:4.3.0'
|
||||||
implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.23.0'
|
implementation 'com.github.penfeizhou.android.animation:glide-plugin:3.0.5'
|
||||||
implementation 'com.google.android.exoplayer:exoplayer:2.18.1'
|
implementation 'androidx.media3:media3-exoplayer-hls:1.2.1'
|
||||||
implementation "androidx.viewpager2:viewpager2:1.0.0"
|
implementation "androidx.media3:media3-exoplayer:1.2.1"
|
||||||
|
implementation "androidx.media3:media3-exoplayer-dash:1.2.1"
|
||||||
|
implementation "androidx.media3:media3-ui:1.2.1"
|
||||||
|
implementation "androidx.media3:media3-session:1.2.1"
|
||||||
|
|
||||||
|
|
||||||
|
implementation "androidx.viewpager2:viewpager2:1.1.0"
|
||||||
implementation 'com.github.piasy:rxandroidaudio:1.7.0'
|
implementation 'com.github.piasy:rxandroidaudio:1.7.0'
|
||||||
implementation 'com.github.piasy:AudioProcessor:1.7.0'
|
implementation 'com.github.piasy:AudioProcessor:1.7.0'
|
||||||
implementation "androidx.work:work-runtime:2.7.1"
|
implementation "androidx.work:work-runtime:2.9.0"
|
||||||
implementation 'app.futured.hauler:hauler:5.0.0'
|
implementation 'app.futured.hauler:hauler:5.0.0'
|
||||||
implementation "com.github.chrisbanes:PhotoView:2.3.0"
|
implementation "com.github.chrisbanes:PhotoView:2.3.0"
|
||||||
implementation "ch.acra:acra-mail:5.9.6"
|
implementation "ch.acra:acra-mail:5.11.3"
|
||||||
implementation "ch.acra:acra-limiter:5.9.3"
|
implementation "ch.acra:acra-limiter:5.11.3"
|
||||||
implementation "ch.acra:acra-dialog:5.9.6"
|
implementation "ch.acra:acra-dialog:5.11.3"
|
||||||
implementation "com.madgag.spongycastle:bctls-jdk15on:1.58.0.0"
|
implementation "com.madgag.spongycastle:bctls-jdk15on:1.58.0.0"
|
||||||
implementation 'com.github.UnifiedPush:android-connector:2.0.1'
|
|
||||||
// implementation 'com.github.UnifiedPush:android-foss_embedded_fcm_distributor:1.0.0-beta1'
|
|
||||||
playstoreImplementation('com.github.UnifiedPush:android-embedded_fcm_distributor:2.1.3') {
|
|
||||||
exclude group: 'com.google.firebase', module: 'firebase-core'
|
|
||||||
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
|
||||||
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
|
|
||||||
}
|
|
||||||
implementation 'com.burhanrashid52:photoeditor:1.5.1'
|
implementation 'com.burhanrashid52:photoeditor:1.5.1'
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
|
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-livedata:2.5.1'
|
implementation 'androidx.lifecycle:lifecycle-livedata:2.8.7'
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1'
|
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.8.7'
|
||||||
implementation 'androidx.navigation:navigation-fragment:2.5.3'
|
implementation 'androidx.navigation:navigation-fragment:2.8.7'
|
||||||
implementation 'androidx.navigation:navigation-ui:2.5.3'
|
implementation 'androidx.navigation:navigation-ui:2.8.7'
|
||||||
testImplementation 'junit:junit:'
|
testImplementation 'junit:junit:'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||||
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
|
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
|
||||||
|
implementation 'com.r0adkll:slidableactivity:2.1.0'
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
|
||||||
|
|
||||||
|
implementation 'androidx.vectordrawable:vectordrawable:1.2.0'
|
||||||
|
implementation "androidx.fragment:fragment:1.8.6"
|
||||||
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
|
implementation 'androidx.browser:browser:1.8.0'
|
||||||
|
implementation 'androidx.documentfile:documentfile:1.0.1'
|
||||||
|
implementation 'com.github.amoskorir:avatarimagegenerator:1.5.0'
|
||||||
|
|
||||||
|
implementation "com.github.mabbas007:TagsEditText:1.0.5"
|
||||||
|
implementation "net.gotev:uploadservice:4.9.2"
|
||||||
|
implementation "net.gotev:uploadservice-okhttp:4.9.2"
|
||||||
|
implementation 'androidx.media:media:1.7.0'
|
||||||
|
implementation 'com.github.mancj:MaterialSearchBar:0.8.5'
|
||||||
|
|
||||||
|
implementation 'com.github.androidmads:QRGenerator:1.0.1'
|
||||||
|
|
||||||
|
implementation 'io.noties.markwon:core:4.6.2'
|
||||||
|
implementation 'io.noties.markwon:ext-tables:4.6.2'
|
||||||
|
implementation 'io.noties.markwon:syntax-highlight:4.6.2'
|
||||||
|
implementation 'io.noties.markwon:ext-strikethrough:4.6.2'
|
||||||
|
implementation 'io.noties.markwon:inline-parser:4.6.2'
|
||||||
|
annotationProcessor 'io.noties:prism4j-bundler:2.0.0'
|
||||||
|
|
||||||
|
//************ CAST **************///
|
||||||
|
|
||||||
|
//---> Google libs (google_full)
|
||||||
|
playstoreImplementation "com.google.android.gms:play-services-cast-tv:21.1.1"
|
||||||
|
playstoreImplementation "com.google.android.gms:play-services-cast:22.0.0"
|
||||||
|
playstoreImplementation "androidx.mediarouter:mediarouter:1.7.0"
|
||||||
|
playstoreImplementation 'com.google.android.gms:play-services-cast-framework:22.0.0'
|
||||||
|
|
||||||
|
|
||||||
|
//----> Other flavors
|
||||||
|
fdroidImplementation 'su.litvak.chromecast:api-v2:0.11.3'
|
||||||
|
fdroidImplementation 'com.fasterxml.jackson.core:jackson-core:2.12.0'
|
||||||
|
fdroidImplementation 'org.slf4j:slf4j-simple:1.7.30'
|
||||||
|
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
|
||||||
}
|
}
|
||||||
def getCurrentFlavor() {
|
def getCurrentFlavor() {
|
||||||
Gradle gradle = getGradle()
|
Gradle gradle = getGradle()
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
package app.fedilab.android;
|
package app.fedilab.android;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry;
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instrumented test, which will execute on an Android device.
|
* Instrumented test, which will execute on an Android device.
|
||||||
*
|
*
|
||||||
|
|
19
app/src/debug/res/xml/compose_shortcuts.xml
Normal file
19
app/src/debug/res/xml/compose_shortcuts.xml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<shortcut
|
||||||
|
android:shortcutId="compose"
|
||||||
|
android:enabled="true"
|
||||||
|
android:icon="@drawable/ic_baseline_add_comment_24"
|
||||||
|
android:shortcutShortLabel="@string/compose_shortcut_short_label1"
|
||||||
|
tools:targetApi="n_mr1">
|
||||||
|
<intent
|
||||||
|
android:action="app.fedilab.android.shorcut.compose"
|
||||||
|
android:targetClass="app.fedilab.android.activities.MainActivity"
|
||||||
|
android:targetPackage="fr.gouv.etalab.mastodon.debug" />
|
||||||
|
|
||||||
|
<categories android:name="android.shortcut.conversation" />
|
||||||
|
<capability-binding android:key="actions.intent.CREATE_MESSAGE" />
|
||||||
|
</shortcut>
|
||||||
|
|
||||||
|
|
||||||
|
</shortcuts>
|
|
@ -0,0 +1,215 @@
|
||||||
|
package app.fedilab.android.activities;
|
||||||
|
/* Copyright 2023 Thomas Schneider
|
||||||
|
*
|
||||||
|
* This file is a part of Fedilab
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import static app.fedilab.android.peertube.helper.Helper.CAST_ID;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.webkit.MimeTypeMap;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.media3.common.Player;
|
||||||
|
import androidx.media3.exoplayer.ExoPlayer;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.security.GeneralSecurityException;
|
||||||
|
|
||||||
|
import app.fedilab.android.BuildConfig;
|
||||||
|
import app.fedilab.android.R;
|
||||||
|
import app.fedilab.android.databinding.ActivityPeertubeBinding;
|
||||||
|
import app.fedilab.android.mastodon.activities.BaseBarActivity;
|
||||||
|
import app.fedilab.android.peertube.client.data.VideoData;
|
||||||
|
import app.fedilab.android.peertube.helper.Helper;
|
||||||
|
import su.litvak.chromecast.api.v2.ChromeCast;
|
||||||
|
import su.litvak.chromecast.api.v2.MediaStatus;
|
||||||
|
import su.litvak.chromecast.api.v2.Status;
|
||||||
|
|
||||||
|
|
||||||
|
public class BasePeertubeActivity extends BaseBarActivity {
|
||||||
|
|
||||||
|
protected ActivityPeertubeBinding binding;
|
||||||
|
protected VideoData.Video peertube;
|
||||||
|
protected ExoPlayer player;
|
||||||
|
protected String videoURL;
|
||||||
|
protected String subtitlesStr;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
binding = ActivityPeertubeBinding.inflate(getLayoutInflater());
|
||||||
|
View view = binding.getRoot();
|
||||||
|
setContentView(view);
|
||||||
|
|
||||||
|
|
||||||
|
binding.minController.castPlay.setOnClickListener(v -> {
|
||||||
|
binding.minController.castLoader.setVisibility(View.VISIBLE);
|
||||||
|
if (PeertubeBaseMainActivity.chromeCast != null) {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
int icon = -1;
|
||||||
|
if (PeertubeBaseMainActivity.chromeCast.getMediaStatus().playerState == MediaStatus.PlayerState.PLAYING) {
|
||||||
|
PeertubeBaseMainActivity.chromeCast.pause();
|
||||||
|
icon = R.drawable.ic_baseline_play_arrow_32;
|
||||||
|
} else if (PeertubeBaseMainActivity.chromeCast.getMediaStatus().playerState == MediaStatus.PlayerState.PAUSED) {
|
||||||
|
PeertubeBaseMainActivity.chromeCast.play();
|
||||||
|
icon = R.drawable.ic_baseline_pause_32;
|
||||||
|
}
|
||||||
|
if (icon != -1) {
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
int finalIcon = icon;
|
||||||
|
Runnable myRunnable = () -> binding.minController.castPlay.setImageResource(finalIcon);
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
}
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> binding.minController.castLoader.setVisibility(View.GONE);
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == R.id.action_cast) {
|
||||||
|
if (PeertubeBaseMainActivity.chromeCasts != null && PeertubeBaseMainActivity.chromeCasts.size() > 0) {
|
||||||
|
String[] chromecast_choice = new String[PeertubeBaseMainActivity.chromeCasts.size()];
|
||||||
|
AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(this);
|
||||||
|
alt_bld.setTitle(R.string.chromecast_choice);
|
||||||
|
int i = 0;
|
||||||
|
for (ChromeCast cc : PeertubeBaseMainActivity.chromeCasts) {
|
||||||
|
chromecast_choice[i] = cc.getTitle();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
for (ChromeCast cc : PeertubeBaseMainActivity.chromeCasts) {
|
||||||
|
if (PeertubeBaseMainActivity.chromecastActivated && cc.isConnected()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
alt_bld.setSingleChoiceItems(chromecast_choice, i, (dialog, position) -> {
|
||||||
|
PeertubeBaseMainActivity.chromeCast = PeertubeBaseMainActivity.chromeCasts.get(position);
|
||||||
|
new Thread(() -> {
|
||||||
|
if (PeertubeBaseMainActivity.chromeCast != null) {
|
||||||
|
Intent intentBC = new Intent(Helper.RECEIVE_CAST_SETTINGS);
|
||||||
|
Bundle b = new Bundle();
|
||||||
|
if (PeertubeBaseMainActivity.chromecastActivated) {
|
||||||
|
b.putInt("displayed", 0);
|
||||||
|
intentBC.putExtras(b);
|
||||||
|
intentBC.setPackage(BuildConfig.APPLICATION_ID);
|
||||||
|
sendBroadcast(intentBC);
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> {
|
||||||
|
binding.doubleTapPlayerView.setVisibility(View.VISIBLE);
|
||||||
|
binding.minController.castMiniController.setVisibility(View.GONE);
|
||||||
|
};
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
b.putInt("displayed", 1);
|
||||||
|
b.putSerializable("castedTube", peertube);
|
||||||
|
intentBC.putExtras(b);
|
||||||
|
intentBC.setPackage(BuildConfig.APPLICATION_ID);
|
||||||
|
sendBroadcast(intentBC);
|
||||||
|
try {
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> {
|
||||||
|
invalidateOptionsMenu();
|
||||||
|
binding.minController.castLoader.setVisibility(View.VISIBLE);
|
||||||
|
player.setPlayWhenReady(false);
|
||||||
|
binding.doubleTapPlayerView.setVisibility(View.GONE);
|
||||||
|
binding.minController.castMiniController.setVisibility(View.VISIBLE);
|
||||||
|
dialog.dismiss();
|
||||||
|
if (videoURL != null) {
|
||||||
|
if (player != null && player.getCurrentPosition() > 0) {
|
||||||
|
videoURL += "?start=" + (player.getCurrentPosition() / 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
if (!PeertubeBaseMainActivity.chromeCast.isConnected()) {
|
||||||
|
PeertubeBaseMainActivity.chromeCast.connect();
|
||||||
|
}
|
||||||
|
myRunnable = this::invalidateOptionsMenu;
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
Status status = PeertubeBaseMainActivity.chromeCast.getStatus();
|
||||||
|
if (PeertubeBaseMainActivity.chromeCast.isAppAvailable(CAST_ID) && !status.isAppRunning(CAST_ID)) {
|
||||||
|
PeertubeBaseMainActivity.chromeCast.launchApp(CAST_ID);
|
||||||
|
}
|
||||||
|
if (videoURL != null) {
|
||||||
|
String mime = MimeTypeMap.getFileExtensionFromUrl(videoURL);
|
||||||
|
PeertubeBaseMainActivity.chromeCast.setRequestTimeout(60000);
|
||||||
|
PeertubeBaseMainActivity.chromeCast.load(peertube.getTitle(), null, videoURL, mime);
|
||||||
|
PeertubeBaseMainActivity.chromeCast.play();
|
||||||
|
binding.minController.castPlay.setImageResource(R.drawable.ic_baseline_pause_32);
|
||||||
|
}
|
||||||
|
myRunnable = () -> binding.minController.castLoader.setVisibility(View.GONE);
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
} catch (IOException | GeneralSecurityException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> {
|
||||||
|
invalidateOptionsMenu();
|
||||||
|
dialog.dismiss();
|
||||||
|
};
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
});
|
||||||
|
alt_bld.setPositiveButton(R.string.close, (dialog, id) -> dialog.dismiss());
|
||||||
|
AlertDialog alert = alt_bld.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(@NotNull Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.video_menu, menu);
|
||||||
|
MenuItem castItem = menu.findItem(R.id.action_cast);
|
||||||
|
if (PeertubeBaseMainActivity.chromeCasts != null && PeertubeBaseMainActivity.chromeCasts.size() > 0) {
|
||||||
|
castItem.setVisible(true);
|
||||||
|
if (PeertubeBaseMainActivity.chromeCast != null && PeertubeBaseMainActivity.chromeCast.isConnected()) {
|
||||||
|
castItem.setIcon(R.drawable.ic_baseline_cast_connected_24);
|
||||||
|
} else {
|
||||||
|
castItem.setIcon(R.drawable.ic_baseline_cast_24);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,270 @@
|
||||||
|
package app.fedilab.android.activities;
|
||||||
|
/* Copyright 2023 Thomas Schneider
|
||||||
|
*
|
||||||
|
* This file is a part of Fedilab
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.NetworkInterface;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import app.fedilab.android.BuildConfig;
|
||||||
|
import app.fedilab.android.R;
|
||||||
|
import app.fedilab.android.databinding.ActivityMainPeertubeBinding;
|
||||||
|
import app.fedilab.android.mastodon.activities.BaseActivity;
|
||||||
|
import app.fedilab.android.peertube.client.data.VideoData;
|
||||||
|
import app.fedilab.android.peertube.helper.Helper;
|
||||||
|
import su.litvak.chromecast.api.v2.ChromeCast;
|
||||||
|
import su.litvak.chromecast.api.v2.ChromeCasts;
|
||||||
|
import su.litvak.chromecast.api.v2.ChromeCastsListener;
|
||||||
|
import su.litvak.chromecast.api.v2.MediaStatus;
|
||||||
|
|
||||||
|
public abstract class PeertubeBaseMainActivity extends BaseActivity implements ChromeCastsListener {
|
||||||
|
|
||||||
|
public static List<ChromeCast> chromeCasts;
|
||||||
|
public static ChromeCast chromeCast;
|
||||||
|
public static boolean chromecastActivated = false;
|
||||||
|
protected ActivityMainPeertubeBinding parentBinding;
|
||||||
|
private BroadcastReceiver manage_chromecast;
|
||||||
|
private VideoData.Video castedTube;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
parentBinding = ActivityMainPeertubeBinding.inflate(getLayoutInflater());
|
||||||
|
View view = parentBinding.getRoot();
|
||||||
|
setContentView(view);
|
||||||
|
ChromeCastsListener chromeCastsListener = this;
|
||||||
|
ChromeCasts.registerListener(chromeCastsListener);
|
||||||
|
|
||||||
|
|
||||||
|
parentBinding.castClose.setOnClickListener(v -> {
|
||||||
|
Intent intentBC = new Intent(Helper.RECEIVE_CAST_SETTINGS);
|
||||||
|
Bundle b = new Bundle();
|
||||||
|
b.putInt("displayed", 0);
|
||||||
|
intentBC.putExtras(b);
|
||||||
|
intentBC.setPackage(BuildConfig.APPLICATION_ID);
|
||||||
|
sendBroadcast(intentBC);
|
||||||
|
});
|
||||||
|
|
||||||
|
parentBinding.castTogglePlay.setOnClickListener(v -> {
|
||||||
|
if (chromeCast != null) {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> parentBinding.castTogglePlay.setVisibility(View.GONE);
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
int icon = -1;
|
||||||
|
if (chromeCast.getMediaStatus().playerState == MediaStatus.PlayerState.PLAYING) {
|
||||||
|
chromeCast.pause();
|
||||||
|
icon = R.drawable.ic_baseline_play_arrow_32;
|
||||||
|
} else if (chromeCast.getMediaStatus().playerState == MediaStatus.PlayerState.PAUSED) {
|
||||||
|
chromeCast.play();
|
||||||
|
icon = R.drawable.ic_baseline_pause_32;
|
||||||
|
}
|
||||||
|
if (icon != -1) {
|
||||||
|
int finalIcon = icon;
|
||||||
|
myRunnable = () -> parentBinding.castTogglePlay.setImageResource(finalIcon);
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
}
|
||||||
|
myRunnable = () -> parentBinding.castTogglePlay.setVisibility(View.VISIBLE);
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
manage_chromecast = new BroadcastReceiver() {
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
Bundle b = intent.getExtras();
|
||||||
|
assert b != null;
|
||||||
|
int state = b.getInt("state_asked", -1);
|
||||||
|
int displayed = b.getInt("displayed", -1);
|
||||||
|
castedTube = (VideoData.Video) b.getSerializable("castedTube");
|
||||||
|
|
||||||
|
if (state == 1) {
|
||||||
|
discoverCast();
|
||||||
|
} else if (state == 0) {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
if (chromeCast != null) {
|
||||||
|
chromeCast.stopApp();
|
||||||
|
chromeCast.disconnect();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
if (displayed == 1) {
|
||||||
|
chromecastActivated = true;
|
||||||
|
if (castedTube != null) {
|
||||||
|
parentBinding.castInfo.setVisibility(View.VISIBLE);
|
||||||
|
Helper.loadGiF(PeertubeBaseMainActivity.this, castedTube.getThumbnailPath(), parentBinding.castView);
|
||||||
|
parentBinding.castTitle.setText(castedTube.getTitle());
|
||||||
|
parentBinding.castDescription.setText(castedTube.getDescription());
|
||||||
|
}
|
||||||
|
} else if (displayed == 0) {
|
||||||
|
chromecastActivated = false;
|
||||||
|
parentBinding.castInfo.setVisibility(View.GONE);
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
if (chromeCast != null) {
|
||||||
|
chromeCast.stopApp();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
ContextCompat.registerReceiver(PeertubeBaseMainActivity.this, manage_chromecast, new IntentFilter(Helper.RECEIVE_CAST_SETTINGS), ContextCompat.RECEIVER_NOT_EXPORTED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void newChromeCastDiscovered(ChromeCast chromeCast) {
|
||||||
|
if (chromeCasts == null) {
|
||||||
|
chromeCasts = new ArrayList<>();
|
||||||
|
chromeCasts.add(chromeCast);
|
||||||
|
} else {
|
||||||
|
boolean canBeAdded = true;
|
||||||
|
for (ChromeCast cast : chromeCasts) {
|
||||||
|
if (cast.getName().compareTo(chromeCast.getName()) == 0) {
|
||||||
|
canBeAdded = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (canBeAdded) {
|
||||||
|
chromeCasts.add(chromeCast);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (chromeCast.isAppRunning(Helper.CAST_ID) && chromeCast.getMediaStatus() != null && chromeCast.getMediaStatus().playerState != null) {
|
||||||
|
if (parentBinding.castInfo.getVisibility() == View.GONE) {
|
||||||
|
parentBinding.castInfo.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void chromeCastRemoved(ChromeCast chromeCast) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
ChromeCasts.unregisterListener(this);
|
||||||
|
if (manage_chromecast != null) {
|
||||||
|
try {
|
||||||
|
unregisterReceiver(manage_chromecast);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
new Thread(() -> {
|
||||||
|
if (chromeCasts != null && chromeCasts.size() > 0) {
|
||||||
|
for (ChromeCast cast : chromeCasts) {
|
||||||
|
try {
|
||||||
|
cast.stopApp();
|
||||||
|
cast.disconnect();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
if (chromeCasts != null) {
|
||||||
|
chromeCasts = null;
|
||||||
|
}
|
||||||
|
if (chromeCast != null) {
|
||||||
|
chromeCast = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Method for discovering cast devices
|
||||||
|
public void discoverCast() {
|
||||||
|
|
||||||
|
new Thread(() -> {
|
||||||
|
if (chromeCasts != null) {
|
||||||
|
for (ChromeCast cast : chromeCasts) {
|
||||||
|
try {
|
||||||
|
cast.disconnect();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
chromeCasts = null;
|
||||||
|
}
|
||||||
|
chromeCasts = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
List<NetworkInterface> interfaces;
|
||||||
|
interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());
|
||||||
|
for (NetworkInterface ni : interfaces) {
|
||||||
|
if ((!ni.isLoopback()) && ni.isUp() && (ni.getName().equals("wlan0"))) {
|
||||||
|
Enumeration<InetAddress> inetAddressEnumeration = ni.getInetAddresses();
|
||||||
|
while (inetAddressEnumeration.hasMoreElements()) {
|
||||||
|
InetAddress inetAddress = inetAddressEnumeration.nextElement();
|
||||||
|
ChromeCasts.restartDiscovery(inetAddress);
|
||||||
|
int tryFind = 0;
|
||||||
|
while (ChromeCasts.get().isEmpty() && tryFind < 5) {
|
||||||
|
try {
|
||||||
|
//noinspection BusyWait
|
||||||
|
Thread.sleep(1000);
|
||||||
|
tryFind++;
|
||||||
|
} catch (InterruptedException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ChromeCasts.stopDiscovery();
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = this::invalidateOptionsMenu;
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
52
app/src/fdroid/res/layout/min_controller.xml
Normal file
52
app/src/fdroid/res/layout/min_controller.xml
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/castMiniController"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/black"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/cast_play"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@string/play"
|
||||||
|
android:src="@drawable/ic_baseline_play_arrow_32"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cast_loader"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/cast_loader_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/please_wait"
|
||||||
|
android:textColor="?colorAccent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/cast_loader_small"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/cast_loader_small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/cast_loader_text"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
10
app/src/fdroid/res/menu/video_menu.xml
Normal file
10
app/src/fdroid/res/menu/video_menu.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_cast"
|
||||||
|
android:icon="@drawable/ic_baseline_cast_24"
|
||||||
|
android:title="@string/cast"
|
||||||
|
android:visible="false"
|
||||||
|
app:showAsAction="always" />
|
||||||
|
</menu>
|
19
app/src/fdroid/res/xml/compose_shortcuts.xml
Normal file
19
app/src/fdroid/res/xml/compose_shortcuts.xml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<shortcut
|
||||||
|
android:shortcutId="compose"
|
||||||
|
android:enabled="true"
|
||||||
|
android:icon="@drawable/ic_baseline_add_comment_24"
|
||||||
|
android:shortcutShortLabel="@string/compose_shortcut_short_label1"
|
||||||
|
tools:targetApi="n_mr1">
|
||||||
|
<intent
|
||||||
|
android:action="app.fedilab.android.shorcut.compose"
|
||||||
|
android:targetClass="app.fedilab.android.activities.MainActivity"
|
||||||
|
android:targetPackage="fr.gouv.etalab.mastodon" />
|
||||||
|
|
||||||
|
<categories android:name="android.shortcut.conversation" />
|
||||||
|
<capability-binding android:key="actions.intent.CREATE_MESSAGE" />
|
||||||
|
</shortcut>
|
||||||
|
|
||||||
|
|
||||||
|
</shortcuts>
|
|
@ -1,17 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
package="app.fedilab.android">
|
|
||||||
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
|
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||||
tools:ignore="ScopedStorage" />
|
tools:ignore="ScopedStorage" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||||
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.camera"
|
android:name="android.hardware.camera"
|
||||||
|
@ -24,13 +25,15 @@
|
||||||
<application
|
<application
|
||||||
android:name="app.fedilab.android.MainApplication"
|
android:name="app.fedilab.android.MainApplication"
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
|
android:dataExtractionRules="@xml/extraction_rules"
|
||||||
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
android:icon="@mipmap/ic_launcher_bubbles"
|
android:icon="@mipmap/ic_launcher_bubbles"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
|
android:requestLegacyExternalStorage="true"
|
||||||
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
|
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:requestLegacyExternalStorage="true"
|
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
tools:replace="android:allowBackup">
|
tools:replace="android:allowBackup">
|
||||||
|
@ -69,87 +72,13 @@
|
||||||
android:host="*"
|
android:host="*"
|
||||||
android:pathPrefix="/@"
|
android:pathPrefix="/@"
|
||||||
android:scheme="https" />
|
android:scheme="https" />
|
||||||
|
<data
|
||||||
|
android:host="*"
|
||||||
|
android:pathPrefix="/notes"
|
||||||
|
android:scheme="https" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity-alias
|
|
||||||
android:name=".activities.MainActivity.Bubbles"
|
|
||||||
android:enabled="true"
|
|
||||||
android:exported="true"
|
|
||||||
android:icon="@mipmap/ic_launcher_bubbles"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
|
|
||||||
android:targetActivity=".activities.MainActivity">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity-alias>
|
|
||||||
|
|
||||||
<activity-alias
|
|
||||||
android:name=".activities.MainActivity.Fediverse"
|
|
||||||
android:enabled="false"
|
|
||||||
android:exported="true"
|
|
||||||
android:icon="@mipmap/ic_launcher_fediverse"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_fediverse_round"
|
|
||||||
android:targetActivity=".activities.MainActivity">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity-alias>
|
|
||||||
|
|
||||||
<activity-alias
|
|
||||||
android:name=".activities.MainActivity.Hero"
|
|
||||||
android:enabled="false"
|
|
||||||
android:exported="true"
|
|
||||||
android:icon="@mipmap/ic_launcher_hero"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_hero_round"
|
|
||||||
android:targetActivity=".activities.MainActivity">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity-alias>
|
|
||||||
|
|
||||||
<activity-alias
|
|
||||||
android:name=".activities.MainActivity.Atom"
|
|
||||||
android:enabled="false"
|
|
||||||
android:exported="true"
|
|
||||||
android:icon="@mipmap/ic_launcher_atom"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_atom_round"
|
|
||||||
android:targetActivity=".activities.MainActivity">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity-alias>
|
|
||||||
|
|
||||||
<activity-alias
|
|
||||||
android:name=".activities.MainActivity.BrainCrash"
|
|
||||||
android:enabled="false"
|
|
||||||
android:exported="true"
|
|
||||||
android:icon="@mipmap/ic_launcher_crash"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_crash_round"
|
|
||||||
android:targetActivity=".activities.MainActivity">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity-alias>
|
|
||||||
|
|
||||||
<activity-alias
|
|
||||||
android:name=".activities.MainActivity.Mastalab"
|
|
||||||
android:enabled="false"
|
|
||||||
android:exported="true"
|
|
||||||
android:icon="@mipmap/ic_launcher_mastalab"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_mastalab_round"
|
|
||||||
android:targetActivity=".activities.MainActivity">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity-alias>
|
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.LoginActivity"
|
android:name=".activities.LoginActivity"
|
||||||
|
@ -167,50 +96,55 @@
|
||||||
android:scheme="fedilab" />
|
android:scheme="fedilab" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.StatusHistoryActivity"
|
android:name=".mastodon.activities.StatusHistoryActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/status_history"
|
android:label="@string/status_history"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ContextActivity"
|
android:name=".mastodon.activities.ContextActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.DraftActivity"
|
android:name=".mastodon.activities.DirectMessageActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".imageeditor.EditImageActivity"
|
android:name=".mastodon.activities.DraftActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ComposeActivity"
|
android:name=".mastodon.imageeditor.EditImageActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".mastodon.activities.ComposeActivity"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
android:label="@string/compose" />
|
android:label="@string/compose" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.StatusInfoActivity"
|
android:name=".mastodon.activities.StatusInfoActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.FollowRequestActivity"
|
android:name=".mastodon.activities.FollowRequestActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ProfileActivity"
|
android:name=".mastodon.activities.ProfileActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/account" />
|
android:label="@string/account" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.admin.AdminAccountActivity"
|
android:name=".mastodon.activities.admin.AdminAccountActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/account" />
|
android:label="@string/account" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.AccountReportActivity"
|
android:name=".mastodon.activities.AccountReportActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/account"
|
android:label="@string/account"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.admin.AdminReportActivity"
|
android:name=".mastodon.activities.admin.AdminReportActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/report"
|
android:label="@string/report"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ScheduledActivity"
|
android:name=".mastodon.activities.ScheduledActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/scheduled" />
|
android:label="@string/scheduled" />
|
||||||
<activity
|
<activity
|
||||||
|
@ -219,17 +153,17 @@
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SearchResultTabActivity"
|
android:name=".mastodon.activities.SearchResultTabActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/search"
|
android:label="@string/search"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.TrendsActivity"
|
android:name=".mastodon.activities.TrendsActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/trending"
|
android:label="@string/trending"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ReorderTimelinesActivity"
|
android:name=".mastodon.activities.ReorderTimelinesActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/reorder_timelines"
|
android:label="@string/reorder_timelines"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
|
@ -238,102 +172,108 @@
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/action_about"
|
android:label="@string/action_about"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.admin.AdminDomainBlockActivity"
|
android:name=".mastodon.activities.TimelineActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:theme="@style/AppThemeBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".mastodon.activities.CheckHomeCacheActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:label="@string/home_cache"
|
||||||
|
android:theme="@style/AppThemeBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".mastodon.activities.admin.AdminDomainBlockActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/blocked_domains"
|
android:label="@string/blocked_domains"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SuggestionActivity"
|
android:name=".mastodon.activities.SuggestionActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/Suggestions"
|
android:label="@string/Suggestions"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.PartnerShipActivity"
|
android:name=".mastodon.activities.DirectoryActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:label="@string/Directory"
|
||||||
|
android:theme="@style/AppThemeBar" />
|
||||||
|
<activity
|
||||||
|
android:name=".mastodon.activities.PartnerShipActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/action_about"
|
android:label="@string/action_about"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ActionActivity"
|
android:name=".mastodon.activities.ActionActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/interactions"
|
android:label="@string/interactions"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.admin.AdminActionActivity"
|
android:name=".mastodon.activities.admin.AdminActionActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/administration"
|
android:label="@string/administration"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.MastodonListActivity"
|
android:name=".mastodon.activities.MastodonListActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/action_lists"
|
android:label="@string/action_lists"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.FollowedTagActivity"
|
android:name=".mastodon.activities.FollowedTagActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/followed_tags"
|
android:label="@string/followed_tags"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SettingsActivity"
|
android:name=".mastodon.activities.SettingsActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="@string/settings"
|
android:label="@string/settings"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.InstanceActivity"
|
android:name=".mastodon.activities.HashTagActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
|
||||||
android:label="@string/action_about_instance"
|
|
||||||
android:theme="@style/AppThemeAlertDialog" />
|
|
||||||
<activity
|
|
||||||
android:name=".activities.InstanceProfileActivity"
|
|
||||||
android:excludeFromRecents="true"
|
|
||||||
android:theme="@style/AppThemeAlertDialog" />
|
|
||||||
<activity
|
|
||||||
android:name=".activities.ProxyActivity"
|
|
||||||
android:excludeFromRecents="true"
|
|
||||||
android:theme="@style/AppThemeAlertDialog" />
|
|
||||||
<activity
|
|
||||||
android:name=".activities.HashTagActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.AnnouncementActivity"
|
android:name=".mastodon.activities.AnnouncementActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.MediaActivity"
|
android:name=".mastodon.activities.MediaActivity"
|
||||||
|
android:hardwareAccelerated="true"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:theme="@style/Transparent" />
|
android:theme="@style/Transparent" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.InstanceHealthActivity"
|
android:name=".mastodon.activities.ReportActivity"
|
||||||
android:excludeFromRecents="true"
|
|
||||||
android:theme="@style/AppThemeAlertDialog" />
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".activities.ReportActivity"
|
|
||||||
android:theme="@style/AppThemeBar"
|
android:theme="@style/AppThemeBar"
|
||||||
android:windowSoftInputMode="stateVisible" />
|
android:windowSoftInputMode="stateVisible" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.CustomSharingActivity"
|
android:name=".mastodon.activities.CustomSharingActivity"
|
||||||
android:label="@string/settings_title_custom_sharing"
|
android:label="@string/settings_title_custom_sharing"
|
||||||
android:theme="@style/AppThemeBar"
|
android:theme="@style/AppThemeBar"
|
||||||
android:windowSoftInputMode="stateVisible" />
|
android:windowSoftInputMode="stateVisible" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.FilterActivity"
|
android:name=".mastodon.activities.FilterActivity"
|
||||||
android:label="@string/filters"
|
android:label="@string/filters"
|
||||||
android:theme="@style/AppThemeBar"
|
android:theme="@style/AppThemeBar"
|
||||||
android:windowSoftInputMode="stateVisible" />
|
android:windowSoftInputMode="stateVisible" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.EditProfileActivity"
|
android:name=".mastodon.activities.EditProfileActivity"
|
||||||
android:label="@string/edit_profile"
|
android:label="@string/edit_profile"
|
||||||
android:theme="@style/AppThemeBar"
|
android:theme="@style/AppThemeBar"
|
||||||
android:windowSoftInputMode="stateVisible" />
|
android:windowSoftInputMode="stateVisible" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.CacheActivity"
|
android:name=".mastodon.activities.CacheActivity"
|
||||||
android:label="@string/action_cache"
|
android:label="@string/action_cache"
|
||||||
android:theme="@style/AppThemeBar" />
|
android:theme="@style/AppThemeBar" />
|
||||||
|
|
||||||
|
<activity android:name=".activities.WebActivityPub"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
<data android:scheme="web+ap" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="${applicationId}.fileProvider"
|
android:authorities="${applicationId}.fileProvider"
|
||||||
|
@ -345,24 +285,476 @@
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".broadcastreceiver.ToastMessage"
|
android:name=".mastodon.broadcastreceiver.ToastMessage"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="RECEIVE_TOAST_MESSAGE" />
|
<action android:name="RECEIVE_TOAST_MESSAGE" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver
|
<service android:name=".mastodon.services.PushServiceImpl"
|
||||||
android:name=".services.CustomReceiver"
|
android:exported="false">
|
||||||
android:enabled="true"
|
|
||||||
android:exported="true">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="org.unifiedpush.android.connector.MESSAGE" />
|
<action android:name="org.unifiedpush.android.connector.PUSH_EVENT"/>
|
||||||
<action android:name="org.unifiedpush.android.connector.UNREGISTERED" />
|
|
||||||
<action android:name="org.unifiedpush.android.connector.NEW_ENDPOINT" />
|
|
||||||
<action android:name="org.unifiedpush.android.connector.REGISTRATION_FAILED" />
|
|
||||||
<action android:name="org.unifiedpush.android.connector.REGISTRATION_REFUSED" />
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</service>
|
||||||
|
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.PeertubeMainActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.PeertubeActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:resizeableActivity="true"
|
||||||
|
android:supportsPictureInPicture="true"
|
||||||
|
tools:targetApi="n" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.PeertubeEditUploadActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:exported="false"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.ShowChannelActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.ShowAccountActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.AccountActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.MyAccountActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.SearchActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.AllPlaylistsActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.AllLocalPlaylistsActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.PlaylistsActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.VideosTimelineActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.SepiaSearchActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:label="@string/sepia_search"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.ManageInstancesActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:label="@string/instances_picker"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.WebviewActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.LoginActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:exported="true"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:host="backtotubelab"
|
||||||
|
android:scheme="tubelab" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.SettingsActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:label="@string/settings"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".peertube.activities.PeertubeUploadActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:label="@string/upload_video"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name=".peertube.services.RetrieveInfoService"
|
||||||
|
android:foregroundServiceType="dataSync"
|
||||||
|
android:exported="false" />
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name="androidx.work.impl.foreground.SystemForegroundService"
|
||||||
|
android:foregroundServiceType="dataSync"
|
||||||
|
tools:node="merge" />
|
||||||
|
|
||||||
|
<!-- ============ -->
|
||||||
|
<!-- CUSTOM ICONS -->
|
||||||
|
<!-- ============ -->
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Bubbles"
|
||||||
|
android:enabled="true"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_bubbles"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.BubblesUA"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_bubbles_ua"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_bubbles_ua_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.BubblesPeaGreen"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_bubbles_pea_green"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_bubbles_pea_green_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.BubblesPride"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_bubbles_pride"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_bubbles_pride_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.BubblesPink"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_bubbles_pink"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_bubbles_pink_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.BubblesPirate"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_bubbles_pirate"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_bubbles_pirate_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Fediverse"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_fediverse"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_fediverse_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Hero"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_hero"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_hero_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Atom"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_atom"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_atom_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.BrainCrash"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_crash"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_crash_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Mastalab"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_mastalab"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_mastalab_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Leaf"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_leaf"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_leaf_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Offset"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_offset"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_offset_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Jungle"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_jungle"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_jungle_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Confetti"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_confetti"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_confetti_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Spaghetti"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_spaghetti"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_spaghetti_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Warm"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_warm"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_warm_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Purple1"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_purple_1"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_purple_1_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Purple2"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_purple_2"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_purple_2_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.YellowHeadedRedBubble"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_yellow_headed_red_bubble"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_yellow_headed_red_bubble_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
|
|
||||||
|
<activity-alias
|
||||||
|
android:name=".activities.MainActivity.Mosaic"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/ic_launcher_mosaic"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_mosaic_round"
|
||||||
|
android:targetActivity=".activities.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.shortcuts"
|
||||||
|
android:resource="@xml/compose_shortcuts" />
|
||||||
|
</activity-alias>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
20
app/src/main/assets/categories.json
Normal file
20
app/src/main/assets/categories.json
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"1": "Music",
|
||||||
|
"2": "Films",
|
||||||
|
"3": "Vehicles",
|
||||||
|
"4": "Art",
|
||||||
|
"5": "Sports",
|
||||||
|
"6": "Travels",
|
||||||
|
"7": "Gaming",
|
||||||
|
"8": "People",
|
||||||
|
"9": "Comedy",
|
||||||
|
"10": "Entertainment",
|
||||||
|
"11": "News & Politics",
|
||||||
|
"12": "How To",
|
||||||
|
"13": "Education",
|
||||||
|
"14": "Activism",
|
||||||
|
"15": "Science & Technology",
|
||||||
|
"16": "Animals",
|
||||||
|
"17": "Kids",
|
||||||
|
"18": "Food"
|
||||||
|
}
|
199
app/src/main/assets/languages.json
Normal file
199
app/src/main/assets/languages.json
Normal file
|
@ -0,0 +1,199 @@
|
||||||
|
{
|
||||||
|
"aa": "Afar",
|
||||||
|
"ab": "Abkhazian",
|
||||||
|
"af": "Afrikaans",
|
||||||
|
"ak": "Akan",
|
||||||
|
"am": "Amharic",
|
||||||
|
"ar": "Arabic",
|
||||||
|
"an": "Aragonese",
|
||||||
|
"ase": "American Sign Language",
|
||||||
|
"as": "Assamese",
|
||||||
|
"av": "Avaric",
|
||||||
|
"avk": "Kotava",
|
||||||
|
"ay": "Aymara",
|
||||||
|
"az": "Azerbaijani",
|
||||||
|
"ba": "Bashkir",
|
||||||
|
"bm": "Bambara",
|
||||||
|
"be": "Belarusian",
|
||||||
|
"bn": "Bengali",
|
||||||
|
"bfi": "British Sign Language",
|
||||||
|
"bi": "Bislama",
|
||||||
|
"bo": "Tibetan",
|
||||||
|
"bs": "Bosnian",
|
||||||
|
"br": "Breton",
|
||||||
|
"bg": "Bulgarian",
|
||||||
|
"bzs": "Brazilian Sign Language",
|
||||||
|
"ca": "Catalan",
|
||||||
|
"cs": "Czech",
|
||||||
|
"ch": "Chamorro",
|
||||||
|
"ce": "Chechen",
|
||||||
|
"cv": "Chuvash",
|
||||||
|
"kw": "Cornish",
|
||||||
|
"co": "Corsican",
|
||||||
|
"cr": "Cree",
|
||||||
|
"cse": "Czech Sign Language",
|
||||||
|
"csl": "Chinese Sign Language",
|
||||||
|
"cy": "Welsh",
|
||||||
|
"da": "Danish",
|
||||||
|
"de": "German",
|
||||||
|
"dv": "Dhivehi",
|
||||||
|
"dsl": "Danish Sign Language",
|
||||||
|
"dz": "Dzongkha",
|
||||||
|
"el": "Greek",
|
||||||
|
"en": "English",
|
||||||
|
"eo": "Esperanto",
|
||||||
|
"et": "Estonian",
|
||||||
|
"eu": "Basque",
|
||||||
|
"ee": "Ewe",
|
||||||
|
"fo": "Faroese",
|
||||||
|
"fa": "Persian",
|
||||||
|
"fj": "Fijian",
|
||||||
|
"fi": "Finnish",
|
||||||
|
"fr": "French",
|
||||||
|
"fy": "Western Frisian",
|
||||||
|
"fsl": "French Sign Language",
|
||||||
|
"ff": "Fulah",
|
||||||
|
"gd": "Scottish Gaelic",
|
||||||
|
"ga": "Irish",
|
||||||
|
"gl": "Galician",
|
||||||
|
"gv": "Manx",
|
||||||
|
"gn": "Guarani",
|
||||||
|
"gsg": "German Sign Language",
|
||||||
|
"gu": "Gujarati",
|
||||||
|
"ht": "Haitian",
|
||||||
|
"ha": "Hausa",
|
||||||
|
"sh": "Serbo-Croatian",
|
||||||
|
"he": "Hebrew",
|
||||||
|
"hz": "Herero",
|
||||||
|
"hi": "Hindi",
|
||||||
|
"ho": "Hiri Motu",
|
||||||
|
"hr": "Croatian",
|
||||||
|
"hu": "Hungarian",
|
||||||
|
"hy": "Armenian",
|
||||||
|
"ig": "Igbo",
|
||||||
|
"ii": "Sichuan Yi",
|
||||||
|
"iu": "Inuktitut",
|
||||||
|
"id": "Indonesian",
|
||||||
|
"ik": "Inupiaq",
|
||||||
|
"is": "Icelandic",
|
||||||
|
"it": "Italian",
|
||||||
|
"jv": "Javanese",
|
||||||
|
"jbo": "Lojban",
|
||||||
|
"ja": "Japanese",
|
||||||
|
"jsl": "Japanese Sign Language",
|
||||||
|
"kab": "Kabyle",
|
||||||
|
"kl": "Kalaallisut",
|
||||||
|
"kn": "Kannada",
|
||||||
|
"ks": "Kashmiri",
|
||||||
|
"ka": "Georgian",
|
||||||
|
"kr": "Kanuri",
|
||||||
|
"kk": "Kazakh",
|
||||||
|
"km": "Khmer",
|
||||||
|
"ki": "Kikuyu",
|
||||||
|
"rw": "Kinyarwanda",
|
||||||
|
"ky": "Kirghiz",
|
||||||
|
"kv": "Komi",
|
||||||
|
"kg": "Kongo",
|
||||||
|
"ko": "Korean",
|
||||||
|
"kj": "Kuanyama",
|
||||||
|
"ku": "Kurdish",
|
||||||
|
"lo": "Lao",
|
||||||
|
"la": "Latin",
|
||||||
|
"lv": "Latvian",
|
||||||
|
"li": "Limburgan",
|
||||||
|
"ln": "Lingala",
|
||||||
|
"lt": "Lithuanian",
|
||||||
|
"lb": "Luxembourgish",
|
||||||
|
"lu": "Luba-Katanga",
|
||||||
|
"lg": "Ganda",
|
||||||
|
"mh": "Marshallese",
|
||||||
|
"ml": "Malayalam",
|
||||||
|
"mr": "Marathi",
|
||||||
|
"mk": "Macedonian",
|
||||||
|
"mg": "Malagasy",
|
||||||
|
"mt": "Maltese",
|
||||||
|
"mn": "Mongolian",
|
||||||
|
"mi": "Maori",
|
||||||
|
"ms": "Malay (macrolanguage)",
|
||||||
|
"my": "Burmese",
|
||||||
|
"na": "Nauru",
|
||||||
|
"nv": "Navajo",
|
||||||
|
"nr": "South Ndebele",
|
||||||
|
"nd": "North Ndebele",
|
||||||
|
"ng": "Ndonga",
|
||||||
|
"ne": "Nepali (macrolanguage)",
|
||||||
|
"nl": "Dutch",
|
||||||
|
"nn": "Norwegian Nynorsk",
|
||||||
|
"nb": "Norwegian Bokmål",
|
||||||
|
"no": "Norwegian",
|
||||||
|
"ny": "Nyanja",
|
||||||
|
"oc": "Occitan",
|
||||||
|
"oj": "Ojibwa",
|
||||||
|
"or": "Oriya (macrolanguage)",
|
||||||
|
"om": "Oromo",
|
||||||
|
"os": "Ossetian",
|
||||||
|
"pa": "Panjabi",
|
||||||
|
"pks": "Pakistan Sign Language",
|
||||||
|
"pl": "Polish",
|
||||||
|
"pt": "Portuguese",
|
||||||
|
"ps": "Pushto",
|
||||||
|
"qu": "Quechua",
|
||||||
|
"rm": "Romansh",
|
||||||
|
"ro": "Romanian",
|
||||||
|
"rsl": "Russian Sign Language",
|
||||||
|
"rn": "Rundi",
|
||||||
|
"ru": "Russian",
|
||||||
|
"sg": "Sango",
|
||||||
|
"sdl": "Saudi Arabian Sign Language",
|
||||||
|
"sfs": "South African Sign Language",
|
||||||
|
"si": "Sinhala",
|
||||||
|
"sk": "Slovak",
|
||||||
|
"sl": "Slovenian",
|
||||||
|
"se": "Northern Sami",
|
||||||
|
"sm": "Samoan",
|
||||||
|
"sn": "Shona",
|
||||||
|
"sd": "Sindhi",
|
||||||
|
"so": "Somali",
|
||||||
|
"st": "Southern Sotho",
|
||||||
|
"es": "Spanish",
|
||||||
|
"sq": "Albanian",
|
||||||
|
"sc": "Sardinian",
|
||||||
|
"sr": "Serbian",
|
||||||
|
"ss": "Swati",
|
||||||
|
"su": "Sundanese",
|
||||||
|
"sw": "Swahili (macrolanguage)",
|
||||||
|
"sv": "Swedish",
|
||||||
|
"swl": "Swedish Sign Language",
|
||||||
|
"ty": "Tahitian",
|
||||||
|
"ta": "Tamil",
|
||||||
|
"tt": "Tatar",
|
||||||
|
"te": "Telugu",
|
||||||
|
"tg": "Tajik",
|
||||||
|
"tl": "Tagalog",
|
||||||
|
"th": "Thai",
|
||||||
|
"ti": "Tigrinya",
|
||||||
|
"tlh": "Klingon",
|
||||||
|
"to": "Tonga (Tonga Islands)",
|
||||||
|
"tn": "Tswana",
|
||||||
|
"ts": "Tsonga",
|
||||||
|
"tk": "Turkmen",
|
||||||
|
"tr": "Turkish",
|
||||||
|
"tw": "Twi",
|
||||||
|
"ug": "Uighur",
|
||||||
|
"uk": "Ukrainian",
|
||||||
|
"ur": "Urdu",
|
||||||
|
"uz": "Uzbek",
|
||||||
|
"ve": "Venda",
|
||||||
|
"vi": "Vietnamese",
|
||||||
|
"wa": "Walloon",
|
||||||
|
"wo": "Wolof",
|
||||||
|
"xh": "Xhosa",
|
||||||
|
"yi": "Yiddish",
|
||||||
|
"yo": "Yoruba",
|
||||||
|
"za": "Zhuang",
|
||||||
|
"zh": "Chinese",
|
||||||
|
"zu": "Zulu",
|
||||||
|
"zxx": "No linguistic content",
|
||||||
|
"zh-Hans": "Simplified Chinese",
|
||||||
|
"zh-Hant": "Traditional Chinese"
|
||||||
|
}
|
|
@ -381,7 +381,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"code": "lo",
|
"code": "lo",
|
||||||
"language": "ພາສາ"
|
"language": "ລາວ"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"code": "lt",
|
"code": "lt",
|
||||||
|
@ -726,5 +726,109 @@
|
||||||
{
|
{
|
||||||
"code": "zu",
|
"code": "zu",
|
||||||
"language": "isiZulu"
|
"language": "isiZulu"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "ast",
|
||||||
|
"language": "Asturianu"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "ckb",
|
||||||
|
"language": "سۆرانی"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "cnr",
|
||||||
|
"language": "crnogorski"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "jbo",
|
||||||
|
"language": "la .lojban."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "kab",
|
||||||
|
"language": "Taqbaylit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "kmr",
|
||||||
|
"language": "Kurmancî"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "ldn",
|
||||||
|
"language": "Láadan"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "lfn",
|
||||||
|
"language": "lingua franca nova"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "sco",
|
||||||
|
"language": "Scots"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "sma",
|
||||||
|
"language": "Åarjelsaemien Gïele"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "smj",
|
||||||
|
"language": "Julevsámegiella"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "szl",
|
||||||
|
"language": "ślůnsko godka"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "tai",
|
||||||
|
"language": "ภาษาไท or ภาษาไต"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "tok",
|
||||||
|
"language": "toki pona"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "zba",
|
||||||
|
"language": "باليبلن"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "zgh",
|
||||||
|
"language": "ⵜⴰⵎⴰⵣⵉⵖⵜ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "en-GB",
|
||||||
|
"language": "English (British)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "es-AR",
|
||||||
|
"language": "Español (Argentina)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "es-MX",
|
||||||
|
"language": "Español (México)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "fr-QC",
|
||||||
|
"language": "Français (Canadien)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "pt-BR",
|
||||||
|
"language": "Português (Brasil)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "pt-PT",
|
||||||
|
"language": "Português (Portugal)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "sr-Latn",
|
||||||
|
"language": "Srpski (latinica)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "zh-CN",
|
||||||
|
"language": "简体中文"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "zh-HK",
|
||||||
|
"language": "繁體中文(香港)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "zh-TW",
|
||||||
|
"language": "繁體中文(臺灣)"
|
||||||
}
|
}
|
||||||
]
|
]
|
|
@ -1,317 +1,298 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"version": "3.14.0",
|
"version": "3.33.1",
|
||||||
"code": "462",
|
"code": "534",
|
||||||
"note": "Added:\n\n- Add Bubble timeline support in extra-features with filters\n- Allow to display public profiles by default to get all messages (Settings > Interface)\n- Glitch: Allow to post messages locally (Can be turned off in Settings)\n- Pixelfed: Custom layout to display Media fully (Also works for other software when there are media)\n- Allow to align left action buttons in messages\n\nChanged:\n- Full rework on links in messages (also mentions and tags)\n- Add pinned tag in \"any\" to avoid to lose it when renaming timeline\n\nFixed:\n- Links to messages not handled by the app\n- CW when editing a message\n- Fix push notifications with several accounts\n- New messages or edition notifications not pushed\n- Fix quotes with tags/mentions\n- Fix notifications\n- Fix sending multiple media\n- Fix crashes"
|
"note": "Added:\n- Highlight bottom hashtags\n- Support Trending Links\n- Featured tags displayed in profiles\n- Add/Remove featured tags from the profile editor\n\nChanged:\n- Add confirmation dialog when long pressing the boost button\n- Open messages by tapping on Scheduled Boost\n- Improve language picker when filtered with some languages\n\nFixed:\n- Limits number of fetch for filters\n- Pleroma instances cannot select media\n- Wrong messages deleted for scheduled (messages and boosts)\n- Fix a crash with long threads\n- Fix a potential memory issue for not cropped media\n- Fix embedded quotes not displayed\n- Some crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.13.7",
|
"version": "3.32.3",
|
||||||
"code": "461",
|
"code": "532",
|
||||||
"note": "Added:\n- Pixelfed: Custom layout to display Media fully \n*(Settings > Timelines > Pixelfed Presentation) - Also works for other softwares when there are media\n\nChanged:\n- Add pinned tag in \"any\" to avoid to lose it when renaming timeline\n\nFixed:\n- Fix push notifications with several accounts\n- Fix quotes with tags/mentions\n- Fix notifications\n- Fix sending multiple media\n- Some crashes"
|
"note": "Fixed:\n- Polls not displayed\n- Pagination with trends\n- Push notifications not working on some devices"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.13.6",
|
"version": "3.32.2",
|
||||||
"code": "460",
|
"code": "531",
|
||||||
"note": "Fixed:\n- Cross-compose: Wrong instance emojis\n- Custom emojis not displayed in notifications\n- Fav/Boost markers with shared messages\n- Empty notifications\n- Fix cw removed when replying\n- Fix expand media with fit preview images when sensitive\n- Fix an issue with fetch more displayed too often (cache clear will help or wait new messages)"
|
"note": "Added:\n- An outline around media\n\nChanged:\n- Make username, display name in nav drawer clickable\n- Gif media not animated by default\n- Disable by default the mention to the booster when replying. Can be enabled in Settings > Compose (per account)\n\nFixed:\n- Wrong preview picture on share from another app\n- Crash when translating with MinT\n- Refresh and pagination broken for the Trending timeline\n- Fix lags / Crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.13.5",
|
"version": "3.32.1",
|
||||||
"code": "459",
|
"code": "530",
|
||||||
"note": "Added:\n- Glitch: Allow to post messages locally (Can be turned off in Settings)\n\nFixed:\n- Crashes"
|
"note": "Fixed:\n- Fix a crash on some devices\n- Hide quote button\n- Fix a layout issue with pictures in landscape\n- Fix a crash when opening the original message from a picture"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.13.4",
|
"version": "3.32.0",
|
||||||
"code": "458",
|
"code": "529",
|
||||||
"note": "Added:\n- Add Bubble timeline support in extra-features with filters\n- Allow to display public profiles by default to get all messages (Settings > Interface)\n\nChanged:\n- Full rework on links in messages (also mentions and tags)\n\nFixed:\n- Spoiler text when editing\n- Fix watermarks"
|
"note": "Added:\n- Add option to disable auto hiding compose button\n\nChanged:\n- Add more content descriptions for buttons\n- Update some buttons\n- Update navigation drawer header\n- Squeeze action buttons when needed to prevent overlapping\n\nFixed:\n- Fix crash when media are too heavy\n- Some custom emojis in bio do not render\n- Posting messages does not work on some Friendica instances\n- Fix a crash with auto-split messages\n- Fix a crash when opening conversations\n- Fix a background color issue when displaying media"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.13.3",
|
"version": "3.31.3",
|
||||||
"code": "457",
|
"code": "528",
|
||||||
"note": "Added:\n- Allow to enable extra features in Settings\n- Customizable settings for extra features\n- Support quotes, reactions with messages\n- Support text format (html, markdown, etc.) when composing\n\nFixed:\n- CW not working with media\n- Media not displayed for older instances\n- Some crashes\n"
|
"note": "Added:\n- Add new icon launchers (Settings > Interface)\n\nChanged:\n- Make logout/proxy button more visible in main menu\n- Remove permission FOREGROUND_SERVICE\n- Improve a little more media layout with translations\n\nFixed:\n- Fix status bar icons not visible in light theme with custom accent color\n- Reaction buttons not clickable for some instances"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.13.2",
|
"version": "3.31.2",
|
||||||
"code": "456",
|
"code": "527",
|
||||||
"note": "Changed:\n- Hidden media smaller with preview images\n\nFixed:\n- Issue with Media for Android 11+\n- Crash when not setting a translation key\n- Fix DeepL for API pro\n- Crash when visiting a profile with a lot of media\n- Home muted accounts not working without filters\n- Animated custom emoji not displayed"
|
"note": "Added:\n- Add support to URL scheme \"web+ap\" for opening profiles with the app\n\nChanged:\n- Layout for media descriptions\n\nFixed:\n- Fix a crash when translating media descriptions\n- Handle included twice when replying to a self user's boost\n- Fix color issues when using a custom theme"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.13.1",
|
"version": "3.31.1",
|
||||||
"code": "455",
|
"code": "526",
|
||||||
"note": "Added:\n- DeepL translation support free/pro keys\n\nChanged:\n- Hide buttons for media when editing\n\nFixed:\n- GIF loaded as static images\n- Suggested accounts cannot be followed"
|
"note": "Added:\n- Add MinT machine translation system support\n- Add support \"instance only\" for GoToSocial\n\nFixed:\n- GIF not displayed in timelines\n- Fix a crash when unpinning timelines\n- Top bar coloring at scroll for conversations\n- Black screen when going back from the Peertube section"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.13.0",
|
"version": "3.31.0",
|
||||||
"code": "454",
|
"code": "524",
|
||||||
"note": "Added:\n- Post random quotes\n- Group reblogs in home timeline\n- Rename Nitter timelines\n- Android 13 support\n- Pagination with search / trending\n- Allow to remove left margin in messages (default: disabled)\n\nChanged:\n- Display translate button only when language is different\n- Respect blank spaces between words in messages\n- Focus button more accessible when editing media\n- Visual feedback for block on account list\n- Visual changes with compose / top bar\n- Use custom Nitter timeline name in manage timelines\n\nFixed:\n- Behavior with cw toggle\n- Truncated gimini links\n- Nav buttons not visible with media (Light theme)\n- Status bar with Android 5\n- Fix links not clickable\n- Fix deep links\n- Fix remote threads not fetched for some instances\n- Adding description to shared media\n- Open with another accounts\n- Chars size not respected for Android 5-6\n- Wrong instance fetched for instances.social\n- Bouncing Timeline on refresh\n- Links to mentions, tags, urls, not visible.\n- Custom channel sounds not applied\n- users with short username are not linked\n- Fix crashes"
|
"note": "Added:\n- Pinned Trending Timeline (can be hidden in Manage Timelines)\n- Add a fallback to the default translator\n- New Pixelfed entry in Settings to disable fullscreen for media\n- Add tooltips for tabs in profiles\n\nChanged:\n- Increase touch area of reply buttons\n- Show a dialog after settings export\n\nFixed:\n- Fix media description not updated when there are several\n- Only a part of DeepL translations are shown\n- Fix Lingva truncated translations\n- Fix a crash when fetching remote profiles\n- Fix a crash with animated emoji\n- Fix a crash when displaying Home cache charts"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.12.3",
|
"version": "3.30.1",
|
||||||
"code": "453",
|
"code": "523",
|
||||||
"note": "Added:\n- Pagination with search / trending\n\nFixed:\n- Long press on Nitter tabs\n- Open with another accounts\n- Chars size not respected for Android 5-6\n- Wrong instance fetched for instances.social"
|
"note": "Added:\n- Follow Twitter tags\n\nChange:\n- Remove automatic backup (Google only)\n\nFixed:\n- Push notifications not working for some devices\n- Filters not applied to media description\n- Fix a crash with animated images in timelines\n- Fix a crash for long threads\n- Fix a crash due to some messages (happened in different timelines)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.12.2",
|
"version": "3.30.0",
|
||||||
"code": "452",
|
"code": "522",
|
||||||
"note": "Added:\n- Rename Nitter timelines\n- Android 13 support\n\nChanged:\n- Visual feedback for block on account list\n- Visual changes with compose / top bar\n\nFixed:\n- Nav buttons not visible with media (Light theme)\n- Status bar with Android 5\n- Fix links not clickable\n- Fix deep links\n- Fix remote threads not fetched for some instances\n- Adding description to shared media\n- Fix crashes"
|
"note": "Added:\n- Allow to follow the discover timelines of Pixelfed instances\n- Keep media proportions in timeline for Pixelfed\n- Add a like button in timelines for Pixelfed\n- Allow to login with a token\n\nChange:\n- Use Pixelfed layout when following Pixelfed instances\n- Allow to scroll buttons for larger screens in conversations\n- Move QR code into header\n\nFixed:\n- Not clickable URLs when Markdown is enabled\n- Nitter to follow Twitter accounts\n- Pixelfed timeline not displayed by default\n- Fix admin reports not accessible\n- Top bar coloring at scroll\n- Drafts not saved when adding/editing media descriptions\n- User search suggestions have duplicates\n- Some minor crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.12.1",
|
"version": "3.29.2",
|
||||||
"code": "451",
|
"code": "518",
|
||||||
"note": "Added:\n- Post random quotes\n- Group reblogs in home timeline\n\nChanged:\n- Display translate button only when language is different\n- Respect blank spaces between words in messages\n- Focus button more accessible when editing media\n\nFixed:\n- Behavior with cw toggle\n- Truncated gimini links"
|
"note": "Fixed:\n- Fix crash when changing the type of notifications\n- Fix issue with names not displayed fully\n- Fix a crash with notifications and Sharkey\n- Fix a crash when app is back to the foreground\n- Fix xmpp links not opening xmpp clients\n- Fix wrong muted time"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.12.0",
|
"version": "3.29.1",
|
||||||
"code": "450",
|
"code": "517",
|
||||||
"note": "Added:\n- Full data import/export feature\n- Android 13 themed icon support\n\nFixed:\n- Fix a regression with filters\n- Fix dark solarized theme\n- Fix hide link previews for CW\n- Fix status bar color for all themes\n- Fix language in compose \"...\"\n- Fix add all home muted accounts from lists\n- Fix top notification badges"
|
"note": "Added:\n- Allow to edit scheduled messages from server side\n\nChanged:\n- Order list name alphabetically in profiles\n- Remove registration for Google\n\nFixed:\n- Push notifications\n- Peertube instances picker\n- Edit scheduled threads (local)\n- Instant search of Hashtag repeats results\n- Quotes broken with Markdowns\n- Fix reports crashes after submitting\n- Fix emoji picker when there is no result\n- Fix other crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.11.3",
|
"version": "3.28.2",
|
||||||
"code": "449",
|
"code": "515",
|
||||||
"note": "Added:\n- Add more targeted languages in picker for translations\n- Add account name in push notifications\n\nFixed:\n- Fix a crash when changing language\n- Fix counter colors\n- Fix default link color\n- Fix a crash when clicking on mentions"
|
"note": "Added:\n- Display a QR code on profiles\n\nFixed:\n- Fix tap on messages in conversations\n- Pronouns taking too much place"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.11.2",
|
"version": "3.28.1",
|
||||||
"code": "448",
|
"code": "514",
|
||||||
"note": "Added:\n- Mute/Unmute accounts in the Home timeline from their messages or their profiles\n- Add all users from a list to \"Muted home\" in one click\n- Display/Manage users that are muted for home\n\nFixed:\n- Timeline crashes"
|
"note": "Added:\n- Allow to disable pronouns support (default: enabled)\n- Add more support for pronouns (localization in different languages)\n\nFixed:\n- Fix a crash when reporting messages\n- Fix a crash when following tags\n- Fix some display issues\n- Several fixes from the last release (3.28.0)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.11.0",
|
"version": "3.28.0",
|
||||||
"code": "446",
|
"code": "513",
|
||||||
"note": "Added:\n- Display all messages in threads from remote instances (when possible)\n- Allow to unmute/unfollow/unpin a tag from tag timelines\n- Display most used accounts in header menu for an easy switch\n- Automatically add the tag when composing from a tag timeline\n- Add a translate button at the bottom of messages (default: disabled)\n- Add account role in profiles\n- Translate morse\n\nChanged:\n- Disable animations after a refresh\n\nFixed:\n- Contact not working when composing\n- Status bar for black theme\n- Message duplicated in conversations when edited\n- Color issue on Android 5\n- Several crashes"
|
"note": "Added:\n- Pronouns support (Timeline/Compose/Autocomplete)\n\nChanged:\n- Use Media3 library\n\nFixed:\n- Timed mute duration too long\n- Sharing videos only download them\n- Crashes from previous release"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.10.2",
|
"version": "3.27.1",
|
||||||
"code": "445",
|
"code": "511",
|
||||||
"note": "Added:\n- Allow to unmute/unfollow/unpin a tag from tag timelines\n- Automatically add the tag when composing from a tag timeline\n- Add a translate button at the bottom of messages (default: disabled)\n- Add account role in profiles\n\nFixed:\n- Contact not working when composing\n- Status bar for black theme\n- Message duplicated in conversations when edited\n- Color issue on Android 5"
|
"note": "Added:\n- Tap on account banners to display them as media\n\nFixed:\n- Position lost when switching between accounts\n- Wrong profiles when enabling remote conversations\n- Peertube local timeline\n- Peertube instances search\n- Crashes of the previous release"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.10.1",
|
"version": "3.27.0",
|
||||||
"code": "444",
|
"code": "510",
|
||||||
"note": "Added:\n- Display all messages in threads from remote instances (when possible)\n* Only public messages for instances using the Mastodon API\n* A dedicated button is displayed at the top right when conditions are filled."
|
"note": "Added:\n- Fixed top bar (default: disabled)\n- Usage frequency of tags when composing\n\nChanged:\n- Markdown support disabled by default\n\nFixed:\n- Fix crashes during interactions or when opening a new screen\n- Fix color of dialogs in Settings\n- Some minor crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.10.0",
|
"version": "3.26.0",
|
||||||
"code": "443",
|
"code": "505",
|
||||||
"note": "Added:\n- Dracula theme\n- Customize message colors\n- Enable/Disable Card presentation\n\nChanged:\n- Colors for some themes\n- Space between buttons\n\nFixed:\n- Animated profile pictures not displayed\n- Mentions broken in profile bio and fields\n- Jumps with fit preview images when scrolling up\n- Fetch more button broken with cache\n- Tag patterns in URL break the link\n- Typo in followed tags"
|
"note": "Added:\n- Android 14 support\n- Automatically split long messages in threads (default: ASK)\n- Links and media are clickable when composing\n- Allow to underline clickable elements (Settings > Timelines - default: disabled)\n- Allow to disable relative date in messages\n- Add a scroll bar for timelines (default: disabled)\n- Add a search bar for custom emojis\n- Links clickable in media descriptions\n\nChanged:\n- Counters close to action buttons\n- Hide emoji picker if the instance has no emoji\n- Followed tags are ordered\n- Account picker when opening with another account\n\nFixed:\n- Avoid error 429 with NTFY\n- Fix custom colors (Android 14)\n- Fix a crash when composing\n- Display issue with followed tags\n- Crashes with profiles\n- Fix an issue with poll and Pleroma\n- Emoji not displayed in the picker\n- Several crashes are fixed"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.9.7",
|
"version": "3.25.3",
|
||||||
"code": "442",
|
"code": "504",
|
||||||
"note": "Added:\n- Dracula theme\n\nChanged:\n- Colors for Light/Dark/Black themes\n\nFixed:\n- Animated profile pictures not displayed\n- Mentions broken in profile bio and fields\n- Tag patterns in URL break the link\n- Typo in followed tags"
|
"note": "Added:\n- Add a scroll bar for timelines (default: disabled)\n- Add a search bar for custom emojis\n\nFixed:\n- Fix prompt to split asked several times when refusing\n- Crashes with profiles\n- Fix an issue with poll and Pleroma\n- Emoji not displayed in the picker"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.9.6",
|
"version": "3.25.2",
|
||||||
"code": "441",
|
"code": "503",
|
||||||
"note": "Fixed:\n- Jumps with fit preview images when scrolling up\n- Fetch more button broken with cache"
|
"note": "Added:\n- Allow to underline clickable elements (Settings > Timelines - default: disabled)\n- Allow to disable relative date in messages\n\nChanged:\n- Counters close to action buttons\n- Hide emoji picker if the instance has no emoji\n- Followed tags are ordered\n- Account picker when opening with another account\n\nFixed:\n- Fix a crash when composing\n- Fix an issue with the back button\n- Display issue with followed tags"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.9.5",
|
"version": "3.25.1",
|
||||||
"code": "440",
|
"code": "502",
|
||||||
"note": "Fixed:\n- Custom emoji are not always displayed\n- Jumps in timeline when using \"fit preview images\"\n- Dark theme: timeline buttons without toggle"
|
"note": "Fix a crash from release 3.25.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.9.4",
|
"version": "3.25.0",
|
||||||
"code": "439",
|
"code": "501",
|
||||||
"note": "Changed:\n- Remove card presentation\n- Link color for black theme\n\nFixed:\n- Crash when changing the theme"
|
"note": "Added:\n- Android 14 support\n- Automatically split long messages in threads (default: ASK)\n- Links and media are clickable when composing\n\nFixed:\n- Avoid error 429 with NTFY\n- Several crashes are fixed"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.9.3",
|
"version": "3.24.1",
|
||||||
"code": "438",
|
"code": "500",
|
||||||
"note": "Added:\n- New design with 5 themes\n\nChanged:\n- Remove built-in browser support\n- Fit preview image displays images vertically\n- Add counters next to images\n\nFixed:\n- Jumps in timelines\n- Replies to wrong messages with followed instances\n- Bug with delete&redraft with a media\n- List cannot be hidden\n- Some crashes"
|
"note": "Added:\n- Three new app icons (Pride, Pink and Pirate)\n- Keep position with remote conversations\n\nFixed:\n- Markdown: stop parsing tags and support strike text\n- Cursor more visible when composing\n- Fix custom instance max char length not working\n- Tabs in profiles\n- Fix not clickable tags for some languages\n- Bug with account having huge amount of followers\n- Crash with several gif in same message\n- Poll max chars\n- Some crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.9.1",
|
"version": "3.24.0",
|
||||||
"code": "436",
|
"code": "499",
|
||||||
"note": "Changed:\n- Remove built-in browser support\n- More spaces between action buttons in messages\n\nFixed:\n- Text size issue\n- Text overlap\n- Wrong background for solarized black\n- Mix between light and dark theme\n- Save button hidden"
|
"note": "Added:\n- Markdown support (can be disabled in Settings > Timelines)\n- Hide / Show Self boosts, self replies and your own messages (Long press the Home tab)\n\nChanged:\n- Full screen size when writing media descriptions.\n- Move media descriptions to the top\n\nFixed:\n- Holes in timelines due to a cache bug\n- Spoiler issue when composing threads\n- CamelCase tags when forwarding them in replies\n- Buttons hidden by keyboard when composing\n- Overlay with menu and buttons when playing videos\n- Clicks on card do not open Mastodon posts inside the app\n- Scrollable bio when editing profiles\n- Crash when adding a user into a list\n- Longer fields when editing bio\n- Crash with Pixelfed\n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.9.0",
|
"version": "3.23.5",
|
||||||
"code": "435",
|
"code": "498",
|
||||||
"note": "Added:\n- Migrate to Material Design 3\n- 5 Themes (Light, Dark, Solarized Light/Dark, Black)\n- Automatically switch between Light/Dark\n- Light and Dark theme can be defined for time-based switch\n- Android 12+: Dynamic color\n\nFixed:\n- Jumps in timelines\n"
|
"note": "Added:\n- Hide / Show Self boosts and self replies (Long press the Home tab)\n\nChanged:\n- Full screen size when writing media descriptions."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.8.1",
|
"version": "3.23.4",
|
||||||
"code": "434",
|
"code": "497",
|
||||||
"note": "Added:\n- Mute tags with long press in timelines\n\nChanged:\n- Muted account messages are now removed from cache\n\nFixed:\n- Open with another account\n- Fix jumps in profiles\n- Media not displayed in album -> force indexation\n- Built-in browser does not give admin scope\n- Some crashes"
|
"note": "Fixed:\n\n- Holes in timelines due to a cache bug\n- Fix tags issue with RTL and the markdown format\n- Scrollable bio when editing profiles\n- Crash when adding a user into a list"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.8.0",
|
"version": "3.23.3",
|
||||||
"code": "433",
|
"code": "496",
|
||||||
"note": "Added:\n- List of blocked domains (allow to unblock)\n- Support gemini links\n- Suggested followers\n- Mod/Adm: Manage instance blocked domains\n- Open messages with another account\n- Allow to disable notifications for admins\n- Sort lists\n\nChanged:\n- Allow search term to be edited\n\nFixed:\n- Drafts deleted with no warning\n- Remove lists from \"Manage timelines\"\n- App crashes when proxy is set\n- Filter not synced after being edited\n- Some crashes / improvements"
|
"note": "- Longer fields when editing bio\n- Clicks on card do not open Mastodon posts inside the app\n- Crash with Pixelfed\n- Line breaks with Markdown\n- Side effects with Markdown and some links"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.7.5",
|
"version": "3.23.2",
|
||||||
"code": "432",
|
"code": "495",
|
||||||
"note": "Added:\n- List of blocked domains (allow to unblock)\n- Support gemini links\n- Suggested followers\n\nChanged:\n- Allow search term to be edited\n\nFixed:\n- Drafts deleted with no warning\n- App crashes when proxy is set\n- Filter not synced after being edited\n- Some crashes"
|
"note": "Added:\n- Markdown support (can be disabled in Settings > Timelines)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.7.4",
|
"version": "3.23.1",
|
||||||
"code": "431",
|
"code": "494",
|
||||||
"note": "Added:\n- Full support to new filters for Mastodon 4\n- Visit profiles without being authenticated / Allow to display all their messages\n\nChanged:\n- Compose view takes the whole width even in threads\n- Accounts can be timed-mute from their profile\n\nFixed:\n- Draft stored when replying \"no\" or dialog prompted without changes\n- Empty pages when starting the app\n- Saving and sharing media fails on some devices\n- Add support for admin notifications\n- Copying content of a message"
|
"note": "Added:\n- Scrollable media description\n\nFixed:\n- Crashes with profiles"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.7.3",
|
"version": "3.23.0",
|
||||||
"code": "430",
|
"code": "493",
|
||||||
"note": "Added:\n- Visit profiles without being authenticated / Allow to display all their messages\n\nFixed:\n- Saving media fails on some devices"
|
"note": "Added:\n- Add preview for app icons\n- Two new app icons\n\nFixed:\n- Fix Nitter feeds\n- Crash with Pixelfed accounts\n- Lingva encoding issue\n- Avoid sleep mode for media activity\n- Videos are played simultaneously\n- Voice messages for Android 10+\n- Punycode not supported for domains"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.7.2",
|
"version": "3.22.2",
|
||||||
"code": "429",
|
"code": "492",
|
||||||
"note": "Added:\n- Full support to new filters for Mastodon 4"
|
"note": "Added:\n- Follow Lemmy instances (from Manage Timelines)\n- View remote conversations (default: disabled - Settings > Interface)\n\nFixed:\n- Add 50 chars max for poll options\n- Too many requests\n- Blank Home page\n- Crashes when visiting profiles\n- Some audio files cannot be uploaded\n- Multiple notifications\n- Fix some other crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.7.1",
|
"version": "3.22.1",
|
||||||
"code": "428",
|
"code": "491",
|
||||||
"note": "Added:\n- Support to open links containing /@display_name/ in their path (works on older devices)\n- Display reply count when counters are enabled\n- Add support for filtering profile messages\n\nChanged:\n- Compose view takes the whole width even in threads\n- Reset push notification marker when clearing cache\n\nFixed:\n- Draft stored when replying \"no\" or dialog prompted without changes\n- Filters not working with tags\n- Add a specific error message for followed tags\n- Empty pages when starting the app"
|
"note": "Added:\n- Follow Lemmy instance (from Manage Timelines)\nFixed:\n- Add 50 chars max for poll options"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.7.0",
|
"version": "3.22.0",
|
||||||
"code": "427",
|
"code": "490",
|
||||||
"note": "Added:\n- Follow tags (dedicated entry in menu)\n- Reduce the list of languages when composing (Settings > Compose)\n- Language indicator when composing\n- Replies are automatically set to first message language\n- Two new Light themes\n- More moderation features\n- List name can be edited\n\nFixed:\n- Filter not working\n- Crash with trends\n- Issue with themes\n- Some content lost when sending messages (mentions)\n- Fix freezes in timelines\n- Some other fixes"
|
"note": "Fixed:\n- Too many requests\n- Blank Home page\n- Crashes when visiting profiles\n- Some audio files cannot be uploaded"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.6.5",
|
"version": "3.21.2",
|
||||||
"code": "426",
|
"code": "489",
|
||||||
"note": "- Two new Light themes\n- More moderation features\n\nFixed:\n- Filter not working\n- Crash with trends\n- Some content lost when sending messages (mentions)\n- Some other fixes"
|
"note": "Added:\n- Android 12+ : Customize accent colors for light/dark theme and per account (Settings > Theming > Custom accent color)\n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.6.4",
|
"version": "3.21.1",
|
||||||
"code": "425",
|
"code": "488",
|
||||||
"note": "Changed:\n- Tag search ordered by popularity\n\nFixed:\n- Unable to get client ID on some devices\n- Issue with messages/notifications not correctly displayed\n- Notifications not received\n- Friendica: issues with mentions and tags (open browser)\n- Improve sharing behaviour"
|
"note": "Added:\n- Filter messages in profiles (hide/show boosts or replies) via a long press on the tab\n\nChanged:\n- Some layout improvements for Peertube\n- Better management of resolution with Peertube\n- Improve instance picker for Peertube\n\nFixed:\n- URL in upper cases\n- Issues with Peertube player\n- False positive error when listening to audio\n- GIF does not honor nsfw\n- Polls having html\n- Fix crashes when scrolling timeline with animated gif"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.6.3",
|
"version": "3.21.0",
|
||||||
"code": "424",
|
"code": "487",
|
||||||
"note": "Fixed:\n- Issue with messages/notifications not correctly displayed\n- Friendica: issues with mentions and tags (open browser)\n- Improve sharing behaviour\n"
|
"note": "Added:\n- Dedicated Peertube entry in main menu (My app)\n- Select instances (Instances picker with Filters)\n- Comment/Boost/Fav Peertube videos with Mastodon accounts\n\nFixed:\n- Fix a crash when searching and with the user directory"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.6.2",
|
"version": "3.20.3",
|
||||||
"code": "423",
|
"code": "486",
|
||||||
"note": "Fixed:\n- Order of notifications\n- URL when sharing boosted message\n- Blank pages when restarting\n- Fix some crashes"
|
"note": "Added:\n- Display all following/followers lists from remote profiles\n- Display all accounts that boosted/fav from a remote message\n\nFixed:\n- Fix a crash with auto-fetch messages"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.6.1",
|
"version": "3.20.2",
|
||||||
"code": "422",
|
"code": "485",
|
||||||
"note": "Added:\n- Display client in detailed messages\n- Visual support for quotes starting with \">\"\n- Increase indentations for threads (zero to 20, default 5)\n- Visibility for public replies set to unlisted (can be disabled)\n\nChanged:\n- Reduce title size when text size is increased\n\nFixed:\n- Filters are not applied\n- Blocking an account doesn't remove messages in cache\n- Fix some crashes"
|
"note": "Added:\n- Visual indicator when fetching missing messages\n- Open media description when it is missing from the warning dialog\n\nChanged:\n- Maths formula aligned to the left\n- Faster access to delete all notifications\n\nFixed:\n- Fix an issue with Nitter and some URLs\n- Fix refresh issue with notifications\n- Fix an issue when entering a Peertube instance\n- Fix jumps with Akkoma/Pleroma when media preview size is not set\n- Some crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.6.0",
|
"version": "3.20.1",
|
||||||
"code": "421",
|
"code": "484",
|
||||||
"note": "Added:\n- Edit messages (if your instance supports that feature)\n- Pin/Unpin messages\n- Set the default language for translations\n- Change app icon (Settings > Interface)\n- Allow to disable \"remember position\" in timelines\n- Allow to disable notification aggregation in settings\n- Icon on media previews if a description is available\n\nChanged:\n- Allow to disable/enable media for notifications\n\nFixed:\n- Post loses \"spoiler message\" when adding a media\n- Camera not working on Android 11\n- Notification aggregation\n- Vibrations when fetching new notifications\n- Fix an issue with media timelines\n- Fix some theme issues\n- Fix an issue with built-in browser & openId\n- Bad behaviours with Art Timelines\n- Some crashes"
|
"note": "Added:\n- Add a button to fetch remote media when it fails\n- Add a settings to automatically fetch remote media when it fails (default: disabled)\n- Display on profiles & list of accounts if users have requested to follow you\n- Warn before boosting a message having no media descriptions (default: enabled)\n\nChanged:\n- Warn when there are missing descriptions enabled by default\n\nFixed:\n- Some settings not properly restored (multiple choices)\n- Cancel a follow request\n- Media with a lot of height in landscape\n- Some crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.5.3",
|
"version": "3.20.0",
|
||||||
"code": "420",
|
"code": "483",
|
||||||
"note": "- Edit messages (if your instance support that feature)\n- Some fixes"
|
"note": "Added:\n- \"Follows you\" indicator in accounts list\n- Settings compose: display a dialog to warn if there are missing media description (default: disabled)\n- Settings > Cache: disable battery optimization\n- Settings > Cache - Add charts to check cache logs\n- Settings > Timelines: AutoPlay gif media (default: enabled)\n- Google: Automatic backup of data and settings\n\nChanged:\n- Improve detections of gap in timelines\n- Improve media description\n- Chat view by default\n- Chat view add an indicator for messages when not direct\n\nFixed:\n- Fix an issue with cache and fetch more\n- Cache view with large fonts\n- Bad behaviors with truncated messages"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.5.2",
|
"version": "3.19.1",
|
||||||
"code": "419",
|
"code": "482",
|
||||||
"note": "Added:\n- Pin/Unpin messages\n- Set the default language for translations\n\nChanged:\n- Allow to disable/enable media for notifications\n\nFixed:\n- Wrong images in notification timeline\n- Double icon bug\n- Fix some crashes"
|
"note": "Added:\n- Settings compose: display a dialog to warn if there are missing media description (default disabled)\n- Settings > Notification: disable battery optimization\n- Settings > Timelines: AutoPlay gif media (default: enabled)\n\nFixed:\n- Fix an issue with cache and fetch more\n- Cache view with large fonts\n- Bad behaviors with truncated messages"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.5.1",
|
"version": "3.19.0",
|
||||||
"code": "418",
|
"code": "481",
|
||||||
"note": "Added:\n- Change app icon (Settings > Interface)\n- Allow to disable \"remember position\" in timelines\n- Allow to disable notification aggregation in settings\n\nChanged:\n- Allow to disable/enable media for notifications\n\nFixed:\n- Post loses \"spoiler message\" when adding a media\n- Camera not working on Android 11\n- Notification aggregation\n- Vibrations when fetching new notifications\n- Fix an issue with media timelines\n- Some crashes"
|
"note": "Added:\n- Settings compose: don't send media if there are no description (default: disabled)\n- Settings Timelines: Enable/Disable truncate links\n- Allow to set max link length (20 - 150 chars)\n\nChanged:\n- Align media with text (left margin enabled)\n\nFixed:\n- Media previews remain the same when sharing\n- Edit media description not working\n- Accessibility (larger fonts): profiles/DM\n- Cross replies: Wrong visibility with the selected account\n- Several crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.5.0",
|
"version": "3.18.2",
|
||||||
"code": "417",
|
"code": "480",
|
||||||
"note": "Changed:\n- Swipe between timelines\n- Improve cache\n- Button sizes can be changed in settings\n- French translation\n\nFixed:\n- Pleroma: Emoji reactions\n- Sharing (several fixes)\n- Theme issues\n- Rendering issue for links\n- Notifications not removed from cache\n- Issue with watermarks\n- Pagination with bookmarks/favourites\n- Some crashes"
|
"note": "Changed:\n- First media layout will depend of its ratio\n\nFixed:\n- Impossible to add media with the chat view\n- Chat view limited in chars\n- Freezes / bad behaviors due to the new media presentation"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.4.2",
|
"version": "3.18.1",
|
||||||
"code": "415",
|
"code": "479",
|
||||||
"note": "Fixed:\n- Attach media to a reply"
|
"note": "Added:\n- Add Lingva translator (Settings > Timelines)\n- Add support for Nyastodon-style emoji reactions (skyevg)\n- Add chat view for DM (default: disable / Settings > Timelines)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.4.1",
|
"version": "3.18.0",
|
||||||
"code": "414",
|
"code": "478",
|
||||||
"note": "Added:\n- Disable counters in settings\nFixed:\n- Duplicated messages from cache\n- Notifications in double\n- Drafts not automatically removed\n- Messages not removed from cache after deletion"
|
"note": "Added:\n- Support camel case tags (automatically recorded when composing)\n- Manage tags when composing (top right menu)\n- Custom tabs (default: enabled)\n\nChanged:\n- Media heights now use the screen size\n- Remove horizontal scroll for media\n- Reduce size of emoji when text size is increased\n- Update available languages in picker\n\nFixed:\n- Forwarded tags are added back after being deleted\n- TalkBack issues\n- Some crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.4.0",
|
"version": "3.17.0",
|
||||||
"code": "413",
|
"code": "477",
|
||||||
"note": "Added:\n- New cache mechanism (can be disabled in settings)\n- Set thumbnails load behavior Always/Wifi only /ask\n- Add counters for new messages in timelines\nFixed:\n- Contextual menu not working in threads\n- Tag search issue with Friendica\n- Notifications click open the wrong tab\n- Encoding issue with media descriptions\n- Some other fixes."
|
"note": "Added:\n- Peertube 2FA support\n- Cache home in background (default disabled -> New settings category and per account) / change frequency\n- Auto-fetch missing messages for the Home (default disabled -> in Settings - Timelines)\n- Automatically switch between tabs when searching\n- More deep links detection\n- Allow to group mentions at the top (default: disabled)\n\n\nFixed:\n- Dynamic color for Android 12+\n- Missing media description for previews\n- Fix a crash when replying\n- Fix button size not changed\n- Forward tags in replies\n- Media cannot be downloaded or shared with Android 10\n- Some crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.3.2",
|
"version": "3.16.4",
|
||||||
"code": "409",
|
"code": "476",
|
||||||
"note": "- Fix an issue with cache and home timeline\n- Nitter timelines use the custom instance from settings\n- Fix Nitter issues (only RT)\n- No longer accepts invalid certificate for onion URLs(Google)\n- Fix some crashes"
|
"note": "Added:\n- Cache home in background (default disabled -> New settings category and per account) / change frequency\n- Auto-fetch missing messages for the Home (default disabled -> in Settings - Timelines)\n- Automatically switch between tabs when searching\n\nFixed:\n- Some crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.3.1",
|
"version": "3.16.3",
|
||||||
"code": "408",
|
"code": "475",
|
||||||
"note": "- Improve speed for Nitter instances\n- Allow to edit Nitter accounts with a long press on tabs\n- Fix pagination issue with pinned timelines\n- Fix some crashes\n- Fix visibility when displaying counters"
|
"note": "Added:\n- Peertube 2FA support\n\nFixed:\n- Dynamic color for Android 12+"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.3.0",
|
"version": "3.16.2",
|
||||||
"code": "407",
|
"code": "474",
|
||||||
"note": "Added:\n- Settings to set all timelines at the top (default disabled)\n- Settings to display timelines in a list (default disabled)\n- Display counters for fav/reblog in timelines (default disabled)\n\nFixed:\n- Visibility issue when replying\n- Some theme issues when composing\n- Some crashes"
|
"note": "Added:\n- Peertube support\n- Compose shortcut (long press launcher)\n- Long press compose button to write with another account\n- Edit description and focus for media (for the next Mastodon release)\n\nChanged:\n- Cross actions with two accounts display a dialog\n- Order & compact og values when sharing > title - url - content\n- Tap on top message (user info) open threads\n\nFixed:\n- Text cleared when adding a media\n- Fix Maths not working with quotes\n- Fix crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.2.0",
|
"version": "3.16.1",
|
||||||
"code": "405",
|
"code": "473",
|
||||||
"note": "Added:\n- Export Settings\n- Propagate manual reordering of lists in timeline to \"Lists\" submenu\n- Allow to change the push distributor in settings\n\nChanged:\n- Improve fit preview images\n- Improve notifications\n- Profile media displayed in a grid\n\nFixed:\n- Some Peertube videos not working\n- Respect the default visibility account when replying\n- Discriminate gif from images\n- App crashes when opening external instance timeline\n- Remove button in thread composer crashes the app\n- Back button opens a lot of old activities before closing the app\n- Problems with sharing\n- Reorder Lists with UI issue on change the visibility\n- Link is not shown correctly in posts from Friendica"
|
"note": "Changed:\n- Edit description and focus for media (for the next Mastodon release)\n\nChanged:\n- Peertube: remove role support to avoid crashes with older instances\n\nFixed:\n- Fix some crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.1.0",
|
"version": "3.16.0",
|
||||||
"code": "402",
|
"code": "472",
|
||||||
"note": "Added:\n- New theme: Dark Elephant from S1m\n- Error messages from server side when posting fails\n\nChanged:\n- Fetch more buttons more visible\n\nFixed:\n- Issue when fetching missing messages\n- Some issues with themes\n- Too much lost space with reaction (Pleroma)\n- Delete and redraft crashes\n- Crash when playing a video\n- Other crash fixes"
|
"note": "Changed:\n- Peertube support\n- Compose shortcut\n- Long press compose button to write with another account\n\nChanged:\n- Cross actions with two accounts display a dialog\n- Order & compact og values when sharing > title - url - content\n\nFixed:\n- Text cleared when adding a media\n- Fix crashes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.0.11",
|
"version": "3.15.2",
|
||||||
"code": "401",
|
"code": "471",
|
||||||
"note": "Added:\n- New theme: Dark Elephant from S1m\n- Error messages from server side when posting fails\n- Allow to set the fetch time for delayed notifications\n\nChanged:\n- Fetch more buttons more visible\n\nFixed:\n- Issue when fetching missing messages\n- Some issues with themes\n- Too much lost space with reaction (Pleroma)\n- Delete and redraft crashes\n- Crash when playing a video\n- Other crash fixes"
|
"note": "Changed:\n- Add instance name when sharing\n\nFixed:\n- Fix a crash when removing media\n- Other minor fixes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.0.10",
|
"version": "3.15.1",
|
||||||
"code": "400",
|
"code": "470",
|
||||||
"note": "Added:\n- Allow to define the max chars count when not detected (In about the instance)\n- Add emoji one picker when composing (must be enabled in settings)\n- Add release notes with the ability to translate them\n\nFixed:\n- Friendica custom emojis not displayed\n- Long press to store media\n- Some bug fixes"
|
"note": "Changed:\n- Material dialogs\n\nFixed:\n- Light theme issues"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.0.9",
|
"version": "3.15.0",
|
||||||
"code": "399",
|
"code": "469",
|
||||||
"note": "Added:\n- Set compose language (from compose menu -> three vertical dots)\n- Add reactions support for Pleroma\n- Add privacy indicator at the top right\n\nChanged\n- Improve the scrolling behaviour\n- Scroll to top (tab reselection) will fetch new messages and then scroll to top\n\nFixed:\n- Empty tag timelines\n- Remove focus point for fit media preview\n- Fix cannot share with one account\n- Fix black theme\n- Theme cannot be selected\n- Fix some button colors"
|
"note": "Added:\n- Maths support (view and compose)\n- Filter DMs in HOME (long press on the tab)\n- Filter languages for users in home timeline (from their profile)\n- Add several targeted languages for translator\n\nChanged:\n- Hide single media with preview is now a setting (default: disabled)\n- Group items in menu of messages\n\nFixed:\n- Cross-actions didn't display account instances"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.0.8",
|
"version": "3.14.6",
|
||||||
"code": "398",
|
"code": "468",
|
||||||
"note": "- Keep improving the scroll behaviour\n- Scroll to top (tab reselection) will fetch new messages and then scroll to top\n- Remove focus point for fit media preview\n- Fix cannot share with one account\n- Fix black theme\n- Fix some button colors"
|
"note": "Added:\n- Maths support (view and compose)\n\nChanged:\n- Hide single media with preview is now a setting (default: disabled)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.0.7",
|
"version": "3.14.5",
|
||||||
"code": "397",
|
"code": "467",
|
||||||
"note": "- Fix some bugs reported."
|
"note": "Changed:\n- Allow to swipe media for profiles\n\nFixed:\n- Fix crashes with pinch zoom\n- Copy/Paste in threads\n- Fix crash when checking redirection on http links\n- Display menu in media viewer resets pinch-zoom"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.0.6",
|
"version": "3.14.4",
|
||||||
"code": "396",
|
"code": "466",
|
||||||
"note": "Added:\n- Allow to set a focus point on previews (media editor)\n- Respect the focus point with previews\n- Pagination with the fetch more button support reading up or down\n- Add trends\n\nFixed:\n- Only last push notification is displayed (not grouped)\n- Bad behavior with the right/left scroll\n- Fix long profiles not fully displayed\n- Issues with some polls\n- Some crashes\n- Some bad behaviors"
|
"note": "Changed:\n- Media viewer (pinch zoom)\n\nFixed:\n- Cross account actions (long press)\n- Boost color\n- Buttons not visible with custom themes.\n- Fix some bad behaviors with media viewer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "3.0.5",
|
"version": "3.14.3",
|
||||||
"code": "395",
|
"code": "465",
|
||||||
"note": "- Fix some bugs\n- Allow to share with the app"
|
"note": "Added:\n- Display date of the message instead of the boost (default: disabled)\n- Allow to disable release notes popup in Settings\n\nFixed:\n- Fix timelines slow down and stuttering after some scrolls\n- Fix color issues with follow buttons\n- Fix import from settings (import from login was OK)"
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "3.0.4",
|
|
||||||
"code": "394",
|
|
||||||
"note": "- Fix crashes for some Pleroma instances"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "3.0.2",
|
|
||||||
"code": "393",
|
|
||||||
"note": "- Some bug fixes\n- Improve pinned timelines"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "3.0.1",
|
|
||||||
"code": "391",
|
|
||||||
"note": "Some quick fixes"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "3.0.0",
|
|
||||||
"code": "390",
|
|
||||||
"note": "New version of Fedilab with new feature.\n- You can now compose threads\n- See the whole thread when replying\n- Cache support\n- New design"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
File diff suppressed because it is too large
Load diff
|
@ -15,15 +15,20 @@ package app.fedilab.android;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
|
import android.app.NotificationChannel;
|
||||||
|
import android.app.NotificationManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.StrictMode;
|
import android.os.StrictMode;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
|
||||||
import androidx.multidex.MultiDex;
|
import androidx.multidex.MultiDex;
|
||||||
import androidx.multidex.MultiDexApplication;
|
import androidx.multidex.MultiDexApplication;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.google.android.material.color.DynamicColors;
|
import net.gotev.uploadservice.UploadServiceConfig;
|
||||||
|
import net.gotev.uploadservice.observer.request.GlobalRequestObserver;
|
||||||
|
|
||||||
import org.acra.ACRA;
|
import org.acra.ACRA;
|
||||||
import org.acra.ReportField;
|
import org.acra.ReportField;
|
||||||
|
@ -32,34 +37,43 @@ import org.acra.config.DialogConfigurationBuilder;
|
||||||
import org.acra.config.MailSenderConfigurationBuilder;
|
import org.acra.config.MailSenderConfigurationBuilder;
|
||||||
import org.acra.data.StringFormat;
|
import org.acra.data.StringFormat;
|
||||||
|
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
import java.util.Objects;
|
||||||
import es.dmoral.toasty.Toasty;
|
|
||||||
|
|
||||||
|
import app.fedilab.android.mastodon.helper.ThemeHelper;
|
||||||
|
import app.fedilab.android.peertube.services.GlobalUploadObserver;
|
||||||
|
import es.dmoral.toasty.Toasty;
|
||||||
|
import io.noties.prism4j.annotations.PrismBundle;
|
||||||
|
|
||||||
|
@PrismBundle(includeAll = true, grammarLocatorClassName = ".MySuperGrammerLocator")
|
||||||
|
|
||||||
public class MainApplication extends MultiDexApplication {
|
public class MainApplication extends MultiDexApplication {
|
||||||
|
|
||||||
|
public static String UPLOAD_CHANNEL_ID = "upload_info_peertube";
|
||||||
private static MainApplication app;
|
private WebView webView;
|
||||||
|
|
||||||
public static MainApplication getApp() {
|
|
||||||
return app;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
app = this;
|
try {
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(MainApplication.this);
|
webView = new WebView(this);
|
||||||
|
} catch (Exception ignored) {
|
||||||
boolean dynamicColor = sharedpreferences.getBoolean(getString(R.string.SET_DYNAMICCOLOR), false);
|
|
||||||
if (dynamicColor) {
|
|
||||||
DynamicColors.applyToActivitiesIfAvailable(this);
|
|
||||||
}
|
}
|
||||||
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
|
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
|
||||||
StrictMode.setVmPolicy(builder.build());
|
StrictMode.setVmPolicy(builder.build());
|
||||||
Toasty.Config.getInstance().apply();
|
Toasty.Config.getInstance().apply();
|
||||||
|
if (webView != null) {
|
||||||
|
try {
|
||||||
|
webView.destroy();
|
||||||
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
createNotificationChannel();
|
||||||
|
UploadServiceConfig.initialize(MainApplication.this, UPLOAD_CHANNEL_ID, true);
|
||||||
|
|
||||||
|
new GlobalRequestObserver(this, new GlobalUploadObserver());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void attachBaseContext(Context base) {
|
protected void attachBaseContext(Context base) {
|
||||||
|
@ -100,4 +114,15 @@ public class MainApplication extends MultiDexApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void createNotificationChannel() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
NotificationChannel channel = new NotificationChannel(UPLOAD_CHANNEL_ID,
|
||||||
|
getString(R.string.notification_channel_name),
|
||||||
|
NotificationManager.IMPORTANCE_LOW);
|
||||||
|
channel.setSound(null, null);
|
||||||
|
((NotificationManager) Objects.requireNonNull(getSystemService(Context.NOTIFICATION_SERVICE))).createNotificationChannel(channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,14 +15,17 @@ package app.fedilab.android.activities;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.ClipData;
|
||||||
|
import android.content.ClipboardManager;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.core.app.ActivityOptionsCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -31,13 +34,17 @@ import java.util.List;
|
||||||
import app.fedilab.android.BaseMainActivity;
|
import app.fedilab.android.BaseMainActivity;
|
||||||
import app.fedilab.android.BuildConfig;
|
import app.fedilab.android.BuildConfig;
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.api.Account;
|
|
||||||
import app.fedilab.android.client.entities.api.Status;
|
|
||||||
import app.fedilab.android.databinding.ActivityAboutBinding;
|
import app.fedilab.android.databinding.ActivityAboutBinding;
|
||||||
import app.fedilab.android.helper.CrossActionHelper;
|
import app.fedilab.android.mastodon.activities.BaseBarActivity;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.mastodon.activities.ProfileActivity;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.mastodon.client.entities.api.Account;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.mastodon.client.entities.api.Status;
|
||||||
|
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
|
||||||
|
import app.fedilab.android.mastodon.helper.CrossActionHelper;
|
||||||
|
import app.fedilab.android.mastodon.helper.Helper;
|
||||||
|
import app.fedilab.android.mastodon.helper.MastodonHelper;
|
||||||
|
import app.fedilab.android.mastodon.viewmodel.mastodon.AccountsVM;
|
||||||
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
|
||||||
public class AboutActivity extends BaseBarActivity {
|
public class AboutActivity extends BaseBarActivity {
|
||||||
|
@ -56,10 +63,10 @@ public class AboutActivity extends BaseBarActivity {
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
|
String version = "";
|
||||||
try {
|
try {
|
||||||
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
|
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||||
String version = pInfo.versionName;
|
version = pInfo.versionName;
|
||||||
binding.aboutVersion.setText(getResources().getString(R.string.about_vesrion, version));
|
binding.aboutVersion.setText(getResources().getString(R.string.about_vesrion, version));
|
||||||
} catch (PackageManager.NameNotFoundException ignored) {
|
} catch (PackageManager.NameNotFoundException ignored) {
|
||||||
}
|
}
|
||||||
|
@ -75,6 +82,20 @@ public class AboutActivity extends BaseBarActivity {
|
||||||
}
|
}
|
||||||
binding.aboutSupportPaypal.setOnClickListener(v -> Helper.openBrowser(AboutActivity.this, "https://www.paypal.me/Mastalab"));
|
binding.aboutSupportPaypal.setOnClickListener(v -> Helper.openBrowser(AboutActivity.this, "https://www.paypal.me/Mastalab"));
|
||||||
|
|
||||||
|
|
||||||
|
String finalVersion = version;
|
||||||
|
binding.aboutVersionCopy.setOnClickListener(v -> {
|
||||||
|
|
||||||
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
String content = "Fedilab v" + finalVersion + " for " + (BuildConfig.DONATIONS ? "FDroid" : "Google");
|
||||||
|
|
||||||
|
ClipData clip = ClipData.newPlainText(Helper.CLIP_BOARD, content);
|
||||||
|
if (clipboard != null) {
|
||||||
|
clipboard.setPrimaryClip(clip);
|
||||||
|
Toasty.info(AboutActivity.this, getString(R.string.clipboard_version), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
if (BuildConfig.DONATIONS) {
|
if (BuildConfig.DONATIONS) {
|
||||||
binding.aboutSupportPaypal.setVisibility(View.VISIBLE);
|
binding.aboutSupportPaypal.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -98,12 +119,14 @@ public class AboutActivity extends BaseBarActivity {
|
||||||
binding.accountUn.setText(account.acct);
|
binding.accountUn.setText(account.acct);
|
||||||
binding.accountPp.setOnClickListener(v -> {
|
binding.accountPp.setOnClickListener(v -> {
|
||||||
Intent intent = new Intent(AboutActivity.this, ProfileActivity.class);
|
Intent intent = new Intent(AboutActivity.this, ProfileActivity.class);
|
||||||
Bundle b = new Bundle();
|
Bundle args = new Bundle();
|
||||||
b.putSerializable(Helper.ARG_ACCOUNT, account);
|
args.putSerializable(Helper.ARG_ACCOUNT, account);
|
||||||
intent.putExtras(b);
|
new CachedBundle(AboutActivity.this).insertBundle(args, Helper.getCurrentAccount(AboutActivity.this), bundleId -> {
|
||||||
ActivityOptionsCompat options = ActivityOptionsCompat
|
Bundle bundle = new Bundle();
|
||||||
.makeSceneTransitionAnimation(AboutActivity.this, binding.accountPp, getString(R.string.activity_porfile_pp));
|
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||||
startActivity(intent, options.toBundle());
|
intent.putExtras(bundle);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
AccountsVM accountsVM = new ViewModelProvider(AboutActivity.this).get(AccountsVM.class);
|
AccountsVM accountsVM = new ViewModelProvider(AboutActivity.this).get(AccountsVM.class);
|
||||||
List<String> ids = new ArrayList<>();
|
List<String> ids = new ArrayList<>();
|
||||||
|
@ -113,7 +136,7 @@ public class AboutActivity extends BaseBarActivity {
|
||||||
if (relationShips != null && relationShips.size() > 0) {
|
if (relationShips != null && relationShips.size() > 0) {
|
||||||
if (!relationShips.get(0).following) {
|
if (!relationShips.get(0).following) {
|
||||||
binding.accountFollow.setVisibility(View.VISIBLE);
|
binding.accountFollow.setVisibility(View.VISIBLE);
|
||||||
binding.accountFollow.setOnClickListener(v -> accountsVM.follow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id, true, false)
|
binding.accountFollow.setOnClickListener(v -> accountsVM.follow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id, true, false, null)
|
||||||
.observe(AboutActivity.this, relationShip -> binding.accountFollow.setVisibility(View.GONE)));
|
.observe(AboutActivity.this, relationShip -> binding.accountFollow.setVisibility(View.GONE)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,139 +0,0 @@
|
||||||
package app.fedilab.android.activities;
|
|
||||||
/* Copyright 2021 Thomas Schneider
|
|
||||||
*
|
|
||||||
* This file is a part of Fedilab
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
|
||||||
* see <http://www.gnu.org/licenses>. */
|
|
||||||
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Window;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import com.vanniktech.emoji.EmojiManager;
|
|
||||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("Registered")
|
|
||||||
public class BaseAlertDialogActivity extends AppCompatActivity {
|
|
||||||
|
|
||||||
static {
|
|
||||||
Helper.installProvider();
|
|
||||||
EmojiManager.install(new EmojiOneProvider());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
|
|
||||||
final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
String currentTheme = sharedpreferences.getString(getString(R.string.SET_THEME_BASE), getString(R.string.SET_DEFAULT_THEME));
|
|
||||||
//Default automatic switch
|
|
||||||
if (currentTheme.equals(getString(R.string.SET_DEFAULT_THEME))) {
|
|
||||||
|
|
||||||
int currentNightMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
|
||||||
switch (currentNightMode) {
|
|
||||||
case Configuration.UI_MODE_NIGHT_NO:
|
|
||||||
String defaultLight = sharedpreferences.getString(getString(R.string.SET_THEME_DEFAULT_LIGHT), "LIGHT");
|
|
||||||
switch (defaultLight) {
|
|
||||||
case "LIGHT":
|
|
||||||
setTheme(R.style.AppThemeAlertDialog);
|
|
||||||
break;
|
|
||||||
case "SOLARIZED_LIGHT":
|
|
||||||
setTheme(R.style.SolarizedAlertDialog);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Configuration.UI_MODE_NIGHT_YES:
|
|
||||||
String defaultDark = sharedpreferences.getString(getString(R.string.SET_THEME_DEFAULT_DARK), "DARK");
|
|
||||||
switch (defaultDark) {
|
|
||||||
case "DARK":
|
|
||||||
setTheme(R.style.AppThemeAlertDialog);
|
|
||||||
break;
|
|
||||||
case "SOLARIZED_DARK":
|
|
||||||
setTheme(R.style.SolarizedAlertDialog);
|
|
||||||
break;
|
|
||||||
case "BLACK":
|
|
||||||
Window window = getWindow();
|
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
|
||||||
window.setStatusBarColor(Color.BLACK);
|
|
||||||
setTheme(R.style.BlackAlertDialog);
|
|
||||||
break;
|
|
||||||
case "DRACULA":
|
|
||||||
setTheme(R.style.DraculaAlertDialog);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch (currentTheme) {
|
|
||||||
case "LIGHT":
|
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
|
||||||
setTheme(R.style.AppThemeAlertDialog);
|
|
||||||
break;
|
|
||||||
case "DARK":
|
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
||||||
setTheme(R.style.AppThemeAlertDialog);
|
|
||||||
break;
|
|
||||||
case "SOLARIZED_LIGHT":
|
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
|
||||||
setTheme(R.style.SolarizedAlertDialog);
|
|
||||||
break;
|
|
||||||
case "SOLARIZED_DARK":
|
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
||||||
setTheme(R.style.SolarizedAlertDialog);
|
|
||||||
break;
|
|
||||||
case "BLACK":
|
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
||||||
Window window = getWindow();
|
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
|
||||||
window.setStatusBarColor(Color.BLACK);
|
|
||||||
setTheme(R.style.BlackAlertDialog);
|
|
||||||
break;
|
|
||||||
case "DRACULA":
|
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
|
||||||
setTheme(R.style.DraculaAlertDialog);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) {
|
|
||||||
ThemeHelper.adjustFontScale(this, getResources().getConfiguration());
|
|
||||||
}
|
|
||||||
Helper.setLocale(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void attachBaseContext(Context newBase) {
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {
|
|
||||||
final Configuration override = new Configuration(newBase.getResources().getConfiguration());
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(newBase);
|
|
||||||
override.fontScale = prefs.getFloat(newBase.getString(R.string.SET_FONT_SCALE), 1.1f);
|
|
||||||
applyOverrideConfiguration(override);
|
|
||||||
}
|
|
||||||
super.attachBaseContext(newBase);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,926 +0,0 @@
|
||||||
package app.fedilab.android.activities;
|
|
||||||
/* Copyright 2021 Thomas Schneider
|
|
||||||
*
|
|
||||||
* This file is a part of Fedilab
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
|
||||||
* see <http://www.gnu.org/licenses>. */
|
|
||||||
|
|
||||||
|
|
||||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
|
||||||
import static app.fedilab.android.BaseMainActivity.currentInstance;
|
|
||||||
import static app.fedilab.android.BaseMainActivity.emojis;
|
|
||||||
import static app.fedilab.android.ui.drawer.ComposeAdapter.prepareDraft;
|
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.ClipData;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.IntentFilter;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Looper;
|
|
||||||
import android.text.Editable;
|
|
||||||
import android.text.TextWatcher;
|
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.MotionEvent;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.work.Data;
|
|
||||||
import androidx.work.OneTimeWorkRequest;
|
|
||||||
import androidx.work.OutOfQuotaPolicy;
|
|
||||||
import androidx.work.WorkManager;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import app.fedilab.android.BaseMainActivity;
|
|
||||||
import app.fedilab.android.R;
|
|
||||||
import app.fedilab.android.client.entities.api.Attachment;
|
|
||||||
import app.fedilab.android.client.entities.api.Context;
|
|
||||||
import app.fedilab.android.client.entities.api.EmojiInstance;
|
|
||||||
import app.fedilab.android.client.entities.api.Instance;
|
|
||||||
import app.fedilab.android.client.entities.api.Mention;
|
|
||||||
import app.fedilab.android.client.entities.api.ScheduledStatus;
|
|
||||||
import app.fedilab.android.client.entities.api.Status;
|
|
||||||
import app.fedilab.android.client.entities.app.BaseAccount;
|
|
||||||
import app.fedilab.android.client.entities.app.StatusDraft;
|
|
||||||
import app.fedilab.android.databinding.ActivityPaginationBinding;
|
|
||||||
import app.fedilab.android.databinding.PopupContactBinding;
|
|
||||||
import app.fedilab.android.exception.DBException;
|
|
||||||
import app.fedilab.android.helper.DividerDecorationSimple;
|
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
|
||||||
import app.fedilab.android.helper.MediaHelper;
|
|
||||||
import app.fedilab.android.interfaces.OnDownloadInterface;
|
|
||||||
import app.fedilab.android.jobs.ComposeWorker;
|
|
||||||
import app.fedilab.android.jobs.ScheduleThreadWorker;
|
|
||||||
import app.fedilab.android.services.ThreadMessageService;
|
|
||||||
import app.fedilab.android.ui.drawer.AccountsReplyAdapter;
|
|
||||||
import app.fedilab.android.ui.drawer.ComposeAdapter;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
|
||||||
import es.dmoral.toasty.Toasty;
|
|
||||||
|
|
||||||
public class ComposeActivity extends BaseActivity implements ComposeAdapter.ManageDrafts, AccountsReplyAdapter.ActionDone, ComposeAdapter.promptDraftListener {
|
|
||||||
|
|
||||||
|
|
||||||
public static final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 754;
|
|
||||||
public static final int REQUEST_AUDIO_PERMISSION_RESULT = 1653;
|
|
||||||
public static final int PICK_MEDIA = 5700;
|
|
||||||
public static final int TAKE_PHOTO = 5600;
|
|
||||||
private final Timer timer = new Timer();
|
|
||||||
private List<Status> statusList;
|
|
||||||
private Status statusReply, statusMention, statusQuoted;
|
|
||||||
private StatusDraft statusDraft;
|
|
||||||
private ComposeAdapter composeAdapter;
|
|
||||||
private final BroadcastReceiver imageReceiver = new BroadcastReceiver() {
|
|
||||||
@Override
|
|
||||||
public void onReceive(android.content.Context context, Intent intent) {
|
|
||||||
String imgpath = intent.getStringExtra("imgpath");
|
|
||||||
float focusX = intent.getFloatExtra("focusX", -2);
|
|
||||||
float focusY = intent.getFloatExtra("focusY", -2);
|
|
||||||
if (imgpath != null) {
|
|
||||||
int position = 0;
|
|
||||||
for (Status status : statusList) {
|
|
||||||
if (status.media_attachments != null && status.media_attachments.size() > 0) {
|
|
||||||
for (Attachment attachment : status.media_attachments) {
|
|
||||||
if (attachment.local_path != null && attachment.local_path.equalsIgnoreCase(imgpath)) {
|
|
||||||
if (focusX != -2) {
|
|
||||||
attachment.focus = focusX + "," + focusY;
|
|
||||||
}
|
|
||||||
|
|
||||||
composeAdapter.notifyItemChanged(position);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
position++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
private boolean promptSaveDraft;
|
|
||||||
private boolean restoredDraft;
|
|
||||||
private List<Attachment> sharedAttachments;
|
|
||||||
private ActivityPaginationBinding binding;
|
|
||||||
private BaseAccount account;
|
|
||||||
private String instance, token;
|
|
||||||
private Uri photoFileUri;
|
|
||||||
private ScheduledStatus scheduledStatus;
|
|
||||||
private String visibility;
|
|
||||||
private app.fedilab.android.client.entities.api.Account accountMention;
|
|
||||||
private String statusReplyId;
|
|
||||||
private app.fedilab.android.client.entities.api.Account mentionBooster;
|
|
||||||
private String sharedSubject, sharedContent, sharedTitle, sharedDescription, shareURL, sharedUrlMedia;
|
|
||||||
private String editMessageId;
|
|
||||||
|
|
||||||
private static int visibilityToNumber(String visibility) {
|
|
||||||
switch (visibility) {
|
|
||||||
case "public":
|
|
||||||
return 3;
|
|
||||||
case "unlisted":
|
|
||||||
return 2;
|
|
||||||
case "private":
|
|
||||||
return 1;
|
|
||||||
case "direct":
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String visibilityToString(int visibility) {
|
|
||||||
switch (visibility) {
|
|
||||||
case 3:
|
|
||||||
return "public";
|
|
||||||
case 2:
|
|
||||||
return "unlisted";
|
|
||||||
case 1:
|
|
||||||
return "private";
|
|
||||||
case 0:
|
|
||||||
return "direct";
|
|
||||||
}
|
|
||||||
return "public";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getVisibility(String defaultVisibility) {
|
|
||||||
int tootVisibility = visibilityToNumber(defaultVisibility);
|
|
||||||
if (currentAccount != null && currentAccount.mastodon_account != null && currentAccount.mastodon_account.source != null) {
|
|
||||||
int userVisibility = visibilityToNumber(currentAccount.mastodon_account.source.privacy);
|
|
||||||
if (tootVisibility > userVisibility) {
|
|
||||||
return visibilityToString(userVisibility);
|
|
||||||
} else {
|
|
||||||
return visibilityToString(tootVisibility);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return defaultVisibility;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
if (timer != null) {
|
|
||||||
timer.cancel();
|
|
||||||
}
|
|
||||||
LocalBroadcastManager.getInstance(this)
|
|
||||||
.unregisterReceiver(imageReceiver);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBackPressed() {
|
|
||||||
storeDraftWarning();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void storeDraftWarning() {
|
|
||||||
if (statusDraft == null) {
|
|
||||||
statusDraft = prepareDraft(statusList, composeAdapter, account.instance, account.user_id);
|
|
||||||
}
|
|
||||||
if (canBeSent(statusDraft)) {
|
|
||||||
if (promptSaveDraft) {
|
|
||||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(ComposeActivity.this, Helper.dialogStyle());
|
|
||||||
alt_bld.setMessage(R.string.save_draft);
|
|
||||||
alt_bld.setPositiveButton(R.string.save, (dialog, id) -> {
|
|
||||||
dialog.dismiss();
|
|
||||||
storeDraft(false);
|
|
||||||
finish();
|
|
||||||
|
|
||||||
});
|
|
||||||
alt_bld.setNegativeButton(R.string.no, (dialog, id) -> {
|
|
||||||
try {
|
|
||||||
new StatusDraft(ComposeActivity.this).removeDraft(statusDraft);
|
|
||||||
} catch (DBException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
dialog.dismiss();
|
|
||||||
finish();
|
|
||||||
});
|
|
||||||
AlertDialog alert = alt_bld.create();
|
|
||||||
alert.show();
|
|
||||||
} else {
|
|
||||||
if (!restoredDraft) {
|
|
||||||
try {
|
|
||||||
new StatusDraft(ComposeActivity.this).removeDraft(statusDraft);
|
|
||||||
} catch (DBException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Intialize the common view for the context
|
|
||||||
*
|
|
||||||
* @param context {@link Context}
|
|
||||||
*/
|
|
||||||
private void initializeContextView(final Context context) {
|
|
||||||
|
|
||||||
if (context == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//Build the array of statuses
|
|
||||||
statusList.addAll(0, context.ancestors);
|
|
||||||
composeAdapter.setStatusCount(context.ancestors.size() + 1);
|
|
||||||
composeAdapter.notifyItemRangeInserted(0, context.ancestors.size());
|
|
||||||
|
|
||||||
composeAdapter.notifyItemRangeChanged(0, statusList.size());
|
|
||||||
if (binding.recyclerView.getItemDecorationCount() > 0) {
|
|
||||||
for (int i = 0; i < binding.recyclerView.getItemDecorationCount(); i++) {
|
|
||||||
binding.recyclerView.removeItemDecorationAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.recyclerView.addItemDecoration(new DividerDecorationSimple(ComposeActivity.this, statusList));
|
|
||||||
binding.recyclerView.scrollToPosition(composeAdapter.getItemCount() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Intialize the common view for the context
|
|
||||||
*
|
|
||||||
* @param context {@link Context}
|
|
||||||
*/
|
|
||||||
private void initializeContextRedraftView(final Context context, Status initialStatus) {
|
|
||||||
|
|
||||||
if (context == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Build the array of statuses
|
|
||||||
statusList.addAll(0, context.ancestors);
|
|
||||||
statusList.add(initialStatus);
|
|
||||||
statusList.add(statusDraft.statusDraftList.get(0));
|
|
||||||
composeAdapter = new ComposeAdapter(statusList, context.ancestors.size(), account, accountMention, visibility, editMessageId);
|
|
||||||
composeAdapter.promptDraftListener = this;
|
|
||||||
composeAdapter.manageDrafts = this;
|
|
||||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(ComposeActivity.this);
|
|
||||||
binding.recyclerView.setLayoutManager(mLayoutManager);
|
|
||||||
binding.recyclerView.setAdapter(composeAdapter);
|
|
||||||
composeAdapter.setStatusCount(context.ancestors.size() + 1);
|
|
||||||
binding.recyclerView.addItemDecoration(new DividerDecorationSimple(ComposeActivity.this, statusList));
|
|
||||||
binding.recyclerView.scrollToPosition(composeAdapter.getItemCount() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
|
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
|
||||||
getMenuInflater().inflate(R.menu.menu_compose, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
storeDraftWarning();
|
|
||||||
return true;
|
|
||||||
} else if (item.getItemId() == R.id.action_photo_camera) {
|
|
||||||
photoFileUri = MediaHelper.dispatchTakePictureIntent(ComposeActivity.this);
|
|
||||||
} else if (item.getItemId() == R.id.action_contacts) {
|
|
||||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(ComposeActivity.this, Helper.dialogStyle());
|
|
||||||
|
|
||||||
builderSingle.setTitle(getString(R.string.select_accounts));
|
|
||||||
PopupContactBinding popupContactBinding = PopupContactBinding.inflate(getLayoutInflater(), new LinearLayout(ComposeActivity.this), false);
|
|
||||||
popupContactBinding.loader.setVisibility(View.VISIBLE);
|
|
||||||
AccountsVM accountsVM = new ViewModelProvider(ComposeActivity.this).get(AccountsVM.class);
|
|
||||||
accountsVM.searchAccounts(instance, token, "", 10, false, true)
|
|
||||||
.observe(ComposeActivity.this, accounts -> onRetrieveContact(popupContactBinding, accounts));
|
|
||||||
|
|
||||||
popupContactBinding.searchAccount.addTextChangedListener(new TextWatcher() {
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
||||||
if (count > 0) {
|
|
||||||
popupContactBinding.searchAccount.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_baseline_close_24, 0);
|
|
||||||
} else {
|
|
||||||
popupContactBinding.searchAccount.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_baseline_search_24, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterTextChanged(Editable s) {
|
|
||||||
if (s != null && s.length() > 0) {
|
|
||||||
accountsVM.searchAccounts(instance, token, s.toString().trim(), 10, false, true)
|
|
||||||
.observe(ComposeActivity.this, accounts -> onRetrieveContact(popupContactBinding, accounts));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
popupContactBinding.searchAccount.setOnTouchListener((v, event) -> {
|
|
||||||
final int DRAWABLE_RIGHT = 2;
|
|
||||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
|
||||||
if (popupContactBinding.searchAccount.length() > 0 && event.getRawX() >= (popupContactBinding.searchAccount.getRight() - popupContactBinding.searchAccount.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width())) {
|
|
||||||
popupContactBinding.searchAccount.setText("");
|
|
||||||
accountsVM.searchAccounts(instance, token, "", 10, false, true)
|
|
||||||
.observe(ComposeActivity.this, accounts -> onRetrieveContact(popupContactBinding, accounts));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
builderSingle.setView(popupContactBinding.getRoot());
|
|
||||||
builderSingle.setNegativeButton(R.string.validate, (dialog, which) -> {
|
|
||||||
dialog.dismiss();
|
|
||||||
composeAdapter.putCursor();
|
|
||||||
});
|
|
||||||
builderSingle.show();
|
|
||||||
} else if (item.getItemId() == R.id.action_microphone) {
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) ==
|
|
||||||
PackageManager.PERMISSION_GRANTED) {
|
|
||||||
MediaHelper.recordAudio(ComposeActivity.this, file -> {
|
|
||||||
List<Uri> uris = new ArrayList<>();
|
|
||||||
uris.add(Uri.fromFile(new File(file)));
|
|
||||||
composeAdapter.addAttachment(-1, uris);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (shouldShowRequestPermissionRationale(Manifest.permission.RECORD_AUDIO)) {
|
|
||||||
Toast.makeText(this,
|
|
||||||
getString(R.string.audio), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO
|
|
||||||
}, REQUEST_AUDIO_PERMISSION_RESULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
MediaHelper.recordAudio(ComposeActivity.this, file -> {
|
|
||||||
List<Uri> uris = new ArrayList<>();
|
|
||||||
uris.add(Uri.fromFile(new File(file)));
|
|
||||||
composeAdapter.addAttachment(-1, uris);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else if (item.getItemId() == R.id.action_schedule) {
|
|
||||||
if (statusDraft == null) {
|
|
||||||
statusDraft = prepareDraft(statusList, composeAdapter, account.instance, account.user_id);
|
|
||||||
}
|
|
||||||
if (canBeSent(statusDraft)) {
|
|
||||||
MediaHelper.scheduleMessage(ComposeActivity.this, date -> storeDraft(true, date));
|
|
||||||
} else {
|
|
||||||
Toasty.info(ComposeActivity.this, getString(R.string.toot_error_no_content), Toasty.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onRetrieveContact(PopupContactBinding popupContactBinding, List<app.fedilab.android.client.entities.api.Account> accounts) {
|
|
||||||
popupContactBinding.loader.setVisibility(View.GONE);
|
|
||||||
if (accounts == null) {
|
|
||||||
accounts = new ArrayList<>();
|
|
||||||
}
|
|
||||||
List<Boolean> checkedValues = new ArrayList<>();
|
|
||||||
List<app.fedilab.android.client.entities.api.Account> contacts = new ArrayList<>(accounts);
|
|
||||||
for (app.fedilab.android.client.entities.api.Account account : contacts) {
|
|
||||||
checkedValues.add(composeAdapter.getLastComposeContent().contains("@" + account.acct));
|
|
||||||
}
|
|
||||||
AccountsReplyAdapter contactAdapter = new AccountsReplyAdapter(contacts, checkedValues);
|
|
||||||
contactAdapter.actionDone = ComposeActivity.this;
|
|
||||||
popupContactBinding.lvAccountsSearch.setAdapter(contactAdapter);
|
|
||||||
popupContactBinding.lvAccountsSearch.setLayoutManager(new LinearLayoutManager(ComposeActivity.this));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
List<Uri> uris = new ArrayList<>();
|
|
||||||
if (requestCode >= PICK_MEDIA && resultCode == RESULT_OK) {
|
|
||||||
ClipData clipData = data.getClipData();
|
|
||||||
int position = requestCode - PICK_MEDIA;
|
|
||||||
if (clipData != null) {
|
|
||||||
for (int i = 0; i < clipData.getItemCount(); i++) {
|
|
||||||
ClipData.Item item = clipData.getItemAt(i);
|
|
||||||
uris.add(item.getUri());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uris.add(data.getData());
|
|
||||||
}
|
|
||||||
composeAdapter.addAttachment(position, uris);
|
|
||||||
} else if (requestCode == TAKE_PHOTO && resultCode == RESULT_OK) {
|
|
||||||
uris.add(photoFileUri);
|
|
||||||
composeAdapter.addAttachment(-1, uris);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
binding = ActivityPaginationBinding.inflate(getLayoutInflater());
|
|
||||||
setContentView(binding.getRoot());
|
|
||||||
setSupportActionBar(binding.toolbar);
|
|
||||||
promptSaveDraft = false;
|
|
||||||
restoredDraft = false;
|
|
||||||
ActionBar actionBar = getSupportActionBar();
|
|
||||||
//Remove title
|
|
||||||
if (actionBar != null) {
|
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
|
||||||
}
|
|
||||||
if (getSupportActionBar() != null) {
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
|
||||||
}
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
|
||||||
binding.title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18 * 1.1f / scale);
|
|
||||||
statusList = new ArrayList<>();
|
|
||||||
Bundle b = getIntent().getExtras();
|
|
||||||
if (b != null) {
|
|
||||||
statusReply = (Status) b.getSerializable(Helper.ARG_STATUS_REPLY);
|
|
||||||
statusQuoted = (Status) b.getSerializable(Helper.ARG_QUOTED_MESSAGE);
|
|
||||||
statusDraft = (StatusDraft) b.getSerializable(Helper.ARG_STATUS_DRAFT);
|
|
||||||
scheduledStatus = (ScheduledStatus) b.getSerializable(Helper.ARG_STATUS_SCHEDULED);
|
|
||||||
statusReplyId = b.getString(Helper.ARG_STATUS_REPLY_ID);
|
|
||||||
statusMention = (Status) b.getSerializable(Helper.ARG_STATUS_MENTION);
|
|
||||||
account = (BaseAccount) b.getSerializable(Helper.ARG_ACCOUNT);
|
|
||||||
editMessageId = b.getString(Helper.ARG_EDIT_STATUS_ID, null);
|
|
||||||
instance = b.getString(Helper.ARG_INSTANCE, null);
|
|
||||||
token = b.getString(Helper.ARG_TOKEN, null);
|
|
||||||
visibility = b.getString(Helper.ARG_VISIBILITY, null);
|
|
||||||
if (visibility == null && statusReply != null) {
|
|
||||||
visibility = getVisibility(statusReply.visibility);
|
|
||||||
} else if (visibility == null && currentAccount != null && currentAccount.mastodon_account != null && currentAccount.mastodon_account.source != null) {
|
|
||||||
visibility = currentAccount.mastodon_account.source.privacy;
|
|
||||||
}
|
|
||||||
mentionBooster = (app.fedilab.android.client.entities.api.Account) b.getSerializable(Helper.ARG_MENTION_BOOSTER);
|
|
||||||
accountMention = (app.fedilab.android.client.entities.api.Account) b.getSerializable(Helper.ARG_ACCOUNT_MENTION);
|
|
||||||
//Shared elements
|
|
||||||
sharedAttachments = (ArrayList<Attachment>) b.getSerializable(Helper.ARG_MEDIA_ATTACHMENTS);
|
|
||||||
sharedUrlMedia = b.getString(Helper.ARG_SHARE_URL_MEDIA);
|
|
||||||
sharedSubject = b.getString(Helper.ARG_SHARE_SUBJECT, null);
|
|
||||||
sharedContent = b.getString(Helper.ARG_SHARE_CONTENT, null);
|
|
||||||
sharedTitle = b.getString(Helper.ARG_SHARE_TITLE, null);
|
|
||||||
sharedDescription = b.getString(Helper.ARG_SHARE_DESCRIPTION, null);
|
|
||||||
shareURL = b.getString(Helper.ARG_SHARE_URL, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sharedContent != null && shareURL != null && sharedContent.compareTo(shareURL) == 0) {
|
|
||||||
sharedContent = "";
|
|
||||||
}
|
|
||||||
if (sharedTitle != null && sharedSubject != null && sharedSubject.length() > sharedTitle.length()) {
|
|
||||||
sharedTitle = sharedSubject;
|
|
||||||
}
|
|
||||||
//Edit a scheduled status from server
|
|
||||||
if (scheduledStatus != null) {
|
|
||||||
statusDraft = new StatusDraft();
|
|
||||||
List<Status> statuses = new ArrayList<>();
|
|
||||||
Status status = new Status();
|
|
||||||
status.id = Helper.generateIdString();
|
|
||||||
status.text = scheduledStatus.params.text;
|
|
||||||
status.in_reply_to_id = scheduledStatus.params.in_reply_to_id;
|
|
||||||
status.poll = scheduledStatus.params.poll;
|
|
||||||
|
|
||||||
if (scheduledStatus.params.media_ids != null && scheduledStatus.params.media_ids.size() > 0) {
|
|
||||||
status.media_attachments = new ArrayList<>();
|
|
||||||
new Thread(() -> {
|
|
||||||
StatusesVM statusesVM = new ViewModelProvider(ComposeActivity.this).get(StatusesVM.class);
|
|
||||||
for (String attachmentId : scheduledStatus.params.media_ids) {
|
|
||||||
statusesVM.getAttachment(instance, token, attachmentId)
|
|
||||||
.observe(ComposeActivity.this, attachment -> status.media_attachments.add(attachment));
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
status.sensitive = scheduledStatus.params.sensitive;
|
|
||||||
status.spoiler_text = scheduledStatus.params.spoiler_text;
|
|
||||||
status.visibility = scheduledStatus.params.visibility;
|
|
||||||
statusDraft.statusDraftList = statuses;
|
|
||||||
}
|
|
||||||
if (account == null) {
|
|
||||||
account = currentAccount;
|
|
||||||
}
|
|
||||||
if (account == null) {
|
|
||||||
Toasty.error(ComposeActivity.this, getString(R.string.toast_error), Toasty.LENGTH_SHORT).show();
|
|
||||||
finish();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (instance == null) {
|
|
||||||
instance = account.instance;
|
|
||||||
}
|
|
||||||
if (token == null) {
|
|
||||||
token = account.token;
|
|
||||||
}
|
|
||||||
if (emojis == null || !emojis.containsKey(instance)) {
|
|
||||||
new Thread(() -> {
|
|
||||||
try {
|
|
||||||
emojis.put(instance, new EmojiInstance(ComposeActivity.this).getEmojiList(instance));
|
|
||||||
} catch (DBException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
if (MainActivity.instanceInfo == null) {
|
|
||||||
String instanceInfo = sharedpreferences.getString(getString(R.string.INSTANCE_INFO) + instance, null);
|
|
||||||
if (instanceInfo != null) {
|
|
||||||
MainActivity.instanceInfo = Instance.restore(instanceInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusesVM statusesVM = new ViewModelProvider(ComposeActivity.this).get(StatusesVM.class);
|
|
||||||
//Empty compose
|
|
||||||
List<Status> statusDraftList = new ArrayList<>();
|
|
||||||
Status status = new Status();
|
|
||||||
status.id = Helper.generateIdString();
|
|
||||||
if (statusQuoted != null) {
|
|
||||||
status.quote_id = statusQuoted.id;
|
|
||||||
}
|
|
||||||
statusDraftList.add(status);
|
|
||||||
|
|
||||||
if (statusReplyId != null && statusDraft != null) {//Delete and redraft
|
|
||||||
statusesVM.getStatus(currentInstance, BaseMainActivity.currentToken, statusReplyId)
|
|
||||||
.observe(ComposeActivity.this, status1 -> {
|
|
||||||
if (status1 != null) {
|
|
||||||
statusesVM.getContext(currentInstance, BaseMainActivity.currentToken, statusReplyId)
|
|
||||||
.observe(ComposeActivity.this, statusContext -> {
|
|
||||||
if (statusContext != null) {
|
|
||||||
initializeContextRedraftView(statusContext, status1);
|
|
||||||
} else {
|
|
||||||
Helper.sendToastMessage(getApplication(), Helper.RECEIVE_TOAST_TYPE_ERROR, getString(R.string.toast_error));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Helper.sendToastMessage(getApplication(), Helper.RECEIVE_TOAST_TYPE_ERROR, getString(R.string.toast_error));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (statusDraft != null) {//Restore a draft with all messages
|
|
||||||
restoredDraft = true;
|
|
||||||
if (statusDraft.statusReplyList != null) {
|
|
||||||
statusList.addAll(statusDraft.statusReplyList);
|
|
||||||
binding.recyclerView.addItemDecoration(new DividerDecorationSimple(ComposeActivity.this, statusList));
|
|
||||||
}
|
|
||||||
int statusCount = statusList.size();
|
|
||||||
statusList.addAll(statusDraft.statusDraftList);
|
|
||||||
composeAdapter = new ComposeAdapter(statusList, statusCount, account, accountMention, visibility, editMessageId);
|
|
||||||
composeAdapter.manageDrafts = this;
|
|
||||||
composeAdapter.promptDraftListener = this;
|
|
||||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(ComposeActivity.this);
|
|
||||||
binding.recyclerView.setLayoutManager(mLayoutManager);
|
|
||||||
binding.recyclerView.setAdapter(composeAdapter);
|
|
||||||
binding.recyclerView.scrollToPosition(composeAdapter.getItemCount() - 1);
|
|
||||||
|
|
||||||
} else if (statusReply != null) {
|
|
||||||
statusList.add(statusReply);
|
|
||||||
int statusCount = statusList.size();
|
|
||||||
statusDraftList.get(0).in_reply_to_id = statusReply.id;
|
|
||||||
//We change order for mentions
|
|
||||||
//At first place the account that has been mentioned if it's not our
|
|
||||||
statusDraftList.get(0).mentions = new ArrayList<>();
|
|
||||||
if (statusReply.account.acct != null && currentAccount.mastodon_account != null && !statusReply.account.acct.equalsIgnoreCase(currentAccount.mastodon_account.acct)) {
|
|
||||||
Mention mention = new Mention();
|
|
||||||
mention.acct = "@" + statusReply.account.acct;
|
|
||||||
mention.url = statusReply.account.url;
|
|
||||||
mention.username = statusReply.account.username;
|
|
||||||
statusDraftList.get(0).mentions.add(mention);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//There are other mentions to
|
|
||||||
if (statusReply.mentions != null && statusReply.mentions.size() > 0) {
|
|
||||||
for (Mention mentionTmp : statusReply.mentions) {
|
|
||||||
if (statusReply.account.acct != null && !mentionTmp.acct.equalsIgnoreCase(statusReply.account.acct) && currentAccount.mastodon_account != null && !mentionTmp.acct.equalsIgnoreCase(currentAccount.mastodon_account.acct)) {
|
|
||||||
statusDraftList.get(0).mentions.add(mentionTmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mentionBooster != null) {
|
|
||||||
Mention mention = new Mention();
|
|
||||||
mention.acct = mentionBooster.acct;
|
|
||||||
mention.url = mentionBooster.url;
|
|
||||||
mention.username = mentionBooster.username;
|
|
||||||
boolean present = false;
|
|
||||||
for (Mention mentionTmp : statusDraftList.get(0).mentions) {
|
|
||||||
if (mentionTmp.acct.equalsIgnoreCase(mentionBooster.acct)) {
|
|
||||||
present = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!present) {
|
|
||||||
statusDraftList.get(0).mentions.add(mention);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (statusReply.spoiler_text != null) {
|
|
||||||
statusDraftList.get(0).spoiler_text = statusReply.spoiler_text;
|
|
||||||
if (statusReply.spoiler_text.trim().length() > 0) {
|
|
||||||
statusDraftList.get(0).spoilerChecked = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (statusReply.language != null && !statusReply.language.isEmpty()) {
|
|
||||||
statusDraftList.get(0).language = statusReply.language;
|
|
||||||
}
|
|
||||||
//StatusDraftList at this point should only have one element
|
|
||||||
statusList.addAll(statusDraftList);
|
|
||||||
composeAdapter = new ComposeAdapter(statusList, statusCount, account, accountMention, visibility, editMessageId);
|
|
||||||
composeAdapter.manageDrafts = this;
|
|
||||||
composeAdapter.promptDraftListener = this;
|
|
||||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(ComposeActivity.this);
|
|
||||||
binding.recyclerView.setLayoutManager(mLayoutManager);
|
|
||||||
binding.recyclerView.setAdapter(composeAdapter);
|
|
||||||
statusesVM.getContext(currentInstance, BaseMainActivity.currentToken, statusReply.id)
|
|
||||||
.observe(ComposeActivity.this, this::initializeContextView);
|
|
||||||
} else if (statusQuoted != null) {
|
|
||||||
statusList.add(statusQuoted);
|
|
||||||
int statusCount = statusList.size();
|
|
||||||
statusDraftList.get(0).quote_id = statusQuoted.id;
|
|
||||||
//StatusDraftList at this point should only have one element
|
|
||||||
statusList.addAll(statusDraftList);
|
|
||||||
composeAdapter = new ComposeAdapter(statusList, statusCount, account, accountMention, visibility, editMessageId);
|
|
||||||
composeAdapter.manageDrafts = this;
|
|
||||||
composeAdapter.promptDraftListener = this;
|
|
||||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(ComposeActivity.this);
|
|
||||||
binding.recyclerView.setLayoutManager(mLayoutManager);
|
|
||||||
binding.recyclerView.setAdapter(composeAdapter);
|
|
||||||
} else {
|
|
||||||
//Compose without replying
|
|
||||||
statusList.addAll(statusDraftList);
|
|
||||||
composeAdapter = new ComposeAdapter(statusList, 0, account, accountMention, visibility, editMessageId);
|
|
||||||
composeAdapter.manageDrafts = this;
|
|
||||||
composeAdapter.promptDraftListener = this;
|
|
||||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(ComposeActivity.this);
|
|
||||||
binding.recyclerView.setLayoutManager(mLayoutManager);
|
|
||||||
binding.recyclerView.setAdapter(composeAdapter);
|
|
||||||
if (statusMention != null) {
|
|
||||||
composeAdapter.loadMentions(statusMention);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MastodonHelper.loadPPMastodon(binding.profilePicture, account.mastodon_account);
|
|
||||||
LocalBroadcastManager.getInstance(this)
|
|
||||||
.registerReceiver(imageReceiver,
|
|
||||||
new IntentFilter(Helper.INTENT_SEND_MODIFIED_IMAGE));
|
|
||||||
|
|
||||||
if (timer != null) {
|
|
||||||
timer.scheduleAtFixedRate(new TimerTask() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (promptSaveDraft) {
|
|
||||||
storeDraft(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 0, 10000);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sharedAttachments != null && sharedAttachments.size() > 0) {
|
|
||||||
for (Attachment attachment : sharedAttachments) {
|
|
||||||
composeAdapter.addAttachment(-1, attachment);
|
|
||||||
}
|
|
||||||
} /*else if (sharedUri != null && !sharedUri.toString().startsWith("http")) {
|
|
||||||
List<Uri> uris = new ArrayList<>();
|
|
||||||
uris.add(sharedUri);
|
|
||||||
Helper.createAttachmentFromUri(ComposeActivity.this, uris, attachments -> {
|
|
||||||
for(Attachment attachment: attachments) {
|
|
||||||
composeAdapter.addAttachment(-1, attachment);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} */ else if (shareURL != null) {
|
|
||||||
|
|
||||||
Helper.download(ComposeActivity.this, sharedUrlMedia, new OnDownloadInterface() {
|
|
||||||
@Override
|
|
||||||
public void onDownloaded(String saveFilePath, String downloadUrl, Error error) {
|
|
||||||
|
|
||||||
composeAdapter.addSharing(shareURL, sharedTitle, sharedDescription, sharedSubject, sharedContent, saveFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpdateProgress(int progress) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (composeAdapter != null) {
|
|
||||||
composeAdapter.addSharing(null, null, sharedDescription, null, sharedContent, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemDraftAdded(int position) {
|
|
||||||
Status status = new Status();
|
|
||||||
|
|
||||||
status.id = Helper.generateIdString();
|
|
||||||
status.mentions = statusList.get(position).mentions;
|
|
||||||
status.visibility = statusList.get(position).visibility;
|
|
||||||
final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ComposeActivity.this);
|
|
||||||
boolean unlistedReplies = sharedpreferences.getBoolean(getString(R.string.SET_UNLISTED_REPLIES), true);
|
|
||||||
if (status.visibility.equalsIgnoreCase("public") && unlistedReplies) {
|
|
||||||
status.visibility = "unlisted";
|
|
||||||
}
|
|
||||||
status.spoiler_text = statusList.get(position).spoiler_text;
|
|
||||||
status.sensitive = statusList.get(position).sensitive;
|
|
||||||
statusList.add(status);
|
|
||||||
composeAdapter.notifyItemInserted(position + 1);
|
|
||||||
binding.recyclerView.smoothScrollToPosition(position + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemDraftDeleted(Status status, int position) {
|
|
||||||
statusList.remove(status);
|
|
||||||
composeAdapter.notifyItemRemoved(position);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSubmit(StatusDraft draft) {
|
|
||||||
//Store in drafts
|
|
||||||
if (statusDraft == null) {
|
|
||||||
statusDraft = draft;
|
|
||||||
} else {
|
|
||||||
statusDraft.statusDraftList = draft.statusDraftList;
|
|
||||||
}
|
|
||||||
storeDraft(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void storeDraft(boolean sendMessage) {
|
|
||||||
storeDraft(sendMessage, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void storeDraft(boolean sendMessage, String scheduledDate) {
|
|
||||||
new Thread(() -> {
|
|
||||||
|
|
||||||
//Collect all statusCompose
|
|
||||||
List<Status> statusDrafts = new ArrayList<>();
|
|
||||||
List<Status> statusReplies = new ArrayList<>();
|
|
||||||
for (Status status : statusList) {
|
|
||||||
if (status.id == null || status.id.startsWith("@fedilab_compose_")) {
|
|
||||||
statusDrafts.add(status);
|
|
||||||
} else {
|
|
||||||
statusReplies.add(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (statusDraft == null) {
|
|
||||||
statusDraft = new StatusDraft(ComposeActivity.this);
|
|
||||||
} else {
|
|
||||||
//Draft previously and date is changed
|
|
||||||
if (statusDraft.scheduled_at != null && scheduledDate != null && statusDraft.workerUuid != null) {
|
|
||||||
WorkManager.getInstance(ComposeActivity.this).cancelWorkById(statusDraft.workerUuid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (statusReplies.size() > 0) {
|
|
||||||
statusDraft.statusReplyList = new ArrayList<>();
|
|
||||||
statusDraft.statusReplyList.addAll(statusReplies);
|
|
||||||
}
|
|
||||||
if (statusDrafts.size() > 0) {
|
|
||||||
statusDraft.statusDraftList = new ArrayList<>();
|
|
||||||
statusDraft.statusDraftList.addAll(statusDrafts);
|
|
||||||
}
|
|
||||||
if (statusDraft.instance == null) {
|
|
||||||
statusDraft.instance = account.instance;
|
|
||||||
}
|
|
||||||
if (statusDraft.user_id == null) {
|
|
||||||
statusDraft.user_id = account.user_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!canBeSent(statusDraft)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (statusDraft.id > 0) {
|
|
||||||
try {
|
|
||||||
new StatusDraft(ComposeActivity.this).updateStatusDraft(statusDraft);
|
|
||||||
} catch (DBException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
statusDraft.id = new StatusDraft(ComposeActivity.this).insertStatusDraft(statusDraft);
|
|
||||||
} catch (DBException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Only one single message scheduled
|
|
||||||
if (sendMessage && scheduledDate != null && statusDraft.statusDraftList.size() > 1) {
|
|
||||||
//Schedule a thread
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat(Helper.SCHEDULE_DATE_FORMAT, Locale.getDefault());
|
|
||||||
Date date;
|
|
||||||
try {
|
|
||||||
date = sdf.parse(scheduledDate);
|
|
||||||
long delayToPass = 0;
|
|
||||||
if (date != null) {
|
|
||||||
delayToPass = (date.getTime() - new Date().getTime());
|
|
||||||
}
|
|
||||||
Data inputData = new Data.Builder()
|
|
||||||
.putString(Helper.ARG_INSTANCE, currentInstance)
|
|
||||||
.putString(Helper.ARG_TOKEN, BaseMainActivity.currentToken)
|
|
||||||
.putString(Helper.ARG_USER_ID, BaseMainActivity.currentUserID)
|
|
||||||
.putLong(Helper.ARG_STATUS_DRAFT_ID, statusDraft.id)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
OneTimeWorkRequest oneTimeWorkRequest = new OneTimeWorkRequest.Builder(ScheduleThreadWorker.class)
|
|
||||||
.setInputData(inputData)
|
|
||||||
.addTag(Helper.WORKER_SCHEDULED_STATUSES)
|
|
||||||
.setInitialDelay(delayToPass, TimeUnit.MILLISECONDS)
|
|
||||||
.build();
|
|
||||||
WorkManager.getInstance(ComposeActivity.this).enqueue(oneTimeWorkRequest);
|
|
||||||
statusDraft.workerUuid = oneTimeWorkRequest.getId();
|
|
||||||
statusDraft.scheduled_at = date;
|
|
||||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
|
||||||
Runnable myRunnable = () -> {
|
|
||||||
Toasty.info(ComposeActivity.this, getString(R.string.toot_scheduled), Toasty.LENGTH_LONG).show();
|
|
||||||
finish();
|
|
||||||
};
|
|
||||||
mainHandler.post(myRunnable);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (sendMessage) {
|
|
||||||
int mediaCount = 0;
|
|
||||||
for (Status status : statusDraft.statusDraftList) {
|
|
||||||
mediaCount += status.media_attachments != null ? status.media_attachments.size() : 0;
|
|
||||||
}
|
|
||||||
if (mediaCount > 0) {
|
|
||||||
Data inputData = new Data.Builder()
|
|
||||||
.putString(Helper.ARG_STATUS_DRAFT_ID, String.valueOf(statusDraft.id))
|
|
||||||
.putString(Helper.ARG_INSTANCE, instance)
|
|
||||||
.putString(Helper.ARG_TOKEN, token)
|
|
||||||
.putString(Helper.ARG_EDIT_STATUS_ID, editMessageId)
|
|
||||||
.putString(Helper.ARG_USER_ID, account.user_id)
|
|
||||||
.putString(Helper.ARG_SCHEDULED_DATE, scheduledDate).build();
|
|
||||||
OneTimeWorkRequest request = new OneTimeWorkRequest.Builder(ComposeWorker.class)
|
|
||||||
.setInputData(inputData)
|
|
||||||
.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST)
|
|
||||||
.build();
|
|
||||||
WorkManager.getInstance(ComposeActivity.this).enqueue(request);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
new ThreadMessageService(ComposeActivity.this, instance, account.user_id, token, statusDraft, scheduledDate, editMessageId);
|
|
||||||
}
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private boolean canBeSent(StatusDraft statusDraft) {
|
|
||||||
if (statusDraft == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
List<Status> statuses = statusDraft.statusDraftList;
|
|
||||||
if (statuses == null || statuses.size() == 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Status statusCheck = statuses.get(0);
|
|
||||||
if (statusCheck == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (statusCheck.text != null && statusCheck.text.trim().length() != 0)
|
|
||||||
|| (statusCheck.media_attachments != null && statusCheck.media_attachments.size() != 0)
|
|
||||||
|| statusCheck.poll != null
|
|
||||||
|| (statusCheck.spoiler_text != null && statusCheck.spoiler_text.trim().length() != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onContactClick(boolean isChecked, String acct) {
|
|
||||||
composeAdapter.updateContent(isChecked, acct);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void promptDraft() {
|
|
||||||
promptSaveDraft = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public enum mediaType {
|
|
||||||
PHOTO,
|
|
||||||
VIDEO,
|
|
||||||
AUDIO,
|
|
||||||
ALL
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,239 +0,0 @@
|
||||||
package app.fedilab.android.activities;
|
|
||||||
/* Copyright 2021 Thomas Schneider
|
|
||||||
*
|
|
||||||
* This file is a part of Fedilab
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
|
||||||
* see <http://www.gnu.org/licenses>. */
|
|
||||||
|
|
||||||
|
|
||||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
|
||||||
import static app.fedilab.android.ui.drawer.StatusAdapter.sendAction;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Looper;
|
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import app.fedilab.android.BaseMainActivity;
|
|
||||||
import app.fedilab.android.R;
|
|
||||||
import app.fedilab.android.client.entities.api.Status;
|
|
||||||
import app.fedilab.android.client.entities.app.StatusCache;
|
|
||||||
import app.fedilab.android.databinding.ActivityConversationBinding;
|
|
||||||
import app.fedilab.android.exception.DBException;
|
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonContext;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.StatusesVM;
|
|
||||||
import es.dmoral.toasty.Toasty;
|
|
||||||
|
|
||||||
public class ContextActivity extends BaseActivity implements FragmentMastodonContext.FirstMessage {
|
|
||||||
|
|
||||||
public static boolean expand;
|
|
||||||
public static boolean displayCW;
|
|
||||||
public static Resources.Theme theme;
|
|
||||||
Fragment currentFragment;
|
|
||||||
private Status firstMessage;
|
|
||||||
private String remote_instance;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
ActivityConversationBinding binding = ActivityConversationBinding.inflate(getLayoutInflater());
|
|
||||||
setContentView(binding.getRoot());
|
|
||||||
setSupportActionBar(binding.toolbar);
|
|
||||||
ActionBar actionBar = getSupportActionBar();
|
|
||||||
//Remove title
|
|
||||||
if (actionBar != null) {
|
|
||||||
actionBar.setDisplayShowTitleEnabled(false);
|
|
||||||
}
|
|
||||||
binding.title.setText(R.string.context_conversation);
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
|
|
||||||
binding.title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18 * 1.1f / scale);
|
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
|
||||||
}
|
|
||||||
Bundle b = getIntent().getExtras();
|
|
||||||
displayCW = sharedpreferences.getBoolean(getString(R.string.SET_EXPAND_CW), false);
|
|
||||||
Status focusedStatus = null; // or other values
|
|
||||||
if (b != null) {
|
|
||||||
focusedStatus = (Status) b.getSerializable(Helper.ARG_STATUS);
|
|
||||||
remote_instance = b.getString(Helper.ARG_REMOTE_INSTANCE, null);
|
|
||||||
}
|
|
||||||
if (focusedStatus == null || currentAccount == null || currentAccount.mastodon_account == null) {
|
|
||||||
finish();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MastodonHelper.loadPPMastodon(binding.profilePicture, currentAccount.mastodon_account);
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putSerializable(Helper.ARG_STATUS, focusedStatus);
|
|
||||||
bundle.putString(Helper.ARG_REMOTE_INSTANCE, remote_instance);
|
|
||||||
FragmentMastodonContext fragmentMastodonContext = new FragmentMastodonContext();
|
|
||||||
fragmentMastodonContext.firstMessage = this;
|
|
||||||
currentFragment = Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_content_main, fragmentMastodonContext, bundle, null, null);
|
|
||||||
if (remote_instance == null) {
|
|
||||||
StatusesVM timelinesVM = new ViewModelProvider(ContextActivity.this).get(StatusesVM.class);
|
|
||||||
timelinesVM.getStatus(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, focusedStatus.id).observe(ContextActivity.this, status -> {
|
|
||||||
if (status != null) {
|
|
||||||
StatusCache statusCache = new StatusCache();
|
|
||||||
statusCache.instance = BaseMainActivity.currentInstance;
|
|
||||||
statusCache.user_id = BaseMainActivity.currentUserID;
|
|
||||||
statusCache.status = status;
|
|
||||||
statusCache.status_id = status.id;
|
|
||||||
//Update cache
|
|
||||||
new Thread(() -> {
|
|
||||||
try {
|
|
||||||
new StatusCache(getApplication()).updateIfExists(statusCache);
|
|
||||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
|
||||||
//Update UI
|
|
||||||
Runnable myRunnable = () -> sendAction(ContextActivity.this, Helper.ARG_STATUS_ACTION, status, null);
|
|
||||||
mainHandler.post(myRunnable);
|
|
||||||
} catch (DBException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
|
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
|
||||||
getMenuInflater().inflate(R.menu.menu_context, menu);
|
|
||||||
MenuItem itemExpand = menu.findItem(R.id.action_expand);
|
|
||||||
if (expand) {
|
|
||||||
itemExpand.setIcon(R.drawable.ic_baseline_expand_less_24);
|
|
||||||
} else {
|
|
||||||
itemExpand.setIcon(R.drawable.ic_baseline_expand_more_24);
|
|
||||||
}
|
|
||||||
MenuItem itemDisplayCW = menu.findItem(R.id.action_show_cw);
|
|
||||||
if (displayCW) {
|
|
||||||
itemDisplayCW.setIcon(R.drawable.ic_baseline_remove_red_eye_24);
|
|
||||||
} else {
|
|
||||||
itemDisplayCW.setIcon(R.drawable.ic_outline_remove_red_eye_24);
|
|
||||||
}
|
|
||||||
MenuItem action_remote = menu.findItem(R.id.action_remote);
|
|
||||||
if (remote_instance != null) {
|
|
||||||
action_remote.setVisible(false);
|
|
||||||
} else {
|
|
||||||
if (firstMessage != null && !firstMessage.visibility.equalsIgnoreCase("direct") && !firstMessage.visibility.equalsIgnoreCase("private")) {
|
|
||||||
Pattern pattern = Helper.statusIdInUrl;
|
|
||||||
Matcher matcher = pattern.matcher(firstMessage.uri);
|
|
||||||
action_remote.setVisible(matcher.find());
|
|
||||||
} else {
|
|
||||||
action_remote.setVisible(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCurrentFragment(FragmentMastodonContext fragmentMastodonContext) {
|
|
||||||
currentFragment = fragmentMastodonContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
finish();
|
|
||||||
return true;
|
|
||||||
} else if (item.getItemId() == R.id.action_expand) {
|
|
||||||
expand = !expand;
|
|
||||||
if (currentFragment != null && currentFragment instanceof FragmentMastodonContext) {
|
|
||||||
((FragmentMastodonContext) currentFragment).redraw();
|
|
||||||
}
|
|
||||||
invalidateOptionsMenu();
|
|
||||||
} else if (item.getItemId() == R.id.action_show_cw) {
|
|
||||||
displayCW = !displayCW;
|
|
||||||
if (currentFragment != null && currentFragment instanceof FragmentMastodonContext) {
|
|
||||||
((FragmentMastodonContext) currentFragment).refresh();
|
|
||||||
}
|
|
||||||
invalidateOptionsMenu();
|
|
||||||
} else if (item.getItemId() == R.id.action_remote) {
|
|
||||||
|
|
||||||
if (firstMessage == null) {
|
|
||||||
Toasty.warning(ContextActivity.this, getString(R.string.toast_try_later), Toasty.LENGTH_SHORT).show();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (firstMessage.account.acct != null) {
|
|
||||||
String instance = null;
|
|
||||||
try {
|
|
||||||
URL url = new URL(firstMessage.uri);
|
|
||||||
instance = url.getHost();
|
|
||||||
} catch (MalformedURLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (instance == null) {
|
|
||||||
Toasty.info(ContextActivity.this, getString(R.string.toast_error_fetch_message), Toasty.LENGTH_SHORT).show();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (instance.equalsIgnoreCase(MainActivity.currentInstance)) {
|
|
||||||
Toasty.info(ContextActivity.this, getString(R.string.toast_on_your_instance), Toasty.LENGTH_SHORT).show();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
Pattern pattern = Helper.statusIdInUrl;
|
|
||||||
Matcher matcher = pattern.matcher(firstMessage.uri);
|
|
||||||
String remoteId = null;
|
|
||||||
if (matcher.find()) {
|
|
||||||
remoteId = matcher.group(1);
|
|
||||||
}
|
|
||||||
if (remoteId != null) {
|
|
||||||
StatusesVM statusesVM = new ViewModelProvider(ContextActivity.this).get(StatusesVM.class);
|
|
||||||
String finalInstance = instance;
|
|
||||||
statusesVM.getStatus(instance, null, remoteId).observe(ContextActivity.this, status -> {
|
|
||||||
if (status != null) {
|
|
||||||
Intent intentContext = new Intent(ContextActivity.this, ContextActivity.class);
|
|
||||||
intentContext.putExtra(Helper.ARG_STATUS, status);
|
|
||||||
intentContext.putExtra(Helper.ARG_REMOTE_INSTANCE, finalInstance);
|
|
||||||
intentContext.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
startActivity(intentContext);
|
|
||||||
} else {
|
|
||||||
Toasty.warning(ContextActivity.this, getString(R.string.toast_error_fetch_message), Toasty.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Toasty.warning(ContextActivity.this, getString(R.string.toast_error_fetch_message), Toasty.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Toasty.warning(ContextActivity.this, getString(R.string.toast_error_fetch_message), Toasty.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void get(Status status) {
|
|
||||||
firstMessage = status;
|
|
||||||
invalidateOptionsMenu();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,173 +0,0 @@
|
||||||
package app.fedilab.android.activities;
|
|
||||||
/* Copyright 2022 Thomas Schneider
|
|
||||||
*
|
|
||||||
* This file is a part of Fedilab
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
|
||||||
* see <http://www.gnu.org/licenses>. */
|
|
||||||
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.text.Html;
|
|
||||||
import android.text.SpannableString;
|
|
||||||
import android.text.Spanned;
|
|
||||||
import android.text.style.ForegroundColorSpan;
|
|
||||||
import android.text.style.UnderlineSpan;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
|
||||||
import com.bumptech.glide.request.target.CustomTarget;
|
|
||||||
import com.bumptech.glide.request.transition.Transition;
|
|
||||||
|
|
||||||
import app.fedilab.android.BaseMainActivity;
|
|
||||||
import app.fedilab.android.R;
|
|
||||||
import app.fedilab.android.client.entities.api.Instance;
|
|
||||||
import app.fedilab.android.databinding.ActivityInstanceBinding;
|
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.InstancesVM;
|
|
||||||
|
|
||||||
|
|
||||||
public class InstanceActivity extends BaseAlertDialogActivity {
|
|
||||||
|
|
||||||
|
|
||||||
ActivityInstanceBinding binding;
|
|
||||||
private boolean applyMaxChar = false;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
binding = ActivityInstanceBinding.inflate(getLayoutInflater());
|
|
||||||
|
|
||||||
setContentView(binding.getRoot());
|
|
||||||
|
|
||||||
getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
||||||
if (getSupportActionBar() != null)
|
|
||||||
getSupportActionBar().hide();
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(InstanceActivity.this);
|
|
||||||
|
|
||||||
|
|
||||||
final SpannableString contentAbout = new SpannableString(getString(R.string.action_about_instance));
|
|
||||||
contentAbout.setSpan(new UnderlineSpan(), 0, contentAbout.length(), 0);
|
|
||||||
contentAbout.setSpan(new ForegroundColorSpan(ThemeHelper.getAttColor(this, R.attr.colorPrimary)), 0, contentAbout.length(),
|
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
|
||||||
binding.tos.setText(contentAbout);
|
|
||||||
|
|
||||||
final SpannableString contentPrivacy = new SpannableString(getString(R.string.action_privacy_policy));
|
|
||||||
contentPrivacy.setSpan(new UnderlineSpan(), 0, contentPrivacy.length(), 0);
|
|
||||||
contentPrivacy.setSpan(new ForegroundColorSpan(ThemeHelper.getAttColor(this, R.attr.colorPrimary)), 0, contentPrivacy.length(),
|
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
|
||||||
binding.privacy.setText(contentPrivacy);
|
|
||||||
|
|
||||||
binding.tos.setOnClickListener(v -> Helper.openBrowser(InstanceActivity.this, "https://" + MainActivity.currentInstance + "/about"));
|
|
||||||
binding.privacy.setOnClickListener(v -> Helper.openBrowser(InstanceActivity.this, "https://" + MainActivity.currentInstance + "/privacy-policy"));
|
|
||||||
binding.close.setOnClickListener(
|
|
||||||
|
|
||||||
view -> {
|
|
||||||
if (applyMaxChar) {
|
|
||||||
String max_char = binding.maxChar.getText().toString();
|
|
||||||
|
|
||||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
|
||||||
if (!max_char.isEmpty()) {
|
|
||||||
try {
|
|
||||||
editor.putInt(getString(R.string.SET_MAX_INSTANCE_CHAR) + MainActivity.currentInstance, Integer.parseInt(max_char));
|
|
||||||
editor.apply();
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
InstancesVM instancesVM = new ViewModelProvider(InstanceActivity.this).get(InstancesVM.class);
|
|
||||||
instancesVM.getInstance(BaseMainActivity.currentInstance).observe(InstanceActivity.this, instanceInfo -> {
|
|
||||||
binding.instanceContainer.setVisibility(View.VISIBLE);
|
|
||||||
binding.loader.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
if (instanceInfo == null || instanceInfo.info == null || instanceInfo.info.description == null) {
|
|
||||||
binding.maxCharContainer.setVisibility(View.VISIBLE);
|
|
||||||
binding.instanceContainer.setVisibility(View.GONE);
|
|
||||||
binding.instanceContact.setVisibility(View.GONE);
|
|
||||||
int val = sharedpreferences.getInt(getString(R.string.SET_MAX_INSTANCE_CHAR) + MainActivity.currentInstance, -1);
|
|
||||||
if (val != -1) {
|
|
||||||
binding.maxChar.setText(String.valueOf(val));
|
|
||||||
}
|
|
||||||
applyMaxChar = true;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Instance instance = instanceInfo.info;
|
|
||||||
binding.instanceTitle.setText(instance.title);
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
|
||||||
binding.instanceDescription.setText(Html.fromHtml(instance.description, Html.FROM_HTML_MODE_LEGACY));
|
|
||||||
else
|
|
||||||
binding.instanceDescription.setText(Html.fromHtml(instance.description));
|
|
||||||
if (instance.description == null || instance.description.trim().length() == 0)
|
|
||||||
binding.instanceDescription.setText(getString(R.string.instance_no_description));
|
|
||||||
binding.instanceVersion.setText(instance.version);
|
|
||||||
binding.instanceUri.setText(instance.uri);
|
|
||||||
if (instance.email == null) {
|
|
||||||
binding.instanceContact.hide();
|
|
||||||
}
|
|
||||||
Glide.with(InstanceActivity.this)
|
|
||||||
.asDrawable()
|
|
||||||
.load(instance.thumbnail)
|
|
||||||
.into(new CustomTarget<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
|
||||||
binding.background.setAlpha(0.2f);
|
|
||||||
binding.background.setBackground(resource);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
binding.instanceContact.setOnClickListener(v -> {
|
|
||||||
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", instance.email, null));
|
|
||||||
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "[Mastodon] - " + instance.uri);
|
|
||||||
startActivity(Intent.createChooser(emailIntent, getString(R.string.send_email)));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
finish();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,118 +0,0 @@
|
||||||
package app.fedilab.android.activities;
|
|
||||||
/* Copyright 2022 Thomas Schneider
|
|
||||||
*
|
|
||||||
* This file is a part of Fedilab
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
|
||||||
* see <http://www.gnu.org/licenses>. */
|
|
||||||
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.text.SpannableString;
|
|
||||||
import android.text.style.UnderlineSpan;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
|
||||||
|
|
||||||
import app.fedilab.android.BaseMainActivity;
|
|
||||||
import app.fedilab.android.R;
|
|
||||||
import app.fedilab.android.client.entities.app.InstanceSocial;
|
|
||||||
import app.fedilab.android.databinding.ActivityInstanceSocialBinding;
|
|
||||||
import app.fedilab.android.helper.Helper;
|
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.InstanceSocialVM;
|
|
||||||
|
|
||||||
|
|
||||||
public class InstanceHealthActivity extends BaseAlertDialogActivity {
|
|
||||||
|
|
||||||
private ActivityInstanceSocialBinding binding;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
binding = ActivityInstanceSocialBinding.inflate(getLayoutInflater());
|
|
||||||
|
|
||||||
setContentView(binding.getRoot());
|
|
||||||
getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
||||||
if (getSupportActionBar() != null)
|
|
||||||
getSupportActionBar().hide();
|
|
||||||
|
|
||||||
binding.close.setOnClickListener(view -> finish());
|
|
||||||
|
|
||||||
SpannableString content = new SpannableString(binding.refInstance.getText().toString());
|
|
||||||
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
|
|
||||||
binding.refInstance.setText(content);
|
|
||||||
binding.refInstance.setOnClickListener(view -> {
|
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://instances.social"));
|
|
||||||
startActivity(browserIntent);
|
|
||||||
});
|
|
||||||
|
|
||||||
checkInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
finish();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void checkInstance() {
|
|
||||||
|
|
||||||
|
|
||||||
InstanceSocialVM instanceSocialVM = new ViewModelProvider(InstanceHealthActivity.this).get(InstanceSocialVM.class);
|
|
||||||
instanceSocialVM.getInstances(BaseMainActivity.currentInstance.trim()).observe(InstanceHealthActivity.this, instanceSocialList -> {
|
|
||||||
if (instanceSocialList != null && instanceSocialList.instances.size() > 0) {
|
|
||||||
InstanceSocial.Instance instanceSocial = instanceSocialList.instances.get(0);
|
|
||||||
for (InstanceSocial.Instance instance : instanceSocialList.instances) {
|
|
||||||
if (instance.name.equalsIgnoreCase(BaseMainActivity.currentInstance.trim())) {
|
|
||||||
instanceSocial = instance;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (instanceSocial.thumbnail != null && !instanceSocial.thumbnail.equals("null"))
|
|
||||||
Glide.with(InstanceHealthActivity.this)
|
|
||||||
.asBitmap()
|
|
||||||
.load(instanceSocial.thumbnail)
|
|
||||||
.into(binding.backGroundImage);
|
|
||||||
binding.name.setText(instanceSocial.name);
|
|
||||||
if (instanceSocial.up) {
|
|
||||||
binding.up.setText(R.string.is_up);
|
|
||||||
binding.up.setTextColor(ThemeHelper.getAttColor(this, R.attr.colorPrimary));
|
|
||||||
} else {
|
|
||||||
binding.up.setText(R.string.is_down);
|
|
||||||
binding.up.setTextColor(ThemeHelper.getAttColor(this, R.attr.colorError));
|
|
||||||
}
|
|
||||||
binding.uptime.setText(getString(R.string.instance_health_uptime, (instanceSocial.uptime * 100)));
|
|
||||||
if (instanceSocial.checked_at != null)
|
|
||||||
binding.checkedAt.setText(getString(R.string.instance_health_checkedat, Helper.dateToString(instanceSocial.checked_at)));
|
|
||||||
binding.values.setText(getString(R.string.instance_health_indication, instanceSocial.version, Helper.withSuffix(instanceSocial.active_users), Helper.withSuffix(instanceSocial.statuses)));
|
|
||||||
binding.instanceContainer.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
binding.instanceContainer.setVisibility(View.VISIBLE);
|
|
||||||
binding.mainContainer.setVisibility(View.GONE);
|
|
||||||
binding.noInstance.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
binding.loader.setVisibility(View.GONE);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -15,8 +15,7 @@ package app.fedilab.android.activities;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
import static app.fedilab.android.helper.Helper.PREF_USER_TOKEN;
|
import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_SOFTWARE;
|
||||||
import static app.fedilab.android.helper.MastodonHelper.REDIRECT_CONTENT_WEB;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
@ -39,13 +38,16 @@ import java.util.regex.Matcher;
|
||||||
|
|
||||||
import app.fedilab.android.BaseMainActivity;
|
import app.fedilab.android.BaseMainActivity;
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.app.Account;
|
import app.fedilab.android.mastodon.activities.BaseActivity;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.mastodon.activities.ProxyActivity;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.mastodon.client.entities.app.Account;
|
||||||
import app.fedilab.android.ui.fragment.login.FragmentLoginMain;
|
import app.fedilab.android.mastodon.exception.DBException;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
import app.fedilab.android.mastodon.helper.Helper;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
import app.fedilab.android.mastodon.helper.MastodonHelper;
|
||||||
import app.fedilab.android.viewmodel.mastodon.OauthVM;
|
import app.fedilab.android.mastodon.viewmodel.mastodon.AccountsVM;
|
||||||
|
import app.fedilab.android.mastodon.viewmodel.mastodon.AdminVM;
|
||||||
|
import app.fedilab.android.mastodon.viewmodel.mastodon.OauthVM;
|
||||||
|
import app.fedilab.android.ui.fragment.FragmentLoginMain;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +71,8 @@ public class LoginActivity extends BaseActivity {
|
||||||
BaseMainActivity.api = Account.API.MASTODON;
|
BaseMainActivity.api = Account.API.MASTODON;
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||||
editor.putString(PREF_USER_TOKEN, account.token);
|
editor.putString(Helper.PREF_USER_TOKEN, account.token);
|
||||||
|
editor.putString(PREF_USER_SOFTWARE, BaseMainActivity.api.name());
|
||||||
editor.commit();
|
editor.commit();
|
||||||
//The user is now authenticated, it will be redirected to MainActivity
|
//The user is now authenticated, it will be redirected to MainActivity
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
|
@ -86,7 +89,7 @@ public class LoginActivity extends BaseActivity {
|
||||||
|
|
||||||
private void manageItent(Intent intent) {
|
private void manageItent(Intent intent) {
|
||||||
|
|
||||||
if (intent != null && intent.getData() != null && intent.getData().toString().contains(REDIRECT_CONTENT_WEB + "?code=")) {
|
if (intent != null && intent.getData() != null && intent.getData().toString().contains(MastodonHelper.REDIRECT_CONTENT_WEB + "?code=")) {
|
||||||
String url = intent.getData().toString();
|
String url = intent.getData().toString();
|
||||||
Matcher matcher = Helper.codePattern.matcher(url);
|
Matcher matcher = Helper.codePattern.matcher(url);
|
||||||
if (!matcher.find()) {
|
if (!matcher.find()) {
|
||||||
|
@ -147,7 +150,6 @@ public class LoginActivity extends BaseActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(LoginActivity.this);
|
|
||||||
setContentView(new FrameLayout(this));
|
setContentView(new FrameLayout(this));
|
||||||
FragmentLoginMain fragmentLoginMain = new FragmentLoginMain();
|
FragmentLoginMain fragmentLoginMain = new FragmentLoginMain();
|
||||||
Helper.addFragment(getSupportFragmentManager(), android.R.id.content, fragmentLoginMain, null, null, null);
|
Helper.addFragment(getSupportFragmentManager(), android.R.id.content, fragmentLoginMain, null, null, null);
|
||||||
|
@ -179,8 +181,7 @@ public class LoginActivity extends BaseActivity {
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
if (id == R.id.action_proxy) {
|
if (id == R.id.action_proxy) {
|
||||||
Intent intent = new Intent(LoginActivity.this, ProxyActivity.class);
|
(new ProxyActivity()).show(getSupportFragmentManager(), null);
|
||||||
startActivity(intent);
|
|
||||||
} else if (id == R.id.action_request_admin) {
|
} else if (id == R.id.action_request_admin) {
|
||||||
item.setChecked(!item.isChecked());
|
item.setChecked(!item.isChecked());
|
||||||
requestedAdmin = item.isChecked();
|
requestedAdmin = item.isChecked();
|
||||||
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
package app.fedilab.android.activities;
|
||||||
|
/* Copyright 2025 Thomas Schneider
|
||||||
|
*
|
||||||
|
* This file is a part of Fedilab
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||||
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import app.fedilab.android.mastodon.activities.ProfileActivity;
|
||||||
|
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
|
||||||
|
import app.fedilab.android.mastodon.helper.Helper;
|
||||||
|
|
||||||
|
|
||||||
|
public class WebActivityPub extends AppCompatActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
Intent appIntent = getIntent();
|
||||||
|
String acct = null;
|
||||||
|
String intent = null;
|
||||||
|
if(appIntent == null) {
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Uri uri = appIntent.getData();
|
||||||
|
if(uri == null) {
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String scheme = uri.getScheme();
|
||||||
|
String uriString = uri.toString();
|
||||||
|
if(!uriString.startsWith(scheme+"://")) {
|
||||||
|
uriString = uri.toString().replace(scheme+":",scheme+"://");
|
||||||
|
uri = Uri.parse(uriString);
|
||||||
|
if(uri == null) {
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String host = uri.getHost();
|
||||||
|
String path = uri.getPath();
|
||||||
|
String query = uri.getQuery();
|
||||||
|
|
||||||
|
if(path == null || path.isEmpty()) {
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(query != null) {
|
||||||
|
String intentPatternString = "intent=(\\w+)";
|
||||||
|
final Pattern intentPattern = Pattern.compile(intentPatternString, Pattern.CASE_INSENSITIVE);
|
||||||
|
Matcher matcherIntent = intentPattern.matcher(query);
|
||||||
|
while (matcherIntent.find()) {
|
||||||
|
intent = matcherIntent.group(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(path.startsWith("/@")) {
|
||||||
|
String[] params = path.split("@");
|
||||||
|
if(params.length == 2) {
|
||||||
|
acct = params[1] + "@" + host;
|
||||||
|
}
|
||||||
|
} else if(path.split("/").length > 2) {
|
||||||
|
String[] params = path.split("/");
|
||||||
|
String root = params[1].toLowerCase();
|
||||||
|
if (root.equals("users")) {
|
||||||
|
acct = params[2] + "@" + host;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(acct != null) {
|
||||||
|
Intent intentProfile = new Intent(WebActivityPub.this, ProfileActivity.class);
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putString(Helper.ARG_MENTION, acct);
|
||||||
|
new CachedBundle(WebActivityPub.this).insertBundle(args, Helper.getCurrentAccount(WebActivityPub.this), bundleId -> {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
|
||||||
|
intentProfile.putExtras(bundle);
|
||||||
|
intentProfile.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
startActivity(intentProfile);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,289 +0,0 @@
|
||||||
package app.fedilab.android.helper;
|
|
||||||
/* Copyright 2022 Thomas Schneider
|
|
||||||
*
|
|
||||||
* This file is a part of Fedilab
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
|
||||||
* see <http://www.gnu.org/licenses>. */
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.util.Base64;
|
|
||||||
|
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import org.spongycastle.asn1.ASN1ObjectIdentifier;
|
|
||||||
import org.spongycastle.asn1.x9.ECNamedCurveTable;
|
|
||||||
import org.spongycastle.asn1.x9.X9ECParameters;
|
|
||||||
import org.spongycastle.crypto.params.ECNamedDomainParameters;
|
|
||||||
import org.spongycastle.crypto.params.ECPrivateKeyParameters;
|
|
||||||
import org.spongycastle.crypto.params.ECPublicKeyParameters;
|
|
||||||
import org.spongycastle.jce.spec.ECNamedCurveSpec;
|
|
||||||
import org.spongycastle.jce.spec.ECParameterSpec;
|
|
||||||
import org.spongycastle.jce.spec.ECPrivateKeySpec;
|
|
||||||
import org.spongycastle.jce.spec.ECPublicKeySpec;
|
|
||||||
import org.spongycastle.math.ec.ECCurve;
|
|
||||||
import org.spongycastle.math.ec.ECPoint;
|
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.security.KeyFactory;
|
|
||||||
import java.security.KeyPair;
|
|
||||||
import java.security.KeyPairGenerator;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.security.NoSuchProviderException;
|
|
||||||
import java.security.PrivateKey;
|
|
||||||
import java.security.PublicKey;
|
|
||||||
import java.security.Security;
|
|
||||||
import java.security.interfaces.ECPublicKey;
|
|
||||||
import java.security.spec.ECGenParameterSpec;
|
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.KeyAgreement;
|
|
||||||
|
|
||||||
|
|
||||||
public class ECDH {
|
|
||||||
|
|
||||||
|
|
||||||
public static final String kp_public = "kp_public";
|
|
||||||
public static final String peer_public = "peer_public";
|
|
||||||
public static final String PROVIDER = org.spongycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME;
|
|
||||||
|
|
||||||
public static final String kp_private = "kp_private";
|
|
||||||
public static final String KEGEN_ALG = "ECDH";
|
|
||||||
|
|
||||||
public static final String name = "prime256v1";
|
|
||||||
|
|
||||||
private static final String kp_public_affine_x = "kp_public_affine_x";
|
|
||||||
private static final String kp_public_affine_y = "kp_public_affine_y";
|
|
||||||
|
|
||||||
private static ECDH instance;
|
|
||||||
|
|
||||||
static {
|
|
||||||
Security.addProvider(new org.spongycastle.jce.provider.BouncyCastleProvider());
|
|
||||||
}
|
|
||||||
|
|
||||||
public final KeyFactory kf;
|
|
||||||
private final KeyPairGenerator kpg;
|
|
||||||
private final String slug;
|
|
||||||
|
|
||||||
public ECDH(String slug) throws Exception {
|
|
||||||
if (slug == null) {
|
|
||||||
throw new Exception("slug cannot be null");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
kf = KeyFactory.getInstance(KEGEN_ALG, PROVIDER);
|
|
||||||
kpg = KeyPairGenerator.getInstance(KEGEN_ALG, PROVIDER);
|
|
||||||
this.slug = slug;
|
|
||||||
} catch (NoSuchAlgorithmException | NoSuchProviderException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static synchronized ECDH getInstance(String slug) throws Exception {
|
|
||||||
if (instance == null) {
|
|
||||||
instance = new ECDH(slug);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String base64Encode(byte[] b) {
|
|
||||||
return Base64.encodeToString(
|
|
||||||
b, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP);
|
|
||||||
}
|
|
||||||
|
|
||||||
static byte[] base64Decode(String str) {
|
|
||||||
return Base64.decode(str, Base64.URL_SAFE);
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized KeyPair generateKeyPair()
|
|
||||||
throws Exception {
|
|
||||||
ECGenParameterSpec ecParamSpec = new ECGenParameterSpec(name);
|
|
||||||
kpg.initialize(ecParamSpec);
|
|
||||||
|
|
||||||
return kpg.generateKeyPair();
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte[] generateSecret(PrivateKey myPrivKey, PublicKey otherPubKey) throws Exception {
|
|
||||||
KeyAgreement keyAgreement = KeyAgreement.getInstance(KEGEN_ALG);
|
|
||||||
keyAgreement.init(myPrivKey);
|
|
||||||
keyAgreement.doPhase(otherPubKey, true);
|
|
||||||
|
|
||||||
return keyAgreement.generateSecret();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
synchronized KeyPair readKeyPair(Context context)
|
|
||||||
throws Exception {
|
|
||||||
return new KeyPair(readMyPublicKey(context), readMyPrivateKey(context));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("ApplySharedPref")
|
|
||||||
public KeyPair newPair(Context context) {
|
|
||||||
SharedPreferences.Editor prefsEditor = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context).edit();
|
|
||||||
KeyPair kp;
|
|
||||||
try {
|
|
||||||
kp = generateKeyPair();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
ECPublicKey key = (ECPublicKey) kp.getPublic();
|
|
||||||
byte[] x = key.getW().getAffineX().toByteArray();
|
|
||||||
byte[] y = key.getW().getAffineY().toByteArray();
|
|
||||||
BigInteger xbi = new BigInteger(1, x);
|
|
||||||
BigInteger ybi = new BigInteger(1, y);
|
|
||||||
X9ECParameters x9 = ECNamedCurveTable.getByName(name);
|
|
||||||
ASN1ObjectIdentifier oid = ECNamedCurveTable.getOID(name);
|
|
||||||
|
|
||||||
ECCurve curve = x9.getCurve();
|
|
||||||
ECPoint point = curve.createPoint(xbi, ybi);
|
|
||||||
ECNamedDomainParameters dParams = new ECNamedDomainParameters(oid,
|
|
||||||
x9.getCurve(), x9.getG(), x9.getN(), x9.getH(), x9.getSeed());
|
|
||||||
|
|
||||||
ECPublicKeyParameters pubKey = new ECPublicKeyParameters(point, dParams);
|
|
||||||
|
|
||||||
|
|
||||||
ECPrivateKeyParameters privateKey = new ECPrivateKeyParameters(new BigInteger(kp.getPrivate().getEncoded()), pubKey.getParameters());
|
|
||||||
byte[] privateKeyBytes = privateKey.getD().toByteArray();
|
|
||||||
|
|
||||||
String keyString = base64Encode(pubKey.getQ().getEncoded(false));
|
|
||||||
String keypString = base64Encode(privateKeyBytes);
|
|
||||||
prefsEditor.putString(kp_public + slug, keyString);
|
|
||||||
prefsEditor.putString(kp_public_affine_x + slug, key.getW().getAffineX().toString());
|
|
||||||
prefsEditor.putString(kp_public_affine_y + slug, key.getW().getAffineY().toString());
|
|
||||||
prefsEditor.putString(kp_private + slug, keypString);
|
|
||||||
prefsEditor.commit();
|
|
||||||
return kp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
synchronized PublicKey readMyPublicKey(Context context) throws Exception {
|
|
||||||
|
|
||||||
X9ECParameters x9 = ECNamedCurveTable.getByName(name);
|
|
||||||
ASN1ObjectIdentifier oid = ECNamedCurveTable.getOID(name);
|
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context);
|
|
||||||
BigInteger xbi = new BigInteger(prefs.getString(kp_public_affine_x + slug, "0"));
|
|
||||||
BigInteger ybi = new BigInteger(prefs.getString(kp_public_affine_y + slug, "0"));
|
|
||||||
|
|
||||||
ECNamedDomainParameters dParams = new ECNamedDomainParameters(oid,
|
|
||||||
x9.getCurve(), x9.getG(), x9.getN(), x9.getH(), x9.getSeed());
|
|
||||||
|
|
||||||
|
|
||||||
ECNamedCurveSpec ecNamedCurveSpec = new ECNamedCurveSpec(name, dParams.getCurve(), dParams.getG(), dParams.getN());
|
|
||||||
java.security.spec.ECPoint w = new java.security.spec.ECPoint(xbi, ybi);
|
|
||||||
return kf.generatePublic(new java.security.spec.ECPublicKeySpec(w, ecNamedCurveSpec));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String uncryptMessage(Context context, String cyphered) {
|
|
||||||
byte[] privateKey = getSharedSecret(context);
|
|
||||||
try {
|
|
||||||
Cipher outCipher = Cipher.getInstance("ECIES", PROVIDER);
|
|
||||||
PrivateKey ddd = readPrivateKey(privateKey);
|
|
||||||
outCipher.init(Cipher.DECRYPT_MODE, readPrivateKey(privateKey));
|
|
||||||
byte[] plaintext = outCipher.doFinal(base64Decode(cyphered));
|
|
||||||
return new String(plaintext);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public PublicKey readPublicKey(String keyStr) throws Exception {
|
|
||||||
ECParameterSpec parameterSpec = org.spongycastle.jce.ECNamedCurveTable.getParameterSpec(name);
|
|
||||||
ECCurve curve = parameterSpec.getCurve();
|
|
||||||
ECPoint point = curve.decodePoint(base64Decode(keyStr));
|
|
||||||
ECPublicKeySpec pubSpec = new ECPublicKeySpec(point, parameterSpec);
|
|
||||||
return kf.generatePublic(pubSpec);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public PrivateKey readPrivateKey(byte[] key) throws Exception {
|
|
||||||
ECParameterSpec parameterSpec = org.spongycastle.jce.ECNamedCurveTable.getParameterSpec(name);
|
|
||||||
ECPrivateKeySpec pubSpec = new ECPrivateKeySpec(new BigInteger(1, key), parameterSpec);
|
|
||||||
return kf.generatePrivate(pubSpec);
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized PrivateKey readMyPrivateKey(Context context) throws Exception {
|
|
||||||
X9ECParameters x9 = ECNamedCurveTable.getByName(name);
|
|
||||||
ASN1ObjectIdentifier oid = ECNamedCurveTable.getOID(name);
|
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context);
|
|
||||||
BigInteger ybi = new BigInteger(prefs.getString(kp_public_affine_y + slug, "0"));
|
|
||||||
ECNamedDomainParameters dParams = new ECNamedDomainParameters(oid,
|
|
||||||
x9.getCurve(), x9.getG(), x9.getN(), x9.getH(), x9.getSeed());
|
|
||||||
ECNamedCurveSpec ecNamedCurveSpec = new ECNamedCurveSpec(name, dParams.getCurve(), dParams.getG(), dParams.getN());
|
|
||||||
return kf.generatePrivate(new java.security.spec.ECPrivateKeySpec(ybi, ecNamedCurveSpec));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private synchronized KeyPair getPair(Context context) {
|
|
||||||
SharedPreferences prefs = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context);
|
|
||||||
String strPub = prefs.getString(kp_public + slug, "");
|
|
||||||
String strPriv = prefs.getString(kp_private + slug, "");
|
|
||||||
if (strPub.trim().isEmpty() || strPriv.trim().isEmpty()) {
|
|
||||||
return newPair(context);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
return readKeyPair(context);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
PublicKey getServerKey(Context context) throws Exception {
|
|
||||||
SharedPreferences prefs = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context);
|
|
||||||
String serverKey = prefs.getString(peer_public + slug, "");
|
|
||||||
return readPublicKey(serverKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
|
||||||
public byte[] getSharedSecret(Context context) {
|
|
||||||
try {
|
|
||||||
KeyPair keyPair = getPair(context);
|
|
||||||
if (keyPair != null) {
|
|
||||||
return generateSecret(keyPair.getPrivate(), getServerKey(context));
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPublicKey(Context context) {
|
|
||||||
SharedPreferences prefs = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context);
|
|
||||||
|
|
||||||
return prefs.getString(kp_public + slug, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("ApplySharedPref")
|
|
||||||
public void saveServerKey(Context context, String strPeerPublic) {
|
|
||||||
SharedPreferences.Editor prefsEditor = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context).edit();
|
|
||||||
|
|
||||||
prefsEditor.putString(peer_public + slug, strPeerPublic);
|
|
||||||
prefsEditor.commit();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,237 +0,0 @@
|
||||||
package app.fedilab.android.helper;
|
|
||||||
/* Copyright 2022 Thomas Schneider
|
|
||||||
*
|
|
||||||
* This file is a part of Fedilab
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
|
||||||
* see <http://www.gnu.org/licenses>. */
|
|
||||||
|
|
||||||
import static app.fedilab.android.client.entities.app.StatusCache.restoreNotificationFromString;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.util.Base64;
|
|
||||||
|
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.security.InvalidAlgorithmParameterException;
|
|
||||||
import java.security.InvalidKeyException;
|
|
||||||
import java.security.KeyFactory;
|
|
||||||
import java.security.KeyPair;
|
|
||||||
import java.security.KeyPairGenerator;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.security.PrivateKey;
|
|
||||||
import java.security.PublicKey;
|
|
||||||
import java.security.SecureRandom;
|
|
||||||
import java.security.Security;
|
|
||||||
import java.security.interfaces.ECPublicKey;
|
|
||||||
import java.security.spec.ECGenParameterSpec;
|
|
||||||
import java.security.spec.ECPoint;
|
|
||||||
import java.security.spec.InvalidKeySpecException;
|
|
||||||
import java.security.spec.PKCS8EncodedKeySpec;
|
|
||||||
import java.security.spec.X509EncodedKeySpec;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.KeyAgreement;
|
|
||||||
import javax.crypto.Mac;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
import javax.crypto.spec.GCMParameterSpec;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
|
|
||||||
import app.fedilab.android.client.entities.api.Notification;
|
|
||||||
|
|
||||||
|
|
||||||
public class ECDHFedilab {
|
|
||||||
|
|
||||||
|
|
||||||
public static final String kp_public = "kp_public";
|
|
||||||
public static final String peer_public = "peer_public";
|
|
||||||
|
|
||||||
public static final String name = "prime256v1";
|
|
||||||
private static final byte[] P256_HEAD = new byte[]{(byte) 0x30, (byte) 0x59, (byte) 0x30, (byte) 0x13, (byte) 0x06, (byte) 0x07, (byte) 0x2a,
|
|
||||||
(byte) 0x86, (byte) 0x48, (byte) 0xce, (byte) 0x3d, (byte) 0x02, (byte) 0x01, (byte) 0x06, (byte) 0x08, (byte) 0x2a, (byte) 0x86,
|
|
||||||
(byte) 0x48, (byte) 0xce, (byte) 0x3d, (byte) 0x03, (byte) 0x01, (byte) 0x07, (byte) 0x03, (byte) 0x42, (byte) 0x00};
|
|
||||||
|
|
||||||
static {
|
|
||||||
Security.addProvider(new org.spongycastle.jce.provider.BouncyCastleProvider());
|
|
||||||
}
|
|
||||||
|
|
||||||
private final KeyPairGenerator kpg;
|
|
||||||
private final PublicKey publicKey;
|
|
||||||
private final String encodedPublicKey;
|
|
||||||
private final byte[] authKey;
|
|
||||||
private final String slug;
|
|
||||||
private final String pushPublicKey;
|
|
||||||
private final String encodedAuthKey;
|
|
||||||
private final String pushAccountID;
|
|
||||||
private final String pushPrivateKey;
|
|
||||||
PrivateKey privateKey;
|
|
||||||
private String pushPrivateKe;
|
|
||||||
|
|
||||||
public ECDHFedilab(Context context, String slug) throws Exception {
|
|
||||||
if (slug == null) {
|
|
||||||
throw new Exception("slug cannot be null");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
kpg = KeyPairGenerator.getInstance("EC");
|
|
||||||
ECGenParameterSpec spec = new ECGenParameterSpec("prime256v1");
|
|
||||||
kpg.initialize(spec);
|
|
||||||
KeyPair keyPair = kpg.generateKeyPair();
|
|
||||||
publicKey = keyPair.getPublic();
|
|
||||||
privateKey = keyPair.getPrivate();
|
|
||||||
encodedPublicKey = Base64.encodeToString(serializeRawPublicKey(publicKey), Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING);
|
|
||||||
authKey = new byte[16];
|
|
||||||
SecureRandom secureRandom = new SecureRandom();
|
|
||||||
secureRandom.nextBytes(authKey);
|
|
||||||
byte[] randomAccountID = new byte[16];
|
|
||||||
secureRandom.nextBytes(randomAccountID);
|
|
||||||
pushPrivateKey = Base64.encodeToString(privateKey.getEncoded(), Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING);
|
|
||||||
pushPublicKey = Base64.encodeToString(publicKey.getEncoded(), Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING);
|
|
||||||
encodedAuthKey = Base64.encodeToString(authKey, Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING);
|
|
||||||
pushAccountID = Base64.encodeToString(randomAccountID, Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING);
|
|
||||||
SharedPreferences.Editor prefsEditor = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context).edit();
|
|
||||||
prefsEditor.putString("pushPrivateKey" + slug, pushPrivateKey);
|
|
||||||
prefsEditor.putString("pushPublicKey" + slug, pushPublicKey);
|
|
||||||
prefsEditor.putString("encodedAuthKey" + slug, encodedAuthKey);
|
|
||||||
prefsEditor.putString("pushAccountID" + slug, pushAccountID);
|
|
||||||
prefsEditor.apply();
|
|
||||||
this.slug = slug;
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getServerKey(Context context, String slug) {
|
|
||||||
SharedPreferences sharedPreferences = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context);
|
|
||||||
return sharedPreferences.getString("server_key" + slug, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static byte[] serializeRawPublicKey(PublicKey key) {
|
|
||||||
ECPoint point = ((ECPublicKey) key).getW();
|
|
||||||
byte[] x = point.getAffineX().toByteArray();
|
|
||||||
byte[] y = point.getAffineY().toByteArray();
|
|
||||||
if (x.length > 32)
|
|
||||||
x = Arrays.copyOfRange(x, x.length - 32, x.length);
|
|
||||||
if (y.length > 32)
|
|
||||||
y = Arrays.copyOfRange(y, y.length - 32, y.length);
|
|
||||||
byte[] result = new byte[65];
|
|
||||||
result[0] = 4;
|
|
||||||
System.arraycopy(x, 0, result, 1 + (32 - x.length), x.length);
|
|
||||||
System.arraycopy(y, 0, result, result.length - y.length, y.length);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Notification decryptNotification(Context context, String slug, byte[] messageEncrypted) {
|
|
||||||
|
|
||||||
|
|
||||||
SharedPreferences sharedPreferences = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(context);
|
|
||||||
String pushPrivateKey = sharedPreferences.getString("pushPrivateKey" + slug, null);
|
|
||||||
String pushPublicKey = sharedPreferences.getString("pushPublicKey" + slug, null);
|
|
||||||
String encodedAuthKey = sharedPreferences.getString("encodedAuthKey" + slug, null);
|
|
||||||
sharedPreferences.getString("pushAccountID" + slug, null);
|
|
||||||
|
|
||||||
|
|
||||||
PublicKey serverKey = null;
|
|
||||||
serverKey = deserializeRawPublicKey(Base64.decode(getServerKey(context, slug), Base64.URL_SAFE));
|
|
||||||
PrivateKey privateKey;
|
|
||||||
PublicKey publicKey;
|
|
||||||
byte[] authKey;
|
|
||||||
try {
|
|
||||||
KeyFactory kf = KeyFactory.getInstance("EC");
|
|
||||||
privateKey = kf.generatePrivate(new PKCS8EncodedKeySpec(Base64.decode(pushPrivateKey, Base64.URL_SAFE)));
|
|
||||||
publicKey = kf.generatePublic(new X509EncodedKeySpec(Base64.decode(pushPublicKey, Base64.URL_SAFE)));
|
|
||||||
authKey = Base64.decode(encodedAuthKey, Base64.URL_SAFE);
|
|
||||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
byte[] sharedSecret;
|
|
||||||
try {
|
|
||||||
KeyAgreement keyAgreement = KeyAgreement.getInstance("ECDH");
|
|
||||||
keyAgreement.init(privateKey);
|
|
||||||
keyAgreement.doPhase(serverKey, true);
|
|
||||||
sharedSecret = keyAgreement.generateSecret();
|
|
||||||
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
byte[] secondSaltInfo = "Content-Encoding: auth\0".getBytes(StandardCharsets.UTF_8);
|
|
||||||
byte[] deriveKey;
|
|
||||||
try {
|
|
||||||
deriveKey = deriveKey(authKey, sharedSecret, secondSaltInfo, 32);
|
|
||||||
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
String decryptedStr;
|
|
||||||
try {
|
|
||||||
|
|
||||||
SecretKeySpec aesKey = new SecretKeySpec(deriveKey, "AES");
|
|
||||||
byte[] iv = Arrays.copyOfRange(messageEncrypted, 0, 12);
|
|
||||||
byte[] ciphertext = Arrays.copyOfRange(messageEncrypted, 12, messageEncrypted.length); // Separate ciphertext (the MAC is implicitly separated from the ciphertext)
|
|
||||||
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
|
|
||||||
GCMParameterSpec gCMParameterSpec = new GCMParameterSpec(128, iv);
|
|
||||||
cipher.init(Cipher.DECRYPT_MODE, aesKey, gCMParameterSpec);
|
|
||||||
byte[] decrypted = cipher.doFinal(ciphertext);
|
|
||||||
decryptedStr = new String(decrypted, 2, decrypted.length - 2, StandardCharsets.UTF_8);
|
|
||||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidAlgorithmParameterException | InvalidKeyException | BadPaddingException | IllegalBlockSizeException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return restoreNotificationFromString(decryptedStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static PublicKey deserializeRawPublicKey(byte[] rawBytes) {
|
|
||||||
if (rawBytes.length != 65 && rawBytes.length != 64)
|
|
||||||
return null;
|
|
||||||
try {
|
|
||||||
KeyFactory kf = KeyFactory.getInstance("EC");
|
|
||||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
||||||
os.write(P256_HEAD);
|
|
||||||
if (rawBytes.length == 64)
|
|
||||||
os.write(4);
|
|
||||||
os.write(rawBytes);
|
|
||||||
return kf.generatePublic(new X509EncodedKeySpec(os.toByteArray()));
|
|
||||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException | IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static byte[] deriveKey(byte[] firstSalt, byte[] secondSalt, byte[] info, int length) throws NoSuchAlgorithmException, InvalidKeyException {
|
|
||||||
Mac hmacContext = Mac.getInstance("HmacSHA256");
|
|
||||||
hmacContext.init(new SecretKeySpec(firstSalt, "HmacSHA256"));
|
|
||||||
byte[] hmac = hmacContext.doFinal(secondSalt);
|
|
||||||
hmacContext.init(new SecretKeySpec(hmac, "HmacSHA256"));
|
|
||||||
hmacContext.update(info);
|
|
||||||
byte[] result = hmacContext.doFinal(new byte[]{1});
|
|
||||||
return result.length <= length ? result : Arrays.copyOfRange(result, 0, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPublicKey() {
|
|
||||||
return this.encodedPublicKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAuthKey() {
|
|
||||||
return this.encodedAuthKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,755 +0,0 @@
|
||||||
package app.fedilab.android.helper;
|
|
||||||
/* Copyright 2021 Thomas Schneider
|
|
||||||
*
|
|
||||||
* This file is a part of Fedilab
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
|
||||||
* see <http://www.gnu.org/licenses>. */
|
|
||||||
|
|
||||||
|
|
||||||
import static app.fedilab.android.BaseMainActivity.currentAccount;
|
|
||||||
import static app.fedilab.android.ui.drawer.StatusAdapter.sendAction;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.ClipData;
|
|
||||||
import android.content.ClipboardManager;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.text.Html;
|
|
||||||
import android.text.Spannable;
|
|
||||||
import android.text.SpannableString;
|
|
||||||
import android.text.SpannableStringBuilder;
|
|
||||||
import android.text.Spanned;
|
|
||||||
import android.text.TextPaint;
|
|
||||||
import android.text.style.ClickableSpan;
|
|
||||||
import android.text.style.QuoteSpan;
|
|
||||||
import android.text.style.URLSpan;
|
|
||||||
import android.util.Patterns;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.webkit.URLUtil;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.lifecycle.LifecycleOwner;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
|
||||||
import androidx.lifecycle.ViewModelStoreOwner;
|
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.lang.ref.WeakReference;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
|
||||||
|
|
||||||
import app.fedilab.android.BaseMainActivity;
|
|
||||||
import app.fedilab.android.R;
|
|
||||||
import app.fedilab.android.activities.ContextActivity;
|
|
||||||
import app.fedilab.android.activities.HashTagActivity;
|
|
||||||
import app.fedilab.android.activities.MainActivity;
|
|
||||||
import app.fedilab.android.activities.ProfileActivity;
|
|
||||||
import app.fedilab.android.client.entities.api.Account;
|
|
||||||
import app.fedilab.android.client.entities.api.Announcement;
|
|
||||||
import app.fedilab.android.client.entities.api.Attachment;
|
|
||||||
import app.fedilab.android.client.entities.api.Emoji;
|
|
||||||
import app.fedilab.android.client.entities.api.Filter;
|
|
||||||
import app.fedilab.android.client.entities.api.Mention;
|
|
||||||
import app.fedilab.android.client.entities.api.Status;
|
|
||||||
import app.fedilab.android.databinding.PopupLinksBinding;
|
|
||||||
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
|
|
||||||
import es.dmoral.toasty.Toasty;
|
|
||||||
|
|
||||||
public class SpannableHelper {
|
|
||||||
|
|
||||||
public static final String CLICKABLE_SPAN = "CLICKABLE_SPAN";
|
|
||||||
private static int linkColor;
|
|
||||||
|
|
||||||
public static Spannable convert(Context context, String text,
|
|
||||||
Status status, Account account, Announcement announcement, WeakReference<View> viewWeakReference) {
|
|
||||||
return convert(context, text, status, account, announcement, viewWeakReference, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Spannable convert(Context context, String text,
|
|
||||||
Status status, Account account, Announcement announcement,
|
|
||||||
WeakReference<View> viewWeakReference, Status.Callback callback) {
|
|
||||||
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
int currentNightMode = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
|
||||||
boolean customLight = sharedpreferences.getBoolean(context.getString(R.string.SET_CUSTOMIZE_LIGHT_COLORS), false);
|
|
||||||
boolean customDark = sharedpreferences.getBoolean(context.getString(R.string.SET_CUSTOMIZE_DARK_COLORS), false);
|
|
||||||
int link_color;
|
|
||||||
if (currentNightMode == Configuration.UI_MODE_NIGHT_NO && customLight) {
|
|
||||||
link_color = sharedpreferences.getInt(context.getString(R.string.SET_LIGHT_LINK), -1);
|
|
||||||
if (link_color != -1) {
|
|
||||||
linkColor = link_color;
|
|
||||||
}
|
|
||||||
} else if (currentNightMode == Configuration.UI_MODE_NIGHT_YES && customDark) {
|
|
||||||
link_color = sharedpreferences.getInt(context.getString(R.string.SET_DARK_LINK), -1);
|
|
||||||
if (link_color != -1) {
|
|
||||||
linkColor = link_color;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
linkColor = -1;
|
|
||||||
}
|
|
||||||
if (linkColor == 0) {
|
|
||||||
linkColor = -1;
|
|
||||||
}
|
|
||||||
List<Mention> mentions = new ArrayList<>();
|
|
||||||
if (status != null && status.mentions != null) {
|
|
||||||
mentions.addAll(status.mentions);
|
|
||||||
}
|
|
||||||
text = text.replaceAll("((<\\s?p\\s?>|<\\s?br\\s?/?>)>(((?!(<\\s?br\\s?/?>|<\\s?/s?p\\s?>)).)*))", "$2<blockquote>$3</blockquote>");
|
|
||||||
text = text.trim().replaceAll("\\s{3}", " ");
|
|
||||||
text = text.trim().replaceAll("\\s{2}", " ");
|
|
||||||
SpannableString initialContent;
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
|
||||||
initialContent = new SpannableString(Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY));
|
|
||||||
else
|
|
||||||
initialContent = new SpannableString(Html.fromHtml(text));
|
|
||||||
|
|
||||||
//Get all links
|
|
||||||
SpannableStringBuilder content = new SpannableStringBuilder(initialContent);
|
|
||||||
URLSpan[] urls = content.getSpans(0, (content.length() - 1), URLSpan.class);
|
|
||||||
//Loop through links
|
|
||||||
for (URLSpan span : urls) {
|
|
||||||
String url = span.getURL();
|
|
||||||
int start = content.getSpanStart(span);
|
|
||||||
int end = content.getSpanEnd(span);
|
|
||||||
if (start < 0 || end > content.length()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
content.removeSpan(span);
|
|
||||||
//Get the matching word associated to the URL
|
|
||||||
String word = content.subSequence(start, end).toString();
|
|
||||||
if (word.startsWith("@") || word.startsWith("#")) {
|
|
||||||
content.setSpan(new LongClickableSpan() {
|
|
||||||
@Override
|
|
||||||
public void onLongClick(View textView) {
|
|
||||||
textView.setTag(CLICKABLE_SPAN);
|
|
||||||
if (word.startsWith("#") && BaseMainActivity.filterFetched && MainActivity.mainFilters != null) {
|
|
||||||
String tag = word.trim();
|
|
||||||
if (!tag.startsWith("#")) {
|
|
||||||
tag = "#" + tag;
|
|
||||||
}
|
|
||||||
Filter fedilabFilter = null;
|
|
||||||
for (Filter filter : MainActivity.mainFilters) {
|
|
||||||
if (filter.title.equals(Helper.FEDILAB_MUTED_HASHTAGS)) {
|
|
||||||
fedilabFilter = filter;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Filter for Fedilab doesn't exist we have to create it
|
|
||||||
if (fedilabFilter == null) {
|
|
||||||
Filter.FilterParams filterParams = new Filter.FilterParams();
|
|
||||||
filterParams.title = Helper.FEDILAB_MUTED_HASHTAGS;
|
|
||||||
filterParams.filter_action = "hide";
|
|
||||||
filterParams.context = new ArrayList<>();
|
|
||||||
filterParams.context.add("home");
|
|
||||||
filterParams.context.add("public");
|
|
||||||
filterParams.context.add("thread");
|
|
||||||
filterParams.context.add("account");
|
|
||||||
String finalTag = tag;
|
|
||||||
FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class);
|
|
||||||
filtersVM.addFilter(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, filterParams)
|
|
||||||
.observe((LifecycleOwner) context, filter -> {
|
|
||||||
if (filter != null) {
|
|
||||||
MainActivity.mainFilters.add(filter);
|
|
||||||
addTagToFilter(context, finalTag, status, filter);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addTagToFilter(context, tag, status, fedilabFilter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(@NonNull View textView) {
|
|
||||||
textView.setTag(CLICKABLE_SPAN);
|
|
||||||
Intent intent;
|
|
||||||
Bundle b;
|
|
||||||
if (word.startsWith("#")) {
|
|
||||||
intent = new Intent(context, HashTagActivity.class);
|
|
||||||
b = new Bundle();
|
|
||||||
b.putString(Helper.ARG_SEARCH_KEYWORD, word.trim());
|
|
||||||
intent.putExtras(b);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(intent);
|
|
||||||
} else if (word.startsWith("@")) {
|
|
||||||
intent = new Intent(context, ProfileActivity.class);
|
|
||||||
b = new Bundle();
|
|
||||||
Mention targetedMention = null;
|
|
||||||
|
|
||||||
for (Mention mention : mentions) {
|
|
||||||
if (word.compareToIgnoreCase("@" + mention.username) == 0) {
|
|
||||||
targetedMention = mention;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (targetedMention != null) {
|
|
||||||
b.putString(Helper.ARG_USER_ID, targetedMention.id);
|
|
||||||
} else {
|
|
||||||
b.putString(Helper.ARG_MENTION, word);
|
|
||||||
}
|
|
||||||
intent.putExtras(b);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateDrawState(@NonNull TextPaint ds) {
|
|
||||||
super.updateDrawState(ds);
|
|
||||||
ds.setUnderlineText(false);
|
|
||||||
if (linkColor != -1) {
|
|
||||||
ds.setColor(linkColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, start, end, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
|
||||||
} else {
|
|
||||||
makeLinks(context, content, url, start, end);
|
|
||||||
}
|
|
||||||
replaceQuoteSpans(context, content);
|
|
||||||
emails(context, content);
|
|
||||||
}
|
|
||||||
|
|
||||||
Pattern imgPattern = Pattern.compile("<img [^>]*src=\"([^\"]+)\"[^>]*>");
|
|
||||||
Matcher matcherImg = imgPattern.matcher(text);
|
|
||||||
HashMap<String, String> imagesToReplace = new LinkedHashMap<>();
|
|
||||||
int inc = 0;
|
|
||||||
while (matcherImg.find()) {
|
|
||||||
String replacement = "[FEDI_IMG_" + inc + "]";
|
|
||||||
imagesToReplace.put(replacement, matcherImg.group(1));
|
|
||||||
inc++;
|
|
||||||
text = text.replaceAll(Pattern.quote(matcherImg.group()), replacement);
|
|
||||||
}
|
|
||||||
|
|
||||||
View view = viewWeakReference.get();
|
|
||||||
List<Emoji> emojiList = null;
|
|
||||||
if (status != null) {
|
|
||||||
emojiList = status.emojis;
|
|
||||||
} else if (account != null) {
|
|
||||||
emojiList = account.emojis;
|
|
||||||
} else if (announcement != null) {
|
|
||||||
emojiList = announcement.emojis;
|
|
||||||
}
|
|
||||||
boolean animate = !sharedpreferences.getBoolean(context.getString(R.string.SET_DISABLE_ANIMATED_EMOJI), false);
|
|
||||||
CustomEmoji customEmoji = new CustomEmoji(new WeakReference<>(view));
|
|
||||||
content = customEmoji.makeEmoji(content, emojiList, animate, callback);
|
|
||||||
|
|
||||||
if (imagesToReplace.size() > 0) {
|
|
||||||
for (Map.Entry<String, String> entry : imagesToReplace.entrySet()) {
|
|
||||||
String key = entry.getKey();
|
|
||||||
String url = entry.getValue();
|
|
||||||
Matcher matcher = Pattern.compile(key, Pattern.LITERAL)
|
|
||||||
.matcher(content);
|
|
||||||
while (matcher.find()) {
|
|
||||||
content.setSpan(customEmoji, matcher.start(), matcher.end(), 0);
|
|
||||||
Glide.with(view)
|
|
||||||
.asDrawable()
|
|
||||||
.load(url)
|
|
||||||
.into(customEmoji.getTarget(animate, null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return trimSpannable(new SpannableStringBuilder(content));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static void makeLinks(Context context, SpannableStringBuilder content, String url, int start, int end) {
|
|
||||||
String newUrl = url;
|
|
||||||
boolean validUrl = URLUtil.isValidUrl(url) && url.length() == (end - start);
|
|
||||||
if (validUrl) {
|
|
||||||
newUrl = Helper.transformURL(context, url);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//If URL has been transformed
|
|
||||||
if (validUrl && newUrl.compareTo(url) != 0) {
|
|
||||||
content.replace(start, end, newUrl);
|
|
||||||
end = start + newUrl.length();
|
|
||||||
url = newUrl;
|
|
||||||
}
|
|
||||||
if (url.length() > 30 && (validUrl || url.startsWith("gimini://"))) {
|
|
||||||
newUrl = url.substring(0, 30);
|
|
||||||
newUrl += "…";
|
|
||||||
content.replace(start, end, newUrl);
|
|
||||||
}
|
|
||||||
int matchEnd = validUrl ? start + newUrl.length() : end;
|
|
||||||
|
|
||||||
String finalUrl = url;
|
|
||||||
if (content.length() < matchEnd) {
|
|
||||||
matchEnd = content.length();
|
|
||||||
}
|
|
||||||
content.setSpan(new LongClickableSpan() {
|
|
||||||
@Override
|
|
||||||
public void onLongClick(View view) {
|
|
||||||
Context mContext = view.getContext();
|
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext);
|
|
||||||
PopupLinksBinding popupLinksBinding = PopupLinksBinding.inflate(LayoutInflater.from(context));
|
|
||||||
dialogBuilder.setView(popupLinksBinding.getRoot());
|
|
||||||
AlertDialog alertDialog = dialogBuilder.create();
|
|
||||||
alertDialog.show();
|
|
||||||
popupLinksBinding.displayFullLink.setOnClickListener(v -> {
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
|
|
||||||
builder.setMessage(finalUrl);
|
|
||||||
builder.setTitle(context.getString(R.string.display_full_link));
|
|
||||||
builder.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss())
|
|
||||||
.show();
|
|
||||||
alertDialog.dismiss();
|
|
||||||
});
|
|
||||||
popupLinksBinding.shareLink.setOnClickListener(v -> {
|
|
||||||
Intent sendIntent = new Intent(Intent.ACTION_SEND);
|
|
||||||
sendIntent.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.shared_via));
|
|
||||||
sendIntent.putExtra(Intent.EXTRA_TEXT, finalUrl);
|
|
||||||
sendIntent.setType("text/plain");
|
|
||||||
sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
Intent intentChooser = Intent.createChooser(sendIntent, context.getString(R.string.share_with));
|
|
||||||
intentChooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(intentChooser);
|
|
||||||
alertDialog.dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
popupLinksBinding.openOtherApp.setOnClickListener(v -> {
|
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
||||||
intent.setData(Uri.parse(finalUrl));
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
try {
|
|
||||||
context.startActivity(intent);
|
|
||||||
} catch (Exception e) {
|
|
||||||
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
alertDialog.dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
popupLinksBinding.copyLink.setOnClickListener(v -> {
|
|
||||||
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
ClipData clip = ClipData.newPlainText(Helper.CLIP_BOARD, finalUrl);
|
|
||||||
if (clipboard != null) {
|
|
||||||
clipboard.setPrimaryClip(clip);
|
|
||||||
Toasty.info(context, context.getString(R.string.clipboard_url), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
alertDialog.dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
popupLinksBinding.checkRedirect.setOnClickListener(v -> {
|
|
||||||
try {
|
|
||||||
|
|
||||||
URL finalUrlCheck = new URL(finalUrl);
|
|
||||||
new Thread(() -> {
|
|
||||||
try {
|
|
||||||
String redirect = null;
|
|
||||||
HttpsURLConnection httpsURLConnection = (HttpsURLConnection) finalUrlCheck.openConnection();
|
|
||||||
httpsURLConnection.setConnectTimeout(10 * 1000);
|
|
||||||
httpsURLConnection.setRequestProperty("http.keepAlive", "false");
|
|
||||||
//httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
|
|
||||||
httpsURLConnection.setRequestMethod("HEAD");
|
|
||||||
httpsURLConnection.setInstanceFollowRedirects(false);
|
|
||||||
if (httpsURLConnection.getResponseCode() == 301 || httpsURLConnection.getResponseCode() == 302) {
|
|
||||||
Map<String, List<String>> map = httpsURLConnection.getHeaderFields();
|
|
||||||
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
|
|
||||||
if (entry.toString().toLowerCase().startsWith("location")) {
|
|
||||||
Matcher matcher = Patterns.WEB_URL.matcher(entry.toString());
|
|
||||||
if (matcher.find()) {
|
|
||||||
redirect = matcher.group(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
httpsURLConnection.getInputStream().close();
|
|
||||||
if (redirect != null && redirect.compareTo(finalUrl) != 0) {
|
|
||||||
URL redirectURL = new URL(redirect);
|
|
||||||
String host = redirectURL.getHost();
|
|
||||||
String protocol = redirectURL.getProtocol();
|
|
||||||
if (protocol == null || host == null) {
|
|
||||||
redirect = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Handler mainHandler = new Handler(context.getMainLooper());
|
|
||||||
String finalRedirect = redirect;
|
|
||||||
Runnable myRunnable = () -> {
|
|
||||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext());
|
|
||||||
if (finalRedirect != null) {
|
|
||||||
builder1.setMessage(context.getString(R.string.redirect_detected, finalUrl, finalRedirect));
|
|
||||||
builder1.setNegativeButton(R.string.copy_link, (dialog, which) -> {
|
|
||||||
ClipboardManager clipboard1 = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
ClipData clip1 = ClipData.newPlainText(Helper.CLIP_BOARD, finalRedirect);
|
|
||||||
if (clipboard1 != null) {
|
|
||||||
clipboard1.setPrimaryClip(clip1);
|
|
||||||
Toasty.info(context, context.getString(R.string.clipboard_url), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
dialog.dismiss();
|
|
||||||
});
|
|
||||||
builder1.setNeutralButton(R.string.share_link, (dialog, which) -> {
|
|
||||||
Intent sendIntent1 = new Intent(Intent.ACTION_SEND);
|
|
||||||
sendIntent1.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.shared_via));
|
|
||||||
sendIntent1.putExtra(Intent.EXTRA_TEXT, finalUrl);
|
|
||||||
sendIntent1.setType("text/plain");
|
|
||||||
context.startActivity(Intent.createChooser(sendIntent1, context.getString(R.string.share_with)));
|
|
||||||
dialog.dismiss();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
builder1.setMessage(R.string.no_redirect);
|
|
||||||
}
|
|
||||||
builder1.setTitle(context.getString(R.string.check_redirect));
|
|
||||||
builder1.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss())
|
|
||||||
.show();
|
|
||||||
|
|
||||||
};
|
|
||||||
mainHandler.post(myRunnable);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}).start();
|
|
||||||
} catch (MalformedURLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
alertDialog.dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(@NonNull View textView) {
|
|
||||||
|
|
||||||
textView.setTag(CLICKABLE_SPAN);
|
|
||||||
Pattern link = Pattern.compile("https?://([\\da-z.-]+\\.[a-z.]{2,10})/(@[\\w._-]*[0-9]*)(/[0-9]+)?$");
|
|
||||||
Matcher matcherLink = link.matcher(finalUrl);
|
|
||||||
Pattern linkLong = Pattern.compile("https?://([\\da-z.-]+\\.[a-z.]{2,10})/(@[\\w_.-]+@[a-zA-Z0-9][a-zA-Z0-9.-]{1,61}[a-zA-Z0-9](?:\\.[a-zA-Z]{2,})+)(/[0-9]+)?$");
|
|
||||||
Matcher matcherLinkLong = linkLong.matcher(finalUrl);
|
|
||||||
if (matcherLink.find() && !finalUrl.contains("medium.com")) {
|
|
||||||
if (matcherLink.group(3) != null && Objects.requireNonNull(matcherLink.group(3)).length() > 0) { //It's a toot
|
|
||||||
CrossActionHelper.fetchRemoteStatus(context, currentAccount, finalUrl, new CrossActionHelper.Callback() {
|
|
||||||
@Override
|
|
||||||
public void federatedStatus(Status status) {
|
|
||||||
Intent intent = new Intent(context, ContextActivity.class);
|
|
||||||
intent.putExtra(Helper.ARG_STATUS, status);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void federatedAccount(Account account) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {//It's an account
|
|
||||||
CrossActionHelper.fetchRemoteAccount(context, currentAccount, matcherLink.group(2) + "@" + matcherLink.group(1), new CrossActionHelper.Callback() {
|
|
||||||
@Override
|
|
||||||
public void federatedStatus(Status status) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void federatedAccount(Account account) {
|
|
||||||
Intent intent = new Intent(context, ProfileActivity.class);
|
|
||||||
Bundle b = new Bundle();
|
|
||||||
b.putSerializable(Helper.ARG_ACCOUNT, account);
|
|
||||||
intent.putExtras(b);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else if (matcherLinkLong.find() && !finalUrl.contains("medium.com")) {
|
|
||||||
if (matcherLinkLong.group(3) != null && Objects.requireNonNull(matcherLinkLong.group(3)).length() > 0) { //It's a toot
|
|
||||||
CrossActionHelper.fetchRemoteStatus(context, currentAccount, finalUrl, new CrossActionHelper.Callback() {
|
|
||||||
@Override
|
|
||||||
public void federatedStatus(Status status) {
|
|
||||||
Intent intent = new Intent(context, ContextActivity.class);
|
|
||||||
intent.putExtra(Helper.ARG_STATUS, status);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void federatedAccount(Account account) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (matcherLinkLong.group(2) != null) {//It's an account
|
|
||||||
CrossActionHelper.fetchRemoteAccount(context, currentAccount, matcherLinkLong.group(2), new CrossActionHelper.Callback() {
|
|
||||||
@Override
|
|
||||||
public void federatedStatus(Status status) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void federatedAccount(Account account) {
|
|
||||||
Intent intent = new Intent(context, ProfileActivity.class);
|
|
||||||
Bundle b = new Bundle();
|
|
||||||
b.putSerializable(Helper.ARG_ACCOUNT, account);
|
|
||||||
intent.putExtras(b);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Helper.openBrowser(context, finalUrl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateDrawState(@NonNull TextPaint ds) {
|
|
||||||
super.updateDrawState(ds);
|
|
||||||
ds.setUnderlineText(false);
|
|
||||||
if (linkColor != -1) {
|
|
||||||
ds.setColor(linkColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, start, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static void emails(Context context, Spannable content) {
|
|
||||||
// --- For all patterns defined in Helper class ---
|
|
||||||
Pattern pattern = Helper.emailPattern;
|
|
||||||
Matcher matcher = pattern.matcher(content);
|
|
||||||
|
|
||||||
while (matcher.find()) {
|
|
||||||
int matchStart = matcher.start();
|
|
||||||
int matchEnd = matcher.end();
|
|
||||||
String email = content.toString().substring(matchStart, matchEnd);
|
|
||||||
if (matchStart >= 0 && matchEnd <= content.toString().length() && matchEnd >= matchStart) {
|
|
||||||
ClickableSpan[] clickableSpans = content.getSpans(matchStart, matchEnd, ClickableSpan.class);
|
|
||||||
if (clickableSpans != null) {
|
|
||||||
for (ClickableSpan clickableSpan : clickableSpans) {
|
|
||||||
content.removeSpan(clickableSpan);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
content.removeSpan(clickableSpans);
|
|
||||||
content.setSpan(new ClickableSpan() {
|
|
||||||
@Override
|
|
||||||
public void onClick(@NonNull View textView) {
|
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
|
||||||
intent.setType("plain/text");
|
|
||||||
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{email});
|
|
||||||
context.startActivity(Intent.createChooser(intent, null));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateDrawState(@NonNull TextPaint ds) {
|
|
||||||
super.updateDrawState(ds);
|
|
||||||
ds.setUnderlineText(false);
|
|
||||||
if (linkColor != -1) {
|
|
||||||
ds.setColor(linkColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addTagToFilter(Context context, String tag, Status status, Filter filter) {
|
|
||||||
for (Filter.KeywordsAttributes keywords : filter.keywords) {
|
|
||||||
if (keywords.keyword.equalsIgnoreCase(tag)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());
|
|
||||||
builder.setMessage(context.getString(R.string.mute_tag, tag));
|
|
||||||
builder
|
|
||||||
.setPositiveButton(R.string.yes, (dialog, which) -> {
|
|
||||||
Filter.FilterParams filterParams = new Filter.FilterParams();
|
|
||||||
filterParams.id = filter.id;
|
|
||||||
filterParams.keywords = new ArrayList<>();
|
|
||||||
Filter.KeywordsParams keywordsParams = new Filter.KeywordsParams();
|
|
||||||
keywordsParams.whole_word = true;
|
|
||||||
keywordsParams.keyword = tag;
|
|
||||||
filterParams.keywords.add(keywordsParams);
|
|
||||||
filterParams.context = filter.context;
|
|
||||||
FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class);
|
|
||||||
filtersVM.editFilter(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, filterParams);
|
|
||||||
if (status != null) {
|
|
||||||
status.filteredByApp = filter;
|
|
||||||
}
|
|
||||||
sendAction(context, Helper.ARG_TIMELINE_REFRESH_ALL, null, null);
|
|
||||||
dialog.dismiss();
|
|
||||||
})
|
|
||||||
.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss())
|
|
||||||
.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert HTML content to text. Also, it handles click on link
|
|
||||||
* This needs to be run asynchronously
|
|
||||||
*
|
|
||||||
* @param status {@link Status} - Status concerned by the spannable transformation
|
|
||||||
* @param content String - text to convert, it can be content, spoiler, poll items, etc.
|
|
||||||
*/
|
|
||||||
private static void convertOuich(@NonNull Status status, SpannableStringBuilder content) {
|
|
||||||
|
|
||||||
Matcher matcher = Helper.ouichesPattern.matcher(content);
|
|
||||||
while (matcher.find()) {
|
|
||||||
Attachment attachment = new Attachment();
|
|
||||||
attachment.type = "audio";
|
|
||||||
String tag = matcher.group(1);
|
|
||||||
attachment.id = tag;
|
|
||||||
if (tag == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
attachment.remote_url = "http://ouich.es/mp3/" + tag + ".mp3";
|
|
||||||
attachment.url = "http://ouich.es/mp3/" + tag + ".mp3";
|
|
||||||
if (status.media_attachments == null) {
|
|
||||||
status.media_attachments = new ArrayList<>();
|
|
||||||
}
|
|
||||||
boolean alreadyAdded = false;
|
|
||||||
for (Attachment at : status.media_attachments) {
|
|
||||||
if (tag.compareTo(at.id) == 0) {
|
|
||||||
alreadyAdded = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!alreadyAdded) {
|
|
||||||
status.media_attachments.add(attachment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static void replaceQuoteSpans(Context context, Spannable spannable) {
|
|
||||||
QuoteSpan[] quoteSpans = spannable.getSpans(0, spannable.length(), QuoteSpan.class);
|
|
||||||
for (QuoteSpan quoteSpan : quoteSpans) {
|
|
||||||
int start = spannable.getSpanStart(quoteSpan);
|
|
||||||
int end = spannable.getSpanEnd(quoteSpan);
|
|
||||||
int flags = spannable.getSpanFlags(quoteSpan);
|
|
||||||
spannable.removeSpan(quoteSpan);
|
|
||||||
int colord = ThemeHelper.getAttColor(context, R.attr.colorPrimary);
|
|
||||||
spannable.setSpan(new CustomQuoteSpan(
|
|
||||||
ContextCompat.getColor(context, R.color.transparent),
|
|
||||||
colord,
|
|
||||||
10,
|
|
||||||
20),
|
|
||||||
start,
|
|
||||||
end,
|
|
||||||
flags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove extra carriage returns at the bottom due to <p> tags in toots
|
|
||||||
*
|
|
||||||
* @param spannable SpannableStringBuilder
|
|
||||||
* @return SpannableStringBuilder
|
|
||||||
*/
|
|
||||||
private static SpannableStringBuilder trimSpannable(SpannableStringBuilder spannable) {
|
|
||||||
|
|
||||||
int trimStart = 0;
|
|
||||||
int trimEnd = 0;
|
|
||||||
String text = spannable.toString();
|
|
||||||
|
|
||||||
while (text.length() > 0 && text.startsWith("\n")) {
|
|
||||||
text = text.substring(1);
|
|
||||||
trimStart += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (text.length() > 0 && text.endsWith("\n")) {
|
|
||||||
text = text.substring(0, text.length() - 1);
|
|
||||||
trimEnd += 1;
|
|
||||||
}
|
|
||||||
return spannable.delete(0, trimStart).delete(spannable.length() - trimEnd, spannable.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Makes the move to account clickable
|
|
||||||
*
|
|
||||||
* @param context Context
|
|
||||||
* @return SpannableString
|
|
||||||
*/
|
|
||||||
public static SpannableString moveToText(final Context context, Account account) {
|
|
||||||
SpannableString spannableString = null;
|
|
||||||
if (account.moved != null) {
|
|
||||||
spannableString = new SpannableString(context.getString(R.string.account_moved_to, account.acct, "@" + account.moved.acct));
|
|
||||||
int startPosition = spannableString.toString().indexOf("@" + account.moved.acct);
|
|
||||||
int endPosition = startPosition + ("@" + account.moved.acct).length();
|
|
||||||
if (startPosition >= 0 && endPosition <= spannableString.toString().length() && endPosition >= startPosition)
|
|
||||||
spannableString.setSpan(new ClickableSpan() {
|
|
||||||
@Override
|
|
||||||
public void onClick(@NonNull View textView) {
|
|
||||||
Intent intent = new Intent(context, ProfileActivity.class);
|
|
||||||
Bundle b = new Bundle();
|
|
||||||
b.putSerializable(Helper.ARG_ACCOUNT, account.moved);
|
|
||||||
intent.putExtras(b);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateDrawState(@NonNull TextPaint ds) {
|
|
||||||
super.updateDrawState(ds);
|
|
||||||
ds.setUnderlineText(false);
|
|
||||||
if (linkColor != -1) {
|
|
||||||
ds.setColor(linkColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
startPosition, endPosition,
|
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
|
||||||
}
|
|
||||||
return spannableString;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Spannable convertEmoji(Activity activity, String text, Account account, WeakReference<View> viewWeakReference) {
|
|
||||||
|
|
||||||
SpannableString initialContent;
|
|
||||||
if (text == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
|
||||||
initialContent = new SpannableString(Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY));
|
|
||||||
else
|
|
||||||
initialContent = new SpannableString(Html.fromHtml(text));
|
|
||||||
|
|
||||||
SpannableStringBuilder content = new SpannableStringBuilder(initialContent);
|
|
||||||
List<Emoji> emojiList = account.emojis;
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
|
||||||
boolean animate = !sharedpreferences.getBoolean(activity.getString(R.string.SET_DISABLE_ANIMATED_EMOJI), false);
|
|
||||||
if (emojiList != null && emojiList.size() > 0) {
|
|
||||||
for (Emoji emoji : emojiList) {
|
|
||||||
Matcher matcher = Pattern.compile(":" + emoji.shortcode + ":", Pattern.LITERAL)
|
|
||||||
.matcher(content);
|
|
||||||
while (matcher.find()) {
|
|
||||||
CustomEmoji customEmoji = new CustomEmoji(new WeakReference<>(viewWeakReference.get()));
|
|
||||||
content.setSpan(customEmoji, matcher.start(), matcher.end(), 0);
|
|
||||||
if (Helper.isValidContextForGlide(activity)) {
|
|
||||||
Glide.with(viewWeakReference.get())
|
|
||||||
.asDrawable()
|
|
||||||
.load(animate ? emoji.url : emoji.static_url)
|
|
||||||
.into(customEmoji.getTarget(animate, null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return trimSpannable(new SpannableStringBuilder(content));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,93 +0,0 @@
|
||||||
package app.fedilab.android.helper;
|
|
||||||
/* Copyright 2022 Thomas Schneider
|
|
||||||
*
|
|
||||||
* This file is a part of Fedilab
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
||||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
|
||||||
* see <http://www.gnu.org/licenses>. */
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.text.Html;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import com.github.stom79.mytransl.MyTransL;
|
|
||||||
import com.github.stom79.mytransl.client.HttpsConnectionException;
|
|
||||||
import com.github.stom79.mytransl.client.Results;
|
|
||||||
import com.github.stom79.mytransl.translate.Params;
|
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
|
||||||
import es.dmoral.toasty.Toasty;
|
|
||||||
|
|
||||||
public class TranslateHelper {
|
|
||||||
|
|
||||||
public static void translate(Context context, String toTranslate, Translate callback) {
|
|
||||||
String statusToTranslate;
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
|
||||||
statusToTranslate = Html.fromHtml(toTranslate, Html.FROM_HTML_MODE_LEGACY).toString();
|
|
||||||
else
|
|
||||||
statusToTranslate = Html.fromHtml(toTranslate).toString();
|
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
String translator = sharedpreferences.getString(context.getString(R.string.SET_TRANSLATOR), "FEDILAB");
|
|
||||||
MyTransL.translatorEngine et;
|
|
||||||
if (translator.compareToIgnoreCase("FEDILAB") == 0) {
|
|
||||||
et = MyTransL.translatorEngine.LIBRETRANSLATE;
|
|
||||||
} else {
|
|
||||||
et = MyTransL.translatorEngine.DEEPL;
|
|
||||||
}
|
|
||||||
final MyTransL myTransL = MyTransL.getInstance(et);
|
|
||||||
myTransL.setObfuscation(true);
|
|
||||||
Params params = new Params();
|
|
||||||
params.setSplit_sentences(false);
|
|
||||||
params.setFormat(Params.fType.TEXT);
|
|
||||||
params.setSource_lang("auto");
|
|
||||||
if (translator.compareToIgnoreCase("FEDILAB") == 0) {
|
|
||||||
myTransL.setLibretranslateDomain("translate.fedilab.app");
|
|
||||||
} else {
|
|
||||||
String translatorVersion = sharedpreferences.getString(context.getString(R.string.SET_TRANSLATOR_VERSION), "PRO");
|
|
||||||
params.setPro(translatorVersion.equals("PRO"));
|
|
||||||
String apikey = sharedpreferences.getString(context.getString(R.string.SET_TRANSLATOR_API_KEY), null);
|
|
||||||
if (apikey != null) {
|
|
||||||
myTransL.setDeeplAPIKey(apikey.trim());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String translate = sharedpreferences.getString(context.getString(R.string.SET_LIVE_TRANSLATE), MyTransL.getLocale());
|
|
||||||
if (translate.equalsIgnoreCase("default")) {
|
|
||||||
translate = MyTransL.getLocale();
|
|
||||||
}
|
|
||||||
|
|
||||||
myTransL.translate(statusToTranslate, translate, params, new Results() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(com.github.stom79.mytransl.translate.Translate translate) {
|
|
||||||
if (translate.getTranslatedContent() != null) {
|
|
||||||
callback.onTranslate(translate.getTranslatedContent());
|
|
||||||
} else {
|
|
||||||
callback.onTranslate("");
|
|
||||||
Toasty.error(context, context.getString(R.string.toast_error_translate), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFail(HttpsConnectionException httpsConnectionException) {
|
|
||||||
callback.onTranslate("");
|
|
||||||
Toasty.error(context, context.getString(R.string.toast_error_translate), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface Translate {
|
|
||||||
void onTranslate(String translated);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
package app.fedilab.android.activities;
|
package app.fedilab.android.mastodon.activities;
|
||||||
/* Copyright 2022 Thomas Schneider
|
/* Copyright 2022 Thomas Schneider
|
||||||
*
|
*
|
||||||
* This file is a part of Fedilab
|
* This file is a part of Fedilab
|
||||||
|
@ -27,16 +27,19 @@ import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.api.Status;
|
import app.fedilab.android.activities.MainActivity;
|
||||||
import app.fedilab.android.client.entities.api.admin.AdminAccount;
|
|
||||||
import app.fedilab.android.client.entities.api.admin.AdminReport;
|
|
||||||
import app.fedilab.android.databinding.ActivityAdminReportBinding;
|
import app.fedilab.android.databinding.ActivityAdminReportBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.mastodon.client.entities.api.Status;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
import app.fedilab.android.mastodon.client.entities.api.admin.AdminAccount;
|
||||||
import app.fedilab.android.ui.drawer.StatusReportAdapter;
|
import app.fedilab.android.mastodon.client.entities.api.admin.AdminReport;
|
||||||
import app.fedilab.android.viewmodel.mastodon.AdminVM;
|
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
|
||||||
|
import app.fedilab.android.mastodon.helper.Helper;
|
||||||
|
import app.fedilab.android.mastodon.helper.ThemeHelper;
|
||||||
|
import app.fedilab.android.mastodon.ui.drawer.StatusReportAdapter;
|
||||||
|
import app.fedilab.android.mastodon.viewmodel.mastodon.AdminVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
public class AccountReportActivity extends BaseBarActivity {
|
public class AccountReportActivity extends BaseBarActivity {
|
||||||
|
@ -46,6 +49,7 @@ public class AccountReportActivity extends BaseBarActivity {
|
||||||
private AdminReport report;
|
private AdminReport report;
|
||||||
private ActivityAdminReportBinding binding;
|
private ActivityAdminReportBinding binding;
|
||||||
private AdminVM adminVM;
|
private AdminVM adminVM;
|
||||||
|
private AdminAccount targeted_account;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -59,12 +63,22 @@ public class AccountReportActivity extends BaseBarActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
report = null;
|
report = null;
|
||||||
AdminAccount targeted_account = null;
|
targeted_account = null;
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle args = getIntent().getExtras();
|
||||||
if (b != null) {
|
if (args != null) {
|
||||||
account_id = b.getString(Helper.ARG_ACCOUNT_ID, null);
|
long bundleId = args.getLong(Helper.ARG_INTENT_ID, -1);
|
||||||
targeted_account = (AdminAccount) b.getSerializable(Helper.ARG_ACCOUNT);
|
new CachedBundle(AccountReportActivity.this).getBundle(bundleId, Helper.getCurrentAccount(AccountReportActivity.this), this::initializeAfterBundle);
|
||||||
report = (AdminReport) b.getSerializable(Helper.ARG_REPORT);
|
} else {
|
||||||
|
initializeAfterBundle(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initializeAfterBundle(Bundle bundle) {
|
||||||
|
|
||||||
|
if (bundle != null) {
|
||||||
|
account_id = bundle.getString(Helper.ARG_ACCOUNT_ID, null);
|
||||||
|
targeted_account = (AdminAccount) bundle.getSerializable(Helper.ARG_ACCOUNT);
|
||||||
|
report = (AdminReport) bundle.getSerializable(Helper.ARG_REPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.allow.getBackground().setColorFilter(ThemeHelper.getAttColor(this, R.attr.colorPrimary), PorterDuff.Mode.MULTIPLY);
|
binding.allow.getBackground().setColorFilter(ThemeHelper.getAttColor(this, R.attr.colorPrimary), PorterDuff.Mode.MULTIPLY);
|
||||||
|
@ -101,7 +115,6 @@ public class AccountReportActivity extends BaseBarActivity {
|
||||||
account_id = targeted_account.username;
|
account_id = targeted_account.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fillReport(AdminAccount accountAdmin, actionType type) {
|
private void fillReport(AdminAccount accountAdmin, actionType type) {
|
||||||
|
@ -133,12 +146,12 @@ public class AccountReportActivity extends BaseBarActivity {
|
||||||
binding.reject.setOnClickListener(view -> adminVM.reject(MainActivity.currentInstance, MainActivity.currentToken, account_id).observe(this, account -> fillReport(account, actionType.REJECT)));
|
binding.reject.setOnClickListener(view -> adminVM.reject(MainActivity.currentInstance, MainActivity.currentToken, account_id).observe(this, account -> fillReport(account, actionType.REJECT)));
|
||||||
binding.allow.setOnClickListener(view -> adminVM.approve(MainActivity.currentInstance, MainActivity.currentToken, account_id).observe(this, account -> fillReport(account, actionType.APPROVE)));
|
binding.allow.setOnClickListener(view -> adminVM.approve(MainActivity.currentInstance, MainActivity.currentToken, account_id).observe(this, account -> fillReport(account, actionType.APPROVE)));
|
||||||
binding.warn.setOnClickListener(view -> {
|
binding.warn.setOnClickListener(view -> {
|
||||||
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account_id, "none", null, null, binding.comment.getText().toString().trim(), binding.emailUser.isChecked());
|
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account_id, "none", null, null, Objects.requireNonNull(binding.comment.getText()).toString().trim(), binding.emailUser.isChecked());
|
||||||
fillReport(accountAdmin, actionType.NONE);
|
fillReport(accountAdmin, actionType.NONE);
|
||||||
});
|
});
|
||||||
binding.silence.setOnClickListener(view -> {
|
binding.silence.setOnClickListener(view -> {
|
||||||
if (!accountAdmin.silenced) {
|
if (!accountAdmin.silenced) {
|
||||||
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account_id, "silence", null, null, binding.comment.getText().toString().trim(), binding.emailUser.isChecked());
|
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account_id, "silence", null, null, Objects.requireNonNull(binding.comment.getText()).toString().trim(), binding.emailUser.isChecked());
|
||||||
accountAdmin.silenced = true;
|
accountAdmin.silenced = true;
|
||||||
fillReport(accountAdmin, actionType.SILENCE);
|
fillReport(accountAdmin, actionType.SILENCE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -147,7 +160,7 @@ public class AccountReportActivity extends BaseBarActivity {
|
||||||
});
|
});
|
||||||
binding.disable.setOnClickListener(view -> {
|
binding.disable.setOnClickListener(view -> {
|
||||||
if (!accountAdmin.disabled) {
|
if (!accountAdmin.disabled) {
|
||||||
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account_id, "disable", null, null, binding.comment.getText().toString().trim(), binding.emailUser.isChecked());
|
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account_id, "disable", null, null, Objects.requireNonNull(binding.comment.getText()).toString().trim(), binding.emailUser.isChecked());
|
||||||
accountAdmin.disabled = true;
|
accountAdmin.disabled = true;
|
||||||
fillReport(accountAdmin, actionType.DISABLE);
|
fillReport(accountAdmin, actionType.DISABLE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -157,7 +170,7 @@ public class AccountReportActivity extends BaseBarActivity {
|
||||||
|
|
||||||
binding.suspend.setOnClickListener(view -> {
|
binding.suspend.setOnClickListener(view -> {
|
||||||
if (!accountAdmin.suspended) {
|
if (!accountAdmin.suspended) {
|
||||||
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account_id, "suspend", null, null, binding.comment.getText().toString().trim(), binding.emailUser.isChecked());
|
adminVM.performAction(MainActivity.currentInstance, MainActivity.currentToken, account_id, "suspend", null, null, Objects.requireNonNull(binding.comment.getText()).toString().trim(), binding.emailUser.isChecked());
|
||||||
accountAdmin.suspended = true;
|
accountAdmin.suspended = true;
|
||||||
fillReport(accountAdmin, actionType.SUSPEND);
|
fillReport(accountAdmin, actionType.SUSPEND);
|
||||||
} else {
|
} else {
|
||||||
|
@ -169,35 +182,21 @@ public class AccountReportActivity extends BaseBarActivity {
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
String message = null;
|
String message = null;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SILENCE:
|
case SILENCE -> message = getString(R.string.account_silenced);
|
||||||
message = getString(R.string.account_silenced);
|
case UNSILENCE -> message = getString(R.string.account_unsilenced);
|
||||||
break;
|
case DISABLE -> message = getString(R.string.account_disabled);
|
||||||
case UNSILENCE:
|
case ENABLE -> message = getString(R.string.account_undisabled);
|
||||||
message = getString(R.string.account_unsilenced);
|
case SUSPEND -> message = getString(R.string.account_suspended);
|
||||||
break;
|
case UNSUSPEND -> message = getString(R.string.account_unsuspended);
|
||||||
case DISABLE:
|
case NONE -> message = getString(R.string.account_warned);
|
||||||
message = getString(R.string.account_disabled);
|
case APPROVE -> {
|
||||||
break;
|
|
||||||
case ENABLE:
|
|
||||||
message = getString(R.string.account_undisabled);
|
|
||||||
break;
|
|
||||||
case SUSPEND:
|
|
||||||
message = getString(R.string.account_suspended);
|
|
||||||
break;
|
|
||||||
case UNSUSPEND:
|
|
||||||
message = getString(R.string.account_unsuspended);
|
|
||||||
break;
|
|
||||||
case NONE:
|
|
||||||
message = getString(R.string.account_warned);
|
|
||||||
break;
|
|
||||||
case APPROVE:
|
|
||||||
binding.allowRejectGroup.setVisibility(View.GONE);
|
binding.allowRejectGroup.setVisibility(View.GONE);
|
||||||
message = getString(R.string.account_approved);
|
message = getString(R.string.account_approved);
|
||||||
break;
|
}
|
||||||
case REJECT:
|
case REJECT -> {
|
||||||
binding.allowRejectGroup.setVisibility(View.GONE);
|
binding.allowRejectGroup.setVisibility(View.GONE);
|
||||||
message = getString(R.string.account_rejected);
|
message = getString(R.string.account_rejected);
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
Toasty.success(AccountReportActivity.this, message, Toast.LENGTH_LONG).show();
|
Toasty.success(AccountReportActivity.this, message, Toast.LENGTH_LONG).show();
|
|
@ -1,4 +1,4 @@
|
||||||
package app.fedilab.android.activities;
|
package app.fedilab.android.mastodon.activities;
|
||||||
/* Copyright 2022 Thomas Schneider
|
/* Copyright 2022 Thomas Schneider
|
||||||
*
|
*
|
||||||
* This file is a part of Fedilab
|
* This file is a part of Fedilab
|
||||||
|
@ -22,13 +22,13 @@ import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.app.Timeline;
|
|
||||||
import app.fedilab.android.databinding.ActivityActionsBinding;
|
import app.fedilab.android.databinding.ActivityActionsBinding;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.mastodon.client.entities.app.Timeline;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
import app.fedilab.android.mastodon.helper.Helper;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAccount;
|
import app.fedilab.android.mastodon.helper.ThemeHelper;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonDomainBlock;
|
import app.fedilab.android.mastodon.ui.fragment.timeline.FragmentMastodonAccount;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
import app.fedilab.android.mastodon.ui.fragment.timeline.FragmentMastodonDomainBlock;
|
||||||
|
import app.fedilab.android.mastodon.ui.fragment.timeline.FragmentMastodonTimeline;
|
||||||
|
|
||||||
public class ActionActivity extends BaseBarActivity {
|
public class ActionActivity extends BaseBarActivity {
|
||||||
|
|
||||||
|
@ -60,8 +60,6 @@ public class ActionActivity extends BaseBarActivity {
|
||||||
private void displayTimeline(Timeline.TimeLineEnum type) {
|
private void displayTimeline(Timeline.TimeLineEnum type) {
|
||||||
canGoBack = true;
|
canGoBack = true;
|
||||||
if (type == Timeline.TimeLineEnum.MUTED_TIMELINE || type == Timeline.TimeLineEnum.BLOCKED_TIMELINE || type == Timeline.TimeLineEnum.MUTED_TIMELINE_HOME) {
|
if (type == Timeline.TimeLineEnum.MUTED_TIMELINE || type == Timeline.TimeLineEnum.BLOCKED_TIMELINE || type == Timeline.TimeLineEnum.MUTED_TIMELINE_HOME) {
|
||||||
|
|
||||||
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
|
|
||||||
fragmentMastodonAccount = new FragmentMastodonAccount();
|
fragmentMastodonAccount = new FragmentMastodonAccount();
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, type);
|
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, type);
|
||||||
|
@ -72,20 +70,21 @@ public class ActionActivity extends BaseBarActivity {
|
||||||
fragmentManager.beginTransaction();
|
fragmentManager.beginTransaction();
|
||||||
fragmentTransaction.replace(R.id.fragment_container, fragmentMastodonAccount);
|
fragmentTransaction.replace(R.id.fragment_container, fragmentMastodonAccount);
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
|
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (type == Timeline.TimeLineEnum.BLOCKED_DOMAIN_TIMELINE) {
|
} else if (type == Timeline.TimeLineEnum.BLOCKED_DOMAIN_TIMELINE) {
|
||||||
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
|
|
||||||
fragmentMastodonDomainBlock = new FragmentMastodonDomainBlock();
|
fragmentMastodonDomainBlock = new FragmentMastodonDomainBlock();
|
||||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||||
FragmentTransaction fragmentTransaction =
|
FragmentTransaction fragmentTransaction =
|
||||||
fragmentManager.beginTransaction();
|
fragmentManager.beginTransaction();
|
||||||
fragmentTransaction.replace(R.id.fragment_container, fragmentMastodonDomainBlock);
|
fragmentTransaction.replace(R.id.fragment_container, fragmentMastodonDomainBlock);
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
|
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
|
|
||||||
fragmentMastodonTimeline = new FragmentMastodonTimeline();
|
fragmentMastodonTimeline = new FragmentMastodonTimeline();
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, type);
|
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, type);
|
||||||
|
@ -96,28 +95,18 @@ public class ActionActivity extends BaseBarActivity {
|
||||||
fragmentManager.beginTransaction();
|
fragmentManager.beginTransaction();
|
||||||
fragmentTransaction.replace(R.id.fragment_container, fragmentMastodonTimeline);
|
fragmentTransaction.replace(R.id.fragment_container, fragmentMastodonTimeline);
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
|
ThemeHelper.slideViewsToLeft(binding.buttonContainer, binding.fragmentContainer, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case MUTED_TIMELINE:
|
case MUTED_TIMELINE -> setTitle(R.string.muted_menu);
|
||||||
setTitle(R.string.muted_menu);
|
case FAVOURITE_TIMELINE -> setTitle(R.string.favourite);
|
||||||
break;
|
case BLOCKED_TIMELINE -> setTitle(R.string.blocked_menu);
|
||||||
case FAVOURITE_TIMELINE:
|
case BOOKMARK_TIMELINE -> setTitle(R.string.bookmarks);
|
||||||
setTitle(R.string.favourite);
|
case BLOCKED_DOMAIN_TIMELINE -> setTitle(R.string.blocked_domains);
|
||||||
break;
|
case MUTED_TIMELINE_HOME -> setTitle(R.string.muted_menu_home);
|
||||||
case BLOCKED_TIMELINE:
|
|
||||||
setTitle(R.string.blocked_menu);
|
|
||||||
break;
|
|
||||||
case BOOKMARK_TIMELINE:
|
|
||||||
setTitle(R.string.bookmarks);
|
|
||||||
break;
|
|
||||||
case BLOCKED_DOMAIN_TIMELINE:
|
|
||||||
setTitle(R.string.blocked_domains);
|
|
||||||
break;
|
|
||||||
case MUTED_TIMELINE_HOME:
|
|
||||||
setTitle(R.string.muted_menu_home);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package app.fedilab.android.activities;
|
package app.fedilab.android.mastodon.activities;
|
||||||
/* Copyright 2022 Thomas Schneider
|
/* Copyright 2022 Thomas Schneider
|
||||||
*
|
*
|
||||||
* This file is a part of Fedilab
|
* This file is a part of Fedilab
|
||||||
|
@ -27,11 +27,11 @@ import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.client.entities.api.EmojiInstance;
|
|
||||||
import app.fedilab.android.databinding.ActivityAnnouncementBinding;
|
import app.fedilab.android.databinding.ActivityAnnouncementBinding;
|
||||||
import app.fedilab.android.exception.DBException;
|
import app.fedilab.android.mastodon.client.entities.api.EmojiInstance;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.mastodon.exception.DBException;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAnnouncement;
|
import app.fedilab.android.mastodon.helper.Helper;
|
||||||
|
import app.fedilab.android.mastodon.ui.fragment.timeline.FragmentMastodonAnnouncement;
|
||||||
|
|
||||||
|
|
||||||
public class AnnouncementActivity extends BaseActivity {
|
public class AnnouncementActivity extends BaseActivity {
|
|
@ -1,4 +1,4 @@
|
||||||
package app.fedilab.android.activities;
|
package app.fedilab.android.mastodon.activities;
|
||||||
/* Copyright 2021 Thomas Schneider
|
/* Copyright 2021 Thomas Schneider
|
||||||
*
|
*
|
||||||
* This file is a part of Fedilab
|
* This file is a part of Fedilab
|
||||||
|
@ -15,6 +15,10 @@ package app.fedilab.android.activities;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
|
|
||||||
|
import static app.fedilab.android.BaseMainActivity.currentInstance;
|
||||||
|
import static app.fedilab.android.BaseMainActivity.currentNightMode;
|
||||||
|
import static app.fedilab.android.BaseMainActivity.currentUserID;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
@ -22,9 +26,11 @@ import android.content.res.Configuration;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
@ -33,9 +39,13 @@ import androidx.preference.PreferenceManager;
|
||||||
import com.vanniktech.emoji.EmojiManager;
|
import com.vanniktech.emoji.EmojiManager;
|
||||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||||
|
|
||||||
|
import org.conscrypt.Conscrypt;
|
||||||
|
|
||||||
|
import java.security.Security;
|
||||||
|
|
||||||
import app.fedilab.android.R;
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.mastodon.helper.Helper;
|
||||||
import app.fedilab.android.helper.ThemeHelper;
|
import app.fedilab.android.mastodon.helper.ThemeHelper;
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("Registered")
|
@SuppressLint("Registered")
|
||||||
|
@ -44,90 +54,115 @@ public class BaseActivity extends AppCompatActivity {
|
||||||
public static int currentThemeId;
|
public static int currentThemeId;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
Helper.installProvider();
|
|
||||||
EmojiManager.install(new EmojiOneProvider());
|
EmojiManager.install(new EmojiOneProvider());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("RestrictedApi")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
boolean patch_provider = true;
|
||||||
final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
String currentTheme = sharedpreferences.getString(getString(R.string.SET_THEME_BASE), getString(R.string.SET_DEFAULT_THEME));
|
try {
|
||||||
//Default automatic switch
|
patch_provider = sharedpreferences.getBoolean(Helper.SET_SECURITY_PROVIDER, true);
|
||||||
if (currentTheme.equals(getString(R.string.SET_DEFAULT_THEME))) {
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
if (patch_provider) {
|
||||||
|
try {
|
||||||
|
Security.insertProviderAt(Conscrypt.newProvider(), 1);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int currentNightMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
String currentTheme = sharedpreferences.getString(getString(R.string.SET_THEME_BASE), getString(R.string.SET_DEFAULT_THEME));
|
||||||
|
boolean customAccentEnabled = sharedpreferences.getBoolean(getString(R.string.SET_CUSTOM_ACCENT) + currentUserID + currentInstance, false);
|
||||||
|
|
||||||
|
//Default automatic switch
|
||||||
|
currentNightMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||||
|
|
||||||
|
|
||||||
|
if(customAccentEnabled && currentNightMode == Configuration.UI_MODE_NIGHT_NO) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR|View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
|
||||||
|
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentTheme.equals(getString(R.string.SET_DEFAULT_THEME))) {
|
||||||
switch (currentNightMode) {
|
switch (currentNightMode) {
|
||||||
case Configuration.UI_MODE_NIGHT_NO:
|
case Configuration.UI_MODE_NIGHT_NO -> {
|
||||||
String defaultLight = sharedpreferences.getString(getString(R.string.SET_THEME_DEFAULT_LIGHT), "LIGHT");
|
String defaultLight = sharedpreferences.getString(getString(R.string.SET_THEME_DEFAULT_LIGHT), "LIGHT");
|
||||||
switch (defaultLight) {
|
switch (defaultLight) {
|
||||||
case "LIGHT":
|
case "LIGHT" -> {
|
||||||
setTheme(R.style.AppTheme);
|
setTheme(R.style.AppTheme);
|
||||||
currentThemeId = R.style.AppTheme;
|
currentThemeId = R.style.AppTheme;
|
||||||
break;
|
}
|
||||||
case "SOLARIZED_LIGHT":
|
case "SOLARIZED_LIGHT" -> {
|
||||||
setTheme(R.style.SolarizedAppTheme);
|
setTheme(R.style.SolarizedAppTheme);
|
||||||
currentThemeId = R.style.SolarizedAppTheme;
|
currentThemeId = R.style.SolarizedAppTheme;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
case Configuration.UI_MODE_NIGHT_YES:
|
}
|
||||||
|
case Configuration.UI_MODE_NIGHT_YES -> {
|
||||||
String defaultDark = sharedpreferences.getString(getString(R.string.SET_THEME_DEFAULT_DARK), "DARK");
|
String defaultDark = sharedpreferences.getString(getString(R.string.SET_THEME_DEFAULT_DARK), "DARK");
|
||||||
switch (defaultDark) {
|
switch (defaultDark) {
|
||||||
case "DARK":
|
case "DARK" -> {
|
||||||
setTheme(R.style.AppTheme);
|
setTheme(R.style.AppTheme);
|
||||||
currentThemeId = R.style.AppTheme;
|
currentThemeId = R.style.AppTheme;
|
||||||
break;
|
}
|
||||||
case "SOLARIZED_DARK":
|
case "SOLARIZED_DARK" -> {
|
||||||
setTheme(R.style.SolarizedAppTheme);
|
setTheme(R.style.SolarizedAppTheme);
|
||||||
currentThemeId = R.style.SolarizedAppTheme;
|
currentThemeId = R.style.SolarizedAppTheme;
|
||||||
break;
|
}
|
||||||
case "BLACK":
|
case "BLACK" -> {
|
||||||
setTheme(R.style.BlackAppTheme);
|
setTheme(R.style.BlackAppTheme);
|
||||||
currentThemeId = R.style.BlackAppTheme;
|
currentThemeId = R.style.BlackAppTheme;
|
||||||
break;
|
}
|
||||||
case "DRACULA":
|
case "DRACULA" -> {
|
||||||
setTheme(R.style.DraculaAppTheme);
|
setTheme(R.style.DraculaAppTheme);
|
||||||
currentThemeId = R.style.DraculaAppTheme;
|
currentThemeId = R.style.DraculaAppTheme;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (currentTheme) {
|
switch (currentTheme) {
|
||||||
case "LIGHT":
|
case "LIGHT" -> {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||||
setTheme(R.style.AppTheme);
|
setTheme(R.style.AppTheme);
|
||||||
currentThemeId = R.style.AppTheme;
|
currentThemeId = R.style.AppTheme;
|
||||||
break;
|
}
|
||||||
case "DARK":
|
case "DARK" -> {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
setTheme(R.style.AppTheme);
|
setTheme(R.style.AppTheme);
|
||||||
currentThemeId = R.style.AppTheme;
|
currentThemeId = R.style.AppTheme;
|
||||||
break;
|
}
|
||||||
case "SOLARIZED_LIGHT":
|
case "SOLARIZED_LIGHT" -> {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||||
setTheme(R.style.SolarizedAppTheme);
|
setTheme(R.style.SolarizedAppTheme);
|
||||||
currentThemeId = R.style.SolarizedAppTheme;
|
currentThemeId = R.style.SolarizedAppTheme;
|
||||||
break;
|
}
|
||||||
case "SOLARIZED_DARK":
|
case "SOLARIZED_DARK" -> {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
setTheme(R.style.SolarizedAppTheme);
|
setTheme(R.style.SolarizedAppTheme);
|
||||||
currentThemeId = R.style.SolarizedAppTheme;
|
currentThemeId = R.style.SolarizedAppTheme;
|
||||||
break;
|
}
|
||||||
case "BLACK":
|
case "BLACK" -> {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
setTheme(R.style.BlackAppTheme);
|
setTheme(R.style.BlackAppTheme);
|
||||||
currentThemeId = R.style.BlackAppTheme;
|
currentThemeId = R.style.BlackAppTheme;
|
||||||
break;
|
}
|
||||||
case "DRACULA":
|
case "DRACULA" -> {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
setTheme(R.style.DraculaAppTheme);
|
setTheme(R.style.DraculaAppTheme);
|
||||||
currentThemeId = R.style.DraculaAppTheme;
|
currentThemeId = R.style.DraculaAppTheme;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
ThemeHelper.applyThemeColor(this);
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) {
|
||||||
ThemeHelper.adjustFontScale(this, getResources().getConfiguration());
|
ThemeHelper.adjustFontScale(this, getResources().getConfiguration());
|
||||||
}
|
}
|
||||||
|
@ -143,11 +178,18 @@ public class BaseActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void attachBaseContext(Context newBase) {
|
protected void attachBaseContext(Context newBase) {
|
||||||
if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {
|
if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {
|
||||||
final Configuration override = new Configuration(newBase.getResources().getConfiguration());
|
final Configuration override = new Configuration();
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(newBase);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(newBase);
|
||||||
override.fontScale = prefs.getFloat(newBase.getString(R.string.SET_FONT_SCALE), 1.1f);
|
override.fontScale = prefs.getFloat(newBase.getString(R.string.SET_FONT_SCALE), 1.1f);
|
||||||
applyOverrideConfiguration(override);
|
applyOverrideConfiguration(override);
|
||||||
}
|
}
|
||||||
super.attachBaseContext(newBase);
|
super.attachBaseContext(newBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
outState.clear();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue