Compare commits
1128 Commits
change_liv
...
dev_6.5.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a276503b5 | ||
| fd0ad36a58 | |||
| 41c8783b53 | |||
|
|
7226add482 | ||
| 09e5f9b984 | |||
| 83ee1f94df | |||
|
|
7e1b054a98 | ||
|
|
9e0c437af5 | ||
|
|
ad26ae7db8 | ||
|
|
84230e517e | ||
| 9818a1af74 | |||
| f91ba79c5c | |||
|
|
0ea9ffc2e8 | ||
|
|
defb5fdd02 | ||
| b443fdd683 | |||
|
|
c11c66f56f | ||
|
|
a618bee6b7 | ||
| 399bedb874 | |||
|
|
3b6e2d47f4 | ||
|
|
96daf73a5c | ||
|
|
55cbd0ff5b | ||
|
|
a3ab9ff03e | ||
|
|
92ed82ea2a | ||
|
|
6d262d0c94 | ||
|
|
ce1174a88c | ||
|
|
2406e9bede | ||
| 9b3a011499 | |||
|
|
7859e7cb29 | ||
|
|
1fd36e3ba0 | ||
| ec3722b7d0 | |||
|
|
35917a5848 | ||
|
|
7ea6bb570d | ||
|
|
43f95260e6 | ||
|
|
54a4c0b590 | ||
|
|
2057a3575f | ||
|
|
aa809ebaf4 | ||
|
|
dffa71e346 | ||
|
|
fea46aab1f | ||
|
|
e032e0807b | ||
|
|
24ed313f60 | ||
|
|
02b70d559d | ||
|
|
7a26e81f67 | ||
| d07439efcf | |||
|
|
7bca817633 | ||
|
|
bad2b3689a | ||
| 3cc9b90151 | |||
|
|
e32e6f95b0 | ||
|
|
2162645da1 | ||
|
|
af17c85366 | ||
|
|
20c00e2896 | ||
|
|
44b95cb1c6 | ||
| 40e744a533 | |||
|
|
82ccd2d89c | ||
|
|
994bd2a3aa | ||
| 3ab91a74d1 | |||
|
|
d899975495 | ||
| dbbe753492 | |||
|
|
017320ac09 | ||
| 7ce0bb3a7c | |||
|
|
a78d5b4aba | ||
| 37fd1e9f47 | |||
|
|
97ad28ba62 | ||
| 3304e8f673 | |||
| e7daabe588 | |||
| d912ad6119 | |||
|
|
dfeb1c246b | ||
|
|
9588619b73 | ||
|
|
6ba71508ca | ||
| c8f443c105 | |||
|
|
ebcfddf450 | ||
| e43fb5e479 | |||
|
|
0c096dcafc | ||
|
|
545c69ff8b | ||
| bf8d88608d | |||
|
|
45c256cbbb | ||
|
|
fb1d6c0688 | ||
| fe921e25bb | |||
|
|
d5ca010ec7 | ||
|
|
04259472a1 | ||
|
|
d6032a0a0a | ||
|
|
4a7790d968 | ||
|
|
49810407ce | ||
|
|
fa086dc5cb | ||
|
|
3f8d6ed4af | ||
|
|
986902886a | ||
|
|
8ed7595aec | ||
|
|
b78fef6adc | ||
| fae0d01dc2 | |||
| 9a8bc0505d | |||
| e31fa0310c | |||
| 2705342e18 | |||
| 1bdf3a2ba3 | |||
|
|
5afa3bd30b | ||
|
|
54458bd0c0 | ||
| c53b9a6064 | |||
| 92d4130c45 | |||
|
|
a353e51ba8 | ||
|
|
0646f245b6 | ||
| 7e3ca79a01 | |||
| dfeb3a78c1 | |||
| e32d450ca1 | |||
| f29766731c | |||
| 736592b4e1 | |||
| 3108c898c2 | |||
| dd2f3db16a | |||
| 8af231e526 | |||
| fdbbc3b224 | |||
| 1e4b0bb536 | |||
| 4729f93515 | |||
|
|
3376a57f9d | ||
|
|
410fcb5895 | ||
|
|
9b62ab6011 | ||
|
|
62aa1d63df | ||
|
|
034f2dba5d | ||
|
|
aee1d6cad4 | ||
| 9b01ae4d82 | |||
| 16f23519b1 | |||
| 9bfed0bc7b | |||
|
|
bc0ed26377 | ||
|
|
0d14ce5aee | ||
|
|
4a7423a5b9 | ||
|
|
0a4425d705 | ||
| d4c2ef71cb | |||
|
|
7184b147d9 | ||
| 39e9670cff | |||
|
|
7d7535935a | ||
|
|
dd657e9918 | ||
| 09cef4ade6 | |||
| 7038681f8c | |||
| 6cf68838f8 | |||
| c3a08974d1 | |||
|
|
20c25a51ef | ||
|
|
9dfb772224 | ||
|
|
f5f68f16b7 | ||
|
|
7672cea263 | ||
| 0a02b39c12 | |||
|
|
e786ae16c2 | ||
|
|
1d447b0a90 | ||
|
|
4918f9ba20 | ||
|
|
124b18dcb0 | ||
|
|
f55e9c0cfe | ||
|
|
84c43f74bc | ||
|
|
674346b6de | ||
|
|
64f40d52da | ||
|
|
75e342975c | ||
|
|
dd4172fc3d | ||
| 6b7a98dbc3 | |||
| 640dea5c53 | |||
| a907897239 | |||
| 3807ff8916 | |||
| 36b85c15f5 | |||
| 3e91068866 | |||
|
|
4d61c7e176 | ||
|
|
c6d9dbc118 | ||
| 6743ec3cf6 | |||
|
|
addab80997 | ||
|
|
9081ba4cd6 | ||
|
|
12bedd630e | ||
|
|
003c7f9e12 | ||
|
|
9089e96856 | ||
| 60c14f720d | |||
|
|
c139b03417 | ||
| b3fb6e62ae | |||
| 613185db40 | |||
|
|
291492f2d0 | ||
|
|
cbe91c84e9 | ||
| f417e4ead8 | |||
|
|
08bc6d554a | ||
|
|
895a1c6951 | ||
| b9f1474362 | |||
|
|
58508ca0ae | ||
|
|
5736265388 | ||
|
|
e68d20252a | ||
| 44b4b06592 | |||
| fb7551f7d0 | |||
|
|
40455fffc9 | ||
| 195035c456 | |||
| 492003ff01 | |||
| 17c2e7f795 | |||
| 1a3d66553c | |||
| 710cddd3a7 | |||
| da7ebb2663 | |||
| 6a6696f355 | |||
| 368b002db6 | |||
| 501a7b482b | |||
|
|
279575d80b | ||
| 3bf594d0b5 | |||
| 5f33fa38f6 | |||
| e0312eedd1 | |||
| 69d8feb9a9 | |||
| 500588c842 | |||
| 0a70da82f0 | |||
| abbb8c524c | |||
| 1334d173cf | |||
| f3ff37aea7 | |||
| 9741be743c | |||
| f54054283c | |||
| fd06243c22 | |||
| cef94a248e | |||
| beb566b294 | |||
|
|
6889828c00 | ||
| 9c57f0bd96 | |||
| a1c96cfd0f | |||
|
|
1198a8f1d8 | ||
| a255d1f2b5 | |||
| 53ce1c703e | |||
| 3f9e95ce7d | |||
|
|
8e07d4523f | ||
| 29ddc54303 | |||
| ae9c050ae6 | |||
| 7b61e8c562 | |||
|
|
23a396864f | ||
| af8052f65b | |||
| 6603a2dbb5 | |||
| f3a0b4d145 | |||
| 0c99324904 | |||
| 8d077e8062 | |||
|
|
3aaafdbbbe | ||
|
|
f4016089a1 | ||
| c53757c64b | |||
| c8c4352284 | |||
|
|
cd2e176f0a | ||
| e6d92ffc86 | |||
| ea0a3375e4 | |||
|
|
06357088c1 | ||
|
|
fa24d226ee | ||
|
|
7eb8153744 | ||
|
|
35f16bdcae | ||
|
|
aacd8b8735 | ||
| 9926997fd7 | |||
| b02cbd7831 | |||
|
|
4150eeed64 | ||
|
|
6e595ff1e4 | ||
|
|
fbc50229e8 | ||
| 1edb07d76c | |||
| 9641d90f32 | |||
| 3095438a5c | |||
|
|
067bbc70c5 | ||
| 7201fd37f3 | |||
|
|
0bab58d507 | ||
|
|
f1ac21fe87 | ||
|
|
f4b5cdfed3 | ||
| 9021659770 | |||
| e04d277560 | |||
|
|
a7a9a28c09 | ||
|
|
bbd394044f | ||
|
|
49df393781 | ||
|
|
f0a8c17401 | ||
| a01ddd310b | |||
|
|
26ec74932f | ||
|
|
3aa85ca9bb | ||
|
|
a67c2b4009 | ||
| 9486a1a572 | |||
| c1aa8188ce | |||
|
|
a83e3e0511 | ||
|
|
3488da27f0 | ||
| 56845de59d | |||
|
|
282790ead5 | ||
|
|
db165cc05d | ||
| 49313ca326 | |||
|
|
b0008405e2 | ||
|
|
9c32c6af25 | ||
| baa2ec127f | |||
|
|
c3b5f17f44 | ||
|
|
c28a91b128 | ||
|
|
f064864d76 | ||
|
|
66290323d8 | ||
| 9526a14ca2 | |||
| 27715cda2c | |||
| 65bfc77376 | |||
| 99618a2779 | |||
| 1b637b7a77 | |||
| 6ee678bd74 | |||
|
|
b4dc035a1b | ||
|
|
1f7aef91a8 | ||
|
|
3e72b4a9eb | ||
|
|
4f103dadc9 | ||
|
|
055d002a34 | ||
|
|
426f7450a2 | ||
| 73a71dabc6 | |||
| 435dc1c4fb | |||
|
|
f347d283a0 | ||
| a6754eb503 | |||
| 070312ff53 | |||
| bd8cf94171 | |||
| 98bb182d56 | |||
| 3454b6f924 | |||
| 5af061c26f | |||
| 83a240fcb8 | |||
| 17decb63fa | |||
|
|
dbe861c608 | ||
| c1c8921f59 | |||
| 82b3b23470 | |||
|
|
e28c6228ad | ||
| df0f5f31e0 | |||
|
|
2a6af7c165 | ||
|
|
8611817a6a | ||
|
|
e4c48f948d | ||
| 46e37b14e4 | |||
| 0d86d142c9 | |||
|
|
96cbadac2c | ||
|
|
f8356b1283 | ||
|
|
576d39461a | ||
|
|
8410439a90 | ||
|
|
73b075b2a7 | ||
| a6b5c102d2 | |||
|
|
229c8e72cf | ||
|
|
f99bef4ac8 | ||
| 34c569ecb5 | |||
| a041450766 | |||
| b5673025be | |||
| f0ddd98942 | |||
| e9488df780 | |||
|
|
e67287e7d3 | ||
|
|
4b8dd546ce | ||
|
|
319a23bf2d | ||
| 611f1da9b8 | |||
| 1953b5a776 | |||
|
|
43deb95435 | ||
| 5a9535e81d | |||
|
|
097528f97a | ||
| abe71808fb | |||
| 59508a45cb | |||
|
|
11bc23418e | ||
|
|
5a5164f72b | ||
|
|
381ca84525 | ||
| 79a709a76f | |||
|
|
5dcdd3fc5f | ||
| 1dce512d27 | |||
| 840129651d | |||
| 59c19d996e | |||
| 703bafa013 | |||
|
|
9e6e25fb9e | ||
| bddf8c71ae | |||
| 47c3282861 | |||
| 181ff4274c | |||
|
|
dc5633bcb9 | ||
| 369f3f2cae | |||
|
|
293c9dcf9e | ||
|
|
d0e2278df7 | ||
| f913248fa1 | |||
|
|
098ef7aa36 | ||
|
|
bfbbe54308 | ||
|
|
32e3584fef | ||
|
|
90c7483dbc | ||
|
|
e38262826d | ||
|
|
cbb1531356 | ||
|
|
0ed37aee11 | ||
|
|
c23ed7defb | ||
|
|
06e077146b | ||
| 10588e4810 | |||
| 4b7469d9d4 | |||
|
|
eb21a17475 | ||
|
|
974546697b | ||
|
|
8507fc1bb7 | ||
|
|
bb4f8bb98e | ||
| 4a4cc179bf | |||
|
|
db8dc2a781 | ||
|
|
4ae1b12be0 | ||
|
|
06289b44d9 | ||
|
|
32fa77be39 | ||
|
|
9869a2376c | ||
| af4176bcb7 | |||
| 499b73295d | |||
| bec764a329 | |||
| 58c988a83a | |||
|
|
0506d82165 | ||
| cfc72f7441 | |||
|
|
b305ba925b | ||
| e99b18eec6 | |||
|
|
38b080f082 | ||
|
|
605f10d0ac | ||
|
|
f7480c6e43 | ||
| ceef0f1e57 | |||
|
|
19c0c8c6e7 | ||
| d50c56bbb2 | |||
| 8ce65ced30 | |||
|
|
80e93f9981 | ||
| a34e90753c | |||
| a53da7a2b8 | |||
|
|
bdd6124300 | ||
| 47c3f59f74 | |||
| 76f94895fe | |||
| e0eea59539 | |||
|
|
917d237b6d | ||
| 508f1a52ae | |||
|
|
4429dc7a4c | ||
|
|
296a6d24bb | ||
|
|
6c19f0efc4 | ||
|
|
6f7a9a9310 | ||
| 66e011f2d3 | |||
|
|
9e7909ec70 | ||
|
|
8ae58e9c14 | ||
|
|
2ce527cee8 | ||
|
|
28ef982b74 | ||
| b44524b25f | |||
| f76d649233 | |||
| 90fee86c19 | |||
| 9707898af9 | |||
|
|
9c3fbe0506 | ||
| a8178c51a0 | |||
|
|
2b62d018b5 | ||
|
|
f7cf72f15f | ||
|
|
b3d4d2b8f9 | ||
|
|
8cbbd4015f | ||
| 51bf55fdeb | |||
|
|
18a5f46133 | ||
| f201e0978e | |||
|
|
63c2891650 | ||
| af164f549f | |||
| 33034ce4d6 | |||
|
|
9d38ff7c8f | ||
| 16caf60f77 | |||
| f3bca96ee8 | |||
|
|
b0ed276e23 | ||
| 906ff6cfa6 | |||
| 6427311cec | |||
| 181f081706 | |||
| 14490cacfa | |||
| 6ff83dabff | |||
| a6d81ef666 | |||
| 11679a62a0 | |||
| 36410ddcaa | |||
|
|
3bf6518e25 | ||
|
|
028f2794bf | ||
|
|
1c198a44cf | ||
| 1fba3bd53e | |||
| fd15428ed9 | |||
|
|
a5fd14cc0e | ||
|
|
3c7a2d3964 | ||
|
|
325d7254f0 | ||
|
|
153d5ff159 | ||
| a86cf97d74 | |||
| 192587f758 | |||
|
|
5697a19f91 | ||
|
|
1fa1874241 | ||
| c43b581157 | |||
| ba5a80fb1d | |||
| 73c8db8fb4 | |||
|
|
f55e1b9c05 | ||
|
|
e5a07613aa | ||
| ed46eb30a8 | |||
|
|
971fceebcd | ||
|
|
329bd63229 | ||
|
|
d320373b07 | ||
| 326bb5ae7f | |||
|
|
95c39cca9d | ||
|
|
849677e50e | ||
| c4ae047a4b | |||
| 5657d5a00b | |||
| 4b6b477351 | |||
| d035018ada | |||
| e301e7bfce | |||
| 97ad5c2d92 | |||
| 43e7713f6b | |||
|
|
cfce501d45 | ||
|
|
b2f35fdc16 | ||
| 87afe9297d | |||
| 48f1d42739 | |||
| 9eed92302d | |||
|
|
f12f6a9130 | ||
| ef757a8adc | |||
| 0177a1314d | |||
| 26cb58463a | |||
|
|
d1d8054c01 | ||
|
|
2db89365bb | ||
|
|
87ba382e81 | ||
|
|
55290a71aa | ||
|
|
5095de3c43 | ||
|
|
70a91fedf3 | ||
| ef8f87d100 | |||
| 6d83c6f8ae | |||
| ce2048b9a5 | |||
| c22da60b82 | |||
| c78bb79633 | |||
| 3a980d22fd | |||
| 2b56eff39a | |||
|
|
9472ccf6c8 | ||
|
|
59d384a81c | ||
|
|
c02f24fdcd | ||
|
|
86c5334ab4 | ||
| 6ef8c3778b | |||
| 0c6eac2936 | |||
|
|
62e2b93bd5 | ||
|
|
d80bc3bd27 | ||
|
|
085f19c3ca | ||
| f4d23c57df | |||
|
|
95429402c7 | ||
|
|
1da79d6f48 | ||
|
|
926bd1a22e | ||
|
|
554bfa137a | ||
| 9e5a61f66c | |||
|
|
be608fd90b | ||
| c9e53b4dfd | |||
| c2aba5da4b | |||
|
|
420118b652 | ||
|
|
076008ce89 | ||
|
|
8455d1253c | ||
| 07f8f46f1f | |||
|
|
8b46c57482 | ||
|
|
db834caf00 | ||
| 5c1eef1419 | |||
| fe29d307a9 | |||
|
|
b8fea6366c | ||
| 06dddb5273 | |||
| d774296db9 | |||
|
|
077cc7fd80 | ||
|
|
fdf9d0aea2 | ||
| 92c38dc0dc | |||
|
|
d8c4b9dd04 | ||
|
|
342b2e9139 | ||
| 88ea48b6ca | |||
|
|
0726c5dc1c | ||
|
|
046adc9340 | ||
|
|
46fa2419d3 | ||
|
|
5c5114f808 | ||
|
|
7f2f7ea4d8 | ||
| a89c441555 | |||
| a1762bc791 | |||
| 34432e5ccf | |||
|
|
46f20c9663 | ||
|
|
e0753ebb29 | ||
|
|
d7d24904bf | ||
|
|
abbc2fc4ee | ||
| 07f0f39978 | |||
| 8d932a09e1 | |||
|
|
34c855fc8f | ||
|
|
824d431a63 | ||
| af63c4c8ac | |||
|
|
16ba71493e | ||
| 94f8ee7f3b | |||
| e7c97f2b55 | |||
|
|
a7e6efa0dc | ||
|
|
ea9807dcdc | ||
| fdd30aa52a | |||
|
|
ba23f720eb | ||
| 05ede89cba | |||
| d6eddeb130 | |||
| bf4710470f | |||
| 5d2a246916 | |||
| cca8f43f61 | |||
|
|
1d66a9b7fb | ||
|
|
c1c4a7a38b | ||
|
|
b8a91a85e4 | ||
|
|
7cb7258210 | ||
|
|
8d823f7a07 | ||
| 6d458d0c7f | |||
| eaed7e448b | |||
| b2f779f58a | |||
| 79ded6bff4 | |||
|
|
d86e16c9f5 | ||
| f2cff3b93f | |||
|
|
e97a4e607c | ||
| 4d86317ec8 | |||
| d36ece4c54 | |||
| 11cf971514 | |||
| 60da453114 | |||
|
|
3d5ac05d36 | ||
| a50a7140fd | |||
|
|
d3268e57bc | ||
|
|
3549c25cca | ||
|
|
859f54b1e1 | ||
| 15b232f52a | |||
| 3c80038bef | |||
| a808cd13c0 | |||
| ce8088059a | |||
|
|
cd0067d77b | ||
|
|
894e264fb3 | ||
| 5dd5b2e0ea | |||
| d14939c893 | |||
|
|
8f58c485c8 | ||
|
|
11e809a978 | ||
|
|
20aa6002f8 | ||
|
|
ffcb0e8790 | ||
|
|
3de7160538 | ||
|
|
1e595ec526 | ||
| 344bbcdfc8 | |||
| c1aeaa0e1b | |||
| e108494bd5 | |||
| bc0e698a77 | |||
| b82c87d5d6 | |||
| 80fe5271f6 | |||
| 944d703e36 | |||
| 911869ed9f | |||
| 543336af99 | |||
| 5d7cff6707 | |||
| 1bbab7ac9e | |||
|
|
16592aaecb | ||
|
|
3de9ff57c3 | ||
| e932238fc2 | |||
|
|
df436bbe1e | ||
|
|
49bd97f646 | ||
| 731f941298 | |||
|
|
c21df55c06 | ||
| 9acbc60db2 | |||
| 5f2dda021a | |||
| 1244010c3d | |||
| 7226d54277 | |||
| eaafcdd444 | |||
| 9f9c02b7e7 | |||
|
|
7bffdda6b9 | ||
| 50d01ccd92 | |||
|
|
420573736d | ||
|
|
aca98cb7e6 | ||
|
|
f26fb83fec | ||
| 1ad9effe91 | |||
| 418d306d72 | |||
| 3606815a41 | |||
| 518e57ee44 | |||
| 872245c9c9 | |||
| 749f756d58 | |||
|
|
a22dfb6214 | ||
|
|
652e569e2b | ||
| d480986485 | |||
| 2e6efc69e8 | |||
| e2761049e5 | |||
| ee6a4288b0 | |||
| 7070f5c1b4 | |||
| cc4cc2f746 | |||
| 93e2a8af02 | |||
| 207811c41d | |||
|
|
8730a6396f | ||
| 05ff51bd48 | |||
| 1904eeb3ba | |||
|
|
70126171c6 | ||
|
|
ee084d6f33 | ||
| bacf4fd32f | |||
|
|
eaae58db31 | ||
|
|
13146595bf | ||
| b3083cdd18 | |||
| cf85870810 | |||
| 182e46799a | |||
| 27bd65d3da | |||
|
|
9fcc04cef2 | ||
| a1f07b8c20 | |||
|
|
65efa88d4a | ||
| 01a2d66585 | |||
| 098e9bf6ba | |||
| ddf56963bb | |||
|
|
eadcaf826b | ||
|
|
36248eaeef | ||
| 04496c3888 | |||
| 494aa6b52d | |||
|
|
4bb51506e3 | ||
|
|
112bec58df | ||
| 0b7a3cc50e | |||
| 9f517199fe | |||
| 2393a53466 | |||
| 80993c7d2d | |||
| 8c0a23d39a | |||
| a0949f0903 | |||
|
|
42052b7465 | ||
| a37a92e211 | |||
|
|
c3ddc62b95 | ||
|
|
0a3409f98a | ||
|
|
d26a687385 | ||
| 2f413e260e | |||
| 6fcb194995 | |||
| 7cea6b4f8d | |||
| 16d02c6936 | |||
| 289c93d824 | |||
| 8f99d68b6f | |||
| e0d7137727 | |||
|
|
7a9ed22ec9 | ||
|
|
af58ec755d | ||
| 4ad2020b57 | |||
| 1db24dae4b | |||
| 76055543c3 | |||
| a1d95d6a94 | |||
| 2143e3eb77 | |||
|
|
4a0901ea93 | ||
|
|
488bee514d | ||
|
|
bafea09e44 | ||
|
|
54923304dc | ||
|
|
8b357233c2 | ||
| 06b5f99930 | |||
| 0b5598346e | |||
|
|
d81e6b9f04 | ||
| 87e3dddac5 | |||
| 55f3ac577b | |||
| 0c053a028e | |||
| df36529619 | |||
| 7555510d94 | |||
|
|
2e986db686 | ||
| 660853d5be | |||
| 956bef4b90 | |||
|
|
43c22fca7c | ||
| 5db84c1e61 | |||
| 00c3e0cb77 | |||
| f4b6c46075 | |||
| 181bb5b445 | |||
|
|
90f58054fa | ||
| 137dbc72d8 | |||
|
|
a7cef3c6f8 | ||
| 339d460c0f | |||
| c8ba78f39b | |||
|
|
d31af73479 | ||
|
|
874800c19d | ||
|
|
404d45893f | ||
| ed6e95f380 | |||
| c4cfa0becd | |||
|
|
a069562bbe | ||
|
|
9158424a25 | ||
| 7488143037 | |||
| 99938f6ed6 | |||
|
|
1bde99f6c9 | ||
|
|
e3a9a037ba | ||
| b1d342f791 | |||
| 7639a70887 | |||
| f690cf0b62 | |||
| 4dcb12eb4f | |||
|
|
af5d8dbf19 | ||
| 9cd1638d55 | |||
| dd1570c10e | |||
| 3af7ca5d94 | |||
| 2d2cc21e15 | |||
| f872029c9d | |||
| 6198489dd4 | |||
| cce8e43c24 | |||
| cae0599307 | |||
|
|
2c6e88500a | ||
| efc20c644a | |||
| bdc43baaa8 | |||
| dc529b6640 | |||
|
|
488cc192b2 | ||
|
|
269f6c64a9 | ||
|
|
51186169ca | ||
|
|
325e57d1d5 | ||
| 862ec98fa3 | |||
| b827f7bfa6 | |||
|
|
786dfb54a3 | ||
|
|
a373738d70 | ||
| 6929276512 | |||
| 64c33f5709 | |||
| 7330e1ae2b | |||
| f359c9994d | |||
| d49b60a1e1 | |||
|
|
ee2cebdc41 | ||
| 1407ecc2f2 | |||
|
|
606fc64262 | ||
| a5516ebfb3 | |||
| dd7214a945 | |||
| a20571e050 | |||
| 8f7adb3079 | |||
| adcf005e62 | |||
|
|
8cff0195ad | ||
| 98940d7554 | |||
| 4a8c29365c | |||
| b641a65117 | |||
|
|
d747407d6b | ||
| f302155912 | |||
|
|
3d60814538 | ||
| 1293368d59 | |||
|
|
d1e1f5f4e8 | ||
|
|
b804c20ba0 | ||
| e030db04b9 | |||
| 0fcadde670 | |||
| e522d04ead | |||
|
|
ce0061e86e | ||
| 7ed4043a1f | |||
|
|
0b97d7bbaf | ||
| 5317f6d88f | |||
| 092b2ac519 | |||
| c9725875b3 | |||
| 6c33ac15f8 | |||
| af91783b9f | |||
| 5755aa5232 | |||
| ddc246e11c | |||
|
|
869ad9adf7 | ||
| 5356d91fef | |||
|
|
f024283e80 | ||
| 49167f332d | |||
| ea69f4bcb7 | |||
|
|
eaf973b927 | ||
| fdbf5aee04 | |||
| e4c490577d | |||
|
|
b5247df69b | ||
| d39ee17cc4 | |||
| 07da7acacd | |||
|
|
28add09f32 | ||
|
|
9d69610713 | ||
|
|
32969a58db | ||
| b188613035 | |||
| 308d5acc21 | |||
|
|
284b9784d6 | ||
| 26f02065df | |||
| eef852c283 | |||
| e0287899f8 | |||
| ae020b105a | |||
| 62c3cdcb30 | |||
| 01c657fdcb | |||
| 3a75e24601 | |||
| e28c393f88 | |||
| bfe8034b24 | |||
| c056dfe246 | |||
| a7cf09de1e | |||
| 7c4c22d69e | |||
| 3747f214b1 | |||
|
|
503fb0d7f1 | ||
|
|
6b0500b5ff | ||
| ae8c6cc23d | |||
| ad028c69d0 | |||
| 03b3398bce | |||
| 4a84283000 | |||
| c49c560e8d | |||
| 8d3ac7761f | |||
| a1d9b1f75b | |||
|
|
afed0c8833 | ||
| 415ed2fc9b | |||
| 8e45e17768 | |||
|
|
576a30d1be | ||
|
|
e380c8dcbc | ||
| 5e9f23286e | |||
| 1bbc78fb32 | |||
| b56368412c | |||
| 4ad75a11a8 | |||
| 3fa259c5b9 | |||
|
|
4cd4939c58 | ||
| b20141de02 | |||
| 9eff246f06 | |||
| 285a33ff9a | |||
|
|
7ebd935eba | ||
| f62a093092 | |||
| 28b4a36800 | |||
| ec59fce097 | |||
| e134ef8d54 | |||
| 29ddc68870 | |||
| 9ead9a6fb8 | |||
| 2a2672587c | |||
| 98122c25d8 | |||
| 84c89d7530 | |||
| 4268816539 | |||
| 721172d48a | |||
| 3e7942dbd4 | |||
| 17d18eff98 | |||
| 0d422177ac | |||
| 6336eab32a | |||
| f91a3f3fc1 | |||
| a489a6d00d | |||
| 8d8cff8d1b | |||
|
|
5f487f74bd | ||
| 857206e3da | |||
|
|
4ebe56913a | ||
|
|
efcc2591c2 | ||
|
|
455b330b7d | ||
|
|
ed2879e263 | ||
| 3b1c5ac1ec | |||
|
|
d243ffb380 | ||
| 6bdd81038b | |||
| 1eff58aca1 | |||
|
|
fa6eda5936 | ||
|
|
72f7e00dd5 | ||
| 707e083684 | |||
| 8b4f88c766 | |||
|
|
ae3ac93248 | ||
|
|
f43ccea32a | ||
|
|
73684b9962 | ||
|
|
80a1508dfc | ||
| 0b1393615c | |||
|
|
4481b102ef | ||
| cab59a5f4a | |||
| 9f6cd3fd6f | |||
|
|
4c5730d3bf | ||
|
|
1222aa9819 | ||
|
|
e58915edb6 | ||
|
|
4d4c251ebd | ||
|
|
6a416aaba1 | ||
| bbb25cde50 | |||
| 210749ebd3 | |||
| 637fedcbe6 | |||
|
|
70b05b85d7 | ||
| 9a1cefdb70 | |||
| 6ca8fb0c29 | |||
|
|
8e7de87c6b | ||
| cb55c09624 | |||
|
|
a41a58dc26 | ||
| f257c2b5a9 | |||
|
|
f5bd17f832 | ||
| 1b7296c13b | |||
| a965a83653 | |||
|
|
5cc521d93c | ||
| 6f2a893a4e | |||
| 1548b6f252 | |||
|
|
0c6b62ed1a | ||
|
|
1fcb3d312c | ||
| 35b24c261e | |||
| e5c5a2e5f5 | |||
| 9934d53390 | |||
| 030fdb6ad0 | |||
|
|
cf4948a3e2 | ||
| afd4cb6e41 | |||
| 596c9f9962 | |||
| 020bbf322d | |||
| 05b1a9bc74 | |||
| 7f001ba887 | |||
|
|
744de267dd | ||
|
|
af26dc24c7 | ||
|
|
e9fa533e5a | ||
| 3bd4301cda | |||
| 23be58c4e8 | |||
| 718d4a5d2f | |||
| 733678532a | |||
| 6fb29bbf60 | |||
| ecbfa57276 | |||
| fc59a6f182 | |||
| 83039d7b29 | |||
|
|
e405965298 | ||
|
|
e6766dc5eb | ||
| fe027e53db | |||
|
|
546d9b5728 | ||
| 7008ccc505 | |||
| 1fc8977f99 | |||
| 4acba02c6a | |||
|
|
491427feba | ||
|
|
249d251708 | ||
|
|
96eee88c82 | ||
|
|
7005895d90 | ||
|
|
3bdee09402 | ||
| 2843131151 | |||
| a8d4d64174 | |||
| 1853acd5eb | |||
|
|
03a4054ee5 | ||
| fe66792935 | |||
|
|
082c9d7d12 | ||
| e35eb5ac7f | |||
|
|
5e631652a9 | ||
| 4eb9adad78 | |||
| 4a9a8c3ec3 | |||
|
|
450047aae2 | ||
| eb65c0e101 | |||
| 6bd29ec63e | |||
| f0231be306 | |||
| b12547cd88 | |||
| ed6b531b8d | |||
| 47b9487e13 | |||
| ec40f8fa0d | |||
| 86a0a19fec | |||
| e0b69be2d4 | |||
| a2ad006a7e | |||
| 9b17c1225a | |||
|
|
32881d3f35 | ||
| e8367b8f1a | |||
| fc1bada607 | |||
| 1eca5b0309 | |||
| 08906e028a | |||
|
|
6e36e15ef3 | ||
| d71fe7d92e | |||
| 72ca2b7b04 | |||
| 5768ff5518 | |||
| 8a03b194b2 | |||
| 0d18a135ec | |||
| 91fdef55c7 | |||
|
|
4d437be248 | ||
| d42835231e | |||
| 3d117dbcb4 | |||
| 202aedbcf3 | |||
|
|
14a4bc4343 | ||
|
|
011322dd8e | ||
|
|
0d219e4b6d | ||
|
|
1972144384 | ||
|
|
08e7e6b461 | ||
| dbba33f085 | |||
| 4a637d0a69 | |||
|
|
a9d323354b | ||
|
|
4cd1c22d01 | ||
|
|
55ff7a1649 | ||
|
|
3deb3693b3 | ||
| 009efc2c86 | |||
| 40b37b49f9 | |||
| a3ad9a17c7 | |||
|
|
2c13c3dce1 | ||
|
|
859d884941 | ||
| 4a28abf5b7 | |||
| 527bb0f1d9 | |||
| 0429e7ca36 | |||
|
|
e8f13d7590 | ||
| 7eb3e567f6 | |||
| 17ec4753b6 | |||
| 2371ef1dee | |||
| c99d139940 | |||
| e0a2f7c798 | |||
| a12524dc9c | |||
|
|
c08cf6ea57 | ||
| 20746185e0 | |||
| 54cf0e213f | |||
|
|
6654fe0434 | ||
| 324917672c | |||
| d0a373123a | |||
| 86b7ad6d92 | |||
| c949667b94 | |||
| a61a41a068 | |||
| 06d241c66c | |||
| 62ed0ae78e | |||
| 1ee335abf2 | |||
|
|
05ee59618b | ||
|
|
fffa7cdabd | ||
| b8ec25c94e | |||
| 38029f7268 | |||
| d2fdccadf2 | |||
|
|
b1d06a4f1a | ||
|
|
ecf3a94b64 | ||
|
|
99b9af2980 | ||
|
|
267d07f3a5 | ||
| 977bfa910c | |||
| fe3c9c1563 | |||
|
|
8c11818b49 | ||
| ee0d8dd1a0 | |||
|
|
1d50f8e4f5 | ||
| e8f9884365 | |||
| 38f6f2f451 | |||
| a664ff7464 | |||
| a4ab6df974 | |||
| dc8f32062c | |||
| 0a090301df | |||
| d53d250e6f | |||
|
|
897a47bee7 | ||
| 0f457efce6 | |||
| 7842c1b838 | |||
| 02a5ceaacc | |||
| 6b1c223acd | |||
|
|
09a9e023d3 | ||
| 9b37374066 | |||
| 45257e8fe1 | |||
|
|
85971339d4 | ||
|
|
383e8c0859 | ||
| 749ac197de | |||
| d20210f291 | |||
|
|
da3398f1f9 | ||
| 81763110d7 | |||
| 6ac610e1aa | |||
|
|
362cc3814e | ||
| 37dfa05a25 | |||
|
|
2df205218c | ||
|
|
cceb697739 | ||
| 7d63869d44 | |||
| 3b1cecf8a3 | |||
| e52ec4a2b8 | |||
|
|
ed300eec30 | ||
| 8455c360fc | |||
| 059bfaf1d9 | |||
|
|
9f0b6897f1 | ||
| 2119d75e5b | |||
| af39c4bac0 | |||
| 93ac837148 | |||
| c4f3d10419 | |||
| 3f9cf21b8f | |||
| e9a8a4dc02 | |||
|
|
84f352a7fb | ||
| 834170e272 | |||
| 042f53e134 | |||
| 0b041bad7b | |||
| fe124dad0c | |||
|
|
7fe7178b27 | ||
|
|
9dcc23960e | ||
|
|
140e5740e6 | ||
|
|
752fae680c | ||
| e2f8e52583 | |||
| 4d573767f7 | |||
| 56475e729c | |||
| 8f0a1a09a6 | |||
|
|
c6b8b61b1e | ||
| 862295ff03 | |||
|
|
d13e42e33d | ||
| 134cdf2e2a | |||
| 44a05ea0d5 | |||
| 7f34c50b71 | |||
|
|
77682d310a | ||
| 2b0846f939 | |||
|
|
0b6c188e0a | ||
| f51f440b43 | |||
|
|
f74a01efc0 | ||
| 6dafa64e0b | |||
|
|
60453c756c | ||
|
|
350f17915a | ||
| ffcb847b02 | |||
| 8eae2c29ae | |||
|
|
5e55a5b94c | ||
| 1eee54fef1 | |||
| 24f691d4b8 | |||
| 1fc417ec25 | |||
| 71713e5b37 | |||
|
|
ef4c377990 | ||
| 88e27df986 | |||
| 628d9c7a1b | |||
|
|
7836c57479 | ||
|
|
939675fe58 | ||
| 5ed5b15737 | |||
| 783685942c | |||
| 30c09b0e26 | |||
| 96f21643b4 | |||
| 977067eda5 | |||
| 3e7279b4de | |||
| 34dd3ca883 | |||
|
|
d0d36ef207 | ||
| a66a32038c | |||
| 80d5bf3007 | |||
| cb39253785 | |||
| 3ec3350c97 | |||
| 7a01f62490 | |||
| 4a6bb9fd56 | |||
| 40532a0972 | |||
|
|
e059d9bbb2 | ||
| ab953b4785 | |||
|
|
6e38ef2962 | ||
|
|
6656aebff9 | ||
| 50b598d8a1 | |||
| cf08f8197b | |||
| 62f1912a7a | |||
| eae7f3d1a0 | |||
| b3e9836d7c | |||
| c3c91ba9a2 | |||
|
|
1075f7252a | ||
| 302435c068 | |||
| 41fb743bda | |||
|
|
823075c0ad | ||
| 8b3b0ce2ea | |||
| e3f9f21287 | |||
| b10d9ada46 | |||
| b48ceea571 | |||
| 1623743b26 | |||
| 703f542abf | |||
| a2de293e10 | |||
| 8d14c06284 | |||
| 8b3f8d783e | |||
| b5ebc085b4 | |||
| 7e169e882d | |||
| 50f83939cc | |||
| f856188a68 |
@@ -71,7 +71,7 @@ public class FaceManager implements SensorEventListener {
|
||||
* 配置美颜SDK
|
||||
*/
|
||||
public void initFURender(Context context) {
|
||||
|
||||
initFaceUnity(context);
|
||||
mFURenderer = FURenderer.getInstance();
|
||||
mFURenderer.setInputTextureType(FUInputTextureEnum.FU_ADM_FLAG_COMMON_TEXTURE);
|
||||
mFURenderer.setCameraFacing(CameraFacingEnum.CAMERA_FRONT);
|
||||
@@ -105,9 +105,11 @@ public class FaceManager implements SensorEventListener {
|
||||
}
|
||||
});
|
||||
}
|
||||
public void loadConfig(){
|
||||
|
||||
public void loadConfig() {
|
||||
initFaceBeauty();
|
||||
}
|
||||
|
||||
public void initFaceBeauty() {
|
||||
FaceBeautyDataFactory faceBeautyDataFactory;
|
||||
faceBeautyDataFactory = new FaceBeautyDataFactory();
|
||||
@@ -115,9 +117,13 @@ public class FaceManager implements SensorEventListener {
|
||||
for (String key : configMap.keySet()) {
|
||||
if ("FilterViewHolder_".equals(key)) {
|
||||
for (FaceBeautyFilterBean filter : faceBeautyDataFactory.getBeautyFilters()) {
|
||||
if (filter.getKey().equals(configMap.get(key))&&!"origin".equals(configMap.get(key))) {
|
||||
faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val")))/100, filter.getDesRes());
|
||||
Log.i(TAG, "test: 设置滤镜 ="+filter.getKey()+" val = "+configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"));
|
||||
if (filter.getKey().equals(configMap.get(key)) && !"origin".equals(configMap.get(key))) {
|
||||
try {
|
||||
faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"))) / 100, filter.getDesRes());
|
||||
Log.i(TAG, "test: 设置滤镜 =" + filter.getKey() + " val = " + configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -125,17 +131,25 @@ public class FaceManager implements SensorEventListener {
|
||||
String name = key.replace("BeautySkinViewHolder_", "");
|
||||
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||
if (bean.getKey().equals(name)) {
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美颜 = "+bean.getKey()+" val = "+configMap.get(key));
|
||||
try {
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美颜 = " + bean.getKey() + " val = " + configMap.get(key));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else if(key.startsWith("BeautyShapeViewHolder")){
|
||||
} else if (key.startsWith("BeautyShapeViewHolder")) {
|
||||
String name = key.replace("BeautyShapeViewHolder_", "");
|
||||
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||
if (bean.getKey().equals(name)) {
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美肤 = "+bean.getKey()+" val = "+configMap.get(key));
|
||||
try {
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美肤 = " + bean.getKey() + " val = " + configMap.get(key));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -277,6 +291,7 @@ public class FaceManager implements SensorEventListener {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
isInit = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -80,11 +80,11 @@ public class ContainerRecyclerAdapter extends RecyclerView.Adapter<BaseViewHolde
|
||||
}
|
||||
|
||||
public void hideSeekBar() {
|
||||
if (seekBar.getVisibility() == View.GONE) {
|
||||
if (seekBar.getVisibility() == View.INVISIBLE) {
|
||||
return;
|
||||
}
|
||||
seekBar.setOnProgressChangeListener(null);
|
||||
seekBar.setVisibility(View.GONE);
|
||||
seekBar.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ public class FURenderer extends IFURenderer {
|
||||
private FURenderKit mFURenderKit;
|
||||
|
||||
/* AI道具*/
|
||||
private String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
||||
private String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
||||
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
||||
public static String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
||||
|
||||
/* GL 线程 ID */
|
||||
private Long mGlThreadId = 0L;
|
||||
|
||||
@@ -314,6 +314,35 @@ public class FileUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String copyAssetsFile(Context context, String assetsPath, String fileName, String saveFileDir) {
|
||||
File fileDir = new File(saveFileDir);
|
||||
if (!fileDir.exists()) {
|
||||
fileDir.mkdirs();
|
||||
}
|
||||
File file = new File(fileDir, fileName);
|
||||
if (file.exists()) {
|
||||
return file.getAbsolutePath();
|
||||
}
|
||||
try {
|
||||
InputStream inputStream = context.getAssets().open(assetsPath);
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
BufferedInputStream bis = new BufferedInputStream(inputStream);
|
||||
BufferedOutputStream bos = new BufferedOutputStream(fos);
|
||||
byte[] byteArray = new byte[1024];
|
||||
int bytes = bis.read(byteArray);
|
||||
while (bytes > 0) {
|
||||
bos.write(byteArray, 0, bytes);
|
||||
bos.flush();
|
||||
bytes = bis.read(byteArray);
|
||||
}
|
||||
bos.close();
|
||||
fos.close();
|
||||
return file.getAbsolutePath();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Uri文件绝对路径
|
||||
@@ -522,6 +551,7 @@ public class FileUtils {
|
||||
|
||||
/**
|
||||
* 遍历一个文件夹获取改文件夹下所有文件名
|
||||
*
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
@@ -563,7 +593,7 @@ public class FileUtils {
|
||||
* @param path String
|
||||
* @return Boolean
|
||||
*/
|
||||
public static Boolean checkIsVideo(Context context,String path) {
|
||||
public static Boolean checkIsVideo(Context context, String path) {
|
||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||
try {
|
||||
retriever.setDataSource(context, Uri.fromFile(new File(path)));
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="colorPrimary">#FF8D41</color>
|
||||
<color name="colorPrimaryDark">#FF8D41</color>
|
||||
<color name="colorAccent">#FF8D41</color>
|
||||
|
||||
<!--fulive demo 主配色-->
|
||||
<color name="primary_background">#050F14</color>
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
<string name="beautify_hip_slim">Hip</string>
|
||||
<string name="beautify_head_slim">Head shrink</string>
|
||||
<string name="beautify_leg_thin_slim">Thin leg</string>
|
||||
<string name="toast_not_detect_body">No body tracking</string>
|
||||
<string name="toast_not_detect_body">No message tracking</string>
|
||||
<string name="pta_human_full_body">Body driver</string>
|
||||
<string name="pta_human_half_body">Bust driver</string>
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.yunbao.faceunity;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
@@ -10,8 +7,5 @@ import static org.junit.Assert.*;
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
|
||||
}
|
||||
1
Share/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
73
Share/build.gradle
Normal file
@@ -0,0 +1,73 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'img-optimizer'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
packagingOptions {
|
||||
pickFirst "lib/armeabi/libyuvutils.so"
|
||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||
pickFirst "lib/armeabi-v7a/libyuvutils.so"
|
||||
pickFirst "lib/armeabi/libyuvtools.so"
|
||||
pickFirst "lib/arm64-v8a/libyuvtools.so"
|
||||
pickFirst "lib/armeabi-v7a/libyuvtools.so"
|
||||
exclude "lib/arm64-v8a/libmmcv_api_handgesture.so"
|
||||
exclude "lib/arm64-v8a/libmmcv_api_express.so"
|
||||
exclude "lib/arm64-v8a/libMediaEncoder.so"
|
||||
exclude "lib/arm64-v8a/libarcore_sdk_c.so"
|
||||
exclude "lib/arm64-v8a/libmediadecoder.so"
|
||||
exclude "lib/arm64-v8a/libMediaMuxer.so"
|
||||
exclude "lib/arm64-v8a/libarcore_sdk_jni.so"
|
||||
exclude "lib/arm64-v8a/libMediaUtils.so"
|
||||
exclude "lib/arm64-v8a/libcosmosffmpeg.so"
|
||||
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode rootProject.ext.android.versionCode
|
||||
versionName rootProject.ext.android.versionName
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
}
|
||||
aaptOptions {
|
||||
cruncherEnabled = false
|
||||
useNewCruncher = false
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'libs', '../libs'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies["appcompat-androidx"]
|
||||
implementation rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
//common
|
||||
implementation project(path: ':common')
|
||||
//Twitter
|
||||
implementation 'com.twitter.sdk.android:twitter:3.1.1'
|
||||
//facebook & Messenger
|
||||
implementation 'com.facebook.android:facebook-share:15.2.0'
|
||||
|
||||
|
||||
|
||||
}
|
||||
0
Share/consumer-rules.pro
Normal file
21
Share/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.share;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.yunbao.share.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
44
Share/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.pdlive.shayu">
|
||||
|
||||
<queries>
|
||||
<package android:name="com.pdlive.shayu"/>
|
||||
<package android:name="com.facebook.orca"/>
|
||||
|
||||
<package
|
||||
android:name="com.facebook.composer" />
|
||||
|
||||
<package
|
||||
android:name="com.facebook.katana" />
|
||||
<package
|
||||
android:name="com.facebook.messenger" />
|
||||
<provider
|
||||
android:authorities="com.facebook.katana.provider.PlatformProvider"
|
||||
tools:ignore="ExportedContentProvider" />
|
||||
|
||||
</queries>
|
||||
<application android:allowBackup="true">
|
||||
<activity
|
||||
android:name="com.facebook.FacebookActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<provider
|
||||
android:name="com.facebook.FacebookContentProvider"
|
||||
android:authorities="com.facebook.app.FacebookContentProvider2011402032399020"
|
||||
android:exported="true" />
|
||||
<receiver
|
||||
android:name="com.yunbao.share.receiver.TwitterResultReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.twitter.sdk.android.tweetcomposer.UPLOAD_SUCCESS" />
|
||||
<action android:name="com.twitter.sdk.android.tweetcomposer.UPLOAD_FAILURE" />
|
||||
<action android:name="com.twitter.sdk.android.tweetcomposer.TWEET_COMPOSE_CANCEL" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
34
Share/src/main/java/com/yunbao/share/AbsShareInterface.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.yunbao.share;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.receiver.TwitterResultReceiver;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class AbsShareInterface {
|
||||
protected final Context mContext;
|
||||
|
||||
public AbsShareInterface(Context context) {
|
||||
this.mContext = context;
|
||||
IntentFilter filter = new IntentFilter(TweetUploadService.UPLOAD_SUCCESS);
|
||||
filter.addAction(TweetUploadService.UPLOAD_FAILURE);
|
||||
filter.addAction(TweetUploadService.TWEET_COMPOSE_CANCEL);
|
||||
context.registerReceiver(new TwitterResultReceiver(), filter);
|
||||
}
|
||||
|
||||
public abstract void share(ShareBuilder builder, ICallback callback);
|
||||
|
||||
public Uri fileToUri(File file){
|
||||
return FileProvider.getUriForFile(mContext,
|
||||
mContext.getPackageName() + ".fileprovider",
|
||||
file
|
||||
);
|
||||
}
|
||||
}
|
||||
6
Share/src/main/java/com/yunbao/share/ICallback.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.yunbao.share;
|
||||
|
||||
public interface ICallback {
|
||||
void onSuccess();
|
||||
void onFailure();
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.yunbao.share.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.platform.FacebookShare;
|
||||
import com.yunbao.share.platform.Instagram;
|
||||
import com.yunbao.share.platform.Line;
|
||||
import com.yunbao.share.platform.MessengerShare;
|
||||
import com.yunbao.share.platform.TwitterShare;
|
||||
import com.yunbao.share.platform.WhatsApp;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppViewHolder> {
|
||||
private Context mContext;
|
||||
private List<ShareBuilder> list;
|
||||
|
||||
public ShareAppAdapter(Context mContext) {
|
||||
list = new ArrayList<>();
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<ShareBuilder> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AppViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new AppViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_share_app, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull AppViewHolder holder, int position) {
|
||||
ShareBuilder builder = list.get(position);
|
||||
switch (builder.getType()) {
|
||||
case ShareBuilder.APP_FACEBOOK:
|
||||
holder.setData(builder, R.mipmap.icon_share_facebook, R.string.dialog_share_app_facebook);
|
||||
break;
|
||||
case ShareBuilder.APP_LINE:
|
||||
holder.setData(builder, R.mipmap.icon_share_line, R.string.dialog_share_app_line);
|
||||
break;
|
||||
case ShareBuilder.APP_TWITTER:
|
||||
holder.setData(builder, R.mipmap.icon_share_twitter, R.string.dialog_share_app_twitter);
|
||||
break;
|
||||
case ShareBuilder.APP_WHATSAPP:
|
||||
holder.setData(builder, R.mipmap.icon_share_whatsapp, R.string.dialog_share_app_whatsapp);
|
||||
break;
|
||||
case ShareBuilder.APP_MESSENGER:
|
||||
holder.setData(builder, R.mipmap.icon_share_messenger, R.string.dialog_share_app_messenger);
|
||||
break;
|
||||
case ShareBuilder.APP_INSTAGRAM:
|
||||
holder.setData(builder, R.mipmap.icon_share_instagram, R.string.dialog_share_app_instagram);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public static class AppViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView icon;
|
||||
TextView title;
|
||||
|
||||
public AppViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
icon = itemView.findViewById(R.id.share_app_icon);
|
||||
title = itemView.findViewById(R.id.share_app_name);
|
||||
}
|
||||
|
||||
public void setData(ShareBuilder bean, @DrawableRes int iconId, @StringRes int appName) {
|
||||
icon.setImageResource(iconId);
|
||||
title.setText(appName);
|
||||
itemView.setOnClickListener(v -> {
|
||||
switch (bean.getType()) {
|
||||
case ShareBuilder.APP_FACEBOOK:
|
||||
new FacebookShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_LINE:
|
||||
new Line(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_TWITTER:
|
||||
new TwitterShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_WHATSAPP:
|
||||
new WhatsApp(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_MESSENGER:
|
||||
new MessengerShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
case ShareBuilder.APP_INSTAGRAM:
|
||||
new Instagram(itemView.getContext()).share(bean, new ShareCallback());
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static class ShareCallback implements ICallback {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
134
Share/src/main/java/com/yunbao/share/bean/ShareBuilder.java
Normal file
@@ -0,0 +1,134 @@
|
||||
package com.yunbao.share.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ShareBuilder {
|
||||
public static final int APP_FACEBOOK = 0;
|
||||
public static final int APP_LINE = 1;
|
||||
public static final int APP_TWITTER = 2;
|
||||
public static final int APP_WHATSAPP = 3;
|
||||
public static final int APP_MESSENGER = 4;
|
||||
public static final int APP_INSTAGRAM = 5;
|
||||
|
||||
private String text;
|
||||
private String link;
|
||||
private File file;
|
||||
private int type;
|
||||
private String uid;
|
||||
private String anchorId;
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
|
||||
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
|
||||
return String.format(CommonAppConfig.HOST +
|
||||
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
|
||||
anchorId,
|
||||
shareUid,
|
||||
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0"
|
||||
) ;
|
||||
}
|
||||
|
||||
public static String createInviteLink(String shareUid) {
|
||||
return String.format("https://www.pdlive.com/public/app/download/index.html?user_id=%s&isGoogle=%s",
|
||||
shareUid,
|
||||
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0"
|
||||
);
|
||||
}
|
||||
|
||||
public static ShareBuilder builder(int type) {
|
||||
return new ShareBuilder(type);
|
||||
}
|
||||
|
||||
private ShareBuilder(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getAnchorId() {
|
||||
return anchorId;
|
||||
}
|
||||
|
||||
public void setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
}
|
||||
|
||||
public String getAnchorName() {
|
||||
return anchorName;
|
||||
}
|
||||
|
||||
public void setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
}
|
||||
|
||||
public String getAnchorAvatar() {
|
||||
return anchorAvatar;
|
||||
}
|
||||
|
||||
public void setAnchorAvatar(String anchorAvatar) {
|
||||
this.anchorAvatar = anchorAvatar;
|
||||
}
|
||||
|
||||
public ShareBuilder setText(String text) {
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareBuilder setLink(String link) {
|
||||
this.link = link;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareBuilder setFile(File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
if (StringUtil.isEmpty(text)) {
|
||||
return getLink();
|
||||
}
|
||||
return text + "\n" + getLink();
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
if (StringUtil.isEmpty(link)) {
|
||||
link = createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ShareBuilder{" +
|
||||
"text='" + text + '\'' +
|
||||
", link='" + link + '\'' +
|
||||
", file=" + file +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.facebook.CallbackManager;
|
||||
import com.facebook.FacebookCallback;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.share.Sharer;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.widget.ShareDialog;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
public class FacebookShare extends AbsShareInterface {
|
||||
public static CallbackManager callbackManager;
|
||||
public FacebookShare(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
callbackManager= CallbackManager.Factory.create();
|
||||
ShareLinkContent content = new ShareLinkContent.Builder()
|
||||
.setContentUrl(Uri.parse(builder.getLink()))
|
||||
.build();
|
||||
ShareDialog dialog=new ShareDialog((Activity) mContext);
|
||||
dialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
|
||||
@Override
|
||||
public void onSuccess(Sharer.Result result) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull FacebookException e) {
|
||||
}
|
||||
});
|
||||
dialog.show(content);
|
||||
}
|
||||
}
|
||||
27
Share/src/main/java/com/yunbao/share/platform/Instagram.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
public class Instagram extends AbsShareInterface {
|
||||
public Instagram(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
String type = "image/*";
|
||||
Intent share = new Intent(Intent.ACTION_SEND);
|
||||
Uri uri = fileToUri(builder.getFile());
|
||||
share.setType(type);
|
||||
share.putExtra(Intent.EXTRA_STREAM, uri);
|
||||
share.setPackage("com.instagram.android");
|
||||
mContext.startActivity(Intent.createChooser(share, "Share to"));
|
||||
callback.onSuccess();
|
||||
}
|
||||
}
|
||||
31
Share/src/main/java/com/yunbao/share/platform/Line.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
|
||||
public class Line extends AbsShareInterface {
|
||||
|
||||
public Line(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
try {
|
||||
Intent share = new Intent(Intent.ACTION_VIEW, Uri.parse("https://line.me/R/share?text=" + URLEncoder.encode(builder.getText(), "UTF-8")));
|
||||
mContext.startActivity(share);
|
||||
callback.onSuccess();
|
||||
} catch (Exception e) {
|
||||
callback.onFailure();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.facebook.CallbackManager;
|
||||
import com.facebook.FacebookCallback;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.facebook.share.Sharer;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.widget.MessageDialog;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
public class MessengerShare extends AbsShareInterface {
|
||||
public static CallbackManager callbackManager;
|
||||
|
||||
public MessengerShare(Context context) {
|
||||
super(context);
|
||||
FacebookSdk.setIsDebugEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
callbackManager = CallbackManager.Factory.create();
|
||||
ShareLinkContent content = new ShareLinkContent.Builder()
|
||||
.setContentUrl(Uri.parse(builder.getLink()))
|
||||
.build();
|
||||
MessageDialog dialog = new MessageDialog((Activity) mContext);
|
||||
dialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
|
||||
@Override
|
||||
public void onSuccess(Sharer.Result result) {
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull FacebookException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
if(dialog.canShow(content)) {
|
||||
dialog.show(content);
|
||||
}else{
|
||||
callback.onFailure();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.twitter.sdk.android.core.Twitter;
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
|
||||
public class TwitterShare extends AbsShareInterface {
|
||||
public TwitterShare(Context context) {
|
||||
super(context);
|
||||
Twitter.initialize(context);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder date, ICallback callback) {
|
||||
|
||||
/*
|
||||
new TwitterAuthClient().authorize((Activity) mContext, new Callback<TwitterSession>() {
|
||||
@Override
|
||||
public void success(Result<TwitterSession> result) {
|
||||
//获取以下登录成功返回信息进行登录验证
|
||||
|
||||
//获取登录用户信息
|
||||
final TwitterSession activeSession=TwitterCore.getInstance().getSessionManager().getActiveSession();
|
||||
Intent intent = new ComposerActivity.Builder(mContext)
|
||||
.session(activeSession)
|
||||
.image(fileToUri(date.getFile()))
|
||||
.text(date.getText())
|
||||
.hashtags("#twitter")
|
||||
.createIntent();
|
||||
mContext.startActivity(intent);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void failure(TwitterException e) {
|
||||
}
|
||||
});*/
|
||||
/* TweetComposer.Builder builder;
|
||||
if (date.getFile() == null) {
|
||||
try {
|
||||
builder=new TweetComposer.Builder(mContext)
|
||||
.text(date.getText())
|
||||
.url(new URL(date.getLink()));
|
||||
} catch (MalformedURLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else {
|
||||
builder = new TweetComposer.Builder(mContext)
|
||||
.text(date.getText())
|
||||
.image(fileToUri(date.getFile()));
|
||||
}
|
||||
builder.show();*/
|
||||
try {
|
||||
Intent sendIntent = new Intent();
|
||||
sendIntent.setAction(Intent.ACTION_VIEW);
|
||||
sendIntent.putExtra(Intent.EXTRA_TEXT, date.getText());
|
||||
// sendIntent.setType("text/plain");
|
||||
//sendIntent.setPackage("com.twitter.composer.ComposerShareActivity");
|
||||
sendIntent.setData(Uri.parse("https://twitter.com/intent/tweet?text=" +URLEncoder.encode(date.getText(),"UTF-8")));
|
||||
mContext.startActivity(sendIntent);
|
||||
callback.onSuccess();
|
||||
} catch (Exception e) {
|
||||
callback.onFailure();
|
||||
}
|
||||
}
|
||||
}
|
||||
30
Share/src/main/java/com/yunbao/share/platform/WhatsApp.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.yunbao.share.platform;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.yunbao.share.AbsShareInterface;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
|
||||
public class WhatsApp extends AbsShareInterface {
|
||||
public WhatsApp(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(ShareBuilder builder, ICallback callback) {
|
||||
try {
|
||||
Intent sendIntent = new Intent();
|
||||
sendIntent.setAction(Intent.ACTION_SEND);
|
||||
sendIntent.putExtra(Intent.EXTRA_TEXT, builder.getText());
|
||||
sendIntent.setType("text/plain");
|
||||
sendIntent.setPackage("com.whatsapp");
|
||||
mContext.startActivity(sendIntent);
|
||||
callback.onSuccess();
|
||||
} catch (Exception e) {
|
||||
callback.onFailure();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yunbao.share.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
public class TwitterResultReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.i("分享log", "onReceive: "+intent.getAction());
|
||||
if (TweetUploadService.UPLOAD_SUCCESS.equals(intent.getAction())) {
|
||||
ToastUtil.show("推特分享成功");
|
||||
// success
|
||||
final Long tweetId = intent.getExtras().getLong(TweetUploadService.EXTRA_TWEET_ID);
|
||||
} else if (TweetUploadService.UPLOAD_FAILURE.equals(intent.getAction())) {
|
||||
// failure
|
||||
ToastUtil.show("推特分享失败");
|
||||
final Intent retryIntent = intent.getExtras().getParcelable(TweetUploadService.EXTRA_RETRY_INTENT);
|
||||
} else if (TweetUploadService.TWEET_COMPOSE_CANCEL.equals(intent.getAction())) {
|
||||
// cancel
|
||||
ToastUtil.show("推特分享取消");
|
||||
}
|
||||
}
|
||||
}
|
||||
158
Share/src/main/java/com/yunbao/share/ui/InvitePopDialog.java
Normal file
@@ -0,0 +1,158 @@
|
||||
package com.yunbao.share.ui;
|
||||
|
||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.Shader;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.adapters.ShareAppAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class InvitePopDialog extends AbsDialogPopupWindow {
|
||||
private ShareAppAdapter adapter;
|
||||
private RecyclerView list;
|
||||
private RoundedImageView avatar;
|
||||
private TextView info;
|
||||
private TextView link;
|
||||
private TextView title;
|
||||
private List<ShareBuilder> data;
|
||||
|
||||
private String uid;
|
||||
private String anchorId;
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
private String url;
|
||||
|
||||
public InvitePopDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public InvitePopDialog setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InvitePopDialog setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InvitePopDialog setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InvitePopDialog setAnchorAvatar(String anchorAvatar) {
|
||||
this.anchorAvatar = anchorAvatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_share;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
findViewById(R.id.close).setOnClickListener(v -> dismiss());
|
||||
((ImageView) findViewById(R.id.close)).setImageResource(R.mipmap.icon_invite_close);
|
||||
findViewById(R.id.share_copy).setOnClickListener(v -> copyLink());
|
||||
// findViewById(R.id.share_preview).setVisibility(GONE);
|
||||
findViewById(R.id.share_dialog).setBackgroundResource(R.mipmap.bg_dialog_inviet);
|
||||
title = findViewById(R.id.share_title);
|
||||
list = findViewById(R.id.share_apps_list);
|
||||
avatar = findViewById(R.id.share_avatar);
|
||||
info = findViewById(R.id.share_info);
|
||||
link = findViewById(R.id.share_link);
|
||||
adapter = new ShareAppAdapter(getContext());
|
||||
list.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
list.setAdapter(adapter);
|
||||
initData();
|
||||
link.setText(url.substring(0, 40));
|
||||
info.setText(R.string.dialog_invite_info);
|
||||
avatar.setImageResource(R.mipmap.ic_launcher);
|
||||
//title.setTextColor(getContext().getResources().getColorStateList(R.drawable.bg_invite_title));
|
||||
title.setText(R.string.dialog_invite_title);
|
||||
title.getViewTreeObserver().addOnGlobalLayoutListener(this::setTitleColor);
|
||||
}
|
||||
|
||||
private void setTitleColor() {
|
||||
int[] colors = {
|
||||
Color.parseColor("#3377FF"),
|
||||
Color.parseColor("#7F66FF"),
|
||||
};
|
||||
float[] position = {
|
||||
0f,
|
||||
1.0f
|
||||
};
|
||||
float height = title.getMeasuredHeight();
|
||||
LinearGradient mLinearGradient = new LinearGradient(0, 0, 0, height, colors, position, Shader.TileMode.CLAMP);
|
||||
title.getPaint().setShader(mLinearGradient);
|
||||
title.invalidate();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
data = new ArrayList<>();
|
||||
data.add(builder(ShareBuilder.APP_FACEBOOK));
|
||||
data.add(builder(ShareBuilder.APP_LINE));
|
||||
data.add(builder(ShareBuilder.APP_TWITTER));
|
||||
data.add(builder(ShareBuilder.APP_WHATSAPP));
|
||||
data.add(builder(ShareBuilder.APP_MESSENGER));
|
||||
// data.add(builder(ShareBuilder.APP_INSTAGRAM));
|
||||
adapter.setList(data);
|
||||
|
||||
}
|
||||
|
||||
private ShareBuilder builder(int type) {
|
||||
ShareBuilder builder = ShareBuilder.builder(type);
|
||||
builder.setText(getContext().getString(R.string.dialog_invite_info));
|
||||
builder.setLink(url);
|
||||
builder.setUid(uid);
|
||||
builder.setAnchorId(anchorId);
|
||||
builder.setAnchorName(anchorName);
|
||||
builder.setAnchorAvatar(anchorAvatar);
|
||||
return builder;
|
||||
}
|
||||
|
||||
private void copyLink() {
|
||||
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData clipData = ClipData.newPlainText("text", info.getText() + "\n" + url);
|
||||
cm.setPrimaryClip(clipData);
|
||||
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
|
||||
}
|
||||
|
||||
public InvitePopDialog setUrl(String data) {
|
||||
this.url = data + "&isGoogle=" + (CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0");
|
||||
return this;
|
||||
}
|
||||
}
|
||||
146
Share/src/main/java/com/yunbao/share/ui/SharePopDialog.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package com.yunbao.share.ui;
|
||||
|
||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.adapters.ShareAppAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SharePopDialog extends AbsDialogPopupWindow {
|
||||
private ShareAppAdapter adapter;
|
||||
private RecyclerView list;
|
||||
private RoundedImageView avatar;
|
||||
private TextView info;
|
||||
private TextView link;
|
||||
private List<ShareBuilder> data;
|
||||
|
||||
private String uid;
|
||||
private String anchorId;
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
private String shareLink;
|
||||
|
||||
public SharePopDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public SharePopDialog setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePopDialog setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePopDialog setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePopDialog setAnchorAvatar(String anchorAvatar) {
|
||||
this.anchorAvatar = anchorAvatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePopDialog setShareLink(String link) {
|
||||
this.shareLink = link;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_share;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
findViewById(R.id.close).setOnClickListener(v -> dismiss());
|
||||
findViewById(R.id.share_copy).setOnClickListener(v -> copyLink());
|
||||
list = findViewById(R.id.share_apps_list);
|
||||
avatar = findViewById(R.id.share_avatar);
|
||||
info = findViewById(R.id.share_info);
|
||||
link = findViewById(R.id.share_link);
|
||||
adapter = new ShareAppAdapter(getContext());
|
||||
list.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
list.setAdapter(adapter);
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
data = new ArrayList<>();
|
||||
data.add(builder(ShareBuilder.APP_FACEBOOK));
|
||||
data.add(builder(ShareBuilder.APP_LINE));
|
||||
data.add(builder(ShareBuilder.APP_TWITTER));
|
||||
data.add(builder(ShareBuilder.APP_WHATSAPP));
|
||||
data.add(builder(ShareBuilder.APP_MESSENGER));
|
||||
//data.add(builder(ShareBuilder.APP_INSTAGRAM));
|
||||
adapter.setList(data);
|
||||
String url;
|
||||
if (shareLink == null) {
|
||||
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar).substring(0, 40) + "...";
|
||||
} else {
|
||||
if (shareLink.length() > 40) {
|
||||
url = shareLink.substring(0, 40) + "...";
|
||||
} else {
|
||||
url = shareLink;
|
||||
}
|
||||
}
|
||||
link.setText(url);
|
||||
info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
|
||||
ImgLoader.display(getContext(), anchorAvatar, avatar);
|
||||
}
|
||||
|
||||
private ShareBuilder builder(int type) {
|
||||
ShareBuilder builder = ShareBuilder.builder(type);
|
||||
builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
|
||||
builder.setUid(uid);
|
||||
builder.setAnchorId(anchorId);
|
||||
builder.setAnchorName(anchorName);
|
||||
builder.setAnchorAvatar(anchorAvatar);
|
||||
if (shareLink != null) {
|
||||
builder.setLink(shareLink);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
private void copyLink() {
|
||||
String url;
|
||||
if (shareLink != null) {
|
||||
url = shareLink;
|
||||
} else {
|
||||
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
|
||||
}
|
||||
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData clipData = ClipData.newPlainText("text",info.getText().toString()+"\n"+url);
|
||||
cm.setPrimaryClip(clipData);
|
||||
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
|
||||
}
|
||||
}
|
||||
9
Share/src/main/res/drawable/bg_btn.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="189dp" android:height="42dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffc621" android:endColor="#ffffae05" android:angle="135" />
|
||||
<corners android:radius="21dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
10
Share/src/main/res/drawable/bg_invite_title.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="112dp" android:height="42dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#ffffffff" />
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#3377FF" android:endColor="#7F66FF" android:angle="90" />
|
||||
<corners android:topLeftRadius="22dp" android:topRightRadius="22dp" android:bottomLeftRadius="22dp" android:bottomRightRadius="22dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
12
Share/src/main/res/drawable/bg_preview.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="15dp" />
|
||||
<solid android:color="#ffffff" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#EBEBEB" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
56
Share/src/main/res/layout/dialog_invite_list.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/share_dialog"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/bg_dialog_share">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dialog_invite_title"
|
||||
android:textColor="@drawable/bg_invite_title"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:srcCompat="@mipmap/icon_dialog_charge_close" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/share_apps_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
|
||||
tools:itemCount="6"
|
||||
tools:layoutManager="GridLayoutManager"
|
||||
tools:listitem="@layout/item_share_app"
|
||||
tools:spanCount="3" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
66
Share/src/main/res/layout/dialog_share.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/share_dialog"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/bg_dialog_share">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dialog_share_title"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:srcCompat="@mipmap/icon_share_close" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/share_preview"
|
||||
layout="@layout/view_share_preview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout2" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/share_apps_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/share_preview"
|
||||
tools:itemCount="6"
|
||||
tools:layoutManager="GridLayoutManager"
|
||||
tools:listitem="@layout/item_share_app"
|
||||
tools:spanCount="3" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
34
Share/src/main/res/layout/item_share_app.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/share_app_icon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="35dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="35dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_app_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:text="TextView"
|
||||
android:textColor="#666666"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/share_app_icon" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
75
Share/src/main/res/layout/view_share_preview.xml
Normal file
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_preview"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/share_avatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dialog_share_info"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_copy"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="16dp"
|
||||
|
||||
android:background="@drawable/bg_btn"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="25dp"
|
||||
android:text="@string/dialog_share_copy"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/share_layout_link"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@mipmap/icon_share_url" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_link"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="TextView"
|
||||
android:textColor="#999999"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
BIN
Share/src/main/res/mipmap/bg_dialog_inviet.png
Normal file
|
After Width: | Height: | Size: 315 KiB |
BIN
Share/src/main/res/mipmap/bg_dialog_share.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
Share/src/main/res/mipmap/icon_invite_close.png
Normal file
|
After Width: | Height: | Size: 548 B |
BIN
Share/src/main/res/mipmap/icon_share_close.png
Normal file
|
After Width: | Height: | Size: 484 B |
BIN
Share/src/main/res/mipmap/icon_share_facebook.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
Share/src/main/res/mipmap/icon_share_instagram.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
Share/src/main/res/mipmap/icon_share_line.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
Share/src/main/res/mipmap/icon_share_messenger.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
Share/src/main/res/mipmap/icon_share_twitter.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
Share/src/main/res/mipmap/icon_share_url.png
Normal file
|
After Width: | Height: | Size: 955 B |
BIN
Share/src/main/res/mipmap/icon_share_whatsapp.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
8
Share/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="dialog_share_title">Share</string>
|
||||
<string name="dialog_share_info">Come and watch %s live on PDLIVE and meet more interesting people!</string>
|
||||
<string name="dialog_invite_title">Invite Friends</string>
|
||||
<string name="dialog_invite_info">Come to PDLIVE to discover more and better live streams.</string>
|
||||
<string name="dialog_share_copy">Copy</string>
|
||||
</resources>
|
||||
17
Share/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<resources>
|
||||
<string name="com.twitter.sdk.android.CONSUMER_KEY" translatable="false">ZWRrZnRUNlBlcHVxMXpsMzVmb2k6MTpjaQ</string>
|
||||
<string name="com.twitter.sdk.android.CONSUMER_SECRET" translatable="false">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
|
||||
<string name="dialog_share_title">分享</string>
|
||||
<string name="dialog_share_info">快來 PDLIVE觀看%s直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_app_facebook" translatable="false">Facebook</string>
|
||||
<string name="dialog_share_app_line" translatable="false">Line</string>
|
||||
<string name="dialog_share_app_twitter" translatable="false">Twitter</string>
|
||||
<string name="dialog_share_app_whatsapp" translatable="false">WhatsApp</string>
|
||||
<string name="dialog_share_app_messenger" translatable="false">Messenger</string>
|
||||
<string name="dialog_share_app_instagram" translatable="false">Instagram</string>
|
||||
|
||||
<string name="dialog_invite_title">邀請好友</string>
|
||||
<string name="dialog_invite_info">快來 PDLIVE觀看直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_copy">複製</string>
|
||||
</resources>
|
||||
17
Share/src/test/java/com/yunbao/share/ExampleUnitTest.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.yunbao.share;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,13 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'img-optimizer'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
android {
|
||||
dexOptions {
|
||||
jumboMode = true
|
||||
}
|
||||
project.tasks.getByName("tasks").doFirst {
|
||||
|
||||
}
|
||||
/* applicationVariants.all { variant ->
|
||||
variant.mergeAssetsProvider.configure {
|
||||
@@ -92,6 +95,13 @@ android {
|
||||
exclude 'lib/armeabi-v7a/libmmlic.so'
|
||||
exclude 'lib/armeabi-v7a/libMNN_CL.so'
|
||||
exclude 'lib/armeabi-v7a/libMNN_Express.so'
|
||||
//美颜
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
exclude 'lib/armeabi-v7a/libCNamaSDK.so'
|
||||
exclude 'lib/arm64-v8a/libCNamaSDK.so'
|
||||
exclude 'lib/armeabi-v7a/libfuai.so'
|
||||
exclude 'lib/arm64-v8a/libfuai.so'
|
||||
}
|
||||
|
||||
}
|
||||
compileOptions {
|
||||
@@ -99,6 +109,11 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
applicationVariants.all { variant ->
|
||||
println "清空build文件夹";
|
||||
for (final def project in rootProject.getAllprojects()) {
|
||||
delete project.buildDir
|
||||
println project.buildDir
|
||||
}
|
||||
String variantName = variant.name.capitalize()
|
||||
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
||||
processManifestTask.doLast { pm ->
|
||||
@@ -139,9 +154,36 @@ android {
|
||||
'Asset/*',
|
||||
'image_effect_shaders/*',
|
||||
'internal/*'
|
||||
//美颜基础组件
|
||||
|
||||
]))
|
||||
println "isPluginModel = " + rootProject.ext.manifestPlaceholders.isPluginModel
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
delete(fileTree(dir: outputDir, includes: [
|
||||
'model/ai_face_processor_lite.bundle',
|
||||
'graphics/face_beautification.bundle'
|
||||
]))
|
||||
} else {
|
||||
println "不删除bundle"
|
||||
}
|
||||
}
|
||||
}
|
||||
variant.outputs.all {
|
||||
def isGoogle = "link"
|
||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay) {
|
||||
isGoogle = "Google"
|
||||
}
|
||||
def isPlugin = "all"
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
isPlugin = "plugin"
|
||||
}
|
||||
def isTest = "测试服"
|
||||
if (rootProject.ext.manifestPlaceholders.serverHost == "https://napi.yaoulive.com") {
|
||||
isTest = "正式服"
|
||||
}
|
||||
outputFileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
||||
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -193,12 +235,17 @@ android {
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
zipAlignEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
debug {
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
zipAlignEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
@@ -230,6 +277,7 @@ dependencies {
|
||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||
|
||||
// implementation rootProject.ext.dependencies["leakcanary"]
|
||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
|
||||
|
||||
|
||||
}
|
||||
|
||||
170
app/proguard-rules.pro
vendored
@@ -12,17 +12,40 @@
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
public *;
|
||||
}
|
||||
|
||||
# Uncomment this to preserve the groupLast number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the groupLast number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
-renamesourcefileattribute SourceFile
|
||||
|
||||
-keep class com.yunbao.**{
|
||||
public <methods>;
|
||||
protected <methods>;
|
||||
}
|
||||
-keep class * implements com.yunbao.common.bean.BaseModel {
|
||||
*;
|
||||
}
|
||||
-keep class com.yunbao.common.bean.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.yunbao.common.views.weight.VerticalViewPager$LayoutParams{
|
||||
*;
|
||||
}
|
||||
-keep class android.**{
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class **.R$* {
|
||||
public static <fields>;
|
||||
}
|
||||
-keep class com.tencent.** { *; }
|
||||
-keep class com.adjust.sdk.**{ *; }
|
||||
-keep class com.google.android.gms.common.ConnectionResult {
|
||||
int SUCCESS;
|
||||
@@ -48,6 +71,13 @@
|
||||
-keep class okhttp3.internal.**{*;}
|
||||
|
||||
-dontwarn okio.**
|
||||
#okhttp
|
||||
-dontwarn okhttp3.**
|
||||
-keep class okhttp3.**{*;}
|
||||
|
||||
#okio
|
||||
-dontwarn okio.**
|
||||
-keep class okio.**{*;}
|
||||
|
||||
# Retrofit
|
||||
|
||||
@@ -55,9 +85,10 @@
|
||||
|
||||
-keep class retrofit2.** { *; }
|
||||
|
||||
-keepattributes Signature-keepattributes Exceptions
|
||||
-keepattributes Signature-keepattributes,Exceptions
|
||||
|
||||
# RxJava RxAndroid
|
||||
-dontwarn java.util.concurrent.Flow*
|
||||
|
||||
-dontwarn sun.misc.**
|
||||
|
||||
@@ -69,20 +100,139 @@ long consumerIndex;
|
||||
|
||||
}
|
||||
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef* {
|
||||
|
||||
rx.internal.util.atomic.LinkedQueueNode producerNode;
|
||||
rx.internal.util.atomic.LinkedQueueNode* producerNode;
|
||||
|
||||
}
|
||||
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef* {
|
||||
|
||||
rx.internal.util.atomic.LinkedQueueNode consumerNode;
|
||||
rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
|
||||
}
|
||||
|
||||
# Gson
|
||||
|
||||
-keep class com.google.gson.stream.** { *; }
|
||||
##---------------Begin: proguard configuration for Gson ----------
|
||||
# Gson uses generic type information stored in a class file when working with fields. Proguard
|
||||
# removes such information by default, so configure it to keep all of it.
|
||||
-keepattributes Signature
|
||||
|
||||
# For using GSON @Expose annotation
|
||||
-keepattributes *Annotation*
|
||||
|
||||
# Gson specific classes
|
||||
-dontwarn sun.misc.**
|
||||
#-keep class com.google.gson.stream.** { *; }
|
||||
|
||||
# Application classes that will be serialized/deserialized over Gson
|
||||
-keep class com.google.gson.examples.android.model.** { <fields>; }
|
||||
|
||||
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
|
||||
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
|
||||
-keep class * extends com.google.gson.TypeAdapter
|
||||
-keep class * implements com.google.gson.TypeAdapterFactory
|
||||
-keep class * implements com.google.gson.JsonSerializer
|
||||
-keep class * implements com.google.gson.JsonDeserializer
|
||||
|
||||
# Prevent R8 from leaving Data object members always null
|
||||
-keepclassmembers,allowobfuscation class * {
|
||||
@com.google.gson.annotations.SerializedName <fields>;
|
||||
}
|
||||
|
||||
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
|
||||
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
|
||||
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
||||
|
||||
##---------------End: proguard configuration for Gson ----------
|
||||
|
||||
-keepattributes EnclosingMethod
|
||||
#--------融云
|
||||
-keepattributes Exceptions,InnerClasses
|
||||
-keepattributes Signature
|
||||
-keep class io.rong.** {*;}
|
||||
-keep class cn.rongcloud.** {*;}
|
||||
-keep class * implements io.rong.imlib.model.MessageContent {*;}
|
||||
-dontwarn io.rong.push.**
|
||||
-dontnote com.xiaomi.**
|
||||
-dontnote com.google.android.gms.gcm.**
|
||||
-dontnote io.rong.**
|
||||
# 下方混淆使用了融云 IMKit 提供的 locationKit 位置插件时才需要配置,可参考高德官网的混淆方式:https://lbs.amap.com/api/android-sdk/guide/create-project/dev-attention
|
||||
-keep class com.amap.api.maps.**{*;}
|
||||
-keep class com.autonavi.**{*;}
|
||||
-keep class com.amap.api.trace.**{*;}
|
||||
-keep class com.amap.api.location.**{*;}
|
||||
-keep class com.amap.api.fence.**{*;}
|
||||
-keep class com.loc.**{*;}
|
||||
-keep class com.autonavi.aps.amapapi.model.**{*;}
|
||||
-keep class com.amap.api.services.**{*;}
|
||||
-ignorewarnings
|
||||
|
||||
#--------科大讯飞
|
||||
-keep class com.iflytek.**{*;}
|
||||
-keepattributes Signature
|
||||
#EvenBus
|
||||
-keepattributes *Annotation*
|
||||
-keepclassmembers class * {
|
||||
@org.greenrobot.eventbus.Subscribe <methods>;
|
||||
}
|
||||
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
|
||||
|
||||
# If using AsyncExecutord, keep required constructor of default event used.
|
||||
# Adjust the class name if a custom failure event type is used.
|
||||
-keepclassmembers class org.greenrobot.eventbus.util.ThrowableFailureEvent {
|
||||
<init>(java.lang.Throwable);
|
||||
}
|
||||
|
||||
# Accessed via reflection, avoid renaming or removal
|
||||
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl*
|
||||
|
||||
#--------ARouter
|
||||
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
||||
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
||||
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
||||
|
||||
# If you use the byType method to obtain Service, add the following rules to protect the interface:
|
||||
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
# If single-type injection is used, that is, no interface is defined to implement IProvider, the following rules need to be added to protect the implementation
|
||||
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
#----retrofit2
|
||||
-keepattributes Signature, InnerClasses, EnclosingMethod
|
||||
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
|
||||
-keepattributes AnnotationDefault
|
||||
-keepclassmembers,allowshrinking,allowobfuscation interface * {
|
||||
@retrofit2.http.* <methods>;
|
||||
}
|
||||
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement*
|
||||
-dontwarn javax.annotation.**
|
||||
-dontwarn kotlin.Unit
|
||||
-dontwarn retrofit2.KotlinExtensions*
|
||||
-dontwarn retrofit2.KotlinExtensions$*
|
||||
-if interface * { @retrofit2.http.* <methods>; }
|
||||
-keep,allowobfuscation interface <1>
|
||||
-if interface * { @retrofit2.http.* <methods>; }
|
||||
-keep,allowobfuscation interface * extends <1>
|
||||
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
|
||||
-if interface * { @retrofit2.http.* public *** *(...); }
|
||||
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
|
||||
|
||||
#-----glide
|
||||
-keep public class com.bumptech.glide.** {*;}
|
||||
-keep public class jp.co.cyberagent.** {*;}
|
||||
-dontwarn jp.co.cyberagent.android.gpuimage.**
|
||||
|
||||
-printconfiguration tmp/full-r8-config.txt
|
||||
#---美颜模块需要暴露出来的参数名
|
||||
-keep class com.yunbao.faceunity.utils.FURenderer{
|
||||
public static java.lang.String BUNDLE_AI_FACE;
|
||||
}
|
||||
-keep class com.yunbao.faceunity.utils.FaceUnityConfig{
|
||||
public static java.lang.String BUNDLE_FACE_BEAUTIFICATION;
|
||||
}
|
||||
-keep class com.faceunity.wrapper.faceunity$LoadConfig*{
|
||||
private static boolean sLoadedLibrary;
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
<uses-permission
|
||||
android:name="android.permission.CALL_PHONE"
|
||||
tools:node="remove" />
|
||||
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_LOGS"
|
||||
tools:ignore="ProtectedPermissions"
|
||||
@@ -78,20 +80,25 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||
<uses-permission android:name="com.android.vending.BILLING" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
|
||||
<!-- Android11新增 -->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||
<queries>
|
||||
<package android:name="com.twitter.android"/>
|
||||
<package android:name="jp.naver.line.android"/>
|
||||
|
||||
</queries>
|
||||
<application
|
||||
android:name="com.shayu.phonelive.AppContext"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="true"
|
||||
android:preserveLegacyExternalStorage="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="theme,label,icon,allowBackup">
|
||||
<!-- <service-->
|
||||
<!-- android:name="com.shayu.phonelive.utils.MyNotificationService">-->
|
||||
@@ -125,20 +132,7 @@
|
||||
|
||||
<data android:scheme="smvslm" />
|
||||
</intent-filter>
|
||||
</activity> <!-- keytool -exportcert -alias androiddebugkey -keystore feixiong.jks | openssl sha1 -binary | openssl base64 -->
|
||||
<meta-data
|
||||
android:name="TencentMapSDK"
|
||||
android:value="${txMapAppKey}" />
|
||||
<!-- 百度语音识别 -->
|
||||
<meta-data
|
||||
android:name="com.baidu.speech.APP_ID"
|
||||
android:value="${baiduAppId}" />
|
||||
<meta-data
|
||||
android:name="com.baidu.speech.API_KEY"
|
||||
android:value="${baiduAppKey}" />
|
||||
<meta-data
|
||||
android:name="com.baidu.speech.SECRET_KEY"
|
||||
android:value="${baiduAppSecretKey}" />
|
||||
</activity>
|
||||
|
||||
<!-- 服务器地址 -->
|
||||
<meta-data
|
||||
@@ -151,6 +145,9 @@
|
||||
<meta-data
|
||||
android:name="IS_UPLOAD_ERROR_LOG"
|
||||
android:value="${isUploadLog}" />
|
||||
<meta-data
|
||||
android:name="IS_PLUGIN_MODEL"
|
||||
android:value="${isPluginModel}" />
|
||||
<meta-data
|
||||
android:name="firebase_crashlytics_collection_enabled"
|
||||
android:value="${isUploadLog}" />
|
||||
@@ -189,12 +186,12 @@
|
||||
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<meta-data
|
||||
android:name="com.huawei.hms.client.appid"
|
||||
android:value="106936673"/>
|
||||
<meta-data
|
||||
android:name="com.huawei.hms.client.cpid"
|
||||
android:value="30086000612391734"/>
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.appid"-->
|
||||
<!-- android:value="106936673"/>-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.cpid"-->
|
||||
<!-- android:value="30086000612391734"/>-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -11,23 +11,23 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustConfig;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.adjust.sdk.LogLevel;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.Utils;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.fm.openinstall.OpenInstall;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.shayu.phonelive.utils.LogUtils;
|
||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||
@@ -36,17 +36,18 @@ import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AnchorStartLiveBean;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.faceunity.FaceManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.socket.SocketReceiveBean;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
import com.yunbao.live.views.PortraitLiveManager;
|
||||
@@ -83,15 +84,14 @@ public class AppContext extends CommonAppContext {
|
||||
public LiveImDeletUtil liveImDeletUtil;
|
||||
private final static List<WeakReference<Activity>> activities = new ArrayList<>();
|
||||
|
||||
|
||||
private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks {
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
Adjust.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
Adjust.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,12 +112,14 @@ public class AppContext extends CommonAppContext {
|
||||
return;
|
||||
}
|
||||
}
|
||||
AppManager.getInstance().removeActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
activities.add(new WeakReference<>(activity));
|
||||
CrashSaveBean.getInstance().setActivitySize(activities);
|
||||
AppManager.getInstance().addActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,13 +132,14 @@ public class AppContext extends CommonAppContext {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
//注册全局异常捕获
|
||||
if (!isMainProcess()) {
|
||||
return;
|
||||
}
|
||||
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
|
||||
//注册全局异常捕获
|
||||
registerError();
|
||||
registerFirebaseCrash();
|
||||
LogUtils.start(this);
|
||||
sInstance = this;
|
||||
L.setDeBug(BuildConfig.DEBUG);
|
||||
AppEventsLogger.activateApp(this);
|
||||
@@ -161,38 +164,8 @@ public class AppContext extends CommonAppContext {
|
||||
OpenInstall.init(this);
|
||||
}
|
||||
|
||||
String environment = AdjustConfig.ENVIRONMENT_PRODUCTION;
|
||||
AdjustConfig config = new AdjustConfig(this, "3om5fbglyqdc", environment);
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == false) {
|
||||
config.setDefaultTracker("xa7k5ut");
|
||||
}
|
||||
Adjust.onCreate(config);
|
||||
|
||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||
config.setLogLevel(LogLevel.WARN);
|
||||
//激活操作记录
|
||||
AdjustEvent adjustEvent = new AdjustEvent("m7wk0c");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_activation", null);
|
||||
|
||||
//FB激活
|
||||
logger.logEvent("FB_activation");
|
||||
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("p7igfz");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
CommonHttpUtil.setAdvertisingChannels("p7igfz", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_complete_1st_loading", null);
|
||||
//FB激活
|
||||
logger.logEvent("FB_complete_1st_loading");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//初始化 AndroidUtilCode
|
||||
Utils.init(this);
|
||||
liveImDeletUtil = new LiveImDeletUtil();
|
||||
@@ -226,11 +199,16 @@ public class AppContext extends CommonAppContext {
|
||||
&& (TextUtils.equals("__system__", message.getTargetId())
|
||||
|| ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
||||
SocketReceiveBean received = JSON.parseObject(content.getContent(), SocketReceiveBean.class);
|
||||
JSONObject map = received.getMsg().getJSONObject(0);
|
||||
sendStartAnchorLive(map);
|
||||
}
|
||||
//主播页面
|
||||
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketRyClient.mSocketHandler != null) {
|
||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||
}
|
||||
|
||||
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
||||
EventBus.getDefault().post(message);
|
||||
}
|
||||
@@ -240,6 +218,14 @@ public class AppContext extends CommonAppContext {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void sendStartAnchorLive(JSONObject map) {
|
||||
AnchorStartLiveBean bean = new AnchorStartLiveBean();
|
||||
bean.setAnchorName(map.getString("anchorName"));
|
||||
bean.setRoomId(map.getString("roomid"));
|
||||
bean.setAvatar(map.getString("avatar"));
|
||||
EventBus.getDefault().post(bean);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -268,10 +254,12 @@ public class AppContext extends CommonAppContext {
|
||||
mSocketHandler.sendMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
configSPApp();
|
||||
//初始化美颜SDK
|
||||
FaceManager.initFaceUnity(this);
|
||||
// FaceManager.initFaceUnity(this);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -313,18 +301,21 @@ public class AppContext extends CommonAppContext {
|
||||
.setMainCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
//闪退后finish所有Activity并且杀死进程
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
if (activity != null && activity.get() != null) {
|
||||
activity.get().finish();
|
||||
AppManager.runDebugCode(() -> {
|
||||
//闪退后finish所有Activity并且杀死进程
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
if (activity != null && activity.get() != null) {
|
||||
activity.get().finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Process.killProcess(Process.myPid());
|
||||
System.exit(0);*/
|
||||
setFirebaseCrashData();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
throw new RuntimeException(e);
|
||||
}, 100);
|
||||
Process.killProcess(Process.myPid());
|
||||
System.exit(0);
|
||||
setFirebaseCrashData();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
throw new RuntimeException(e);
|
||||
}, 100);
|
||||
});
|
||||
|
||||
})
|
||||
.setUncaughtCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
@@ -342,7 +333,7 @@ public class AppContext extends CommonAppContext {
|
||||
}
|
||||
|
||||
|
||||
private void setFirebaseCrashData() {
|
||||
public static void setFirebaseCrashData() {
|
||||
if (!CommonAppConfig.IS_UPLOAD_ERROR_LOG) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,9 +8,13 @@ import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.FileUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
@@ -90,10 +94,12 @@ public class NeverCrashUtils {
|
||||
*
|
||||
* @param application application
|
||||
*/
|
||||
private boolean errorWhile = true;
|
||||
|
||||
public void register(Application application) {
|
||||
//主线程异常拦截
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
while (true) {
|
||||
while (errorWhile) {
|
||||
try {
|
||||
Looper.loop();
|
||||
} catch (Throwable e) {
|
||||
@@ -101,10 +107,13 @@ public class NeverCrashUtils {
|
||||
Log.e(TAG, "未捕获的主线程异常行为", e);
|
||||
}
|
||||
e.printStackTrace();
|
||||
Toast.makeText(application, "发生闪退", Toast.LENGTH_SHORT).show();
|
||||
AppContext.setFirebaseCrashData();
|
||||
FirebaseCrashlytics.getInstance().recordException(e);
|
||||
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||
return;
|
||||
AppManager.runDebugCode(() -> errorWhile = false);
|
||||
// return;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -139,11 +148,11 @@ public class NeverCrashUtils {
|
||||
writer.write("PhoneName=" + Build.BRAND + "\n");
|
||||
writer.write("Phone=" + Build.MODEL + "\n");
|
||||
writer.write("CPU=" + Arrays.toString(Build.SUPPORTED_ABIS) + "\n");
|
||||
writer.write("runTime=" + (System.currentTimeMillis() - CrashSaveBean.getInstance().getStartTime())+ "\n");
|
||||
writer.write("enterRoom=" + CrashSaveBean.getInstance().getEnterRoom()+ "\n");
|
||||
writer.write("slidingRoom=" + CrashSaveBean.getInstance().getSlidingRoom()+ "\n");
|
||||
writer.write("playSvga=" + CrashSaveBean.getInstance().getPlaySvga()+ "\n");
|
||||
writer.write("ActivitySize=" + CrashSaveBean.getInstance().getActivitySize()+ "\n");
|
||||
writer.write("runTime=" + (System.currentTimeMillis() - CrashSaveBean.getInstance().getStartTime()) + "\n");
|
||||
writer.write("enterRoom=" + CrashSaveBean.getInstance().getEnterRoom() + "\n");
|
||||
writer.write("slidingRoom=" + CrashSaveBean.getInstance().getSlidingRoom() + "\n");
|
||||
writer.write("playSvga=" + CrashSaveBean.getInstance().getPlaySvga() + "\n");
|
||||
writer.write("ActivitySize=" + CrashSaveBean.getInstance().getActivitySize() + "\n");
|
||||
writer.write("UserData=" + SpUtil.getInstance().getStringValue(SpUtil.USER_INFO) + "\n");
|
||||
writer.write("[ERROR]");
|
||||
PrintWriter printWriter = new PrintWriter(writer);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.shayu.phonelive.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -21,9 +22,10 @@ import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -48,6 +50,7 @@ import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.DownloadUtil;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LogUtil;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
@@ -101,20 +104,22 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
private int mVideoLastProgress;
|
||||
private boolean mForward;
|
||||
|
||||
@Override
|
||||
public Resources getResources() {
|
||||
Resources res = super.getResources();
|
||||
Configuration config = new Configuration();
|
||||
config.setToDefaults();
|
||||
config.locale = IMLoginManager.get(this).getLocaleLanguage();
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
return res;
|
||||
}
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
setStatusBar();
|
||||
setContentView(R.layout.activity_launcher);
|
||||
//开屏
|
||||
AdjustEvent adjustEvent = new AdjustEvent("vjqk8g");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_screen", null);
|
||||
//FB激活
|
||||
logger.logEvent("FB_screen");
|
||||
mContext = this;
|
||||
mRoot = findViewById(R.id.root);
|
||||
mCover = findViewById(R.id.cover);
|
||||
@@ -140,6 +145,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
};
|
||||
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
|
||||
LogUtil.uploadErrorLog(AppContext.sInstance);
|
||||
SpUtil.getInstance().setBooleanValue("NOTIFICATION", NotificationManagerCompat.from(this).areNotificationsEnabled());
|
||||
}
|
||||
|
||||
|
||||
@@ -194,6 +200,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
String adInfo = bean.getAdInfo();
|
||||
if (!TextUtils.isEmpty(adInfo)) {
|
||||
JSONObject obj = JSON.parseObject(adInfo);
|
||||
Log.i(TAG, "callback: " + adInfo);
|
||||
if (obj.getIntValue("switch") == 1) {
|
||||
List<AdBean> list = JSON.parseArray(obj.getString("list"), AdBean.class);
|
||||
if (list != null && list.size() > 0) {
|
||||
@@ -278,8 +285,19 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
if (getIntent().getStringExtra("activityUrl") != null) {
|
||||
intent.putExtra("activityUrl", getIntent().getStringExtra("activityUrl"));
|
||||
}
|
||||
|
||||
LauncherActivity.this.startActivity(intent);
|
||||
if (mImageViewList != null && mImageViewList.size() > 0) {
|
||||
Log.i(TAG, "forwardMainActivity: " + mImageViewList.size());
|
||||
AdBean bean = mAdList.get(0);
|
||||
if (bean != null && bean.getAnimation() == 1) {
|
||||
intent.putExtra("ad_url", mAdList.get(0).getUrl());
|
||||
Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(LauncherActivity.this, mImageViewList.get(0), "ad_img_0").toBundle();
|
||||
LauncherActivity.this.startActivity(intent, bundle);
|
||||
} else {
|
||||
LauncherActivity.this.startActivity(intent);
|
||||
}
|
||||
} else {
|
||||
LauncherActivity.this.startActivity(intent);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -388,6 +406,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
imageView.setBackgroundColor(0xffffffff);
|
||||
imageView.setTransitionName("ad_img_" + i);
|
||||
mImageViewList.add(imageView);
|
||||
ImgLoader.display(mContext, mAdList.get(i).getUrl(), imageView);
|
||||
}
|
||||
@@ -521,7 +540,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
}
|
||||
} else if (e == TXLiveConstants.PLAY_ERR_NET_DISCONNECT ||
|
||||
e == TXLiveConstants.PLAY_ERR_FILE_NOT_FOUND) {
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_play_error));
|
||||
ToastUtil.show(mContext.getString(R.string.live_play_error));
|
||||
checkUidAndToken();
|
||||
} else if (e == TXLiveConstants.PLAY_EVT_PLAY_PROGRESS) {
|
||||
int progress = bundle.getInt("EVT_PLAY_PROGRESS_MS");
|
||||
|
||||
@@ -2,7 +2,10 @@ package com.shayu.phonelive.utils;
|
||||
|
||||
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
@@ -17,6 +20,7 @@ import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
@@ -31,9 +35,12 @@ import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.phonelive.AppContext;
|
||||
import com.shayu.phonelive.activity.LauncherActivity;
|
||||
import com.yunbao.common.bean.NotificationMsgBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
|
||||
import org.json.JSONException;
|
||||
@@ -52,7 +59,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
NotificationManager manager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);
|
||||
NotificationChannel channel = new NotificationChannel(channelID, channelNAME, level);
|
||||
channel.setSound(Uri.parse("android.resource://" + context.getPackageName() + "/raw/pdlive_sound"),null);
|
||||
channel.setSound(Uri.parse("android.resource://" + context.getPackageName() + "/raw/pdlive_sound"), null);
|
||||
manager.createNotificationChannel(channel);
|
||||
return channelID;
|
||||
} else {
|
||||
@@ -81,6 +88,26 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
@Override
|
||||
public boolean onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) {
|
||||
Log.i("gmc", notificationMessage.getPushContent() + "VVV" + notificationMessage.getPushTitle() + "gmc11112222" + notificationMessage.getExtra());
|
||||
if (!SpUtil.getInstance().getBooleanValue("NOTIFICATION")) {
|
||||
if (AppContext.activityWeakReference != null) {
|
||||
Activity activity = AppContext.activityWeakReference.get();
|
||||
if (activity != null) {
|
||||
DialogUitl.showSimpleDialog(activity, "应用需要通知权限", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
|
||||
intent.putExtra("app_package", context.getPackageName());
|
||||
intent.putExtra("app_uid", context.getApplicationInfo().uid);
|
||||
// for Android 8 and above
|
||||
intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
|
||||
activity.startActivity(intent);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (notificationMessage.getExtra() == null) {
|
||||
msg.setImg("" + notificationMessage.getSenderPortrait());
|
||||
msg.setTitle(notificationMessage.getPushTitle());
|
||||
@@ -199,7 +226,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
}else {
|
||||
} else {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||
@@ -233,7 +260,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
}else {
|
||||
} else {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||
@@ -276,7 +303,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
}else {
|
||||
} else {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||
|
||||
90
app/src/main/java/com/shayu/phonelive/utils/LogUtils.java
Normal file
@@ -0,0 +1,90 @@
|
||||
package com.shayu.phonelive.utils;
|
||||
|
||||
import static java.text.DateFormat.DEFAULT;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
public class LogUtils {
|
||||
/**
|
||||
* 采集所有日志
|
||||
*/
|
||||
public static void start(Context context) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
String[] exec = new String[]{"logcat", "-c"};
|
||||
Runtime.getRuntime().exec(exec).waitFor();
|
||||
|
||||
exec = new String[]{"logcat", "-v", "color", "UTC-8"};
|
||||
|
||||
Process process = Runtime.getRuntime().exec(exec);
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
String line;
|
||||
PrintWriter writer = null;
|
||||
String title = "[PDLIVE]" + CommonAppConfig.getInstance().getUid() + "_";
|
||||
String today = title + SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).format(new Date());
|
||||
File dir = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator);
|
||||
if (dir.listFiles() != null) {
|
||||
for (File file : dir.listFiles()) {
|
||||
if (file.getName().endsWith(".log") && !"error.log".equals(file.getName())) {
|
||||
String fileName = file.getName().replace(".log", "").split("_")[1];
|
||||
if (isDelLog(fileName)) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File saveFile = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator + today + ".log");
|
||||
FileOutputStream os = new FileOutputStream(saveFile, true);
|
||||
writer = new PrintWriter(os);
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
writer.append(line).write("\n");
|
||||
writer.flush();
|
||||
}
|
||||
writer.flush();
|
||||
writer.close();
|
||||
exec = new String[]{"logcat", "-c"};
|
||||
Runtime.getRuntime().exec(exec).waitFor();
|
||||
bufferedReader.close();
|
||||
start(context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是要删除的日志
|
||||
**/
|
||||
private static boolean isDelLog(String time) {
|
||||
try {
|
||||
Calendar timeCal = Calendar.getInstance(Locale.CHINA);
|
||||
timeCal.setTime(Objects.requireNonNull(SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).parse(time)));
|
||||
Calendar calendar = Calendar.getInstance(Locale.CHINA);
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE, -3);
|
||||
return calendar.after(timeCal);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/res/drawable/no_banner.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">PDLIVE</string>
|
||||
<string name="leak_canary_test_class_name">assertk.Assert</string>
|
||||
</resources>
|
||||
@@ -86,7 +86,7 @@ public class TieZhiAdapter extends RecyclerView.Adapter<TieZhiAdapter.Vh> {
|
||||
TiUtils.unzip(file, targetDir);
|
||||
bean.setDownloadSuccess(mContext);
|
||||
} catch (Exception e) {
|
||||
ToastUtil.show(WordUtil.getString(R.string.tiezhi_download_failed));
|
||||
ToastUtil.show(mContext.getString(R.string.tiezhi_download_failed));
|
||||
bean.setDownloading(false);
|
||||
} finally {
|
||||
file.delete();
|
||||
@@ -103,7 +103,7 @@ public class TieZhiAdapter extends RecyclerView.Adapter<TieZhiAdapter.Vh> {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtil.show(WordUtil.getString(R.string.tiezhi_download_failed));
|
||||
ToastUtil.show(mContext.getString(R.string.tiezhi_download_failed));
|
||||
bean.setDownloading(false);
|
||||
notifyItemChanged(position, Constants.PAYLOAD);
|
||||
mLoadingTaskMap.remove(position);
|
||||
|
||||
@@ -22,6 +22,7 @@ buildscript {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
|
||||
classpath 'com.google.gms:google-services:4.3.3'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
||||
classpath "com.alibaba:arouter-register:1.0.2"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -116,8 +116,8 @@ dependencies {
|
||||
api rootProject.ext.dependencies["ucrop"]
|
||||
|
||||
//腾讯定位,地图sdk
|
||||
api files('libs/TencentLocationSdk_v6.2.5.3.jar')
|
||||
api files('libs/TencentMapSDK_1.2.8.1.jar')
|
||||
// api files('libs/TencentLocationSdk_v6.2.5.3.jar')
|
||||
// api files('libs/TencentMapSDK_1.2.8.1.jar')
|
||||
|
||||
//下拉刷新上拉加载
|
||||
api rootProject.ext.dependencies["smartRefreshLayout"]
|
||||
@@ -147,7 +147,6 @@ dependencies {
|
||||
//谷歌支付
|
||||
//谷歌内购
|
||||
api 'com.android.billingclient:billing:5.0.0'
|
||||
implementation 'com.teprinciple:updateapputils:2.3.0'
|
||||
api 'com.squareup.picasso:picasso:2.5.2'
|
||||
api "com.immomo.cosmos.mediax:beautyutils:2.2.1_01071700"
|
||||
api files('libs/liteavsdk.jar')
|
||||
@@ -155,27 +154,28 @@ dependencies {
|
||||
//腾讯im
|
||||
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
||||
api 'com.google.code.gson:gson:2.8.8'
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.5.8' // 音视频通话基础能力库
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.0' // 音视频通话基础能力库
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.2.0.2'
|
||||
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.2.5.4' // 即时通讯基础能力库
|
||||
api 'cn.rongcloud.sdk:im_kit:5.2.5.4' // 即时通讯 UI 基础组件
|
||||
//融云小视频模块
|
||||
api 'cn.rongcloud.sdk:sight:5.2.5.4'
|
||||
api 'com.facebook.android:facebook-android-sdk:15.0.1'
|
||||
implementation 'com.facebook.android:facebook-android-sdk:15.0.1'
|
||||
api 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||
implementation 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||
|
||||
api('com.twitter.sdk.android:twitter-core:3.1.1@aar') {
|
||||
transitive = true
|
||||
}
|
||||
api 'com.linecorp:linesdk:5.0.1'
|
||||
api 'com.adjust.sdk:adjust-android:4.30.1'
|
||||
api 'com.android.installreferrer:installreferrer:2.2'
|
||||
//Retrofit2库
|
||||
api 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||
api 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
|
||||
//gson解析
|
||||
api 'com.squareup.retrofit2:converter-gson:2.3.0'
|
||||
implementation "io.reactivex.rxjava2:rxjava:2.2.3"
|
||||
api 'com.squareup.retrofit2:converter-gson:2.3.0'//混淆
|
||||
implementation "io.reactivex.rxjava2:rxjava:2.2.3"//混淆
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||
api 'com.jakewharton.rxbinding3:rxbinding:3.1.0'
|
||||
//loading样式库
|
||||
@@ -188,4 +188,12 @@ dependencies {
|
||||
api 'com.github.princekin-f:EasyFloat:2.0.4'
|
||||
api files('libs/Msc.jar')
|
||||
|
||||
api 'com.github.li-xiaojun:XPopup:2.9.1'
|
||||
|
||||
api 'com.github.shenbengit:PagerGridLayoutManager:1.1.7'
|
||||
//选择器
|
||||
api 'com.github.gzu-liyujiang.AndroidPicker:Common:4.1.11'
|
||||
api 'com.github.gzu-liyujiang.AndroidPicker:WheelView:4.1.11'
|
||||
//自定义圆角图片
|
||||
api 'com.makeramen:roundedimageview:2.3.0'
|
||||
}
|
||||
|
||||
@@ -32,8 +32,9 @@
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
<!--
|
||||
|
||||
<!--支付宝-->
|
||||
支付宝
|
||||
<activity
|
||||
android:name="com.alipay.sdk.app.H5PayActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
||||
@@ -46,7 +47,8 @@
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
||||
<!--支付宝 end-->
|
||||
支付宝 end
|
||||
-->
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.ErrorActivity"
|
||||
|
||||
@@ -35,6 +35,8 @@ public class CommonAppConfig {
|
||||
public static final boolean IS_GOOGLE_PLAY = getMetaDataBoolean("IS_GOOGLE_PLAY");
|
||||
//是否开启上报错误日志功能
|
||||
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
||||
//是否为插件包模式
|
||||
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
||||
|
||||
//外部sd卡
|
||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||
@@ -383,7 +385,7 @@ public class CommonAppConfig {
|
||||
public String getAppName() {
|
||||
if (TextUtils.isEmpty(mAppName)) {
|
||||
int res = CommonAppContext.sInstance.getResources().getIdentifier("app_name", "string", "myname.pdlive.shayu");
|
||||
mAppName = WordUtil.getString(res);
|
||||
mAppName =WordUtil.getString(res);
|
||||
}
|
||||
return mAppName;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package com.yunbao.common;
|
||||
|
||||
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
||||
import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.android.gms.common.api.ApiException;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.rong.imlib.RongIMClient;
|
||||
@@ -24,9 +24,6 @@ import io.rong.push.RongPushClient;
|
||||
import io.rong.push.pushconfig.PushConfig;
|
||||
import me.leolin.shortcutbadger.ShortcutBadger;
|
||||
|
||||
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
||||
import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/3.
|
||||
@@ -35,13 +32,12 @@ import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
||||
public class CommonAppContext extends MultiDexApplication {
|
||||
|
||||
public static CommonAppContext sInstance;
|
||||
public static WeakReference<Activity> activityWeakReference;
|
||||
private int mCount;
|
||||
private boolean mFront;//是否前台
|
||||
public static int jpushMsgNum;
|
||||
public static int Ingroup = 0;
|
||||
public static String lang = "chinese";
|
||||
public static FirebaseAnalytics mFirebaseAnalytics;
|
||||
public static AppEventsLogger logger;
|
||||
public static boolean isReady = false;
|
||||
public static String home_zdy_img_us = "";
|
||||
public static String home_zdy_img_cn = "";
|
||||
@@ -67,33 +63,31 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
//初始化友盟统计
|
||||
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||
FacebookSdk.sdkInitialize(getApplicationContext());
|
||||
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
||||
mFirebaseAnalytics.setAnalyticsCollectionEnabled(true);
|
||||
mFirebaseAnalytics.setUserProperty("ALLOW_AD_PERSONALIZATION_SIGNALS", "true" );
|
||||
|
||||
|
||||
|
||||
logger = AppEventsLogger.newLogger(this);
|
||||
setAutoLogAppEventsEnabled(true);
|
||||
FacebookSdk.fullyInitialize();
|
||||
setAdvertiserIDCollectionEnabled(true);
|
||||
registerActivityLifecycleCallbacks();
|
||||
|
||||
Locale locale;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
locale = getResources().getConfiguration().getLocales().get(0);
|
||||
} else {
|
||||
locale = getResources().getConfiguration().locale;
|
||||
}
|
||||
if(locale.getLanguage().equals("en")){
|
||||
lang = "english";
|
||||
}else{
|
||||
lang = "chinese";
|
||||
}
|
||||
Log.i("lang",lang);
|
||||
Locale locale;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
locale = getResources().getConfiguration().getLocales().get(0);
|
||||
} else {
|
||||
locale = getResources().getConfiguration().locale;
|
||||
}
|
||||
if (locale.getLanguage().equals("zh")) {
|
||||
lang = "chinese";
|
||||
|
||||
} else {
|
||||
lang = "english";
|
||||
|
||||
}
|
||||
Log.i("lang", lang);
|
||||
|
||||
}
|
||||
|
||||
public static Activity getTopActivity() {
|
||||
return activityWeakReference.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
@@ -111,11 +105,12 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
mCount++;
|
||||
activityWeakReference = new WeakReference<>(activity);
|
||||
if (!mFront) {
|
||||
mFront = true;
|
||||
L.e("AppContext------->处于前台");
|
||||
ShortcutBadger.applyCount(activity,0);
|
||||
jpushMsgNum=0;
|
||||
ShortcutBadger.applyCount(activity, 0);
|
||||
jpushMsgNum = 0;
|
||||
CommonAppConfig.getInstance().setFrontGround(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
public class Constants {
|
||||
public static final String NEW_ENTER_ROOM = "enterRoom";
|
||||
|
||||
public static final String URL = "url";
|
||||
public static final String PAYLOAD = "payload";
|
||||
public static final String SEX = "sex";
|
||||
@@ -74,7 +76,7 @@ public class Constants {
|
||||
public static final String PAY_BUY_COIN_ALI = "Charge.getAliOrder";
|
||||
public static final String PAY_BUY_COIN_WX = "Charge.getWxOrder";
|
||||
|
||||
public static final String PACKAGE_NAME_ALI = "com.eg.android.AlipayGphone";//支付宝的包名
|
||||
// public static final String PACKAGE_NAME_ALI = "com.eg.android.AlipayGphone";//支付宝的包名
|
||||
public static final String PACKAGE_NAME_WX = "com.tencent.mm";//微信的包名
|
||||
public static final String PACKAGE_NAME_QQ = "com.tencent.mobileqq";//QQ的包名
|
||||
public static final String LAT = "lat";
|
||||
@@ -130,6 +132,8 @@ public class Constants {
|
||||
public static final int LIVE_FUNC_MIC = 2013;//語音
|
||||
public static final int LIVE_FUNC_WKS = 2014;//語音
|
||||
public static final int LIVE_FUNC_ZSLK = 2015;//語音
|
||||
public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK
|
||||
public static final int LIVE_ROBOT = 2017;//机器人
|
||||
|
||||
//socket
|
||||
public static final String SOCKET_CONN = "conn";
|
||||
@@ -143,6 +147,7 @@ public class Constants {
|
||||
public static final String SOCKET_ALL_SERVER_NOTIFY = "AllServerNotify";//全服通知
|
||||
public static final String SOCKET_SEND_BARRAGE = "SendBarrage";//发弹幕
|
||||
public static final String SOCKET_LIVE_DRPK = "LiveDRPK";//多人PK
|
||||
public static final String SOCKET_LIVE_DRPK_RANDOM = "LiveRandomPK";//随机PK
|
||||
public static final String SOCKET_LEAVE_ROOM = "disconnect";//用户离开房间
|
||||
public static final String SOCKET_LIVE_END = "StartEndLive";//主播关闭直播
|
||||
public static final String SOCKET_SYSTEM = "SystemNot";//系统消息
|
||||
@@ -167,7 +172,19 @@ public class Constants {
|
||||
public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息
|
||||
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
|
||||
public static final String AI_AUTOMATIC_SPEECH = "aiAutomaticSpeech";//机器人助手
|
||||
public static final String AI_AUTOMATIC_SPEECH_LIVE = "aiAutomaticSpeechNew";//机器人助手
|
||||
public static final String STAR_CHALLENGE_UPGRADE_NOTIFY = "starChallengeUpgradeNotify";//星级挑战成功
|
||||
public static final String SUPER_VISION = "supervision";//超级发言警告
|
||||
public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据
|
||||
public static final String CUSTOM_FULL_SERVICE_NOTIFY = "customFullServiceNotify";//全服通知
|
||||
public static final String XYD_COMPLETE = "XydComplete";//心愿单完成通知
|
||||
public static final String WISH_LIST_PROGRESS = "wishListProgress";//心愿单进度通知
|
||||
public static final String LIVE_VOTE_CREATE = "createVote";
|
||||
public static final String LIVE_VOTE_UPDATE = "updateVote";
|
||||
public static final String LIVE_VOTE_END = "endVote";
|
||||
public static final String LIVE_PK_END = "endPK";//结束PK,以这个PK获取到的参数为准
|
||||
public static final String RED_PACKET = "RedPacket";//红包通知
|
||||
public static final String RED_PACKET_SUPER_JACKPOT = "RedPacketSuperJackpot";//超级红包通知
|
||||
|
||||
//游戏socket
|
||||
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花
|
||||
@@ -182,6 +199,7 @@ public class Constants {
|
||||
public static final String LOVE_CHECK = "LoveCheck";//热度卡消息
|
||||
public static final String TRUMPET_NOTIFY = "TrumpetNotify";//全栈喇叭
|
||||
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
||||
public static final String Lucky100Check = "Lucky100Check";//幸运天使
|
||||
|
||||
public static final int SOCKET_WHAT_CONN = 0;
|
||||
public static final int SOCKET_WHAT_DISCONN = 2;
|
||||
|
||||
@@ -8,7 +8,7 @@ public class HtmlConfig {
|
||||
|
||||
//登录即代表同意服务和隐私条款
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=3";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/portal/page/index/id/59";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=Portal&m=Page&a=index&id=59";
|
||||
|
||||
//注册用户协议
|
||||
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=2";
|
||||
|
||||
@@ -27,6 +27,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.LifeCycleListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -48,6 +49,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
Resources res = super.getResources();
|
||||
Configuration config = new Configuration();
|
||||
config.setToDefaults();
|
||||
config.locale = IMLoginManager.get(this).getLocaleLanguage();
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
return res;
|
||||
}
|
||||
@@ -55,6 +57,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
create();
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
isFullWindow = getIntent().getBooleanExtra("isFull", false);
|
||||
@@ -86,6 +89,9 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
|
||||
protected void main() {
|
||||
|
||||
}
|
||||
protected void create(){
|
||||
|
||||
}
|
||||
|
||||
protected boolean isStatusBarWhite() {
|
||||
|
||||
@@ -60,6 +60,6 @@ public class ErrorActivity extends AbsActivity {
|
||||
ClipboardManager clipboardManager = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clipData = ClipData.newPlainText("text", mErrorInfo);
|
||||
clipboardManager.setPrimaryClip(clipData);
|
||||
ToastUtil.show(WordUtil.getString(R.string.copy_success));
|
||||
ToastUtil.show(mContext.getString(R.string.copy_success));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
@@ -7,12 +8,9 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
@@ -23,15 +21,33 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.AndroidBug5497Workaround;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.HintCustomPopup;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/25.
|
||||
@@ -59,19 +75,18 @@ public class WebViewActivity extends AbsActivity {
|
||||
protected void main() {
|
||||
String url = getIntent().getStringExtra(Constants.URL);
|
||||
L.e("H5--->" + url);
|
||||
Bus.getOn(this);
|
||||
LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
|
||||
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
btnEdit = (ImageView) findViewById(R.id.btn_edit);
|
||||
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
||||
v_spacing = (View) findViewById(R.id.v_spacing);
|
||||
AndroidBug5497Workaround.assistActivity(this);
|
||||
mWebView = findViewById(R.id.webView);
|
||||
|
||||
mWebView = new WebView(mContext);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
params.topMargin = DpUtil.dp2px(1);
|
||||
mWebView.setLayoutParams(params);
|
||||
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
rootView.addView(mWebView);
|
||||
// mWebView.setLayoutParams(params);
|
||||
//mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
@@ -93,6 +108,12 @@ public class WebViewActivity extends AbsActivity {
|
||||
if (url.contains("for")) {
|
||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||
}
|
||||
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
||||
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
||||
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
||||
if (!navigationGestureEnabled(mContext)) {
|
||||
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@@ -136,7 +157,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
});
|
||||
mWebView.addJavascriptInterface(new JsInteration(), "androidObject");
|
||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
|
||||
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
@@ -150,6 +171,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
mWebView.loadUrl(url);
|
||||
AndroidBug5497Workaround.assistActivity(this);
|
||||
|
||||
if (Constants.myIntoIndex == 2) {
|
||||
ft_title.setVisibility(View.GONE);
|
||||
@@ -165,58 +187,6 @@ public class WebViewActivity extends AbsActivity {
|
||||
}
|
||||
}
|
||||
|
||||
//js调用原生
|
||||
public class JsInteration {
|
||||
@JavascriptInterface
|
||||
public void onBack() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void modifyMydata() {
|
||||
indexInto = 1;
|
||||
RouteUtil.forwardEditProfileActivity();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void reportUser(String touid) {
|
||||
RouteUtil.forwardLiveReportActivity(touid);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void gotoHomePage(String indexStr) {
|
||||
Log.e("tgasss","indexStr4"+indexStr);
|
||||
|
||||
if (!"".equals(indexStr) && indexStr != null) {
|
||||
int index = -1;
|
||||
if ("0".equals(indexStr)) {
|
||||
index = 0;
|
||||
} else if ("1".equals(indexStr)) {
|
||||
index = 1;
|
||||
} else if ("2".equals(indexStr)) {
|
||||
index = 2;
|
||||
} else if ("3".equals(indexStr)) {
|
||||
index = 3;
|
||||
}
|
||||
if (index != -1) {
|
||||
finish();
|
||||
Constants.isShowPage = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openWebView(String url) {
|
||||
Constants.isTitle = false;
|
||||
RouteUtil.forwardZhuangBanActivity(url);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openWebViewTitle(String url) {
|
||||
Constants.isTitle = true;
|
||||
RouteUtil.forwardZhuangBanActivity(url);
|
||||
}
|
||||
}
|
||||
|
||||
private void openImageChooserActivity(ValueCallback<Uri> valueCallback) {
|
||||
mValueCallback = valueCallback;
|
||||
@@ -228,7 +198,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
}
|
||||
intent.setType("image/*");
|
||||
startActivityForResult(Intent.createChooser(intent, WordUtil.getString(R.string.choose_flie)), CHOOSE);
|
||||
startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@@ -278,13 +248,13 @@ public class WebViewActivity extends AbsActivity {
|
||||
}
|
||||
}
|
||||
Intent intent = new Intent(context, WebViewActivity.class);
|
||||
intent.putExtra(Constants.URL, url);
|
||||
intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
public static void forward(Context context, String url) {
|
||||
forward(context, url, true);
|
||||
}
|
||||
forward(context, url, true); }
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
@@ -298,6 +268,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
Constants.myIntoIndex = 0;
|
||||
indexInto = 0;
|
||||
Constants.LoginKefu = true;
|
||||
Bus.getOff(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@@ -348,11 +319,61 @@ public class WebViewActivity extends AbsActivity {
|
||||
if (Constants.isShowPage != -1) {
|
||||
finish();
|
||||
}
|
||||
// new Handler().postDelayed(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// mWebView.reload();
|
||||
// }
|
||||
// }, 100);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||
indexInto = event.getIndexInto();
|
||||
if (event.getMethod().equals("androidInviteShare")) {
|
||||
try {
|
||||
Class<?> clz = mContext.getClassLoader().loadClass("com.yunbao.share.ui.InvitePopDialog");
|
||||
Object invite = clz.getConstructor(Context.class).newInstance(mContext);
|
||||
invite = invite.getClass().getMethod("setUrl", String.class).invoke(invite, event.getData());
|
||||
assert invite != null;
|
||||
invite.getClass().getMethod("showDialog").invoke(invite);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else if (TextUtils.equals(event.getMethod(), "clickLogOffAccount")) {
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new HintCustomPopup(mContext,
|
||||
mContext.getString(R.string.delete_account1),
|
||||
mContext.getString(R.string.delete_account2))
|
||||
.setLiveOpenOk(mContext.getString(R.string.delete_account3))
|
||||
.setLiveOpenCancel(mContext.getString(R.string.cancel))
|
||||
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||
@Override
|
||||
public void onSure() {
|
||||
LiveNetManager.get(mContext).
|
||||
setLogOff(new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
Stack<Activity> allActivityStacks = AppManager.getInstance().getAllActivityStacks();
|
||||
for (int i = 0; i < allActivityStacks.size(); i++) {
|
||||
if (!(allActivityStacks.get(i) instanceof WebViewActivity)) {
|
||||
allActivityStacks.get(i).finish();
|
||||
}
|
||||
}
|
||||
IMLoginManager.get(mContext).logout(mContext);
|
||||
CommonAppConfig.getInstance().clearLoginInfo();
|
||||
mContext.finish();
|
||||
RouteUtil.forwardLoginActivity();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
}))
|
||||
.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.UserMedalModel;
|
||||
import com.yunbao.common.views.AchievementDetailsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AchievementDetailsAdapter extends RecyclerView.Adapter {
|
||||
private List<UserMedalModel> dressInfo = new ArrayList<>();
|
||||
|
||||
public AchievementDetailsAdapter(List<UserMedalModel> dressInfo) {
|
||||
this.dressInfo = dressInfo;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_achievement_details, parent, false);
|
||||
return new AchievementDetailsViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
AchievementDetailsViewHolder achievementDetailsViewHolder = (AchievementDetailsViewHolder) holder;
|
||||
achievementDetailsViewHolder.showData(dressInfo.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dressInfo.size();
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class ChatChargeCoinAdapter extends RecyclerView.Adapter<ChatChargeCoinAd
|
||||
mList = list;
|
||||
mCoinName = CommonAppConfig.getInstance().getCoinName();
|
||||
mGoldCoinName = CommonAppConfig.getInstance().getGoldCoinName();
|
||||
mGiveString = WordUtil.getString(R.string.coin_give);
|
||||
mGiveString = context.getString(R.string.coin_give);
|
||||
mOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.http.main.MainNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.DrawerRecommendViewHolder;
|
||||
import com.yunbao.common.views.DrawerTaskViewHolder;
|
||||
import com.yunbao.common.views.FunGamesViewHolder;
|
||||
import com.yunbao.common.views.RecommendViewHolder;
|
||||
import com.yunbao.common.views.RigtsInterestsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新侧边栏适配器
|
||||
*/
|
||||
public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
// "type": 1,//模块类型 1 充值送好礼类型2 任务中心类型 3趣味游戏类4 权益 ,5为你推荐
|
||||
private final int GOOD_GIFTS = 1;
|
||||
private final int TASK_CENTER = 2;
|
||||
private final int FUN_GAMES = 3;
|
||||
private final int RIGHTS_INTERESTS = 4;
|
||||
private final int RECOMMEND = 5;
|
||||
private String liveId;
|
||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
|
||||
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
||||
|
||||
public CustomDrawerPopupAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
|
||||
public CustomDrawerPopupAdapter setLiveId(String liveId) {
|
||||
this.liveId = liveId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupAdapter setList(List<AnchorRecommendItemModel> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
switch (viewType) {
|
||||
case GOOD_GIFTS:
|
||||
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_good_gifts, parent, false);
|
||||
return new DrawerRecommendViewHolder(goodGiftsView);
|
||||
case TASK_CENTER:
|
||||
View taskCenterView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_tsak_center, parent, false);
|
||||
return new DrawerTaskViewHolder(taskCenterView);
|
||||
case FUN_GAMES:
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_fun_games_view, parent, false);
|
||||
return new FunGamesViewHolder(runGamesView);
|
||||
case RIGHTS_INTERESTS:
|
||||
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_rights_interests, parent, false);
|
||||
return new RigtsInterestsViewHolder(rightsInterestsView);
|
||||
default:
|
||||
View recommendView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_recommend, parent, false);
|
||||
return new RecommendViewHolder(recommendView);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (holder instanceof DrawerRecommendViewHolder) {
|
||||
DrawerRecommendViewHolder recommendViewHolder = (DrawerRecommendViewHolder) holder;
|
||||
recommendViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof DrawerTaskViewHolder) {
|
||||
DrawerTaskViewHolder taskViewHolder = (DrawerTaskViewHolder) holder;
|
||||
taskViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof FunGamesViewHolder) {
|
||||
FunGamesViewHolder funGamesViewHolder = (FunGamesViewHolder) holder;
|
||||
funGamesViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof RigtsInterestsViewHolder) {
|
||||
RigtsInterestsViewHolder rigtsInterestsViewHolder = (RigtsInterestsViewHolder) holder;
|
||||
rigtsInterestsViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof RecommendViewHolder) {
|
||||
|
||||
RecommendViewHolder recommendViewHolder = (RecommendViewHolder) holder;
|
||||
recommendViewHolder.setData(infoModels.get(position));
|
||||
recommendViewHolder.updateData(list);
|
||||
|
||||
recommendViewHolder.setListener(new RecommendViewHolder.RecommendViewListener() {
|
||||
@Override
|
||||
public void changeOneBatch() {
|
||||
//推荐位
|
||||
MainNetManager.get((Activity) mContext)
|
||||
.anchorRecommend("9", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||
@Override
|
||||
public void onSuccess(AnchorRecommendModel anchorRecommendModel) {
|
||||
|
||||
List<AnchorRecommendItemModel> models = anchorRecommendModel.getList();
|
||||
int userIndex = -1;
|
||||
for (int i = 0; i < models.size(); i++) {
|
||||
if (TextUtils.equals(models.get(i).getUid(), liveId)) {
|
||||
userIndex = i;
|
||||
}
|
||||
}
|
||||
if (userIndex != -1) {
|
||||
models.remove(userIndex);
|
||||
}
|
||||
recommendViewHolder.updateData(models);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(R.string.net_error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void goToLive(AnchorRecommendItemModel model) {
|
||||
if (listener != null) {
|
||||
listener.goToLive(model);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return infoModels.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
CustomSidebarInfoModel model = infoModels.get(position);
|
||||
switch (model.getType()) {
|
||||
case "1":
|
||||
return GOOD_GIFTS;
|
||||
case "2":
|
||||
return TASK_CENTER;
|
||||
case "3":
|
||||
return FUN_GAMES;
|
||||
case "4":
|
||||
return RIGHTS_INTERESTS;
|
||||
case "5":
|
||||
return RECOMMEND;
|
||||
}
|
||||
return super.getItemViewType(position);
|
||||
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarInfoModel> mInfoModels) {
|
||||
infoModels.clear();
|
||||
infoModels.addAll(mInfoModels);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private CustomDrawerListener listener;
|
||||
|
||||
public CustomDrawerPopupAdapter setListener(CustomDrawerListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface CustomDrawerListener {
|
||||
void goToLive(AnchorRecommendItemModel model);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.views.DrawerRecommendChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DrawerRecommendAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public DrawerRecommendAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_drawer_recommend_child, parent, false);
|
||||
return new DrawerRecommendChildViewHolder(goodGiftsView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
DrawerRecommendChildViewHolder childViewHolder = (DrawerRecommendChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.DrawerTaskChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DrawerTaskAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public DrawerTaskAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View taskCenterView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_tsak_center_child, parent, false);
|
||||
return new DrawerTaskChildViewHolder(taskCenterView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
DrawerTaskChildViewHolder taskChildViewHolder = (DrawerTaskChildViewHolder) holder;
|
||||
taskChildViewHolder.setData(child.get(position), position);
|
||||
taskChildViewHolder.setListener(new DrawerTaskChildViewHolder.DrawerTaskChildListener() {
|
||||
@Override
|
||||
public void giftSuccess(CustomSidebarChildModel model, int index) {
|
||||
//将领取的任务移动至任务列表尾部
|
||||
Bus.get().post(new CustomDrawerPopupEvent()
|
||||
.setDisMiss(false).setRefresh(true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
if (child.size()>3){
|
||||
return 3;
|
||||
}else {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
// for (CustomSidebarChildModel childModel : mChild) {
|
||||
// if (TextUtils.equals("1", childModel.getIsShow())) {
|
||||
// child.add(childModel);
|
||||
// }
|
||||
// }
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.views.FunGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FunGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public FunGamesAdapter(Context mContext, boolean rigts) {
|
||||
this.mContext = mContext;
|
||||
this.rigts = rigts;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_fun_games_child_view, parent, false);
|
||||
return new FunGamesChildViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
FunGamesChildViewHolder childViewHolder = (FunGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
if (mChild.size() > 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
child.add(mChild.get(i));
|
||||
}
|
||||
} else {
|
||||
child.addAll(mChild);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void selectAll(List<CustomSidebarChildModel> mChild){
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.views.GiftAlreadyWallViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftAlreadyWallAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftWall = new ArrayList<>();
|
||||
private boolean sbWy;//是否正在直播
|
||||
|
||||
public GiftAlreadyWallAdapter(boolean sbWy) {
|
||||
this.sbWy = sbWy;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_already_wall, parent, false);
|
||||
return new GiftAlreadyWallViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftAlreadyWallViewHolder withoutWallViewHolder = (GiftAlreadyWallViewHolder) holder;
|
||||
withoutWallViewHolder.showData(giftWall.get(position), sbWy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftWall.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftQuantityModel;
|
||||
import com.yunbao.common.views.GiftNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftNumberAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftQuantityModel> giftQuantityModels;
|
||||
|
||||
public GiftNumberAdapter(List<GiftQuantityModel> giftQuantityModels) {
|
||||
this.giftQuantityModels = giftQuantityModels;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_gift_number, parent, false);
|
||||
return new GiftNumber(robotSayHelloView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftNumber giftNumber = (GiftNumber) holder;
|
||||
giftNumber.showData(giftQuantityModels.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftQuantityModels.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.views.GiftWithoutWallViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWithoutWallAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftWall = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_without_wall, parent, false);
|
||||
return new GiftWithoutWallViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftWithoutWallViewHolder withoutWallViewHolder = (GiftWithoutWallViewHolder) holder;
|
||||
withoutWallViewHolder.showData(giftWall.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftWall.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.WishModel;
|
||||
import com.yunbao.common.event.LiveNewWishListCloseEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.DayWishItemViewHolder;
|
||||
import com.yunbao.common.views.LunarWishItemViewHolder;
|
||||
import com.yunbao.common.views.SeasonalWishItemViewHolder;
|
||||
import com.yunbao.common.views.WeekWishItemViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewWishAdapter extends RecyclerView.Adapter {
|
||||
private int type = 0;
|
||||
private List<WishModel> wishList = new ArrayList<>();
|
||||
|
||||
public void addData(List<WishModel> wishModelList, int type) {
|
||||
this.type = type;
|
||||
wishList.clear();
|
||||
wishList.addAll(wishModelList);
|
||||
wishList.add(null);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void addGiftListModel(WishModel model) {
|
||||
switch (type) {
|
||||
case 1:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
|
||||
break;
|
||||
case 2:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
|
||||
break;
|
||||
case 3:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
|
||||
break;
|
||||
case 4:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
|
||||
break;
|
||||
}
|
||||
boolean isAdd = false;
|
||||
for (int i = 0; i < wishList.size(); i++) {
|
||||
if (wishList.get(i)!=null){
|
||||
if (!TextUtils.isEmpty(wishList.get(i).getLid()) && !TextUtils.isEmpty(model.getLid())
|
||||
&& TextUtils.equals(wishList.get(i).getLid(), model.getLid())) {
|
||||
ToastUtil.show(R.string.too_many_gifts);
|
||||
isAdd = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!isAdd) {
|
||||
wishList.add(0, model);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<WishModel> getWishList() {
|
||||
|
||||
return wishList;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (type == 1) {
|
||||
View dayWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_day_wish, parent, false);
|
||||
return new DayWishItemViewHolder(dayWish);
|
||||
} else if (type == 2) {
|
||||
View weekWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_week_wish, parent, false);
|
||||
return new WeekWishItemViewHolder(weekWish);
|
||||
} else if (type == 3) {
|
||||
View lunarWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_lunar_wish, parent, false);
|
||||
return new LunarWishItemViewHolder(lunarWish);
|
||||
} else {
|
||||
View seasonalWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_seasonal_wish, parent, false);
|
||||
return new SeasonalWishItemViewHolder(seasonalWish);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (position == wishList.size()) return;
|
||||
if (holder instanceof DayWishItemViewHolder) {
|
||||
DayWishItemViewHolder dayWishItemViewHolder = (DayWishItemViewHolder) holder;
|
||||
dayWishItemViewHolder.steDayWishData(wishList.get(position), position, new DayWishItemViewHolder.DayWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
} else if (holder instanceof WeekWishItemViewHolder) {
|
||||
WeekWishItemViewHolder weekWishItemViewHolder = (WeekWishItemViewHolder) holder;
|
||||
weekWishItemViewHolder.steWeekWishData(wishList.get(position), position, new WeekWishItemViewHolder.WeekWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
} else if (holder instanceof LunarWishItemViewHolder) {
|
||||
LunarWishItemViewHolder lunarWishItemViewHolder = (LunarWishItemViewHolder) holder;
|
||||
lunarWishItemViewHolder.steLunarWishData(wishList.get(position), position, new LunarWishItemViewHolder.LunarWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
} else if (holder instanceof SeasonalWishItemViewHolder) {
|
||||
SeasonalWishItemViewHolder seasonalWishItemViewHolder = (SeasonalWishItemViewHolder) holder;
|
||||
seasonalWishItemViewHolder.steSeasonalWish(wishList.get(position), position, new SeasonalWishItemViewHolder.SeasonalWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return wishList.size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftListModel;
|
||||
import com.yunbao.common.event.LiveNewWishGiftEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.LiveNewWishGiftViewHolder;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewWishGiftAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftListModel> giftListModels = new ArrayList<>();
|
||||
|
||||
public LiveNewWishGiftAdapter(List<GiftListModel> giftListModels) {
|
||||
this.giftListModels = giftListModels;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View dayWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gitf_wish, parent, false);
|
||||
return new LiveNewWishGiftViewHolder(dayWish);
|
||||
}
|
||||
|
||||
private int index = -1;
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
LiveNewWishGiftViewHolder wishGiftViewHolder = (LiveNewWishGiftViewHolder) holder;
|
||||
wishGiftViewHolder.setData(giftListModels.get(position), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
index = position;
|
||||
notifyDataSetChanged();
|
||||
Bus.get().post(new LiveNewWishGiftEvent().setModel(giftListModels.get(position)));
|
||||
}
|
||||
});
|
||||
wishGiftViewHolder.onSelect(index == position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftListModels.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewWishListAdapter extends FragmentStateAdapter {
|
||||
private List<Fragment> list = new ArrayList<>();
|
||||
|
||||
public LiveNewWishListAdapter(@NonNull FragmentActivity fragmentActivity, List<Fragment> list) {
|
||||
super(fragmentActivity);
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return list.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.views.LiveSystemMessageViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 主播消息中心适配器
|
||||
*/
|
||||
public class LiveSystemMessageAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private LayoutInflater mInflater;
|
||||
private List<ListInfoMessageModel> listInfoMessageModels = new ArrayList<>();
|
||||
|
||||
public LiveSystemMessageAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
mInflater = LayoutInflater.from(mContext);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new LiveSystemMessageViewHolder(mInflater.inflate(R.layout.view_live_system_message, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
LiveSystemMessageViewHolder messageViewHolder = (LiveSystemMessageViewHolder) holder;
|
||||
messageViewHolder.setViewData(listInfoMessageModels.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listInfoMessageModels.size();
|
||||
}
|
||||
|
||||
public void addData(List<ListInfoMessageModel> list) {
|
||||
listInfoMessageModels.addAll(list);
|
||||
notifyDataSetChanged();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.UserMedalListModel;
|
||||
import com.yunbao.common.views.MedalAchievementViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MedalAchievementAdapter extends RecyclerView.Adapter {
|
||||
private List<UserMedalListModel> medalData = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_medal_achievement, parent, false);
|
||||
return new MedalAchievementViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
MedalAchievementViewHolder achievementViewHolder = (MedalAchievementViewHolder) holder;
|
||||
achievementViewHolder.showData(medalData.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return medalData.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<UserMedalListModel> mGiftWall) {
|
||||
|
||||
medalData.clear();
|
||||
medalData.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.views.MonthGiftNamingViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MonthGiftNamingAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftWall = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_month_gift_naming, parent, false);
|
||||
return new MonthGiftNamingViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
MonthGiftNamingViewHolder monthGiftNamingViewHolder = (MonthGiftNamingViewHolder) holder;
|
||||
monthGiftNamingViewHolder.showData(giftWall.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftWall.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.views.RecommendChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RecommendAdapter extends RecyclerView.Adapter {
|
||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
private Context mContext;
|
||||
|
||||
public RecommendAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new RecommendChildViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_sidebar_lives_new, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
RecommendChildViewHolder itemViewHolder = (RecommendChildViewHolder) holder;
|
||||
itemViewHolder.setData(list.get(position));
|
||||
itemViewHolder.setListener(new RecommendChildViewHolder.RecommendChildListener() {
|
||||
@Override
|
||||
public void goToLive(AnchorRecommendItemModel model) {
|
||||
if (callback != null) {
|
||||
callback.goToLive(model);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public void updateData(List<AnchorRecommendItemModel> mList) {
|
||||
list.clear();
|
||||
list.addAll(mList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private RecommendCallback callback;
|
||||
|
||||
public RecommendAdapter setCallback(RecommendCallback callback) {
|
||||
this.callback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface RecommendCallback {
|
||||
void goToLive(AnchorRecommendItemModel model);
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public abstract class RefreshAdapter<T> extends RecyclerView.Adapter {
|
||||
return position;
|
||||
}
|
||||
|
||||
protected boolean canClick() {
|
||||
protected static boolean canClick() {
|
||||
return ClickUtil.canClick();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.views.RobotMessageViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RobotMessageAdapter extends RecyclerView.Adapter {
|
||||
private List<LiveAiRobotBean.Message> messageList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View robotMessageView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_robot_message, parent, false);
|
||||
return new RobotMessageViewHolder(robotMessageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
RobotMessageViewHolder messageViewHolder = (RobotMessageViewHolder) holder;
|
||||
messageViewHolder.setData(messageList.get(position), position + 1);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return messageList.size();
|
||||
}
|
||||
|
||||
|
||||
public void setDataAll(List<LiveAiRobotBean.Message> messages) {
|
||||
messageList.clear();
|
||||
messageList.addAll(messages);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
// 删除数据
|
||||
public void removeData(int position) {
|
||||
messageList.remove(position);
|
||||
//删除动画
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.views.RobotSayHelloViewHoler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RobotSayHelloAdapter extends RecyclerView.Adapter {
|
||||
private List<LiveAiRobotBean.Message> messageList = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_robot_message, parent, false);
|
||||
return new RobotSayHelloViewHoler(robotSayHelloView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
RobotSayHelloViewHoler robotSayHelloViewHoler = (RobotSayHelloViewHoler) holder;
|
||||
robotSayHelloViewHoler.setData(messageList.get(position), position + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return messageList.size();
|
||||
}
|
||||
|
||||
|
||||
public void setDataAll(List<LiveAiRobotBean.Message> messages) {
|
||||
messageList.clear();
|
||||
messageList.addAll(messages);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
// 删除数据
|
||||
public void removeData(int position) {
|
||||
messageList.remove(position);
|
||||
//删除动画
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
public class AdBean {
|
||||
private String mUrl;
|
||||
private String mLink;
|
||||
private int animation;//是否使用过度动画
|
||||
|
||||
@JSONField(name = "thumb")
|
||||
public String getUrl() {
|
||||
@@ -26,4 +27,12 @@ public class AdBean {
|
||||
public void setLink(String link) {
|
||||
mLink = link;
|
||||
}
|
||||
@JSONField(name = "animation")
|
||||
public int getAnimation() {
|
||||
return animation;
|
||||
}
|
||||
@JSONField(name = "animation")
|
||||
public void setAnimation(int animation) {
|
||||
this.animation = animation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class AnchorRecommendItemModel extends BaseModel {
|
||||
private String avatarThumb = "";
|
||||
@SerializedName("avatar2")
|
||||
private String avatar2 = "";
|
||||
@SerializedName("user_nicename")
|
||||
@SerializedName(value = "user_nicename", alternate = "userNiceName")
|
||||
private String userNicename = "";
|
||||
@SerializedName("level")
|
||||
private String level = "";
|
||||
|
||||
@@ -17,6 +17,8 @@ public class AnchorRecommendModel extends BaseModel {
|
||||
//是否展示0=不展示1=展示
|
||||
@SerializedName("list_show")
|
||||
private int listShow = 0;
|
||||
@SerializedName("red_packet_show")
|
||||
private int showRedPacket = 0;//是否显示首页红包浮窗
|
||||
//是否支持换一批0=不支持 1=支持
|
||||
@SerializedName("up_show")
|
||||
private int upShow = 0;
|
||||
@@ -24,6 +26,10 @@ public class AnchorRecommendModel extends BaseModel {
|
||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
@SerializedName("slide")
|
||||
private List<SlideInfoModel> slide = new ArrayList<>();
|
||||
@SerializedName("red_packet_total")
|
||||
private int redPacketTotal = 100;
|
||||
@SerializedName("red_packet_day_create_num")
|
||||
private int redPacketNum = 0;
|
||||
|
||||
public List<SlideInfoModel> getSlide() {
|
||||
return slide;
|
||||
@@ -52,6 +58,30 @@ public class AnchorRecommendModel extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getShowRedPacket() {
|
||||
return showRedPacket;
|
||||
}
|
||||
|
||||
public void setShowRedPacket(int showRedPacket) {
|
||||
this.showRedPacket = showRedPacket;
|
||||
}
|
||||
|
||||
public int getRedPacketTotal() {
|
||||
return redPacketTotal;
|
||||
}
|
||||
|
||||
public void setRedPacketTotal(int redPacketTotal) {
|
||||
this.redPacketTotal = redPacketTotal;
|
||||
}
|
||||
|
||||
public int getRedPacketNum() {
|
||||
return redPacketNum;
|
||||
}
|
||||
|
||||
public void setRedPacketNum(int redPacketNum) {
|
||||
this.redPacketNum = redPacketNum;
|
||||
}
|
||||
|
||||
public List<AnchorRecommendItemModel> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||