Compare commits
464 Commits
6.4.5
...
dev_6.4.9_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f072a31fc | ||
|
|
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 | |||
|
|
3d5ac05d36 | ||
|
|
d3268e57bc | ||
|
|
3549c25cca | ||
|
|
859f54b1e1 | ||
| a808cd13c0 | |||
|
|
cd0067d77b | ||
|
|
894e264fb3 | ||
| 5dd5b2e0ea | |||
|
|
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 |
@@ -118,8 +118,12 @@ public class FaceManager implements SensorEventListener {
|
|||||||
if ("FilterViewHolder_".equals(key)) {
|
if ("FilterViewHolder_".equals(key)) {
|
||||||
for (FaceBeautyFilterBean filter : faceBeautyDataFactory.getBeautyFilters()) {
|
for (FaceBeautyFilterBean filter : faceBeautyDataFactory.getBeautyFilters()) {
|
||||||
if (filter.getKey().equals(configMap.get(key)) && !"origin".equals(configMap.get(key))) {
|
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());
|
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"));
|
Log.i(TAG, "test: 设置滤镜 =" + filter.getKey() + " val = " + configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,8 +131,12 @@ public class FaceManager implements SensorEventListener {
|
|||||||
String name = key.replace("BeautySkinViewHolder_", "");
|
String name = key.replace("BeautySkinViewHolder_", "");
|
||||||
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||||
if (bean.getKey().equals(name)) {
|
if (bean.getKey().equals(name)) {
|
||||||
|
try {
|
||||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||||
Log.i(TAG, "test: 设置美颜 = " + bean.getKey() + " val = " + configMap.get(key));
|
Log.i(TAG, "test: 设置美颜 = " + bean.getKey() + " val = " + configMap.get(key));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,8 +144,12 @@ public class FaceManager implements SensorEventListener {
|
|||||||
String name = key.replace("BeautyShapeViewHolder_", "");
|
String name = key.replace("BeautyShapeViewHolder_", "");
|
||||||
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||||
if (bean.getKey().equals(name)) {
|
if (bean.getKey().equals(name)) {
|
||||||
|
try {
|
||||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||||
Log.i(TAG, "test: 设置美肤 = " + bean.getKey() + " val = " + configMap.get(key));
|
Log.i(TAG, "test: 设置美肤 = " + bean.getKey() + " val = " + configMap.get(key));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,11 +80,11 @@ public class ContainerRecyclerAdapter extends RecyclerView.Adapter<BaseViewHolde
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void hideSeekBar() {
|
public void hideSeekBar() {
|
||||||
if (seekBar.getVisibility() == View.GONE) {
|
if (seekBar.getVisibility() == View.INVISIBLE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
seekBar.setOnProgressChangeListener(null);
|
seekBar.setOnProgressChangeListener(null);
|
||||||
seekBar.setVisibility(View.GONE);
|
seekBar.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -299,7 +299,7 @@
|
|||||||
<string name="beautify_hip_slim">Hip</string>
|
<string name="beautify_hip_slim">Hip</string>
|
||||||
<string name="beautify_head_slim">Head shrink</string>
|
<string name="beautify_head_slim">Head shrink</string>
|
||||||
<string name="beautify_leg_thin_slim">Thin leg</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_full_body">Body driver</string>
|
||||||
<string name="pta_human_half_body">Bust driver</string>
|
<string name="pta_human_half_body">Bust driver</string>
|
||||||
|
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ dependencies {
|
|||||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||||
|
|
||||||
// implementation rootProject.ext.dependencies["leakcanary"]
|
// implementation rootProject.ext.dependencies["leakcanary"]
|
||||||
|
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,11 +78,14 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||||
<uses-permission android:name="com.android.vending.BILLING" />
|
<uses-permission android:name="com.android.vending.BILLING" />
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
|
|
||||||
<!-- Android11新增 -->
|
<!-- 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.MANAGE_EXTERNAL_STORAGE" />-->
|
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||||
|
<queries>
|
||||||
|
<package android:name="com.twitter.android"/>
|
||||||
|
|
||||||
|
</queries>
|
||||||
<application
|
<application
|
||||||
android:name="com.shayu.phonelive.AppContext"
|
android:name="com.shayu.phonelive.AppContext"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
|||||||
@@ -17,10 +17,6 @@ import android.util.Log;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
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.android.arouter.launcher.ARouter;
|
||||||
import com.blankj.utilcode.util.Utils;
|
import com.blankj.utilcode.util.Utils;
|
||||||
import com.facebook.appevents.AppEventsLogger;
|
import com.facebook.appevents.AppEventsLogger;
|
||||||
@@ -38,8 +34,6 @@ import com.yunbao.common.CommonAppConfig;
|
|||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.bean.CrashSaveBean;
|
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.InstructorSendReward;
|
||||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||||
@@ -47,7 +41,6 @@ import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
|||||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.SpUtil;
|
import com.yunbao.common.utils.SpUtil;
|
||||||
import com.yunbao.faceunity.FaceManager;
|
|
||||||
import com.yunbao.live.socket.SocketRyClient;
|
import com.yunbao.live.socket.SocketRyClient;
|
||||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||||
import com.yunbao.live.views.PortraitLiveManager;
|
import com.yunbao.live.views.PortraitLiveManager;
|
||||||
@@ -87,12 +80,10 @@ public class AppContext extends CommonAppContext {
|
|||||||
private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks {
|
private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks {
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResumed(Activity activity) {
|
public void onActivityResumed(Activity activity) {
|
||||||
Adjust.onResume();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityPaused(Activity activity) {
|
public void onActivityPaused(Activity activity) {
|
||||||
Adjust.onPause();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -131,11 +122,11 @@ public class AppContext extends CommonAppContext {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
//注册全局异常捕获
|
|
||||||
if (!isMainProcess()) {
|
if (!isMainProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
|
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
|
||||||
|
//注册全局异常捕获
|
||||||
registerError();
|
registerError();
|
||||||
registerFirebaseCrash();
|
registerFirebaseCrash();
|
||||||
LogUtils.start(this);
|
LogUtils.start(this);
|
||||||
@@ -163,38 +154,8 @@ public class AppContext extends CommonAppContext {
|
|||||||
OpenInstall.init(this);
|
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());
|
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
|
//初始化 AndroidUtilCode
|
||||||
Utils.init(this);
|
Utils.init(this);
|
||||||
liveImDeletUtil = new LiveImDeletUtil();
|
liveImDeletUtil = new LiveImDeletUtil();
|
||||||
@@ -317,17 +278,17 @@ public class AppContext extends CommonAppContext {
|
|||||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
//闪退后finish所有Activity并且杀死进程
|
//闪退后finish所有Activity并且杀死进程
|
||||||
for (WeakReference<Activity> activity : activities) {
|
/* for (WeakReference<Activity> activity : activities) {
|
||||||
if (activity != null && activity.get() != null) {
|
if (activity != null && activity.get() != null) {
|
||||||
activity.get().finish();
|
activity.get().finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Process.killProcess(Process.myPid());
|
*//* Process.killProcess(Process.myPid());
|
||||||
System.exit(0);*/
|
System.exit(0);*//*
|
||||||
setFirebaseCrashData();
|
setFirebaseCrashData();
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}, 100);
|
}, 100);*/
|
||||||
})
|
})
|
||||||
.setUncaughtCrashHandler((t, e) -> {
|
.setUncaughtCrashHandler((t, e) -> {
|
||||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ public class NeverCrashUtils {
|
|||||||
Log.e(TAG, "未捕获的主线程异常行为", e);
|
Log.e(TAG, "未捕获的主线程异常行为", e);
|
||||||
}
|
}
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Toast.makeText(application, "发生闪退", Toast.LENGTH_SHORT).show();
|
//Toast.makeText(application, "发生闪退:"+e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
||||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||||
return;
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
package com.shayu.phonelive.activity;
|
package com.shayu.phonelive.activity;
|
||||||
|
|
||||||
import static com.yunbao.common.CommonAppContext.logger;
|
|
||||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@@ -25,8 +21,6 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.app.NotificationManagerCompat;
|
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.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@@ -50,7 +44,6 @@ import com.yunbao.common.http.CommonHttpUtil;
|
|||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
|
||||||
import com.yunbao.common.utils.DownloadUtil;
|
import com.yunbao.common.utils.DownloadUtil;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.LogUtil;
|
import com.yunbao.common.utils.LogUtil;
|
||||||
@@ -111,14 +104,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
|||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
setStatusBar();
|
setStatusBar();
|
||||||
setContentView(R.layout.activity_launcher);
|
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;
|
mContext = this;
|
||||||
mRoot = findViewById(R.id.root);
|
mRoot = findViewById(R.id.root);
|
||||||
mCover = findViewById(R.id.cover);
|
mCover = findViewById(R.id.cover);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
|
|||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
@@ -34,6 +35,7 @@ import com.bumptech.glide.request.target.SimpleTarget;
|
|||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
import com.bumptech.glide.request.transition.Transition;
|
import com.bumptech.glide.request.transition.Transition;
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
|
import com.shayu.phonelive.AppContext;
|
||||||
import com.shayu.phonelive.activity.LauncherActivity;
|
import com.shayu.phonelive.activity.LauncherActivity;
|
||||||
import com.yunbao.common.bean.NotificationMsgBean;
|
import com.yunbao.common.bean.NotificationMsgBean;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
@@ -87,7 +89,10 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
|||||||
public boolean onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) {
|
public boolean onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) {
|
||||||
Log.i("gmc", notificationMessage.getPushContent() + "VVV" + notificationMessage.getPushTitle() + "gmc11112222" + notificationMessage.getExtra());
|
Log.i("gmc", notificationMessage.getPushContent() + "VVV" + notificationMessage.getPushTitle() + "gmc11112222" + notificationMessage.getExtra());
|
||||||
if (!SpUtil.getInstance().getBooleanValue("NOTIFICATION")) {
|
if (!SpUtil.getInstance().getBooleanValue("NOTIFICATION")) {
|
||||||
DialogUitl.showSimpleDialog(context, "应用需要通知权限", new DialogUitl.SimpleCallback() {
|
if (AppContext.activityWeakReference != null) {
|
||||||
|
Activity activity = AppContext.activityWeakReference.get();
|
||||||
|
if (activity != null) {
|
||||||
|
DialogUitl.showSimpleDialog(activity, "应用需要通知权限", new DialogUitl.SimpleCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onConfirmClick(Dialog dialog, String content) {
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
@@ -96,10 +101,13 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
|||||||
intent.putExtra("app_uid", context.getApplicationInfo().uid);
|
intent.putExtra("app_uid", context.getApplicationInfo().uid);
|
||||||
// for Android 8 and above
|
// for Android 8 and above
|
||||||
intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
|
intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
|
||||||
context.startActivity(intent);
|
activity.startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (notificationMessage.getExtra() == null) {
|
if (notificationMessage.getExtra() == null) {
|
||||||
msg.setImg("" + notificationMessage.getSenderPortrait());
|
msg.setImg("" + notificationMessage.getSenderPortrait());
|
||||||
msg.setTitle(notificationMessage.getPushTitle());
|
msg.setTitle(notificationMessage.getPushTitle());
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class LogUtils {
|
|||||||
String[] exec = new String[]{"logcat", "-c"};
|
String[] exec = new String[]{"logcat", "-c"};
|
||||||
Runtime.getRuntime().exec(exec).waitFor();
|
Runtime.getRuntime().exec(exec).waitFor();
|
||||||
|
|
||||||
exec = new String[]{"logcat", "-v", "UTC", "-D"};
|
exec = new String[]{"logcat", "-v", "color", "UTC-8"};
|
||||||
|
|
||||||
Process process = Runtime.getRuntime().exec(exec);
|
Process process = Runtime.getRuntime().exec(exec);
|
||||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||||
@@ -55,6 +55,7 @@ public class LogUtils {
|
|||||||
writer = new PrintWriter(os);
|
writer = new PrintWriter(os);
|
||||||
while ((line = bufferedReader.readLine()) != null) {
|
while ((line = bufferedReader.readLine()) != null) {
|
||||||
writer.append(line).write("\n");
|
writer.append(line).write("\n");
|
||||||
|
writer.flush();
|
||||||
}
|
}
|
||||||
writer.flush();
|
writer.flush();
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">PDLIVE</string>
|
<string name="app_name">PDLIVE</string>
|
||||||
|
<string name="leak_canary_test_class_name">assertk.Assert</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -147,7 +147,6 @@ dependencies {
|
|||||||
//谷歌支付
|
//谷歌支付
|
||||||
//谷歌内购
|
//谷歌内购
|
||||||
api 'com.android.billingclient:billing:5.0.0'
|
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.squareup.picasso:picasso:2.5.2'
|
||||||
api "com.immomo.cosmos.mediax:beautyutils:2.2.1_01071700"
|
api "com.immomo.cosmos.mediax:beautyutils:2.2.1_01071700"
|
||||||
api files('libs/liteavsdk.jar')
|
api files('libs/liteavsdk.jar')
|
||||||
@@ -155,9 +154,11 @@ dependencies {
|
|||||||
//腾讯im
|
//腾讯im
|
||||||
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
||||||
api 'com.google.code.gson:gson:2.8.8'
|
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 版本为例
|
//此处以集成 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:im_kit:5.2.5.4' // 即时通讯 UI 基础组件
|
||||||
//融云小视频模块
|
//融云小视频模块
|
||||||
api 'cn.rongcloud.sdk:sight:5.2.5.4'
|
api 'cn.rongcloud.sdk:sight:5.2.5.4'
|
||||||
@@ -168,7 +169,6 @@ dependencies {
|
|||||||
transitive = true
|
transitive = true
|
||||||
}
|
}
|
||||||
api 'com.linecorp:linesdk:5.0.1'
|
api 'com.linecorp:linesdk:5.0.1'
|
||||||
api 'com.adjust.sdk:adjust-android:4.30.1'
|
|
||||||
api 'com.android.installreferrer:installreferrer:2.2'
|
api 'com.android.installreferrer:installreferrer:2.2'
|
||||||
//Retrofit2库
|
//Retrofit2库
|
||||||
api 'com.squareup.retrofit2:retrofit:2.3.0'
|
api 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||||
|
|||||||
@@ -32,8 +32,9 @@
|
|||||||
android:resource="@xml/file_paths" />
|
android:resource="@xml/file_paths" />
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
<!--支付宝-->
|
支付宝
|
||||||
<activity
|
<activity
|
||||||
android:name="com.alipay.sdk.app.H5PayActivity"
|
android:name="com.alipay.sdk.app.H5PayActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
||||||
@@ -46,7 +47,8 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
||||||
<!--支付宝 end-->
|
支付宝 end
|
||||||
|
-->
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.yunbao.common.activity.ErrorActivity"
|
android:name="com.yunbao.common.activity.ErrorActivity"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,22 +1,22 @@
|
|||||||
package com.yunbao.common;
|
package com.yunbao.common;
|
||||||
|
|
||||||
|
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
||||||
|
import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.multidex.MultiDex;
|
import androidx.multidex.MultiDex;
|
||||||
import androidx.multidex.MultiDexApplication;
|
import androidx.multidex.MultiDexApplication;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.facebook.FacebookSdk;
|
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.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import io.rong.imlib.RongIMClient;
|
import io.rong.imlib.RongIMClient;
|
||||||
@@ -24,9 +24,6 @@ import io.rong.push.RongPushClient;
|
|||||||
import io.rong.push.pushconfig.PushConfig;
|
import io.rong.push.pushconfig.PushConfig;
|
||||||
import me.leolin.shortcutbadger.ShortcutBadger;
|
import me.leolin.shortcutbadger.ShortcutBadger;
|
||||||
|
|
||||||
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
|
||||||
import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2017/8/3.
|
* Created by cxf on 2017/8/3.
|
||||||
@@ -35,13 +32,12 @@ import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
|||||||
public class CommonAppContext extends MultiDexApplication {
|
public class CommonAppContext extends MultiDexApplication {
|
||||||
|
|
||||||
public static CommonAppContext sInstance;
|
public static CommonAppContext sInstance;
|
||||||
|
public static WeakReference<Activity> activityWeakReference;
|
||||||
private int mCount;
|
private int mCount;
|
||||||
private boolean mFront;//是否前台
|
private boolean mFront;//是否前台
|
||||||
public static int jpushMsgNum;
|
public static int jpushMsgNum;
|
||||||
public static int Ingroup = 0;
|
public static int Ingroup = 0;
|
||||||
public static String lang = "chinese";
|
public static String lang = "chinese";
|
||||||
public static FirebaseAnalytics mFirebaseAnalytics;
|
|
||||||
public static AppEventsLogger logger;
|
|
||||||
public static boolean isReady = false;
|
public static boolean isReady = false;
|
||||||
public static String home_zdy_img_us = "";
|
public static String home_zdy_img_us = "";
|
||||||
public static String home_zdy_img_cn = "";
|
public static String home_zdy_img_cn = "";
|
||||||
@@ -67,13 +63,6 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
//初始化友盟统计
|
//初始化友盟统计
|
||||||
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||||
FacebookSdk.sdkInitialize(getApplicationContext());
|
FacebookSdk.sdkInitialize(getApplicationContext());
|
||||||
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
|
||||||
mFirebaseAnalytics.setAnalyticsCollectionEnabled(true);
|
|
||||||
mFirebaseAnalytics.setUserProperty("ALLOW_AD_PERSONALIZATION_SIGNALS", "true" );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
logger = AppEventsLogger.newLogger(this);
|
|
||||||
setAutoLogAppEventsEnabled(true);
|
setAutoLogAppEventsEnabled(true);
|
||||||
FacebookSdk.fullyInitialize();
|
FacebookSdk.fullyInitialize();
|
||||||
setAdvertiserIDCollectionEnabled(true);
|
setAdvertiserIDCollectionEnabled(true);
|
||||||
@@ -94,6 +83,9 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Activity getTopActivity() {
|
||||||
|
return activityWeakReference.get();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void attachBaseContext(Context base) {
|
protected void attachBaseContext(Context base) {
|
||||||
@@ -111,6 +103,7 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityStarted(Activity activity) {
|
public void onActivityStarted(Activity activity) {
|
||||||
mCount++;
|
mCount++;
|
||||||
|
activityWeakReference = new WeakReference<>(activity);
|
||||||
if (!mFront) {
|
if (!mFront) {
|
||||||
mFront = true;
|
mFront = true;
|
||||||
L.e("AppContext------->处于前台");
|
L.e("AppContext------->处于前台");
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
public static final String NEW_ENTER_ROOM = "enterRoom";
|
||||||
|
|
||||||
public static final String URL = "url";
|
public static final String URL = "url";
|
||||||
public static final String PAYLOAD = "payload";
|
public static final String PAYLOAD = "payload";
|
||||||
public static final String SEX = "sex";
|
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_ALI = "Charge.getAliOrder";
|
||||||
public static final String PAY_BUY_COIN_WX = "Charge.getWxOrder";
|
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_WX = "com.tencent.mm";//微信的包名
|
||||||
public static final String PACKAGE_NAME_QQ = "com.tencent.mobileqq";//QQ的包名
|
public static final String PACKAGE_NAME_QQ = "com.tencent.mobileqq";//QQ的包名
|
||||||
public static final String LAT = "lat";
|
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_MIC = 2013;//語音
|
||||||
public static final int LIVE_FUNC_WKS = 2014;//語音
|
public static final int LIVE_FUNC_WKS = 2014;//語音
|
||||||
public static final int LIVE_FUNC_ZSLK = 2015;//語音
|
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
|
//socket
|
||||||
public static final String SOCKET_CONN = "conn";
|
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_ALL_SERVER_NOTIFY = "AllServerNotify";//全服通知
|
||||||
public static final String SOCKET_SEND_BARRAGE = "SendBarrage";//发弹幕
|
public static final String SOCKET_SEND_BARRAGE = "SendBarrage";//发弹幕
|
||||||
public static final String SOCKET_LIVE_DRPK = "LiveDRPK";//多人PK
|
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_LEAVE_ROOM = "disconnect";//用户离开房间
|
||||||
public static final String SOCKET_LIVE_END = "StartEndLive";//主播关闭直播
|
public static final String SOCKET_LIVE_END = "StartEndLive";//主播关闭直播
|
||||||
public static final String SOCKET_SYSTEM = "SystemNot";//系统消息
|
public static final String SOCKET_SYSTEM = "SystemNot";//系统消息
|
||||||
@@ -167,9 +172,11 @@ public class Constants {
|
|||||||
public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息
|
public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息
|
||||||
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
|
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
|
||||||
public static final String AI_AUTOMATIC_SPEECH = "aiAutomaticSpeech";//机器人助手
|
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 STAR_CHALLENGE_UPGRADE_NOTIFY = "starChallengeUpgradeNotify";//星级挑战成功
|
||||||
public static final String SUPER_VISION = "supervision";//超级发言警告
|
public static final String SUPER_VISION = "supervision";//超级发言警告
|
||||||
public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据
|
public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据
|
||||||
|
public static final String CUSTOM_FULL_SERVICE_NOTIFY = "customFullServiceNotify";//全服通知
|
||||||
|
|
||||||
//游戏socket
|
//游戏socket
|
||||||
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花
|
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花
|
||||||
@@ -184,6 +191,7 @@ public class Constants {
|
|||||||
public static final String LOVE_CHECK = "LoveCheck";//热度卡消息
|
public static final String LOVE_CHECK = "LoveCheck";//热度卡消息
|
||||||
public static final String TRUMPET_NOTIFY = "TrumpetNotify";//全栈喇叭
|
public static final String TRUMPET_NOTIFY = "TrumpetNotify";//全栈喇叭
|
||||||
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
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_CONN = 0;
|
||||||
public static final int SOCKET_WHAT_DISCONN = 2;
|
public static final int SOCKET_WHAT_DISCONN = 2;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.yunbao.common.Constants;
|
|||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||||
import com.yunbao.common.utils.AndroidBug5497Workaround;
|
import com.yunbao.common.utils.AndroidBug5497Workaround;
|
||||||
|
import com.yunbao.common.utils.DeviceUtils;
|
||||||
import com.yunbao.common.utils.DpUtil;
|
import com.yunbao.common.utils.DpUtil;
|
||||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
@@ -67,14 +68,13 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
btnEdit = (ImageView) findViewById(R.id.btn_edit);
|
btnEdit = (ImageView) findViewById(R.id.btn_edit);
|
||||||
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
||||||
v_spacing = (View) findViewById(R.id.v_spacing);
|
v_spacing = (View) findViewById(R.id.v_spacing);
|
||||||
|
mWebView = findViewById(R.id.webView);
|
||||||
AndroidBug5497Workaround.assistActivity(this);
|
AndroidBug5497Workaround.assistActivity(this);
|
||||||
|
|
||||||
mWebView = new WebView(mContext);
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
params.topMargin = DpUtil.dp2px(1);
|
params.topMargin = DpUtil.dp2px(1);
|
||||||
mWebView.setLayoutParams(params);
|
// mWebView.setLayoutParams(params);
|
||||||
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
//mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||||
rootView.addView(mWebView);
|
|
||||||
mWebView.setWebViewClient(new WebViewClient() {
|
mWebView.setWebViewClient(new WebViewClient() {
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
@@ -96,6 +96,11 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
if (url.contains("for")) {
|
if (url.contains("for")) {
|
||||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||||
}
|
}
|
||||||
|
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
||||||
|
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
||||||
|
if (!navigationGestureEnabled(mContext)) {
|
||||||
|
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.yunbao.common.bean.AnchorRecommendItemModel;
|
|||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||||
import com.yunbao.common.http.main.MainNetManager;
|
import com.yunbao.common.http.main.MainNetManager;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.views.DrawerRecommendViewHolder;
|
import com.yunbao.common.views.DrawerRecommendViewHolder;
|
||||||
import com.yunbao.common.views.DrawerTaskViewHolder;
|
import com.yunbao.common.views.DrawerTaskViewHolder;
|
||||||
import com.yunbao.common.views.FunGamesViewHolder;
|
import com.yunbao.common.views.FunGamesViewHolder;
|
||||||
@@ -121,6 +122,7 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(R.string.net_error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -75,7 +75,7 @@ public class AnchorRecommendItemModel extends BaseModel {
|
|||||||
private String avatarThumb = "";
|
private String avatarThumb = "";
|
||||||
@SerializedName("avatar2")
|
@SerializedName("avatar2")
|
||||||
private String avatar2 = "";
|
private String avatar2 = "";
|
||||||
@SerializedName("user_nicename")
|
@SerializedName(value = "user_nicename", alternate = "userNiceName")
|
||||||
private String userNicename = "";
|
private String userNicename = "";
|
||||||
@SerializedName("level")
|
@SerializedName("level")
|
||||||
private String level = "";
|
private String level = "";
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class CheckLiveModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("type")
|
||||||
|
private int type;
|
||||||
|
@SerializedName("type_val")
|
||||||
|
private String typeVal;
|
||||||
|
@SerializedName("type_msg")
|
||||||
|
private String typeMsg;
|
||||||
|
@SerializedName("live_sdk")
|
||||||
|
private String liveSdk;
|
||||||
|
|
||||||
|
public static CheckLiveModel objectFromData(String str) {
|
||||||
|
|
||||||
|
return new Gson().fromJson(str, CheckLiveModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTypeVal() {
|
||||||
|
return typeVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTypeVal(String typeVal) {
|
||||||
|
this.typeVal = typeVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTypeMsg() {
|
||||||
|
return typeMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTypeMsg(String typeMsg) {
|
||||||
|
this.typeMsg = typeMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveSdk() {
|
||||||
|
return liveSdk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveSdk(String liveSdk) {
|
||||||
|
this.liveSdk = liveSdk;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.yunbao.common.bean;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,7 +15,7 @@ public class CrashSaveBean {
|
|||||||
private long enterRoom;//进入房间次数
|
private long enterRoom;//进入房间次数
|
||||||
private long slidingRoom;//滑动直播间次数
|
private long slidingRoom;//滑动直播间次数
|
||||||
private long playSvga;//加载播放svga次数
|
private long playSvga;//加载播放svga次数
|
||||||
private List<WeakReference<Activity>> activities;//Activity数量
|
private List<WeakReference<Activity>> activities = new ArrayList<>();//Activity数量
|
||||||
|
|
||||||
private CrashSaveBean() {
|
private CrashSaveBean() {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,554 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class EnterRoomInfoModel extends BaseModel {
|
||||||
|
@SerializedName("votestotal")
|
||||||
|
private String votestotal;
|
||||||
|
@SerializedName("medalRankNum")
|
||||||
|
private String medalRankNum;
|
||||||
|
@SerializedName("barrage_fee")
|
||||||
|
private String barrageFee;
|
||||||
|
@SerializedName("userlist_time")
|
||||||
|
private String userlistTime;
|
||||||
|
@SerializedName("chatserver")
|
||||||
|
private String chatserver;
|
||||||
|
@SerializedName("linkmic_uid")
|
||||||
|
private String linkmicUid;
|
||||||
|
@SerializedName("linkmic_pull")
|
||||||
|
private String linkmicPull;
|
||||||
|
@SerializedName("nums")
|
||||||
|
private String nums;
|
||||||
|
@SerializedName("game")
|
||||||
|
private List<?> game;
|
||||||
|
@SerializedName("gamebet")
|
||||||
|
private List<String> gamebet;
|
||||||
|
@SerializedName("gametime")
|
||||||
|
private String gametime;
|
||||||
|
@SerializedName("gameid")
|
||||||
|
private String gameid;
|
||||||
|
@SerializedName("gameaction")
|
||||||
|
private String gameaction;
|
||||||
|
@SerializedName("game_bankerid")
|
||||||
|
private String gameBankerid;
|
||||||
|
@SerializedName("game_banker_name")
|
||||||
|
private String gameBankerName;
|
||||||
|
@SerializedName("game_banker_avatar")
|
||||||
|
private String gameBankerAvatar;
|
||||||
|
@SerializedName("game_banker_coin")
|
||||||
|
private String gameBankerCoin;
|
||||||
|
@SerializedName("game_banker_limit")
|
||||||
|
private String gameBankerLimit;
|
||||||
|
@SerializedName("shut_time")
|
||||||
|
private String shutTime;
|
||||||
|
@SerializedName("kick_time")
|
||||||
|
private String kickTime;
|
||||||
|
@SerializedName("speak_limit")
|
||||||
|
private String speakLimit;
|
||||||
|
@SerializedName("barrage_limit")
|
||||||
|
private String barrageLimit;
|
||||||
|
@SerializedName("coin")
|
||||||
|
private String coin;
|
||||||
|
@SerializedName("vip")
|
||||||
|
private VipModel vip;
|
||||||
|
@SerializedName("liang")
|
||||||
|
private LiangModel liang;
|
||||||
|
@SerializedName("medal_level")
|
||||||
|
private String medalLevel;
|
||||||
|
@SerializedName("medal_name")
|
||||||
|
private String medalName;
|
||||||
|
@SerializedName("issuper")
|
||||||
|
private String issuper;
|
||||||
|
@SerializedName("usertype")
|
||||||
|
private String usertype;
|
||||||
|
@SerializedName("front_task")
|
||||||
|
private String frontTask;
|
||||||
|
@SerializedName("ismic")
|
||||||
|
private String ismic;
|
||||||
|
@SerializedName("isattention")
|
||||||
|
private String isattention;
|
||||||
|
@SerializedName("userlists")
|
||||||
|
private List<LiveUserGiftBean> userlists;
|
||||||
|
@SerializedName("guard")
|
||||||
|
private GuardModel guard;
|
||||||
|
@SerializedName("guard_nums")
|
||||||
|
private String guardNums;
|
||||||
|
@SerializedName("pkinfo")
|
||||||
|
private PkinfoModel pkinfo;
|
||||||
|
@SerializedName("lminfo")
|
||||||
|
private LminfoModel lminfo;
|
||||||
|
@SerializedName("isred")
|
||||||
|
private String isred;
|
||||||
|
@SerializedName("is_fans")
|
||||||
|
private String isFans;
|
||||||
|
@SerializedName("count_fans")
|
||||||
|
private String countFans;
|
||||||
|
@SerializedName("isconnection")
|
||||||
|
private String isconnection;
|
||||||
|
@SerializedName("isleave")
|
||||||
|
private String isleave;
|
||||||
|
@SerializedName("landscape")
|
||||||
|
private String landscape;
|
||||||
|
@SerializedName("un_charge")
|
||||||
|
private String unCharge;
|
||||||
|
@SerializedName("see_time")
|
||||||
|
private String seeTime;
|
||||||
|
@SerializedName("greetings")
|
||||||
|
private List<String> greetings;
|
||||||
|
@SerializedName("live_bg")
|
||||||
|
private String liveBg;
|
||||||
|
@SerializedName("anchor_goodnum")
|
||||||
|
private String anchorGoodnum;
|
||||||
|
@SerializedName("jackpot_level")
|
||||||
|
private String jackpotLevel="-1";
|
||||||
|
|
||||||
|
public String getJackpotLevel() {
|
||||||
|
|
||||||
|
return jackpotLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setJackpotLevel(String jackpotLevel) {
|
||||||
|
this.jackpotLevel = jackpotLevel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVotestotal() {
|
||||||
|
return votestotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setVotestotal(String votestotal) {
|
||||||
|
this.votestotal = votestotal;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMedalRankNum() {
|
||||||
|
return medalRankNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setMedalRankNum(String medalRankNum) {
|
||||||
|
this.medalRankNum = medalRankNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarrageFee() {
|
||||||
|
return barrageFee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setBarrageFee(String barrageFee) {
|
||||||
|
this.barrageFee = barrageFee;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserlistTime() {
|
||||||
|
return userlistTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setUserlistTime(String userlistTime) {
|
||||||
|
this.userlistTime = userlistTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChatserver() {
|
||||||
|
return chatserver;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setChatserver(String chatserver) {
|
||||||
|
this.chatserver = chatserver;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLinkmicUid() {
|
||||||
|
return linkmicUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setLinkmicUid(String linkmicUid) {
|
||||||
|
this.linkmicUid = linkmicUid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLinkmicPull() {
|
||||||
|
return linkmicPull;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setLinkmicPull(String linkmicPull) {
|
||||||
|
this.linkmicPull = linkmicPull;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNums() {
|
||||||
|
return nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setNums(String nums) {
|
||||||
|
this.nums = nums;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<?> getGame() {
|
||||||
|
return game;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGame(List<?> game) {
|
||||||
|
this.game = game;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getGamebet() {
|
||||||
|
return gamebet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGamebet(List<String> gamebet) {
|
||||||
|
this.gamebet = gamebet;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGametime() {
|
||||||
|
return gametime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGametime(String gametime) {
|
||||||
|
this.gametime = gametime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGameid() {
|
||||||
|
return gameid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGameid(String gameid) {
|
||||||
|
this.gameid = gameid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGameaction() {
|
||||||
|
return gameaction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGameaction(String gameaction) {
|
||||||
|
this.gameaction = gameaction;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGameBankerid() {
|
||||||
|
return gameBankerid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGameBankerid(String gameBankerid) {
|
||||||
|
this.gameBankerid = gameBankerid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGameBankerName() {
|
||||||
|
return gameBankerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGameBankerName(String gameBankerName) {
|
||||||
|
this.gameBankerName = gameBankerName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGameBankerAvatar() {
|
||||||
|
return gameBankerAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGameBankerAvatar(String gameBankerAvatar) {
|
||||||
|
this.gameBankerAvatar = gameBankerAvatar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGameBankerCoin() {
|
||||||
|
return gameBankerCoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGameBankerCoin(String gameBankerCoin) {
|
||||||
|
this.gameBankerCoin = gameBankerCoin;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGameBankerLimit() {
|
||||||
|
return gameBankerLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGameBankerLimit(String gameBankerLimit) {
|
||||||
|
this.gameBankerLimit = gameBankerLimit;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShutTime() {
|
||||||
|
return shutTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setShutTime(String shutTime) {
|
||||||
|
this.shutTime = shutTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKickTime() {
|
||||||
|
return kickTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setKickTime(String kickTime) {
|
||||||
|
this.kickTime = kickTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpeakLimit() {
|
||||||
|
return speakLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setSpeakLimit(String speakLimit) {
|
||||||
|
this.speakLimit = speakLimit;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarrageLimit() {
|
||||||
|
return barrageLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setBarrageLimit(String barrageLimit) {
|
||||||
|
this.barrageLimit = barrageLimit;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCoin() {
|
||||||
|
return coin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setCoin(String coin) {
|
||||||
|
this.coin = coin;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VipModel getVip() {
|
||||||
|
return vip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setVip(VipModel vip) {
|
||||||
|
this.vip = vip;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiangModel getLiang() {
|
||||||
|
return liang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setLiang(LiangModel liang) {
|
||||||
|
this.liang = liang;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMedalLevel() {
|
||||||
|
return medalLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setMedalLevel(String medalLevel) {
|
||||||
|
this.medalLevel = medalLevel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMedalName() {
|
||||||
|
return medalName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setMedalName(String medalName) {
|
||||||
|
this.medalName = medalName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssuper() {
|
||||||
|
return issuper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setIssuper(String issuper) {
|
||||||
|
this.issuper = issuper;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsertype() {
|
||||||
|
return usertype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setUsertype(String usertype) {
|
||||||
|
this.usertype = usertype;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFrontTask() {
|
||||||
|
return frontTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setFrontTask(String frontTask) {
|
||||||
|
this.frontTask = frontTask;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsmic() {
|
||||||
|
return ismic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setIsmic(String ismic) {
|
||||||
|
this.ismic = ismic;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsattention() {
|
||||||
|
return isattention;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setIsattention(String isattention) {
|
||||||
|
this.isattention = isattention;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LiveUserGiftBean> getUserlists() {
|
||||||
|
return userlists;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setUserlists(List<LiveUserGiftBean> userlists) {
|
||||||
|
this.userlists = userlists;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardModel getGuard() {
|
||||||
|
return guard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGuard(GuardModel guard) {
|
||||||
|
this.guard = guard;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGuardNums() {
|
||||||
|
return guardNums;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGuardNums(String guardNums) {
|
||||||
|
this.guardNums = guardNums;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel getPkinfo() {
|
||||||
|
return pkinfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setPkinfo(PkinfoModel pkinfo) {
|
||||||
|
this.pkinfo = pkinfo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LminfoModel getLminfo() {
|
||||||
|
return lminfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setLminfo(LminfoModel lminfo) {
|
||||||
|
this.lminfo = lminfo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsred() {
|
||||||
|
return isred;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setIsred(String isred) {
|
||||||
|
this.isred = isred;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsFans() {
|
||||||
|
return isFans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setIsFans(String isFans) {
|
||||||
|
this.isFans = isFans;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountFans() {
|
||||||
|
return countFans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setCountFans(String countFans) {
|
||||||
|
this.countFans = countFans;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsconnection() {
|
||||||
|
if(StringUtil.isEmpty(isconnection)){
|
||||||
|
isconnection="0";
|
||||||
|
}
|
||||||
|
return isconnection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setIsconnection(String isconnection) {
|
||||||
|
this.isconnection = isconnection;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsleave() {
|
||||||
|
return isleave;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setIsleave(String isleave) {
|
||||||
|
this.isleave = isleave;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLandscape() {
|
||||||
|
return landscape;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setLandscape(String landscape) {
|
||||||
|
this.landscape = landscape;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnCharge() {
|
||||||
|
return unCharge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setUnCharge(String unCharge) {
|
||||||
|
this.unCharge = unCharge;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSeeTime() {
|
||||||
|
return seeTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setSeeTime(String seeTime) {
|
||||||
|
this.seeTime = seeTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getGreetings() {
|
||||||
|
return greetings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setGreetings(List<String> greetings) {
|
||||||
|
this.greetings = greetings;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveBg() {
|
||||||
|
return liveBg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setLiveBg(String liveBg) {
|
||||||
|
this.liveBg = liveBg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnchorGoodnum() {
|
||||||
|
return anchorGoodnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel setAnchorGoodnum(String anchorGoodnum) {
|
||||||
|
this.anchorGoodnum = anchorGoodnum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整合进入直播间接口
|
||||||
|
*/
|
||||||
|
public class EnterRoomNewModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("liveInfo")
|
||||||
|
private LiveInfoModel liveInfo = new LiveInfoModel();//直播间信息
|
||||||
|
@SerializedName("enterRoomInfo")
|
||||||
|
private EnterRoomInfoModel enterRoomInfo = new EnterRoomInfoModel();//原接口进入直播间数据返回
|
||||||
|
@SerializedName("rankHour")
|
||||||
|
private RankHourModel rankHour = new RankHourModel();//.热度卡
|
||||||
|
@SerializedName("newPeopleTask")
|
||||||
|
private NewPeopleTaskModel newPeopleTask = new NewPeopleTaskModel();//新人任务
|
||||||
|
@SerializedName("wishList")
|
||||||
|
private WishListModel wishList = new WishListModel();//心愿单
|
||||||
|
@SerializedName("guardUser")
|
||||||
|
private GuardUserModel guardUserAvatar = new GuardUserModel();//守护
|
||||||
|
@SerializedName("activeList")
|
||||||
|
private List<ActiveModel> activeList = new ArrayList<>();//活动列表
|
||||||
|
@SerializedName("isUseHotCard")
|
||||||
|
private String isUseHotCard = "";//是否使用热度卡
|
||||||
|
@SerializedName("liveRoomActivity")
|
||||||
|
private List<LiveRoomActivityModel> liveRoomActivityModels = new ArrayList<>();//活动列表
|
||||||
|
@SerializedName("clarityType")
|
||||||
|
private int clarityType;
|
||||||
|
|
||||||
|
public List<LiveRoomActivityModel> getLiveRoomActivityModels() {
|
||||||
|
return liveRoomActivityModels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setLiveRoomActivityModels(List<LiveRoomActivityModel> liveRoomActivityModels) {
|
||||||
|
this.liveRoomActivityModels = liveRoomActivityModels;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveInfoModel getLiveInfo() {
|
||||||
|
return liveInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setLiveInfo(LiveInfoModel liveInfo) {
|
||||||
|
this.liveInfo = liveInfo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomInfoModel getEnterRoomInfo() {
|
||||||
|
return enterRoomInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setEnterRoomInfo(EnterRoomInfoModel enterRoomInfo) {
|
||||||
|
this.enterRoomInfo = enterRoomInfo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RankHourModel getRankHour() {
|
||||||
|
return rankHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setRankHour(RankHourModel rankHour) {
|
||||||
|
this.rankHour = rankHour;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewPeopleTaskModel getNewPeopleTask() {
|
||||||
|
return newPeopleTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setNewPeopleTask(NewPeopleTaskModel newPeopleTask) {
|
||||||
|
this.newPeopleTask = newPeopleTask;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishListModel getWishList() {
|
||||||
|
return wishList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setWishList(WishListModel wishList) {
|
||||||
|
this.wishList = wishList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserModel getGuardUserAvatar() {
|
||||||
|
return guardUserAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setGuardUserAvatar(GuardUserModel guardUserAvatar) {
|
||||||
|
this.guardUserAvatar = guardUserAvatar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ActiveModel> getActiveList() {
|
||||||
|
return activeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setActiveList(List<ActiveModel> activeList) {
|
||||||
|
this.activeList = activeList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsUseHotCard() {
|
||||||
|
return isUseHotCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setIsUseHotCard(String isUseHotCard) {
|
||||||
|
this.isUseHotCard = isUseHotCard;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClarityType() {
|
||||||
|
return clarityType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClarityType(int clarityType) {
|
||||||
|
this.clarityType = clarityType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "EnterRoomNewModel{" +
|
||||||
|
"liveInfo=" + liveInfo +
|
||||||
|
", enterRoomInfo=" + enterRoomInfo +
|
||||||
|
", rankHour=" + rankHour +
|
||||||
|
", newPeopleTask=" + newPeopleTask +
|
||||||
|
", wishList=" + wishList +
|
||||||
|
", guardUserAvatar=" + guardUserAvatar +
|
||||||
|
", activeList=" + activeList +
|
||||||
|
", isUseHotCard='" + isUseHotCard + '\'' +
|
||||||
|
", liveRoomActivityModels=" + liveRoomActivityModels +
|
||||||
|
", clarityType=" + clarityType +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
105
common/src/main/java/com/yunbao/common/bean/GiftModel.java
Normal file
105
common/src/main/java/com/yunbao/common/bean/GiftModel.java
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class GiftModel extends BaseModel{
|
||||||
|
@SerializedName("id")
|
||||||
|
private String id;
|
||||||
|
@SerializedName("sendtype")
|
||||||
|
private String sendtype;
|
||||||
|
@SerializedName("type")
|
||||||
|
private String type;
|
||||||
|
@SerializedName("mark")
|
||||||
|
private String mark;
|
||||||
|
@SerializedName("giftname")
|
||||||
|
private String giftname;
|
||||||
|
@SerializedName("needcoin")
|
||||||
|
private String needcoin;
|
||||||
|
@SerializedName("gifticon")
|
||||||
|
private String gifticon;
|
||||||
|
@SerializedName("swf")
|
||||||
|
private String swf;
|
||||||
|
@SerializedName("gift_uid")
|
||||||
|
private String giftUid;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSendtype() {
|
||||||
|
return sendtype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel setSendtype(String sendtype) {
|
||||||
|
this.sendtype = sendtype;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMark() {
|
||||||
|
return mark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel setMark(String mark) {
|
||||||
|
this.mark = mark;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGiftname() {
|
||||||
|
return giftname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel setGiftname(String giftname) {
|
||||||
|
this.giftname = giftname;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNeedcoin() {
|
||||||
|
return needcoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel setNeedcoin(String needcoin) {
|
||||||
|
this.needcoin = needcoin;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGifticon() {
|
||||||
|
return gifticon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel setGifticon(String gifticon) {
|
||||||
|
this.gifticon = gifticon;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSwf() {
|
||||||
|
return swf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel setSwf(String swf) {
|
||||||
|
this.swf = swf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGiftUid() {
|
||||||
|
return giftUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel setGiftUid(String giftUid) {
|
||||||
|
this.giftUid = giftUid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
29
common/src/main/java/com/yunbao/common/bean/GuardModel.java
Normal file
29
common/src/main/java/com/yunbao/common/bean/GuardModel.java
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class GuardModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("type")
|
||||||
|
private String type;
|
||||||
|
@SerializedName("endtime")
|
||||||
|
private String endtime;
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardModel setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndtime() {
|
||||||
|
return endtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardModel setEndtime(String endtime) {
|
||||||
|
this.endtime = endtime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class GuardUserModel extends BaseModel{
|
||||||
|
|
||||||
|
@SerializedName("guardUserAvatar")
|
||||||
|
private String guardUserAvatar;
|
||||||
|
@SerializedName("guardType")
|
||||||
|
private String guardType;
|
||||||
|
|
||||||
|
public static GuardUserModel objectFromData(String str) {
|
||||||
|
|
||||||
|
return new Gson().fromJson(str, GuardUserModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGuardUserAvatar() {
|
||||||
|
return guardUserAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGuardUserAvatar(String guardUserAvatar) {
|
||||||
|
this.guardUserAvatar = guardUserAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGuardType() {
|
||||||
|
return guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGuardType(String guardType) {
|
||||||
|
this.guardType = guardType;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
|
||||||
|
public class HttpCallbackModel extends BaseModel {
|
||||||
|
private int code;
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
public HttpCallbackModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public HttpCallbackModel(int code, String msg) {
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -66,6 +66,7 @@ public class IMLoginModel extends BaseModel {
|
|||||||
* noble_name : 贵族
|
* noble_name : 贵族
|
||||||
* sex : 1
|
* sex : 1
|
||||||
* slide : [{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"首充特惠大禮包","slide_id":91,"slide_name":"首充特惠大禮包","slide_pic":"https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html"},{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"充值反饋活動","slide_id":88,"slide_name":"充值反饋活動","slide_pic":"https://qny.shayucm.com/20220511/faacb51d5a45f7ff24a6f0314df133fb.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/GuildTournament/202204/Tournament.html"}]
|
* slide : [{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"首充特惠大禮包","slide_id":91,"slide_name":"首充特惠大禮包","slide_pic":"https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html"},{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"充值反饋活動","slide_id":88,"slide_name":"充值反饋活動","slide_pic":"https://qny.shayucm.com/20220511/faacb51d5a45f7ff24a6f0314df133fb.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/GuildTournament/202204/Tournament.html"}]
|
||||||
|
* slide : [{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"首充特惠大禮包","slide_id":91,"slide_name":"首充特惠大禮包","slide_pic":"https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html"},{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"充值反饋活動","slide_id":88,"slide_name":"充值反饋活動","slide_pic":"https://qny.shayucm.com/20220511/faacb51d5a45f7ff24a6f0314df133fb.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/GuildTournament/202204/Tournament.html"}]
|
||||||
* users_type : A
|
* users_type : A
|
||||||
* votes : 0.00
|
* votes : 0.00
|
||||||
* votestotal : 0
|
* votestotal : 0
|
||||||
@@ -224,6 +225,126 @@ public class IMLoginModel extends BaseModel {
|
|||||||
//超皇字体颜色
|
//超皇字体颜色
|
||||||
@SerializedName("contentColor")
|
@SerializedName("contentColor")
|
||||||
private String contentColor = "";
|
private String contentColor = "";
|
||||||
|
//创建时间
|
||||||
|
@SerializedName("create_time")
|
||||||
|
private String createTime = "";
|
||||||
|
|
||||||
|
@SerializedName("is_guess")
|
||||||
|
private String isGuess = "";
|
||||||
|
|
||||||
|
@SerializedName("goodnum_expire_time")
|
||||||
|
private String goodnumExpireTime = "";
|
||||||
|
|
||||||
|
@SerializedName("version")
|
||||||
|
private String version = "";
|
||||||
|
|
||||||
|
@SerializedName("max_noble_end_time")
|
||||||
|
private String maxNobleEndTime = "";
|
||||||
|
|
||||||
|
@SerializedName("custom_color_id")
|
||||||
|
private String customColorId = "";
|
||||||
|
|
||||||
|
@SerializedName("is_chat")
|
||||||
|
private String isChat = "";
|
||||||
|
|
||||||
|
@SerializedName("is_rong")
|
||||||
|
private String isRong = "";
|
||||||
|
|
||||||
|
@SerializedName("contribution")
|
||||||
|
private String contribution = "";
|
||||||
|
|
||||||
|
@SerializedName("guard_type")
|
||||||
|
private String guardType = "";
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsGuess() {
|
||||||
|
return isGuess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setIsGuess(String isGuess) {
|
||||||
|
this.isGuess = isGuess;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGoodnumExpireTime() {
|
||||||
|
return goodnumExpireTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setGoodnumExpireTime(String goodnumExpireTime) {
|
||||||
|
this.goodnumExpireTime = goodnumExpireTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaxNobleEndTime() {
|
||||||
|
return maxNobleEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setMaxNobleEndTime(String maxNobleEndTime) {
|
||||||
|
this.maxNobleEndTime = maxNobleEndTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCustomColorId() {
|
||||||
|
return customColorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setCustomColorId(String customColorId) {
|
||||||
|
this.customColorId = customColorId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsChat() {
|
||||||
|
return isChat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setIsChat(String isChat) {
|
||||||
|
this.isChat = isChat;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsRong() {
|
||||||
|
return isRong;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setIsRong(String isRong) {
|
||||||
|
this.isRong = isRong;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContribution() {
|
||||||
|
return contribution;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setContribution(String contribution) {
|
||||||
|
this.contribution = contribution;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGuardType() {
|
||||||
|
return guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMLoginModel setGuardType(String guardType) {
|
||||||
|
this.guardType = guardType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getNobleEndTime() {
|
public String getNobleEndTime() {
|
||||||
return nobleEndTime;
|
return nobleEndTime;
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class LinkMicUserBean extends BaseModel {
|
||||||
|
@SerializedName("user_nicename")
|
||||||
|
private String uname;
|
||||||
|
@SerializedName("avatar")
|
||||||
|
private String avatar;
|
||||||
|
@SerializedName("dress_avatar")
|
||||||
|
private String dress_avatar;
|
||||||
|
private String uid = "";
|
||||||
|
private String action;
|
||||||
|
@SerializedName("id")
|
||||||
|
private String id;//连麦显示右侧头像时要用
|
||||||
|
@SerializedName("level")
|
||||||
|
private int level;
|
||||||
|
@SerializedName("sex")
|
||||||
|
private int sex;
|
||||||
|
|
||||||
|
public String getUname() {
|
||||||
|
return uname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUname(String uname) {
|
||||||
|
this.uname = uname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar(String avatar) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAction() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAction(String action) {
|
||||||
|
this.action = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDress_avatar() {
|
||||||
|
return dress_avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDress_avatar(String dress_avatar) {
|
||||||
|
this.dress_avatar = dress_avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLevel(int level) {
|
||||||
|
this.level = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSex() {
|
||||||
|
return sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSex(int sex) {
|
||||||
|
this.sex = sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LinkMicUserBean{" +
|
||||||
|
"uname='" + uname + '\'' +
|
||||||
|
", avatar='" + avatar + '\'' +
|
||||||
|
", dress_avatar='" + dress_avatar + '\'' +
|
||||||
|
", uid='" + uid + '\'' +
|
||||||
|
", action='" + action + '\'' +
|
||||||
|
", id='" + id + '\'' +
|
||||||
|
", level=" + level +
|
||||||
|
", sex=" + sex +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LinkMicUserBeanV2 extends BaseModel {
|
||||||
|
private String roomuserid;
|
||||||
|
private int status;
|
||||||
|
private List<LinkMicUserBean> userlist;
|
||||||
|
|
||||||
|
public String getRoomuserid() {
|
||||||
|
return roomuserid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomuserid(String roomuserid) {
|
||||||
|
this.roomuserid = roomuserid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LinkMicUserBean> getUserlist() {
|
||||||
|
return userlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserlist(List<LinkMicUserBean> userlist) {
|
||||||
|
this.userlist = userlist;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class ListInfoMessageModel extends BaseModel {
|
||||||
|
@SerializedName("id")
|
||||||
|
private int id;
|
||||||
|
@SerializedName("title")
|
||||||
|
private String title;
|
||||||
|
@SerializedName("banner")
|
||||||
|
private String banner;
|
||||||
|
@SerializedName("content")
|
||||||
|
private String content;
|
||||||
|
@SerializedName("link")
|
||||||
|
private String link;
|
||||||
|
@SerializedName("addtime")
|
||||||
|
private String addtime;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBanner() {
|
||||||
|
return banner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setBanner(String banner) {
|
||||||
|
this.banner = banner;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLink() {
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setLink(String link) {
|
||||||
|
this.link = link;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddtime() {
|
||||||
|
return addtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListInfoMessageModel setAddtime(String addtime) {
|
||||||
|
this.addtime = addtime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会话列表展示时间
|
||||||
|
*/
|
||||||
|
public String getLastDate(String type) {
|
||||||
|
if (!TextUtils.isEmpty(addtime) && !TextUtils.equals(addtime, "0")) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||||
|
Date currenTimeZone;
|
||||||
|
if (TextUtils.equals(type, "-1")) {
|
||||||
|
currenTimeZone = new Date(Long.parseLong(addtime));
|
||||||
|
} else {
|
||||||
|
currenTimeZone = new Date(Long.parseLong(addtime + "000"));
|
||||||
|
}
|
||||||
|
return sdf.format(currenTimeZone);
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
138
common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java
Normal file
138
common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人bean
|
||||||
|
*/
|
||||||
|
public class LiveAiRobotBean extends BaseModel {
|
||||||
|
@SerializedName("ai_name")
|
||||||
|
private String name;
|
||||||
|
@SerializedName("ai_state")
|
||||||
|
private int status;//1=开 0=关
|
||||||
|
@SerializedName("ai_time")
|
||||||
|
private int time;
|
||||||
|
@SerializedName("ai_sayhi")
|
||||||
|
private int autoSeyHiNumber;// 自动打招呼已配置数量
|
||||||
|
@SerializedName("ai_gz")
|
||||||
|
private int autoRequestFollowNumber;//自动求关注已配置数量
|
||||||
|
|
||||||
|
public LiveAiRobotBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(int time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAutoSeyHiNumber() {
|
||||||
|
return autoSeyHiNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutoSeyHiNumber(int autoSeyHiNumber) {
|
||||||
|
this.autoSeyHiNumber = autoSeyHiNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAutoRequestFollowNumber() {
|
||||||
|
return autoRequestFollowNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutoRequestFollowNumber(int autoRequestFollowNumber) {
|
||||||
|
this.autoRequestFollowNumber = autoRequestFollowNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LiveAiRobotBean{" +
|
||||||
|
"name='" + name + '\'' +
|
||||||
|
", status=" + status +
|
||||||
|
", time=" + time +
|
||||||
|
", autoSeyHiNumber=" + autoSeyHiNumber +
|
||||||
|
", autoRequestFollowNumber=" + autoRequestFollowNumber +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人消息
|
||||||
|
*/
|
||||||
|
public static class Message {
|
||||||
|
public static final int TYPE_SAY_HI=1;//自动打招呼
|
||||||
|
public static final int TYPE_FOLLOW=3;//自动求关注
|
||||||
|
@SerializedName("id")
|
||||||
|
private int id;
|
||||||
|
@SerializedName("uid")
|
||||||
|
private int uid;
|
||||||
|
@SerializedName("type")
|
||||||
|
private int type;
|
||||||
|
@SerializedName("content")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
public Message() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(int uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Message{" +
|
||||||
|
"id=" + id +
|
||||||
|
", uid=" + uid +
|
||||||
|
", type=" + type +
|
||||||
|
", content='" + content + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,11 +5,10 @@ import android.os.Parcelable;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.yunbao.common.R;
|
|
||||||
import com.yunbao.common.utils.WordUtil;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2017/8/9.
|
* Created by cxf on 2017/8/9.
|
||||||
@@ -53,6 +52,8 @@ public class LiveBean implements Parcelable {
|
|||||||
private String recommendCardIconSizeTwo = "";
|
private String recommendCardIconSizeTwo = "";
|
||||||
private String recommendCardIconSizeThree = "";
|
private String recommendCardIconSizeThree = "";
|
||||||
|
|
||||||
|
private Map<String,String> params;//用于跳转Activity时扩展参数,例:从首页Banner跳转到直播间时需要根据携带参数判断是否弹出新人特惠对话框
|
||||||
|
|
||||||
public String getRecommendCardIconSizeTwo() {
|
public String getRecommendCardIconSizeTwo() {
|
||||||
return recommendCardIconSizeTwo;
|
return recommendCardIconSizeTwo;
|
||||||
}
|
}
|
||||||
@@ -83,6 +84,14 @@ public class LiveBean implements Parcelable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParams(Map<String, String> params) {
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
|
|
||||||
public String getRecommendcardtype() {
|
public String getRecommendcardtype() {
|
||||||
return recommendCardtype;
|
return recommendCardtype;
|
||||||
}
|
}
|
||||||
@@ -387,18 +396,19 @@ public class LiveBean implements Parcelable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private LiveBean(Parcel in) {
|
private LiveBean(Parcel in) {
|
||||||
this.uid = in.readString();
|
this.uid = in.readString();
|
||||||
this.avatar = in.readString();
|
this.avatar = in.readString();
|
||||||
this.avatarThumb = in.readString();
|
this.avatarThumb = in.readString();
|
||||||
this.userNiceName = in.readString();
|
this.userNiceName = in.readString();
|
||||||
this.sex = in.readInt();
|
|
||||||
this.title = in.readString();
|
this.title = in.readString();
|
||||||
this.city = in.readString();
|
this.city = in.readString();
|
||||||
this.stream = in.readString();
|
this.stream = in.readString();
|
||||||
this.pull = in.readString();
|
this.pull = in.readString();
|
||||||
this.thumb = in.readString();
|
this.thumb = in.readString();
|
||||||
this.nums = in.readString();
|
this.nums = in.readString();
|
||||||
|
this.sex = in.readInt();
|
||||||
this.distance = in.readString();
|
this.distance = in.readString();
|
||||||
this.levelAnchor = in.readInt();
|
this.levelAnchor = in.readInt();
|
||||||
this.type = in.readInt();
|
this.type = in.readInt();
|
||||||
@@ -406,6 +416,23 @@ public class LiveBean implements Parcelable {
|
|||||||
this.goodNum = in.readString();
|
this.goodNum = in.readString();
|
||||||
this.gameAction = in.readInt();
|
this.gameAction = in.readInt();
|
||||||
this.game = in.readString();
|
this.game = in.readString();
|
||||||
|
this.islive = in.readString();
|
||||||
|
this.isTop = in.readString();
|
||||||
|
this.pk_avatar_thumb = in.readString();
|
||||||
|
this.landscape = in.readInt();
|
||||||
|
this.hot_num = in.readString();
|
||||||
|
this.content_pic_size_one = in.readString();
|
||||||
|
this.content_pic_size_two = in.readString();
|
||||||
|
this.content_pic_size_three = in.readString();
|
||||||
|
this.is_week = in.readString();
|
||||||
|
this.img = in.readString();
|
||||||
|
this.url = in.readString();
|
||||||
|
this.drpk_status = in.readString();
|
||||||
|
this.is_rong = in.readInt();
|
||||||
|
this.isattention = in.readString();
|
||||||
|
this.recommendCardtype = in.readString();
|
||||||
|
this.recommendCardIconSizeTwo = in.readString();
|
||||||
|
this.recommendCardIconSizeThree = in.readString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -419,13 +446,13 @@ public class LiveBean implements Parcelable {
|
|||||||
dest.writeString(this.avatar);
|
dest.writeString(this.avatar);
|
||||||
dest.writeString(this.avatarThumb);
|
dest.writeString(this.avatarThumb);
|
||||||
dest.writeString(this.userNiceName);
|
dest.writeString(this.userNiceName);
|
||||||
dest.writeInt(this.sex);
|
|
||||||
dest.writeString(this.title);
|
dest.writeString(this.title);
|
||||||
dest.writeString(this.city);
|
dest.writeString(this.city);
|
||||||
dest.writeString(this.stream);
|
dest.writeString(this.stream);
|
||||||
dest.writeString(this.pull);
|
dest.writeString(this.pull);
|
||||||
dest.writeString(this.thumb);
|
dest.writeString(this.thumb);
|
||||||
dest.writeString(this.nums);
|
dest.writeString(this.nums);
|
||||||
|
dest.writeInt(this.sex);
|
||||||
dest.writeString(this.distance);
|
dest.writeString(this.distance);
|
||||||
dest.writeInt(this.levelAnchor);
|
dest.writeInt(this.levelAnchor);
|
||||||
dest.writeInt(this.type);
|
dest.writeInt(this.type);
|
||||||
@@ -433,6 +460,23 @@ public class LiveBean implements Parcelable {
|
|||||||
dest.writeString(this.goodNum);
|
dest.writeString(this.goodNum);
|
||||||
dest.writeInt(this.gameAction);
|
dest.writeInt(this.gameAction);
|
||||||
dest.writeString(this.game);
|
dest.writeString(this.game);
|
||||||
|
dest.writeString(this.islive);
|
||||||
|
dest.writeString(this.isTop);
|
||||||
|
dest.writeString(this.pk_avatar_thumb);
|
||||||
|
dest.writeInt(this.landscape);
|
||||||
|
dest.writeString(this.hot_num);
|
||||||
|
dest.writeString(this.content_pic_size_one);
|
||||||
|
dest.writeString(this.content_pic_size_two);
|
||||||
|
dest.writeString(this.content_pic_size_three);
|
||||||
|
dest.writeString(this.is_week);
|
||||||
|
dest.writeString(this.img);
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeString(this.drpk_status);
|
||||||
|
dest.writeInt(this.is_rong);
|
||||||
|
dest.writeString(this.isattention);
|
||||||
|
dest.writeString(this.recommendCardtype);
|
||||||
|
dest.writeString(this.recommendCardIconSizeTwo);
|
||||||
|
dest.writeString(this.recommendCardIconSizeThree);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Creator<LiveBean> CREATOR = new Creator<LiveBean>() {
|
public static final Creator<LiveBean> CREATOR = new Creator<LiveBean>() {
|
||||||
@@ -449,6 +493,44 @@ public class LiveBean implements Parcelable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "uid: " + uid + " , userNiceName: " + userNiceName + " ,playUrl: " + pull;
|
return "LiveBean{" +
|
||||||
|
"uid='" + uid + '\'' +
|
||||||
|
", avatar='" + avatar + '\'' +
|
||||||
|
", avatarThumb='" + avatarThumb + '\'' +
|
||||||
|
", userNiceName='" + userNiceName + '\'' +
|
||||||
|
", title='" + title + '\'' +
|
||||||
|
", city='" + city + '\'' +
|
||||||
|
", stream='" + stream + '\'' +
|
||||||
|
", pull='" + pull + '\'' +
|
||||||
|
", thumb='" + thumb + '\'' +
|
||||||
|
", nums='" + nums + '\'' +
|
||||||
|
", sex=" + sex +
|
||||||
|
", distance='" + distance + '\'' +
|
||||||
|
", levelAnchor=" + levelAnchor +
|
||||||
|
", type=" + type +
|
||||||
|
", typeVal='" + typeVal + '\'' +
|
||||||
|
", goodNum='" + goodNum + '\'' +
|
||||||
|
", gameAction=" + gameAction +
|
||||||
|
", game='" + game + '\'' +
|
||||||
|
", islive='" + islive + '\'' +
|
||||||
|
", isTop='" + isTop + '\'' +
|
||||||
|
", pk_avatar_thumb='" + pk_avatar_thumb + '\'' +
|
||||||
|
", landscape=" + landscape +
|
||||||
|
", hot_num='" + hot_num + '\'' +
|
||||||
|
", content_pic_size_one='" + content_pic_size_one + '\'' +
|
||||||
|
", content_pic_size_two='" + content_pic_size_two + '\'' +
|
||||||
|
", content_pic_size_three='" + content_pic_size_three + '\'' +
|
||||||
|
", is_week='" + is_week + '\'' +
|
||||||
|
", img='" + img + '\'' +
|
||||||
|
", url='" + url + '\'' +
|
||||||
|
", drpk_status='" + drpk_status + '\'' +
|
||||||
|
", is_rong=" + is_rong +
|
||||||
|
", isattention='" + isattention + '\'' +
|
||||||
|
", recommendCardtype='" + recommendCardtype + '\'' +
|
||||||
|
", recommendCardIconSizeTwo='" + recommendCardIconSizeTwo + '\'' +
|
||||||
|
", recommendCardIconSizeThree='" + recommendCardIconSizeThree + '\'' +
|
||||||
|
", params=" + params +
|
||||||
|
", mWeekList=" + mWeekList +
|
||||||
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播数据
|
||||||
|
*/
|
||||||
|
public class LiveDataInfoModel extends BaseModel{
|
||||||
|
@SerializedName("totalCoin")
|
||||||
|
private long totalCoin;//钻石数量
|
||||||
|
@SerializedName("totalGold")
|
||||||
|
private long totalGold;//金币数量
|
||||||
|
@SerializedName("acceptNum")
|
||||||
|
private long acceptNum;//送礼人数
|
||||||
|
@SerializedName("enterNum")
|
||||||
|
private long enterNum;//进场人数
|
||||||
|
@SerializedName("attentionNum")
|
||||||
|
private long attentionNum;//关注人数
|
||||||
|
@SerializedName("fanGroupNum")
|
||||||
|
private long fanGroupNum;//粉丝团人数
|
||||||
|
@SerializedName("attentionNumRate")
|
||||||
|
private double attentionNumRate;//关注转化率
|
||||||
|
@SerializedName("fanGroupNumRate")
|
||||||
|
private double fanGroupNumRate;//粉丝团转化率
|
||||||
|
|
||||||
|
public LiveDataInfoModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTotalCoin() {
|
||||||
|
return totalCoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCoin(long totalCoin) {
|
||||||
|
this.totalCoin = totalCoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTotalGold() {
|
||||||
|
return totalGold;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalGold(long totalGold) {
|
||||||
|
this.totalGold = totalGold;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAcceptNum() {
|
||||||
|
return acceptNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAcceptNum(long acceptNum) {
|
||||||
|
this.acceptNum = acceptNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getEnterNum() {
|
||||||
|
return enterNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterNum(long enterNum) {
|
||||||
|
this.enterNum = enterNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAttentionNum() {
|
||||||
|
return attentionNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttentionNum(long attentionNum) {
|
||||||
|
this.attentionNum = attentionNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFanGroupNum() {
|
||||||
|
return fanGroupNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFanGroupNum(long fanGroupNum) {
|
||||||
|
this.fanGroupNum = fanGroupNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getAttentionNumRate() {
|
||||||
|
return attentionNumRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttentionNumRate(double attentionNumRate) {
|
||||||
|
this.attentionNumRate = attentionNumRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getFanGroupNumRate() {
|
||||||
|
return fanGroupNumRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFanGroupNumRate(double fanGroupNumRate) {
|
||||||
|
this.fanGroupNumRate = fanGroupNumRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LiveDataInfoModel{" +
|
||||||
|
"totalCoin=" + totalCoin +
|
||||||
|
", totalGold=" + totalGold +
|
||||||
|
", acceptNum=" + acceptNum +
|
||||||
|
", enterNum=" + enterNum +
|
||||||
|
", attentionNum=" + attentionNum +
|
||||||
|
", fanGroupNum=" + fanGroupNum +
|
||||||
|
", attentionNumRate=" + attentionNumRate +
|
||||||
|
", fanGroupNumRate=" + fanGroupNumRate +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -62,7 +62,7 @@ public class LiveInfoModel extends BaseModel {
|
|||||||
@SerializedName("islive")
|
@SerializedName("islive")
|
||||||
private long islive;
|
private long islive;
|
||||||
@SerializedName("landscape")
|
@SerializedName("landscape")
|
||||||
private long landscape = 0;
|
private int landscape = 0;
|
||||||
@SerializedName("is_rong")
|
@SerializedName("is_rong")
|
||||||
private long isRong = 0;
|
private long isRong = 0;
|
||||||
@SerializedName("nums")
|
@SerializedName("nums")
|
||||||
@@ -208,11 +208,11 @@ public class LiveInfoModel extends BaseModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getLandscape() {
|
public int getLandscape() {
|
||||||
return landscape;
|
return landscape;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveInfoModel setLandscape(long landscape) {
|
public LiveInfoModel setLandscape(int landscape) {
|
||||||
this.landscape = landscape;
|
this.landscape = landscape;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动列表
|
||||||
|
*/
|
||||||
|
public class LiveRoomActivityModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("name")
|
||||||
|
private String name;
|
||||||
|
@SerializedName("img")
|
||||||
|
private String img;
|
||||||
|
@SerializedName("link")
|
||||||
|
private String link;
|
||||||
|
@SerializedName("is_hidden")
|
||||||
|
private String isHidden;
|
||||||
|
@SerializedName("show_type")
|
||||||
|
private String showType;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRoomActivityModel setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImg() {
|
||||||
|
return img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRoomActivityModel setImg(String img) {
|
||||||
|
this.img = img;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLink() {
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRoomActivityModel setLink(String link) {
|
||||||
|
this.link = link;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsHidden() {
|
||||||
|
return isHidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRoomActivityModel setIsHidden(String isHidden) {
|
||||||
|
this.isHidden = isHidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShowType() {
|
||||||
|
return showType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRoomActivityModel setShowType(String showType) {
|
||||||
|
this.showType = showType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.yunbao.live.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.common.R;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class LiveStetUpStatusModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("wishList")
|
||||||
|
private String wishList;
|
||||||
|
@SerializedName("ai_state")
|
||||||
|
private String aiState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wishList 1设置 0 未设置
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean getWishListState() {
|
||||||
|
return TextUtils.equals(wishList, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* aiState 1打开机器人 0 未设置
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean getAiStateState() {
|
||||||
|
return TextUtils.equals(aiState, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishList() {
|
||||||
|
return wishList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveStetUpStatusModel setWishList(String wishList) {
|
||||||
|
this.wishList = wishList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAiState() {
|
||||||
|
return aiState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveStetUpStatusModel setAiState(String aiState) {
|
||||||
|
this.aiState = aiState;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
259
common/src/main/java/com/yunbao/common/bean/LiveTaskModel.java
Normal file
259
common/src/main/java/com/yunbao/common/bean/LiveTaskModel.java
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播任务
|
||||||
|
*/
|
||||||
|
public class LiveTaskModel extends BaseModel {
|
||||||
|
public static final int TASK_TYPE_TIP = 0;
|
||||||
|
public static final int TASK_TYPE_ITEM = 1;
|
||||||
|
|
||||||
|
int type;
|
||||||
|
@SerializedName("new")
|
||||||
|
NewUser user;
|
||||||
|
@SerializedName("list")
|
||||||
|
List<List<Task>> list;
|
||||||
|
|
||||||
|
public LiveTaskModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewUser getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(NewUser user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<List<Task>> getList() {
|
||||||
|
if (user != null && user.isNew()) {
|
||||||
|
for (List<Task> tasks : list) {
|
||||||
|
for (Task task : tasks) {
|
||||||
|
task.isNewUser = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setList(List<List<Task>> list) {
|
||||||
|
this.list = list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LiveTaskModel{" +
|
||||||
|
"type=" + type +
|
||||||
|
", user=" + user +
|
||||||
|
", list=" + list +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class NewUser {
|
||||||
|
@SerializedName("isNew")
|
||||||
|
private int isNew;
|
||||||
|
@SerializedName("endTime")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
public NewUser() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNew() {
|
||||||
|
return isNew == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNew(int aNew) {
|
||||||
|
isNew = aNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndTime() {
|
||||||
|
if (!StringUtil.isEmpty(endTime)) {
|
||||||
|
endTime = WordUtil.getString(R.string.live_task_new_user_timer) + new SimpleDateFormat("yyyy/MM/dd HH:mm", Locale.getDefault()).format(new Date(Long.parseLong(endTime) * 1000));
|
||||||
|
}
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(String endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "NewUser{" +
|
||||||
|
"isNew=" + isNew +
|
||||||
|
", endTime='" + endTime + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Task implements Serializable {
|
||||||
|
@SerializedName("id")
|
||||||
|
private int id;
|
||||||
|
@SerializedName("type")
|
||||||
|
private int type;
|
||||||
|
@SerializedName("task_type")
|
||||||
|
private int taskType;
|
||||||
|
@SerializedName("task_name")
|
||||||
|
private String taskName;
|
||||||
|
@SerializedName("task_num")
|
||||||
|
private int taskNum;
|
||||||
|
@SerializedName("hot")
|
||||||
|
private long hot;
|
||||||
|
@SerializedName("exp")
|
||||||
|
private long exp;
|
||||||
|
@SerializedName("new_hot")
|
||||||
|
private long newUserHot;
|
||||||
|
@SerializedName("new_exp")
|
||||||
|
private long newUserExp;
|
||||||
|
@SerializedName("sort")
|
||||||
|
private int sort;
|
||||||
|
@SerializedName("status")
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
@SerializedName("now_num")
|
||||||
|
private int nowValue;
|
||||||
|
|
||||||
|
private boolean isNewUser = false;
|
||||||
|
|
||||||
|
public Task() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTaskType() {
|
||||||
|
return taskType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskType(int taskType) {
|
||||||
|
this.taskType = taskType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskName() {
|
||||||
|
return taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskName(String taskName) {
|
||||||
|
this.taskName = taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTaskNum() {
|
||||||
|
return taskNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskNum(int taskNum) {
|
||||||
|
this.taskNum = taskNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getHot() {
|
||||||
|
if (isNewUser) {
|
||||||
|
hot = newUserHot;
|
||||||
|
}
|
||||||
|
return hot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHot(long hot) {
|
||||||
|
this.hot = hot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getExp() {
|
||||||
|
if (isNewUser) {
|
||||||
|
exp = newUserExp;
|
||||||
|
}
|
||||||
|
return exp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExp(long exp) {
|
||||||
|
this.exp = exp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getNewUserHot() {
|
||||||
|
return newUserHot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNewUserHot(long newUserHot) {
|
||||||
|
this.newUserHot = newUserHot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getNewUserExp() {
|
||||||
|
return newUserExp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNewUserExp(long newUserExp) {
|
||||||
|
this.newUserExp = newUserExp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSort(int sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getStatus() {
|
||||||
|
return status == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNowValue() {
|
||||||
|
return nowValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNowValue(int nowValue) {
|
||||||
|
this.nowValue = nowValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Task{" +
|
||||||
|
"id=" + id +
|
||||||
|
", type=" + type +
|
||||||
|
", taskType=" + taskType +
|
||||||
|
", taskName='" + taskName + '\'' +
|
||||||
|
", taskNum=" + taskNum +
|
||||||
|
", hot=" + hot +
|
||||||
|
", exp=" + exp +
|
||||||
|
", newUserHot=" + newUserHot +
|
||||||
|
", newUserExp=" + newUserExp +
|
||||||
|
", sort=" + sort +
|
||||||
|
", status=" + status +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.yunbao.common.bean.UserBean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2018/10/27.
|
||||||
|
* 直播间用户列表实体类
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class LiveUserGiftBean extends UserBean {
|
||||||
|
|
||||||
|
private String contribution;
|
||||||
|
private int guardType;
|
||||||
|
private int nub;
|
||||||
|
|
||||||
|
public LiveUserGiftBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNub() {
|
||||||
|
return nub;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNub(int nub) {
|
||||||
|
this.nub = nub;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContribution() {
|
||||||
|
return contribution;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContribution(String contribution) {
|
||||||
|
this.contribution = contribution;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否送过礼物
|
||||||
|
*/
|
||||||
|
public boolean hasContribution() {
|
||||||
|
return !TextUtils.isEmpty(this.contribution) && !"0".equals(this.contribution);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSONField(name = "guard_type")
|
||||||
|
public int getGuardType() {
|
||||||
|
return guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSONField(name = "guard_type")
|
||||||
|
public void setGuardType(int guardType) {
|
||||||
|
this.guardType = guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveUserGiftBean(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
super.writeToParcel(dest, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LiveUserGiftBean{" +
|
||||||
|
"contribution='" + contribution + '\'' +
|
||||||
|
", guardType=" + guardType +
|
||||||
|
", nub=" + nub +
|
||||||
|
", id='" + id + '\'' +
|
||||||
|
", userNiceName='" + userNiceName + '\'' +
|
||||||
|
", avatar='" + avatar + '\'' +
|
||||||
|
", avatarThumb='" + avatarThumb + '\'' +
|
||||||
|
", sex=" + sex +
|
||||||
|
", signature='" + signature + '\'' +
|
||||||
|
", coin='" + coin + '\'' +
|
||||||
|
", gold='" + gold + '\'' +
|
||||||
|
", votes='" + votes + '\'' +
|
||||||
|
", consumption='" + consumption + '\'' +
|
||||||
|
", votestotal='" + votestotal + '\'' +
|
||||||
|
", province='" + province + '\'' +
|
||||||
|
", city='" + city + '\'' +
|
||||||
|
", location='" + location + '\'' +
|
||||||
|
", birthday='" + birthday + '\'' +
|
||||||
|
", level=" + level +
|
||||||
|
", levelAnchor=" + levelAnchor +
|
||||||
|
", lives=" + lives +
|
||||||
|
", follows=" + follows +
|
||||||
|
", fans=" + fans +
|
||||||
|
", vip=" + vip +
|
||||||
|
", liang=" + liang +
|
||||||
|
", car=" + car +
|
||||||
|
", medal_level=" + medal_level +
|
||||||
|
", medal_name='" + medal_name + '\'' +
|
||||||
|
", Dress=" + Dress +
|
||||||
|
", noble_id='" + noble_id + '\'' +
|
||||||
|
", yuanbao='" + yuanbao + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
23
common/src/main/java/com/yunbao/common/bean/LminfoModel.java
Normal file
23
common/src/main/java/com/yunbao/common/bean/LminfoModel.java
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class LminfoModel extends BaseModel{
|
||||||
|
|
||||||
|
@SerializedName("status")
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
public static LminfoModel objectFromData(String str) {
|
||||||
|
|
||||||
|
return new Gson().fromJson(str, LminfoModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
package com.yunbao.live.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
|
||||||
public class MicUserBean {
|
public class MicUserBean extends BaseModel{
|
||||||
protected String id;
|
protected String id;
|
||||||
protected String userNiceName;
|
protected String userNiceName;
|
||||||
protected String avatar;
|
protected String avatar;
|
||||||
protected int level;
|
protected int level;
|
||||||
protected int sex;
|
protected int sex;
|
||||||
protected String dress_avatar;
|
protected String dress_avatar;
|
||||||
|
protected int type;
|
||||||
|
|
||||||
@JSONField(name = "dress_avatar")
|
@JSONField(name = "dress_avatar")
|
||||||
public String getDress_avatar() {
|
public String getDress_avatar() {
|
||||||
@@ -65,4 +66,12 @@ public class MicUserBean {
|
|||||||
public void setAvatar(String avatar) {
|
public void setAvatar(String avatar) {
|
||||||
this.avatar = avatar;
|
this.avatar = avatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class NewPeopleTaskModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("task")
|
||||||
|
private TaskModel task = new TaskModel();
|
||||||
|
@SerializedName("gift")
|
||||||
|
private GiftModel gift = new GiftModel();
|
||||||
|
@SerializedName("reward_all")
|
||||||
|
private RewardAllModel rewardAll = new RewardAllModel();
|
||||||
|
@SerializedName("reward_one")
|
||||||
|
private RewardAllModel rewardOne = new RewardAllModel();
|
||||||
|
|
||||||
|
public TaskModel getTask() {
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewPeopleTaskModel setTask(TaskModel task) {
|
||||||
|
this.task = task;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GiftModel getGift() {
|
||||||
|
return gift;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewPeopleTaskModel setGift(GiftModel gift) {
|
||||||
|
this.gift = gift;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardAllModel getRewardAll() {
|
||||||
|
return rewardAll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewPeopleTaskModel setRewardAll(RewardAllModel rewardAll) {
|
||||||
|
this.rewardAll = rewardAll;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardAllModel getRewardOne() {
|
||||||
|
return rewardOne;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewPeopleTaskModel setRewardOne(RewardAllModel rewardOne) {
|
||||||
|
this.rewardOne = rewardOne;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class PKTopThreeModel extends BaseModel {
|
||||||
|
@SerializedName("uid")
|
||||||
|
private String uid;
|
||||||
|
@SerializedName("img")
|
||||||
|
private String img;
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
private String liveuid;
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PKTopThreeModel setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImg() {
|
||||||
|
return img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PKTopThreeModel setImg(String img) {
|
||||||
|
this.img = img;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PKTopThreeModel setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class PkTopUsersModel extends BaseModel {
|
||||||
|
@SerializedName("red_one")
|
||||||
|
private PKTopThreeModel redOne;
|
||||||
|
@SerializedName("red_two")
|
||||||
|
private PKTopThreeModel redTwo;
|
||||||
|
@SerializedName("red_three")
|
||||||
|
private PKTopThreeModel redThree;
|
||||||
|
@SerializedName("blue_one")
|
||||||
|
private PKTopThreeModel blueOne;
|
||||||
|
@SerializedName("blue_two")
|
||||||
|
private PKTopThreeModel blueTwo;
|
||||||
|
@SerializedName("blue_three")
|
||||||
|
private PKTopThreeModel blueThree;
|
||||||
|
}
|
||||||
172
common/src/main/java/com/yunbao/common/bean/PkinfoModel.java
Normal file
172
common/src/main/java/com/yunbao/common/bean/PkinfoModel.java
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class PkinfoModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("pkuid")
|
||||||
|
private String pkuid;
|
||||||
|
@SerializedName("pkuname")
|
||||||
|
private String pkuname;
|
||||||
|
@SerializedName("pkuimg")
|
||||||
|
private String pkuimg;
|
||||||
|
@SerializedName("pkpull")
|
||||||
|
private String pkpull;
|
||||||
|
@SerializedName("ifpk")
|
||||||
|
private String ifpk;
|
||||||
|
@SerializedName("pk_time")
|
||||||
|
private String pkTime;
|
||||||
|
@SerializedName("end_pk_time")
|
||||||
|
private String endPkTime;
|
||||||
|
@SerializedName("pk_gift_liveuid")
|
||||||
|
private String pkGiftLiveuid;
|
||||||
|
@SerializedName("pk_gift_pkuid")
|
||||||
|
private String pkGiftPkuid;
|
||||||
|
@SerializedName("anyway")
|
||||||
|
private String anyway;
|
||||||
|
@SerializedName("drpk_status")
|
||||||
|
private String drpkStatus;
|
||||||
|
@SerializedName("drpk_roomid")
|
||||||
|
private String drpkRoomid;
|
||||||
|
@SerializedName("drpk_time")
|
||||||
|
private String drpkTime;
|
||||||
|
@SerializedName("pk_top_users")
|
||||||
|
private PkTopUsersModel pkTopUsers;
|
||||||
|
@SerializedName("userlist")
|
||||||
|
private JsonArray userlist;
|
||||||
|
|
||||||
|
public JsonArray getUserlist() {
|
||||||
|
return userlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserlist(JsonArray userlist) {
|
||||||
|
this.userlist = userlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkuid() {
|
||||||
|
return pkuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setPkuid(String pkuid) {
|
||||||
|
this.pkuid = pkuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkuname() {
|
||||||
|
return pkuname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setPkuname(String pkuname) {
|
||||||
|
this.pkuname = pkuname;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkuimg() {
|
||||||
|
return pkuimg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setPkuimg(String pkuimg) {
|
||||||
|
this.pkuimg = pkuimg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkpull() {
|
||||||
|
return pkpull;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setPkpull(String pkpull) {
|
||||||
|
this.pkpull = pkpull;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIfpk() {
|
||||||
|
return ifpk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setIfpk(String ifpk) {
|
||||||
|
this.ifpk = ifpk;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkTime() {
|
||||||
|
return pkTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setPkTime(String pkTime) {
|
||||||
|
this.pkTime = pkTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndPkTime() {
|
||||||
|
return endPkTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setEndPkTime(String endPkTime) {
|
||||||
|
this.endPkTime = endPkTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkGiftLiveuid() {
|
||||||
|
return pkGiftLiveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setPkGiftLiveuid(String pkGiftLiveuid) {
|
||||||
|
this.pkGiftLiveuid = pkGiftLiveuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkGiftPkuid() {
|
||||||
|
return pkGiftPkuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setPkGiftPkuid(String pkGiftPkuid) {
|
||||||
|
this.pkGiftPkuid = pkGiftPkuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnyway() {
|
||||||
|
return anyway;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setAnyway(String anyway) {
|
||||||
|
this.anyway = anyway;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDrpkStatus() {
|
||||||
|
return drpkStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setDrpkStatus(String drpkStatus) {
|
||||||
|
this.drpkStatus = drpkStatus;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDrpkRoomid() {
|
||||||
|
return drpkRoomid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setDrpkRoomid(String drpkRoomid) {
|
||||||
|
this.drpkRoomid = drpkRoomid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDrpkTime() {
|
||||||
|
return drpkTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setDrpkTime(String drpkTime) {
|
||||||
|
this.drpkTime = drpkTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkTopUsersModel getPkTopUsers() {
|
||||||
|
return pkTopUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PkinfoModel setPkTopUsers(PkTopUsersModel pkTopUsers) {
|
||||||
|
this.pkTopUsers = pkTopUsers;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class PrankGiftBean extends BaseModel{
|
||||||
|
@SerializedName("prank_content")
|
||||||
|
private String title;
|
||||||
|
@SerializedName("gift_name")
|
||||||
|
private String name;
|
||||||
|
@SerializedName("gift_icon")
|
||||||
|
private String icon;
|
||||||
|
@SerializedName("gift_num")
|
||||||
|
private int num;
|
||||||
|
@SerializedName("gift_id")
|
||||||
|
private String giftId;
|
||||||
|
|
||||||
|
public PrankGiftBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNum() {
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNum(int num) {
|
||||||
|
this.num = num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIcon() {
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIcon(String icon) {
|
||||||
|
this.icon = icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGiftId() {
|
||||||
|
return giftId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGiftId(String giftId) {
|
||||||
|
this.giftId = giftId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
|
public class PrankHttpTurntableBean extends BaseModel {
|
||||||
|
@SerializedName("id")
|
||||||
|
private int id;
|
||||||
|
@SerializedName("anchor_id")
|
||||||
|
private String anchor_id;
|
||||||
|
@SerializedName("coin")
|
||||||
|
private long coin = 1000;
|
||||||
|
@SerializedName("hope_coin")
|
||||||
|
private long hopeCoin = 1000;
|
||||||
|
@SerializedName("turntable_one")
|
||||||
|
private String turntable1;
|
||||||
|
@SerializedName("turntable_two")
|
||||||
|
private String turntable2;
|
||||||
|
@SerializedName("turntable_three")
|
||||||
|
private String turntable3;
|
||||||
|
@SerializedName("turntable_four")
|
||||||
|
private String turntable4;
|
||||||
|
@SerializedName("turntable_five")
|
||||||
|
private String turntable5;
|
||||||
|
@SerializedName("turntable_six")
|
||||||
|
private String turntable6;
|
||||||
|
@SerializedName("status")
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
public PrankHttpTurntableBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnchor_id() {
|
||||||
|
return anchor_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnchor_id(String anchor_id) {
|
||||||
|
this.anchor_id = anchor_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getCoin() {
|
||||||
|
return coin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoin(long coin) {
|
||||||
|
this.coin = coin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getHopeCoin() {
|
||||||
|
return hopeCoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHopeCoin(long hopeCoin) {
|
||||||
|
this.hopeCoin = hopeCoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTurntable1() {
|
||||||
|
return turntable1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTurntable1(String turntable1) {
|
||||||
|
this.turntable1 = turntable1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTurntable2() {
|
||||||
|
return turntable2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTurntable2(String turntable2) {
|
||||||
|
this.turntable2 = turntable2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTurntable3() {
|
||||||
|
return turntable3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTurntable3(String turntable3) {
|
||||||
|
this.turntable3 = turntable3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTurntable4() {
|
||||||
|
return turntable4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTurntable4(String turntable4) {
|
||||||
|
this.turntable4 = turntable4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTurntable5() {
|
||||||
|
return turntable5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTurntable5(String turntable5) {
|
||||||
|
this.turntable5 = turntable5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTurntable6() {
|
||||||
|
return turntable6;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTurntable6(String turntable6) {
|
||||||
|
this.turntable6 = turntable6;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
|
||||||
|
public class PrankTurntableBean extends BaseModel {
|
||||||
|
private int id;
|
||||||
|
private String context;
|
||||||
|
|
||||||
|
public PrankTurntableBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContext() {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContext(String context) {
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机PK UserBean
|
||||||
|
*/
|
||||||
|
public class RandomPkUserBean extends UserBean {
|
||||||
|
@SerializedName("is_pk")
|
||||||
|
private int pk;
|
||||||
|
@SerializedName("isattention")
|
||||||
|
private String attention;
|
||||||
|
@SerializedName("user_nicename")
|
||||||
|
private String userNiceName;
|
||||||
|
|
||||||
|
public RandomPkUserBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPk() {
|
||||||
|
return pk==1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAttention() {
|
||||||
|
return attention.equals("1");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttention() {
|
||||||
|
return attention;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttention(String attention) {
|
||||||
|
this.attention = attention;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPk() {
|
||||||
|
return pk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPk(int pk) {
|
||||||
|
this.pk = pk;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUserNiceName() {
|
||||||
|
return userNiceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setUserNiceName(String userNiceName) {
|
||||||
|
this.userNiceName = userNiceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RandomPkUserBean{" +
|
||||||
|
"pk=" + pk +
|
||||||
|
", attention='" + attention + '\'' +
|
||||||
|
", userNiceName='" + userNiceName + '\'' +
|
||||||
|
", id='" + id + '\'' +
|
||||||
|
", userNiceName='" + userNiceName + '\'' +
|
||||||
|
", avatar='" + avatar + '\'' +
|
||||||
|
", avatarThumb='" + avatarThumb + '\'' +
|
||||||
|
", sex=" + sex +
|
||||||
|
", signature='" + signature + '\'' +
|
||||||
|
", coin='" + coin + '\'' +
|
||||||
|
", gold='" + gold + '\'' +
|
||||||
|
", votes='" + votes + '\'' +
|
||||||
|
", consumption='" + consumption + '\'' +
|
||||||
|
", votestotal='" + votestotal + '\'' +
|
||||||
|
", province='" + province + '\'' +
|
||||||
|
", city='" + city + '\'' +
|
||||||
|
", location='" + location + '\'' +
|
||||||
|
", birthday='" + birthday + '\'' +
|
||||||
|
", level=" + level +
|
||||||
|
", levelAnchor=" + levelAnchor +
|
||||||
|
", lives=" + lives +
|
||||||
|
", follows=" + follows +
|
||||||
|
", fans=" + fans +
|
||||||
|
", vip=" + vip +
|
||||||
|
", liang=" + liang +
|
||||||
|
", car=" + car +
|
||||||
|
", medal_level=" + medal_level +
|
||||||
|
", medal_name='" + medal_name + '\'' +
|
||||||
|
", Dress=" + Dress +
|
||||||
|
", noble_id='" + noble_id + '\'' +
|
||||||
|
", yuanbao='" + yuanbao + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class RankHourModel extends BaseModel {
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
private String liveuid;
|
||||||
|
@SerializedName("hourchart_h5_url")
|
||||||
|
private String hourchartH5Url;
|
||||||
|
@SerializedName("rank")
|
||||||
|
private String rank;
|
||||||
|
@SerializedName("starlightVal")
|
||||||
|
private String starlightVal;
|
||||||
|
@SerializedName("isshow")
|
||||||
|
private String isshow;
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RankHourModel setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHourchartH5Url() {
|
||||||
|
return hourchartH5Url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RankHourModel setHourchartH5Url(String hourchartH5Url) {
|
||||||
|
this.hourchartH5Url = hourchartH5Url;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRank() {
|
||||||
|
return rank;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RankHourModel setRank(String rank) {
|
||||||
|
this.rank = rank;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStarlightVal() {
|
||||||
|
return starlightVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RankHourModel setStarlightVal(String starlightVal) {
|
||||||
|
this.starlightVal = starlightVal;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsshow() {
|
||||||
|
return isshow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RankHourModel setIsshow(String isshow) {
|
||||||
|
this.isshow = isshow;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
128
common/src/main/java/com/yunbao/common/bean/RankPkInfoBean.java
Normal file
128
common/src/main/java/com/yunbao/common/bean/RankPkInfoBean.java
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class RankPkInfoBean extends BaseModel {
|
||||||
|
private int id;
|
||||||
|
@SerializedName("start_time")
|
||||||
|
private String startTime;
|
||||||
|
@SerializedName("end_time")
|
||||||
|
private String endTime;
|
||||||
|
@SerializedName("pk_start_hour1")
|
||||||
|
private String pkStartHour1;
|
||||||
|
@SerializedName("pk_end_hour1")
|
||||||
|
private String pkEndHour1;
|
||||||
|
@SerializedName("pk_start_hour2")
|
||||||
|
private String pkStartHour2;
|
||||||
|
@SerializedName("pk_end_hour2")
|
||||||
|
private String pkEndHour2;
|
||||||
|
|
||||||
|
public RankPkInfoBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(String startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndTime() {
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(String endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkStartHour1() {
|
||||||
|
return pkStartHour1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkStartHour1(String pkStartHour1) {
|
||||||
|
this.pkStartHour1 = pkStartHour1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkEndHour1() {
|
||||||
|
return pkEndHour1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkEndHour1(String pkEndHour1) {
|
||||||
|
this.pkEndHour1 = pkEndHour1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkStartHour2() {
|
||||||
|
return pkStartHour2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkStartHour2(String pkStartHour2) {
|
||||||
|
this.pkStartHour2 = pkStartHour2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkEndHour2() {
|
||||||
|
return pkEndHour2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkEndHour2(String pkEndHour2) {
|
||||||
|
this.pkEndHour2 = pkEndHour2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否在排位赛时间范围内
|
||||||
|
*/
|
||||||
|
public boolean isRankPKTime() {
|
||||||
|
try {
|
||||||
|
Date now =new Date();
|
||||||
|
Date startDate = simpleDateToDate(startTime, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
Date endDate = simpleDateToDate(endTime, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
if (startDate == null || endDate == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Calendar calendarStart = Calendar.getInstance(Locale.CHINA);
|
||||||
|
Calendar calendarEnd = Calendar.getInstance(Locale.CHINA);
|
||||||
|
Calendar calendarNow = Calendar.getInstance(Locale.CHINA);
|
||||||
|
calendarNow.setTime(now);
|
||||||
|
calendarStart.setTime(startDate);
|
||||||
|
calendarEnd.setTime(endDate);
|
||||||
|
if (calendarStart.before(calendarNow) && calendarEnd.after(calendarNow)) {
|
||||||
|
calendarNow.setTime(simpleDateToDate(dateToSimpleDate(now,"HH:mm:ss"),"HH:mm:ss"));
|
||||||
|
calendarStart.setTime(simpleDateToDate(pkStartHour1, "HH:mm:ss"));
|
||||||
|
calendarEnd.setTime(simpleDateToDate(pkEndHour1, "HH:mm:ss"));
|
||||||
|
if (calendarStart.before(calendarNow) && calendarEnd.after(calendarNow)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
calendarNow.setTime(simpleDateToDate(dateToSimpleDate(now,"HH:mm:ss"),"HH:mm:ss"));
|
||||||
|
calendarStart.setTime(simpleDateToDate(pkStartHour2, "HH:mm:ss"));
|
||||||
|
calendarEnd.setTime(simpleDateToDate(pkEndHour2, "HH:mm:ss"));
|
||||||
|
return calendarStart.before(calendarNow) && calendarEnd.after(calendarNow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Date simpleDateToDate(String time, String pattern) throws ParseException {
|
||||||
|
return new SimpleDateFormat(pattern, Locale.CHINA).parse(time);
|
||||||
|
}
|
||||||
|
private String dateToSimpleDate(Date date,String pattern){
|
||||||
|
return new SimpleDateFormat(pattern,Locale.CHINA).format(date);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class RewardAllModel extends BaseModel{
|
||||||
|
@SerializedName("gold")
|
||||||
|
private String gold;
|
||||||
|
@SerializedName("experience")
|
||||||
|
private String experience;
|
||||||
|
|
||||||
|
public String getGold() {
|
||||||
|
return gold;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardAllModel setGold(String gold) {
|
||||||
|
this.gold = gold;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExperience() {
|
||||||
|
return experience;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardAllModel setExperience(String experience) {
|
||||||
|
this.experience = experience;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
50
common/src/main/java/com/yunbao/common/bean/TaskModel.java
Normal file
50
common/src/main/java/com/yunbao/common/bean/TaskModel.java
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class TaskModel extends BaseModel{
|
||||||
|
@SerializedName("uid")
|
||||||
|
private String uid;
|
||||||
|
@SerializedName("attent")
|
||||||
|
private String attent;
|
||||||
|
@SerializedName("illumine")
|
||||||
|
private String illumine;
|
||||||
|
@SerializedName("sendgift")
|
||||||
|
private String sendgift;
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TaskModel setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttent() {
|
||||||
|
return attent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TaskModel setAttent(String attent) {
|
||||||
|
this.attent = attent;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIllumine() {
|
||||||
|
return illumine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TaskModel setIllumine(String illumine) {
|
||||||
|
this.illumine = illumine;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSendgift() {
|
||||||
|
return sendgift;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TaskModel setSendgift(String sendgift) {
|
||||||
|
this.sendgift = sendgift;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import android.text.TextUtils;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2017/8/14.
|
* Created by cxf on 2017/8/14.
|
||||||
@@ -61,6 +62,26 @@ public class UserBean implements Parcelable {
|
|||||||
private int praise;
|
private int praise;
|
||||||
//是否隐藏
|
//是否隐藏
|
||||||
private boolean isHide = false;
|
private boolean isHide = false;
|
||||||
|
//是否为随机PK,仅在主播PK时使用
|
||||||
|
private boolean randomPk;
|
||||||
|
//随机天梯排位赛PK img,仅在主播PK时使用
|
||||||
|
private String mRankPkImgUrl;
|
||||||
|
|
||||||
|
public boolean isRandomPk() {
|
||||||
|
return randomPk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRandomPk(boolean randomPk) {
|
||||||
|
this.randomPk = randomPk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRankPkImgUrl() {
|
||||||
|
return mRankPkImgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRankPkImgUrl(String mRankPkImgUrl) {
|
||||||
|
this.mRankPkImgUrl = mRankPkImgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isHide() {
|
public boolean isHide() {
|
||||||
return isHide;
|
return isHide;
|
||||||
@@ -96,6 +117,9 @@ public class UserBean implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getIs_bind() {
|
public String getIs_bind() {
|
||||||
|
if(StringUtil.isEmpty(is_bind)){
|
||||||
|
is_bind="0";
|
||||||
|
}
|
||||||
return is_bind;
|
return is_bind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class WishListModel extends BaseModel {
|
||||||
|
@SerializedName("wishList")
|
||||||
|
private List<WishModel> wishList;
|
||||||
|
@SerializedName("img")
|
||||||
|
private String img;
|
||||||
|
|
||||||
|
public List<WishModel> getWishList() {
|
||||||
|
return wishList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishListModel setWishList(List<WishModel> wishList) {
|
||||||
|
this.wishList = wishList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImg() {
|
||||||
|
return img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishListModel setImg(String img) {
|
||||||
|
this.img = img;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
106
common/src/main/java/com/yunbao/common/bean/WishModel.java
Normal file
106
common/src/main/java/com/yunbao/common/bean/WishModel.java
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class WishModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("id")
|
||||||
|
private String id;
|
||||||
|
@SerializedName("dtime")
|
||||||
|
private String dtime;
|
||||||
|
@SerializedName("luid")
|
||||||
|
private String luid;
|
||||||
|
@SerializedName("lid")
|
||||||
|
private String lid;
|
||||||
|
@SerializedName("wishlist_icon")
|
||||||
|
private String wishlistIcon;
|
||||||
|
@SerializedName("wishlist_num")
|
||||||
|
private String wishlistNum;
|
||||||
|
@SerializedName("wishlist_progress")
|
||||||
|
private String wishlistProgress;
|
||||||
|
@SerializedName("wishlist_name")
|
||||||
|
private String wishlistName;
|
||||||
|
@SerializedName("create_time")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishModel setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDtime() {
|
||||||
|
return dtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishModel setDtime(String dtime) {
|
||||||
|
this.dtime = dtime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLuid() {
|
||||||
|
return luid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishModel setLuid(String luid) {
|
||||||
|
this.luid = luid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLid() {
|
||||||
|
return lid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishModel setLid(String lid) {
|
||||||
|
this.lid = lid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishlistIcon() {
|
||||||
|
return wishlistIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishModel setWishlistIcon(String wishlistIcon) {
|
||||||
|
this.wishlistIcon = wishlistIcon;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishlistNum() {
|
||||||
|
return wishlistNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishModel setWishlistNum(String wishlistNum) {
|
||||||
|
this.wishlistNum = wishlistNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishlistProgress() {
|
||||||
|
return wishlistProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishModel setWishlistProgress(String wishlistProgress) {
|
||||||
|
this.wishlistProgress = wishlistProgress;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishlistName() {
|
||||||
|
return wishlistName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishModel setWishlistName(String wishlistName) {
|
||||||
|
this.wishlistName = wishlistName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WishModel setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -75,6 +75,9 @@ public class TabButtonGroup extends LinearLayout implements View.OnClickListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getCurPosition() {
|
||||||
|
return mCurPosition;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|||||||
@@ -4,13 +4,16 @@ import android.app.Dialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.DialogFragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
||||||
import com.yunbao.common.utils.ClickUtil;
|
import com.yunbao.common.utils.ClickUtil;
|
||||||
|
|
||||||
@@ -34,7 +37,7 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
|||||||
} else {
|
} else {
|
||||||
mRootView = LayoutInflater.from(mContext).inflate(getLayoutId(), null);
|
mRootView = LayoutInflater.from(mContext).inflate(getLayoutId(), null);
|
||||||
}
|
}
|
||||||
final Dialog dialog = new Dialog(mContext, getDialogStyle());
|
Dialog dialog = new Dialog(mContext, getDialogStyle());
|
||||||
dialog.setContentView(mRootView);
|
dialog.setContentView(mRootView);
|
||||||
dialog.setCancelable(canCancel());
|
dialog.setCancelable(canCancel());
|
||||||
dialog.setCanceledOnTouchOutside(canCancel());
|
dialog.setCanceledOnTouchOutside(canCancel());
|
||||||
@@ -74,4 +77,12 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
|||||||
return ClickUtil.canClick();
|
return ClickUtil.canClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
|
||||||
|
try {
|
||||||
|
super.show(manager, tag);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
|
|
||||||
|
|
||||||
|
public abstract class AbsDialogPopupWindow extends BottomPopupView {
|
||||||
|
private final Context mContext;
|
||||||
|
|
||||||
|
public AbsDialogPopupWindow(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void buildDialog(XPopup.Builder builder);
|
||||||
|
public abstract int bindLayoutId();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return bindLayoutId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showDialog() {
|
||||||
|
XPopup.Builder builder = new XPopup.Builder(mContext);
|
||||||
|
builder.isDestroyOnDismiss(true);
|
||||||
|
buildDialog(builder);
|
||||||
|
builder.asCustom(this).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.yunbao.common.dialog;
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||||
|
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||||
|
import static com.yunbao.common.CommonAppContext.lang;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -12,30 +16,14 @@ import androidx.fragment.app.DialogFragment;
|
|||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
import com.adjust.sdk.Adjust;
|
|
||||||
import com.adjust.sdk.AdjustEvent;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.facebook.appevents.AppEventsLogger;
|
|
||||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.event.InstructorOperationEvent;
|
import com.yunbao.common.event.InstructorOperationEvent;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
|
||||||
import com.yunbao.common.http.HttpCallback;
|
|
||||||
import com.yunbao.common.http.HttpClient;
|
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
|
||||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
|
||||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
|
||||||
import static com.yunbao.common.CommonAppContext.lang;
|
|
||||||
|
|
||||||
public class InstructorOperationDialog extends AbsDialogFragment {
|
public class InstructorOperationDialog extends AbsDialogFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -106,30 +94,6 @@ public class InstructorOperationDialog extends AbsDialogFragment {
|
|||||||
mRootView.findViewById(R.id.to_msg).setOnClickListener(new View.OnClickListener() {
|
mRootView.findViewById(R.id.to_msg).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
AdjustEvent adjustEvent1 = new AdjustEvent("82nzkz");
|
|
||||||
Adjust.trackEvent(adjustEvent1);
|
|
||||||
CommonHttpUtil.setAdvertisingChannels("82nzkz", new HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0) {
|
|
||||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_director_enter", null);
|
|
||||||
AppEventsLogger.newLogger(mContext).logEvent("FB_director_enter");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
AdjustEvent adjustEvent2 = new AdjustEvent("ykpmj8");
|
|
||||||
Adjust.trackEvent(adjustEvent2);
|
|
||||||
CommonHttpUtil.setAdvertisingChannels("ykpmj8", new HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0) {
|
|
||||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_director_message_box", null);
|
|
||||||
AppEventsLogger.newLogger(mContext).logEvent("FB_director_message_box");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
EventBus.getDefault().post(new InstructorOperationEvent());
|
EventBus.getDefault().post(new InstructorOperationEvent());
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.utils.DpUtil;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
public class YoursystemisolderDialog extends AbsDialogFragment {
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.view_yoursystemisolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getDialogStyle() {
|
||||||
|
return R.style.dialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canCancel() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setWindowAttributes(Window window) {
|
||||||
|
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||||
|
WindowManager.LayoutParams params = window.getAttributes();
|
||||||
|
params.width = DpUtil.dp2px(277);
|
||||||
|
params.height = DpUtil.dp2px(134);
|
||||||
|
params.gravity = Gravity.CENTER;
|
||||||
|
window.setAttributes(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
TextView hint = (TextView) findViewById(R.id.hint);
|
||||||
|
TextView toSetUp = (TextView) findViewById(R.id.to_set_up);
|
||||||
|
TextView knowThe = (TextView) findViewById(R.id.know_the);
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.know_the), () -> dismiss());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
|
||||||
|
try {
|
||||||
|
super.show(manager, tag);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private YoursystemisolderDialog.HintListener listener;
|
||||||
|
|
||||||
|
public YoursystemisolderDialog setListener(YoursystemisolderDialog.HintListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface HintListener {
|
||||||
|
void requestPermission();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
public class AnchorInfoEvent {
|
||||||
|
protected boolean clear;
|
||||||
|
protected String id;
|
||||||
|
protected String userNiceName;
|
||||||
|
protected String avatar;
|
||||||
|
|
||||||
|
public AnchorInfoEvent(boolean clears,String ids, String userNiceNames,String avatars) {
|
||||||
|
clear = clears;
|
||||||
|
id = ids;
|
||||||
|
userNiceName = userNiceNames;
|
||||||
|
avatar = avatars;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserNiceName() {
|
||||||
|
return userNiceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserNiceName(String userNiceName) {
|
||||||
|
this.userNiceName = userNiceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar(String avatar) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isClear() {
|
||||||
|
return clear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClear(boolean clear) {
|
||||||
|
this.clear = clear;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AnchorInfoEvent{" +
|
||||||
|
"clear=" + clear +
|
||||||
|
", id='" + id + '\'' +
|
||||||
|
", userNiceName='" + userNiceName + '\'' +
|
||||||
|
", avatar='" + avatar + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@ public class CoinChangeEvent {
|
|||||||
private String goldCoinNum;
|
private String goldCoinNum;
|
||||||
private boolean chargeSuccess;
|
private boolean chargeSuccess;
|
||||||
|
|
||||||
|
|
||||||
public CoinChangeEvent(String coin) {
|
public CoinChangeEvent(String coin) {
|
||||||
this.coin = coin;
|
this.coin = coin;
|
||||||
}
|
}
|
||||||
@@ -19,6 +20,7 @@ public class CoinChangeEvent {
|
|||||||
this.coin = coin;
|
this.coin = coin;
|
||||||
this.chargeSuccess = chargeSuccess;
|
this.chargeSuccess = chargeSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoinChangeEvent(String coin, String goldCoinNum, boolean chargeSuccess) {
|
public CoinChangeEvent(String coin, String goldCoinNum, boolean chargeSuccess) {
|
||||||
this.coin = coin;
|
this.coin = coin;
|
||||||
this.goldCoinNum = goldCoinNum;
|
this.goldCoinNum = goldCoinNum;
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全服通知
|
||||||
|
*/
|
||||||
|
public class CustomFullServiceNotifyEvent extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("_method_")
|
||||||
|
private String method;
|
||||||
|
@SerializedName("action")
|
||||||
|
private String action;
|
||||||
|
@SerializedName("content")//内容
|
||||||
|
private String content;
|
||||||
|
@SerializedName("duration")//展示时长 单位秒
|
||||||
|
private int duration;
|
||||||
|
@SerializedName("img")//图片路径
|
||||||
|
private String img;
|
||||||
|
@SerializedName("msgtype")
|
||||||
|
private String msgtype;
|
||||||
|
@SerializedName("type")//通知类型 1 图片通知 2文字通知
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
public String getMethod() {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomFullServiceNotifyEvent setMethod(String method) {
|
||||||
|
this.method = method;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAction() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomFullServiceNotifyEvent setAction(String action) {
|
||||||
|
this.action = action;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomFullServiceNotifyEvent setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDuration() {
|
||||||
|
return duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomFullServiceNotifyEvent setDuration(int duration) {
|
||||||
|
this.duration = duration;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImg() {
|
||||||
|
return img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomFullServiceNotifyEvent setImg(String img) {
|
||||||
|
this.img = img;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsgtype() {
|
||||||
|
return msgtype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomFullServiceNotifyEvent setMsgtype(String msgtype) {
|
||||||
|
this.msgtype = msgtype;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomFullServiceNotifyEvent setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
public class LivePushRyEvent extends BaseModel {
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
public class LiveRobotMessageEvent extends BaseModel {
|
||||||
|
private int index = -1;
|
||||||
|
|
||||||
|
public int getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRobotMessageEvent setIndex(int index) {
|
||||||
|
this.index = index;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
public class LiveRobotSayHelloEvent extends BaseModel {
|
||||||
|
private int index = -1;
|
||||||
|
|
||||||
|
public int getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRobotSayHelloEvent setIndex(int index) {
|
||||||
|
this.index = index;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -239,6 +239,7 @@ public class ImgLoader {
|
|||||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
callback.onLoadSuccess(resource);
|
callback.onLoadSuccess(resource);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ public class API extends BaseApi {
|
|||||||
loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY);
|
loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY);
|
||||||
OkHttpClient.Builder builder = new OkHttpClient()
|
OkHttpClient.Builder builder = new OkHttpClient()
|
||||||
.newBuilder()
|
.newBuilder()
|
||||||
|
|
||||||
.addInterceptor(initQuery(isNeedUid,CommonAppContext.sInstance.getApplicationContext()))
|
.addInterceptor(initQuery(isNeedUid,CommonAppContext.sInstance.getApplicationContext()))
|
||||||
.addInterceptor(loggingInterceptor);
|
.addInterceptor(loggingInterceptor);
|
||||||
|
|
||||||
return create(builder.build(),
|
return create(builder.build(),
|
||||||
GsonConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class);
|
GsonConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import android.content.Context;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.adjust.sdk.Adjust;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@@ -18,6 +17,7 @@ import com.yunbao.common.activity.ErrorActivity;
|
|||||||
import com.yunbao.common.bean.ConfigBean;
|
import com.yunbao.common.bean.ConfigBean;
|
||||||
import com.yunbao.common.event.FollowEvent;
|
import com.yunbao.common.event.FollowEvent;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
|
import com.yunbao.common.manager.APKManager;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.manager.NewLevelManager;
|
import com.yunbao.common.manager.NewLevelManager;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
@@ -196,6 +196,28 @@ public class CommonHttpUtil {
|
|||||||
JSONArray levelArray = obj.getJSONArray("level_new");
|
JSONArray levelArray = obj.getJSONArray("level_new");
|
||||||
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
|
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
|
||||||
}
|
}
|
||||||
|
if (obj.containsKey("levelanchor_new")) {//缓存等级数据
|
||||||
|
JSONArray levelArray = obj.getJSONArray("levelanchor_new");
|
||||||
|
new NewLevelManager(context).UpAnchorDataLevel(levelArray.toJSONString());
|
||||||
|
}
|
||||||
|
if (obj.containsKey("apk_ver")) {
|
||||||
|
APKManager.get().setApkVer(obj.getString("apk_ver"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("apk_url")) {
|
||||||
|
APKManager.get().setAPKUrl(obj.getString("apk_url"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("apk_des")) {
|
||||||
|
APKManager.get().setAPKDes(obj.getString("apk_des"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("google_isup")) {
|
||||||
|
APKManager.get().setAPKGoogleIsUp(obj.getInteger("google_isup"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("isup")) {
|
||||||
|
APKManager.get().setAPKIsUp(obj.getInteger("isup"));
|
||||||
|
}
|
||||||
|
if (obj.containsKey("clarity")) {
|
||||||
|
IMLoginManager.get(context).setClarity(obj.getString("clarity"));
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||||
@@ -417,14 +439,14 @@ public class CommonHttpUtil {
|
|||||||
.params("touid", touid)
|
.params("touid", touid)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
//
|
||||||
//埋点唯一性
|
// //埋点唯一性
|
||||||
public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
// public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("Tx.setAdvertisingChannels", CommonHttpConsts.GET_USER_BASEINFO)
|
// HttpClient.getInstance().get("Tx.setAdvertisingChannels", CommonHttpConsts.GET_USER_BASEINFO)
|
||||||
.params("operation", operation)
|
// .params("operation", operation)
|
||||||
.params("marking", Adjust.getAdid())
|
// .params("marking", Adjust.getAdid())
|
||||||
.execute(callback);
|
// .execute(callback);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,18 +3,31 @@ package com.yunbao.common.http;
|
|||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.bean.CheckLiveModel;
|
||||||
import com.yunbao.common.bean.ContributeModel;
|
import com.yunbao.common.bean.ContributeModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||||
|
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||||
import com.yunbao.common.bean.FaceBookUpModel;
|
import com.yunbao.common.bean.FaceBookUpModel;
|
||||||
import com.yunbao.common.bean.HourRank;
|
import com.yunbao.common.bean.HourRank;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
|
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||||
|
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||||
|
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||||
import com.yunbao.common.bean.LiveInfoModel;
|
import com.yunbao.common.bean.LiveInfoModel;
|
||||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||||
|
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||||
|
import com.yunbao.common.bean.LiveTaskModel;
|
||||||
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||||
import com.yunbao.common.bean.NewPeopleInfo;
|
import com.yunbao.common.bean.NewPeopleInfo;
|
||||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||||
import com.yunbao.common.bean.PkRankBean;
|
import com.yunbao.common.bean.PkRankBean;
|
||||||
|
import com.yunbao.common.bean.PrankGiftBean;
|
||||||
|
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||||
|
import com.yunbao.common.bean.RandomPkUserBean;
|
||||||
|
import com.yunbao.common.bean.RankPkInfoBean;
|
||||||
import com.yunbao.common.bean.SearchModel;
|
import com.yunbao.common.bean.SearchModel;
|
||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.bean.SlideInBannerModel;
|
import com.yunbao.common.bean.SlideInBannerModel;
|
||||||
@@ -22,6 +35,7 @@ import com.yunbao.common.bean.StarChallengeStatusModel;
|
|||||||
import com.yunbao.common.bean.VipModel;
|
import com.yunbao.common.bean.VipModel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
@@ -29,6 +43,7 @@ import retrofit2.http.FormUrlEncoded;
|
|||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
import retrofit2.http.QueryMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PDLive网络接口访问
|
* PDLive网络接口访问
|
||||||
@@ -171,10 +186,10 @@ public interface PDLiveApi {
|
|||||||
Observable<ResponseModel<List<ActiveModel>>> getActiveList();
|
Observable<ResponseModel<List<ActiveModel>>> getActiveList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取活动
|
* 获取多人连麦列表
|
||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=live.getDrLm")
|
@GET("/api/public/?service=live.getDrLm")
|
||||||
Observable<ResponseModel<List<ActiveModel>>> getDrLm();
|
Observable<ResponseModel<List<LinkMicUserBeanV2>>> getDrLm(@Query("uid") String uid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取日榜、周榜数据
|
* 获取日榜、周榜数据
|
||||||
@@ -269,4 +284,295 @@ public interface PDLiveApi {
|
|||||||
*/
|
*/
|
||||||
@GET("/api/public/?service=Ranking.getAnchorRankData")
|
@GET("/api/public/?service=Ranking.getAnchorRankData")
|
||||||
Observable<ResponseModel<PkRankBean>> getPkRanksList(@Query("anchor_id") String anchorId, @Query("anchor_id2") String pkUid);
|
Observable<ResponseModel<PkRankBean>> getPkRanksList(@Query("anchor_id") String anchorId, @Query("anchor_id2") String pkUid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多人连麦-创建房间
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.createDrLm")
|
||||||
|
Observable<ResponseModel<BaseModel>> createDrLm();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多人连麦-关闭房间
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.delDrLm")
|
||||||
|
Observable<ResponseModel<BaseModel>> delDrLm();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多人连麦-踢出用户
|
||||||
|
*
|
||||||
|
* @param uid 对方uid
|
||||||
|
* @param roomId 当前房间号
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.killDrLm")
|
||||||
|
Observable<ResponseModel<BaseModel>> killDrLm(@Query("uid") String uid, @Query("roomid") String roomId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新进入房间接口
|
||||||
|
*
|
||||||
|
* @param groupId 房间名 g+liveUid
|
||||||
|
* @param stream
|
||||||
|
* @param liveUid
|
||||||
|
* @param city
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.enterRoomNew")
|
||||||
|
Observable<ResponseModel<EnterRoomNewModel>> enterRoomNew(
|
||||||
|
@Query("GroupId") String groupId,
|
||||||
|
@Query("stream") String stream,
|
||||||
|
@Query("liveuid") String liveUid,
|
||||||
|
@Query("city") String city
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查直播间状态
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.checkLive")
|
||||||
|
Observable<ResponseModel<List<CheckLiveModel>>> checkLive(
|
||||||
|
@Query("liveuid") String liveUid,
|
||||||
|
@Query("stream") String stream
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加入房间推送Im欢迎语
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Tx.userJoinRoomNew")
|
||||||
|
Observable<ResponseModel<String>> userJoinRoomNew(
|
||||||
|
@Query("GroupId") String GroupId,
|
||||||
|
@Query("stream") String stream
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加入房间推送Im欢迎语
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Tx.leaveRoomNew")
|
||||||
|
Observable<ResponseModel<List<Object>>> leaveRoomNew(
|
||||||
|
@Query("GroupId") String GroupId,
|
||||||
|
@Query("stream") String stream
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取随机PK开关
|
||||||
|
*
|
||||||
|
* @return 1=开,0=关
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Livepk.getRandomPKType")
|
||||||
|
Observable<ResponseModel<List<Integer>>> getRandomPkSwitch();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置随机PK开关
|
||||||
|
*
|
||||||
|
* @param pk 1=开,0=关
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Livepk.setRandomPKType")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> changeRandomPkSwitch(@Query("random_pk") int pk);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取自由PK次数
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Livepk.getActivePkNum")
|
||||||
|
Observable<ResponseModel<Integer>> getFreePkNumber();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起随机PK
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Livepk.setRandomPK")
|
||||||
|
Observable<ResponseModel<String>> randomPK();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机PK后调用接口给后台记录
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Livepk.startRandomPK")
|
||||||
|
Observable<ResponseModel<BaseModel>> startRandomPK(@Query("pkuid") String pkuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自由PK开始后调用接口扣掉次数
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Livepk.setActivePkNum")
|
||||||
|
Observable<ResponseModel<BaseModel>> setFreePkNum();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机PK搜索用户
|
||||||
|
*
|
||||||
|
* @param cs 简体关键字/uid
|
||||||
|
* @param ct 繁体关键字/uid
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Livepk.searchUser")
|
||||||
|
Observable<ResponseModel<List<RandomPkUserBean>>> randomPkSearchUser(@Query("jian_key") String cs, @Query("fan_key") String ct);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝随机PK
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Livepk.setBanRandomPK")
|
||||||
|
Observable<ResponseModel<BaseModel>> setBanRandomPK();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝随机PK
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Ranking.getRankingInfo")
|
||||||
|
Observable<ResponseModel<RankPkInfoBean>> getRankingInfo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取转盘整蛊列表
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Prank.getAnchorPrankTurntable")
|
||||||
|
Observable<ResponseModel<PrankHttpTurntableBean>> getAnchorPrankTurntable(
|
||||||
|
@Query("anchor_id") String anchor_id
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交整蛊
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Prank.setAnchorPrankTurntable")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> setAnchorPrankTurntable(
|
||||||
|
@Query("anchor_id") String anchor_id,
|
||||||
|
@Query("coin") String coin,
|
||||||
|
@Query("turntable_one") String turntable_one,
|
||||||
|
@Query("turntable_two") String turntable_two,
|
||||||
|
@Query("turntable_three") String turntable_three,
|
||||||
|
@Query("turntable_four") String turntable_four,
|
||||||
|
@Query("turntable_five") String turntable_five,
|
||||||
|
@Query("turntable_six") String turntable_six,
|
||||||
|
@Query("status") String status
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转盘整蛊结束后调用的接口
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Prank.endPrankTurntable")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> endPrankTurntable(
|
||||||
|
@Query("anchor_id") String anchor_id
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取整蛊列表
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Prank.prankList")
|
||||||
|
Observable<ResponseModel<List<PrankGiftBean>>> prankList(@Query("anchor_id") String anchor_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置礼物整蛊
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Prank.setPrank")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> setPrank(
|
||||||
|
@Query("anchor_id") String anchor_id,
|
||||||
|
@Query("gift_id") String gift_id,
|
||||||
|
@Query("gift_num") String gift_num,
|
||||||
|
@Query("prank_content") String prank_content
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除礼物整蛊
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Prank.deletePrank")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> deletePrank(
|
||||||
|
@Query("anchor_id") String anchor_id,
|
||||||
|
@Query("prank_index") String prank_index
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置机器人开关
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.setAnchorAiState")
|
||||||
|
Observable<ResponseModel<HttpCallbackModel>> setAnchorAiState(
|
||||||
|
@Query("ai_state") String ai_state
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取机器人信息
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getAnchorAiState")
|
||||||
|
Observable<ResponseModel<LiveAiRobotBean>> getAnchorAiState(
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改机器人信息
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.setAnchorAiState")
|
||||||
|
Observable<ResponseModel<Integer>> setAnchorAiState(
|
||||||
|
@QueryMap Map<String, Object> map
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取机器人自定义话术
|
||||||
|
*
|
||||||
|
* @param type 1(自定义打招呼) 3(自定义求关注)
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getAiAutomaticSpeech")
|
||||||
|
Observable<ResponseModel<List<LiveAiRobotBean.Message>>> getAiAutomaticSpeech(
|
||||||
|
@Query("type") String type
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人添加话术
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.addAiAutomaticSpeech")
|
||||||
|
Observable<ResponseModel<List<String>>> addAiAutomaticSpeech(
|
||||||
|
@Query("type") String type,
|
||||||
|
@Query("content") String content
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人删除话术
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.delAiAutomaticSpeech ")
|
||||||
|
Observable<ResponseModel<List<String>>> delAiAutomaticSpeech(
|
||||||
|
@Query("type") String type,
|
||||||
|
@Query("id") String id
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机器人修改话术
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.updateAiAutomaticSpeech")
|
||||||
|
Observable<ResponseModel<List<String>>> updateAiAutomaticSpeech(
|
||||||
|
@Query("type") String type,
|
||||||
|
@Query("id") String id,
|
||||||
|
@Query("content") String content
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开播获取机器人状态和心愿单状态
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getLiveStetUpStatus")
|
||||||
|
Observable<ResponseModel<LiveStetUpStatusModel>> getLiveStetUpStatus(
|
||||||
|
@Query("liveuid") String liveUid
|
||||||
|
);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=live.jieshuDRPK")
|
||||||
|
Observable<ResponseModel<BaseModel>> jieshuDRPK(
|
||||||
|
@Query("roomid") String roomId,
|
||||||
|
@Query("uid") String uid);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Message.getListInfo")
|
||||||
|
Observable<ResponseModel<List<ListInfoMessageModel>>> getListInfo(
|
||||||
|
@Query("type") String type,
|
||||||
|
@Query("p") int p);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取主播任务列表
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getLiveTaskStatus")
|
||||||
|
Observable<ResponseModel<LiveTaskModel>> getLiveTaskList(
|
||||||
|
@Query("type") int type,
|
||||||
|
@Query("liveuid") String liveUid
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取直播数据
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Live.getLiveStatisticalData")
|
||||||
|
Observable<ResponseModel<LiveDataInfoModel>> getLiveDataInfo(
|
||||||
|
@Query("liveuid") String liveUid
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取直播数据
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Message.getAnchorMsg")
|
||||||
|
Observable<ResponseModel<List<ListInfoMessageModel>>> getAnchorMsg(
|
||||||
|
@Query("liveuid") String liveUid, @Query("page") int page, @Query("limit") int limit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.yunbao.common.http.base;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.CheckLiveModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播间类型返回
|
||||||
|
*/
|
||||||
|
public interface CheckLiveCallBack {
|
||||||
|
/**
|
||||||
|
* ;普通房
|
||||||
|
*/
|
||||||
|
void forwardNormalRoom(CheckLiveModel model);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码房
|
||||||
|
*/
|
||||||
|
void forwardPwdRoom(CheckLiveModel model);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费房
|
||||||
|
*/
|
||||||
|
void forwardPayRoom(CheckLiveModel model);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求失败
|
||||||
|
*
|
||||||
|
* @param error
|
||||||
|
*/
|
||||||
|
void onError(String error);
|
||||||
|
}
|
||||||
@@ -2,26 +2,47 @@ package com.yunbao.common.http.live;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.bean.CheckLiveModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||||
|
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.bean.LinkMicUserBean;
|
||||||
|
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||||
|
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||||
|
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||||
|
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||||
import com.yunbao.common.bean.LiveInfoModel;
|
import com.yunbao.common.bean.LiveInfoModel;
|
||||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||||
|
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||||
|
import com.yunbao.common.bean.LiveTaskModel;
|
||||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||||
|
import com.yunbao.common.bean.PkRankBean;
|
||||||
|
import com.yunbao.common.bean.PrankGiftBean;
|
||||||
|
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||||
|
import com.yunbao.common.bean.RandomPkUserBean;
|
||||||
|
import com.yunbao.common.bean.RankPkInfoBean;
|
||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||||
import com.yunbao.common.bean.VipModel;
|
import com.yunbao.common.bean.VipModel;
|
||||||
import com.yunbao.common.http.API;
|
import com.yunbao.common.http.API;
|
||||||
import com.yunbao.common.http.ResponseModel;
|
import com.yunbao.common.http.ResponseModel;
|
||||||
|
import com.yunbao.common.http.base.CheckLiveCallBack;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
import io.reactivex.functions.Consumer;
|
import io.reactivex.functions.Consumer;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
@@ -291,4 +312,851 @@ public class LiveNetManager {
|
|||||||
}
|
}
|
||||||
}, throwable -> callback.onError(throwable.getMessage())).isDisposed();
|
}, throwable -> callback.onError(throwable.getMessage())).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查直播间状态
|
||||||
|
*
|
||||||
|
* @param liveUid
|
||||||
|
* @param stream
|
||||||
|
* @param callBack
|
||||||
|
*/
|
||||||
|
public void checkLive(String liveUid, String stream, CheckLiveCallBack callBack) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.checkLive(liveUid, stream)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<CheckLiveModel>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<CheckLiveModel>> listResponseModel) throws Exception {
|
||||||
|
if (listResponseModel.getData().getCode() == 0) {
|
||||||
|
List<CheckLiveModel> checkLiveModels = listResponseModel.getData().getInfo();
|
||||||
|
if (checkLiveModels.size() > 0) {
|
||||||
|
CheckLiveModel liveModel = checkLiveModels.get(0);
|
||||||
|
switch (liveModel.getType()) {
|
||||||
|
case Constants.LIVE_TYPE_NORMAL:
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.forwardNormalRoom(liveModel);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Constants.LIVE_TYPE_PWD:
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.forwardPwdRoom(liveModel);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Constants.LIVE_TYPE_PAY:
|
||||||
|
case Constants.LIVE_TYPE_TIME:
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.forwardPayRoom(liveModel);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.onError(listResponseModel.getData().getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.onError(listResponseModel.getData().getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callBack != null) {
|
||||||
|
callBack.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新进入直播间接口
|
||||||
|
*
|
||||||
|
* @param stream
|
||||||
|
* @param liveUid
|
||||||
|
* @param city
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
private Disposable enterRoomDisposable = null;
|
||||||
|
|
||||||
|
public void enterRoomNew(String stream, String liveUid, String city, HttpCallback<EnterRoomNewModel> callback) {
|
||||||
|
enterRoomDisposable = API.get().pdLiveApi(mContext)
|
||||||
|
.enterRoomNew("g" + liveUid, stream, liveUid, city)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<EnterRoomNewModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<EnterRoomNewModel> enterRoomNewModelResponseModel) throws Exception {
|
||||||
|
Log.e("进入房间", "enterRoomNew--------------------------------------------");
|
||||||
|
enterRoomDisposable = null;
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(enterRoomNewModelResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
enterRoomDisposable = null;
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加入房间推送IM消息
|
||||||
|
*
|
||||||
|
* @param stream
|
||||||
|
* @param liveUid
|
||||||
|
*/
|
||||||
|
private Disposable userJoinDisposable = null;
|
||||||
|
|
||||||
|
public void userJoinRoomNew(String stream, String liveUid) {
|
||||||
|
userJoinDisposable = API.get().pdLiveApi(mContext)
|
||||||
|
.userJoinRoomNew("g" + liveUid, stream)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<String>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<String> stringResponseModel) throws Exception {
|
||||||
|
Log.e("进入房间", "userJoinRoomNew--------------------------------------------");
|
||||||
|
userJoinDisposable = null;
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
userJoinDisposable = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 离开直播间
|
||||||
|
*
|
||||||
|
* @param stream
|
||||||
|
* @param liveUid
|
||||||
|
*/
|
||||||
|
public void leaveRoomNew(String stream, String liveUid, HttpCallback<String> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.leaveRoomNew("g" + liveUid, stream)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<Object>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<Object>> listResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取多人连麦用户列表
|
||||||
|
*/
|
||||||
|
public void getDRMicUserList(String uid, HttpCallback<List<LinkMicUserBean>> callback) {
|
||||||
|
API.get().createPDLiveApi(false)
|
||||||
|
.getDrLm(uid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<LinkMicUserBeanV2>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<LinkMicUserBeanV2>> listResponseModel) throws Exception {
|
||||||
|
List<LinkMicUserBean> list = new ArrayList<>();
|
||||||
|
for (LinkMicUserBeanV2 bean : listResponseModel.getData().getInfo()) {
|
||||||
|
list.addAll(bean.getUserlist());
|
||||||
|
for (LinkMicUserBean userBean : bean.getUserlist()) {
|
||||||
|
Log.i("多人连麦", "list: " + userBean.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.i("多人连麦", "accept: " + list.size());
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Disposable randomPkApi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PK排位赛接口
|
||||||
|
*/
|
||||||
|
public void getRandomPk(String mLiveUid, String pkUid, HttpCallback<PkRankBean> callback) {
|
||||||
|
randomPkApi = API.get().pdLiveApi(mContext)
|
||||||
|
.getPkRanksList(mLiveUid, pkUid)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取随机PK开关
|
||||||
|
* 1=开,0=关
|
||||||
|
*/
|
||||||
|
public void getRandomPkSwitch(HttpCallback<Integer> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getRandomPkSwitch()
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo().get(0));
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置随机PK开关
|
||||||
|
*
|
||||||
|
* @param pk 1=开,0=关
|
||||||
|
* @param callback @{@link HttpCallbackModel#getCode()} 0=成功
|
||||||
|
*/
|
||||||
|
public void changeRandomPkSwitch(int pk, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.changeRandomPkSwitch(pk)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<BaseModel>> responseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
HttpCallbackModel model = new HttpCallbackModel();
|
||||||
|
model.setCode(responseModel.getData().getCode());
|
||||||
|
model.setMsg(responseModel.getData().getMsg());
|
||||||
|
callback.onSuccess(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取自由PK次数
|
||||||
|
*/
|
||||||
|
public void getFreePkNumber(HttpCallback<Integer> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getFreePkNumber()
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(new Consumer<ResponseModel<Integer>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<Integer> responseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起随机PK
|
||||||
|
*/
|
||||||
|
public void randomPK(HttpCallback<String> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.randomPK()
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(new Consumer<ResponseModel<String>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<String> responseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自由PK开始后调用接口扣掉次数
|
||||||
|
*/
|
||||||
|
public void setFreePkNum(HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.setFreePkNum()
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(new Consumer<ResponseModel<BaseModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<BaseModel> responseModel) throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机PK后调用接口给后台记录
|
||||||
|
*/
|
||||||
|
public void startRandomPK(String pkuid, HttpCallback<Boolean> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.startRandomPK(pkuid)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(new Consumer<ResponseModel<BaseModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<BaseModel> responseModel) throws Exception {
|
||||||
|
if (responseModel.getData().getCode() == 0) {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
callback.onSuccess(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机PK后调用接口给后台记录
|
||||||
|
*
|
||||||
|
* @param cs 简体关键字/uid
|
||||||
|
* @param ct 繁体关键字/uid
|
||||||
|
*/
|
||||||
|
public void randomPkSearchUser(String cs, String ct, HttpCallback<List<RandomPkUserBean>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.randomPkSearchUser(cs, ct)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<RandomPkUserBean>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<RandomPkUserBean>> responseModel) throws Exception {
|
||||||
|
if (responseModel.getData().getCode() == 0) {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝随机PK
|
||||||
|
*/
|
||||||
|
public void setBanRandomPK(HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.setBanRandomPK()
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(new Consumer<ResponseModel<BaseModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<BaseModel> responseModel) throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取随机排位赛信息
|
||||||
|
*/
|
||||||
|
public void getRankPkInfoBean(HttpCallback<RankPkInfoBean> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getRankingInfo()
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(new Consumer<ResponseModel<RankPkInfoBean>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<RankPkInfoBean> rankPkInfoBeanResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(rankPkInfoBeanResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取转盘整蛊列表
|
||||||
|
*/
|
||||||
|
public void getAnchorPrankTurntable(String mLiveUid, HttpCallback<PrankHttpTurntableBean> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getAnchorPrankTurntable(mLiveUid)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交转盘整蛊
|
||||||
|
*/
|
||||||
|
public void setAnchorPrankTurntable(String mLiveUid, String coin,
|
||||||
|
String turntable_one,
|
||||||
|
String turntable_two,
|
||||||
|
String turntable_three,
|
||||||
|
String turntable_four,
|
||||||
|
String turntable_five,
|
||||||
|
String turntable_six,
|
||||||
|
String status,
|
||||||
|
HttpCallback<Object> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.setAnchorPrankTurntable(mLiveUid,
|
||||||
|
coin,
|
||||||
|
turntable_one,
|
||||||
|
turntable_two,
|
||||||
|
turntable_three,
|
||||||
|
turntable_four,
|
||||||
|
turntable_five,
|
||||||
|
turntable_six,
|
||||||
|
status)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取转盘整蛊列表
|
||||||
|
*/
|
||||||
|
public void getPrankGiftList(String mLiveUid, HttpCallback<List<PrankGiftBean>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.prankList(mLiveUid)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置礼物整蛊
|
||||||
|
*/
|
||||||
|
public void setPrankGift(String mLiveUid, String gift_id, String gift_num, String prank_content, HttpCallback<PrankHttpTurntableBean> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.setPrank(mLiveUid, gift_id, gift_num, prank_content)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(null);
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除礼物整蛊
|
||||||
|
*/
|
||||||
|
public void deletePrankGift(String mLiveUid, String prank_index, HttpCallback<PrankHttpTurntableBean> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.deletePrank(mLiveUid, prank_index)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(null);
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整蛊结束
|
||||||
|
*/
|
||||||
|
public void endPrankTurntable(String mLiveUid, HttpCallback<BaseModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.endPrankTurntable(mLiveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(null);
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getAiRobotStatus(HttpCallback<LiveAiRobotBean> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getAnchorAiState()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAiRobotStatus(String status, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.setAnchorAiState(status)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(null);
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAiRobotDate(String name, String value, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put(name, value);
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.setAnchorAiState(map)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(null);
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getAiRobotBody(int type, HttpCallback<List<LiveAiRobotBean.Message>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getAiAutomaticSpeech(type + "")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(responseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addAiRobotBody(int type, String content, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.addAiAutomaticSpeech(type + "", content)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateAiRobotBody(int type, int id, String content, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.updateAiAutomaticSpeech(type + "", id + "", content)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void delAiRobotBody(int type, int id, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.delAiAutomaticSpeech(type + "", id + "")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(responseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开播设置数据获取
|
||||||
|
*
|
||||||
|
* @param liveUid
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public void getLiveStetUpStatus(String liveUid, HttpCallback<LiveStetUpStatusModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getLiveStetUpStatus(liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<LiveStetUpStatusModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<LiveStetUpStatusModel> liveStetUpStatusModelResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(liveStetUpStatusModelResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void jieshuDRPK(String uID) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.jieshuDRPK(uID, uID)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(baseModelResponseModel -> {
|
||||||
|
|
||||||
|
}, throwable -> {
|
||||||
|
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getListInfo(String type, int p, HttpCallback<List<ListInfoMessageModel>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getListInfo(type, p)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}, throwable -> {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取直播任务
|
||||||
|
*
|
||||||
|
* @param type 1 直播任务 2粉丝任务
|
||||||
|
*/
|
||||||
|
public void getLiveTask(int type, String liveUid, HttpCallback<LiveTaskModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getLiveTaskList(type, liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}, throwable -> {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取直播数据
|
||||||
|
*/
|
||||||
|
public void getLiveData(String liveUid, HttpCallback<LiveDataInfoModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getLiveDataInfo(liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}, throwable -> {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取主播消息
|
||||||
|
*
|
||||||
|
* @param liveUid 直播间id
|
||||||
|
* @param page 页码
|
||||||
|
* @param callback 回调
|
||||||
|
*/
|
||||||
|
public void getAnchorMsg(String liveUid, int page, HttpCallback<List<ListInfoMessageModel>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getAnchorMsg(liveUid, page, 10)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, throwable -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(throwable.getMessage());
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播间取消网络请求
|
||||||
|
*/
|
||||||
|
public void cancelLive() {
|
||||||
|
if (userJoinDisposable != null) {
|
||||||
|
userJoinDisposable.dispose();
|
||||||
|
}
|
||||||
|
if (enterRoomDisposable != null) {
|
||||||
|
enterRoomDisposable.dispose();
|
||||||
|
}
|
||||||
|
if (randomPkApi != null) {
|
||||||
|
randomPkApi.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.yunbao.common.manager;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.yunbao.common.CommonAppContext;
|
||||||
|
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||||
|
import com.yunbao.common.utils.VersionUtil;
|
||||||
|
|
||||||
|
public class APKManager extends BaseCacheManager {
|
||||||
|
private static APKManager manager;
|
||||||
|
private final String APK_VER = "apk_ver";
|
||||||
|
private final String APK_URL = "apk_url";
|
||||||
|
private final String APK_DES = "apk_des";
|
||||||
|
private final String APK_IS_UP = "isup";
|
||||||
|
private final String APK_GOOGLE_IS_UP = "google_isup";
|
||||||
|
|
||||||
|
public APKManager(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单利
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static APKManager get() {
|
||||||
|
if (null == manager) {
|
||||||
|
manager = new APKManager(CommonAppContext.sInstance.getBaseContext());
|
||||||
|
}
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAPKUrl(String apkUrl) {
|
||||||
|
put(APK_URL, apkUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAPKDes(String apkDes) {
|
||||||
|
put(APK_DES, apkDes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAPKUrl() {
|
||||||
|
return getString(APK_URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAPKDes() {
|
||||||
|
return getString(APK_DES);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApkVer(String apkVer) {
|
||||||
|
put(APK_VER, apkVer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getApkVerNew() {
|
||||||
|
|
||||||
|
return VersionUtil.isLatest(getString(APK_VER));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAPKIsUp(int apkIsUp) {
|
||||||
|
put(APK_IS_UP, apkIsUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAPKGoogleIsUp(int apkGoogleIsUp) {
|
||||||
|
put(APK_GOOGLE_IS_UP, apkGoogleIsUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getApkIsUp() {
|
||||||
|
return getInt(APK_IS_UP, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAPKGoogleIsUp() {
|
||||||
|
return getInt(APK_GOOGLE_IS_UP, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,12 +2,12 @@ package com.yunbao.common.manager;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.cosmos.baseutil.app.AppContext;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lzf.easyfloat.EasyFloat;
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
@@ -39,7 +39,50 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
private final String IS_FLOAT = "is_float";
|
private final String IS_FLOAT = "is_float";
|
||||||
private final String IS_HINT = "is_hint";
|
private final String IS_HINT = "is_hint";
|
||||||
private final String IS_HINT2 = "is_hint2";
|
private final String IS_HINT2 = "is_hint2";
|
||||||
|
private final String SELECT_CLARITY = "selectClarity";
|
||||||
|
private final String CLARITY = "clarity";
|
||||||
|
private final String xiaJBG = "xiaJBG";
|
||||||
|
|
||||||
|
public void setXiaJBG(boolean xjbg) {
|
||||||
|
put(xiaJBG, xjbg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean IsXiaJBG() {
|
||||||
|
return getBoolean(xiaJBG, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClarity(String clarity) {
|
||||||
|
put(CLARITY, clarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1080p开播分辨率:clarity 0关闭 1开启
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean getClarity() {
|
||||||
|
return TextUtils.equals(getString(CLARITY), "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置清晰度
|
||||||
|
*
|
||||||
|
* @param selectClarity
|
||||||
|
*/
|
||||||
|
public void setSelectClarity(int selectClarity) {
|
||||||
|
put(SELECT_CLARITY, selectClarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取清晰度
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getSelectClarity() {
|
||||||
|
|
||||||
|
return getInt(SELECT_CLARITY, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isHint() {
|
public boolean isHint() {
|
||||||
return 1 == getInt(IS_HINT, 0);
|
return 1 == getInt(IS_HINT, 0);
|
||||||
@@ -242,11 +285,12 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMountEffect() {
|
public boolean isMountEffect() {
|
||||||
return getBoolean(MountEffect, true);
|
|
||||||
|
return getBoolean(MountEffect, !(Build.VERSION.SDK_INT < Build.VERSION_CODES.O));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGiftEffect() {
|
public boolean isGiftEffect() {
|
||||||
return getBoolean(GiftEffect, true);
|
return getBoolean(GiftEffect, !(Build.VERSION.SDK_INT < Build.VERSION_CODES.O));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -271,7 +315,7 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
.execute(new HttpCallback() {
|
.execute(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (info.length > 0) {
|
if (info.length > 0 && userInfo != null) {
|
||||||
if ("1".equals(info[0])) {
|
if ("1".equals(info[0])) {
|
||||||
userInfo.setIsAdmin("1");
|
userInfo.setIsAdmin("1");
|
||||||
InstructorRemarkManager.get(context).getNetInstructorRemark();
|
InstructorRemarkManager.get(context).getNetInstructorRemark();
|
||||||
|
|||||||
261
common/src/main/java/com/yunbao/common/manager/IMRTCManager.java
Normal file
261
common/src/main/java/com/yunbao/common/manager/IMRTCManager.java
Normal file
@@ -0,0 +1,261 @@
|
|||||||
|
package com.yunbao.common.manager;
|
||||||
|
|
||||||
|
import static cn.rongcloud.rtc.base.RTCErrorCode.JOIN_CHAT_ROOM_TIMEOUT;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCRemoteUser;
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCRoom;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCRoomEventsListener;
|
||||||
|
import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
|
||||||
|
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RTC管理类,负责管理申请、同意、拒绝PK
|
||||||
|
*/
|
||||||
|
public class IMRTCManager {
|
||||||
|
private static IMRTCManager manager;
|
||||||
|
private RCRTCRoom rtcRoom;
|
||||||
|
private List<String> requestUid;
|
||||||
|
|
||||||
|
private IMRTCManager() {
|
||||||
|
requestUid = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMRTCManager getInstance() {
|
||||||
|
if (manager == null) {
|
||||||
|
manager = new IMRTCManager();
|
||||||
|
}
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRtcRoom(RCRTCRoom rtcRoom) {
|
||||||
|
this.rtcRoom = rtcRoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 响应PK请求
|
||||||
|
*
|
||||||
|
* @param liveUid 对方房间号
|
||||||
|
* @param agree 是否同意
|
||||||
|
* @param extra 扩展参数
|
||||||
|
* @param callback 回调
|
||||||
|
*/
|
||||||
|
public void responseJoinOtherRoom(String liveUid, boolean agree, String extra, IRCRTCResultCallback callback) {
|
||||||
|
if (rtcRoom != null) {
|
||||||
|
/*
|
||||||
|
inviterRoomId - 邀请者所在房间 id,
|
||||||
|
inviterUserId - 邀请者用户 id
|
||||||
|
agree - 被邀请者是否同意连麦邀请
|
||||||
|
inviteeAutoMix - 是否将被邀请者音视频资源发送到邀请人房间中合流
|
||||||
|
1:inviteeAutoMix 为true时:
|
||||||
|
1.1:如果邀请方在发送连麦请求之前发布了资源,当被邀请方加入邀请者房间成功后,服务器会把邀请方流资源合并到被邀请方视图(默认仅悬浮布局合流)上。
|
||||||
|
1.2:如果邀请方在发送连麦请求之前没有发布资源,将会在邀请方发布资源成功后,服务器才会把邀请方的资源合并到被邀请方视图(默认仅悬浮布局合流)上。
|
||||||
|
2: 无论为true或false,双方都可以使用RCRTCLiveInfo.setMixConfig(RCRTCMixConfig, IRCRTCResultCallback) 方法主动设置合流布局。一旦主动设置过合流布局,后续音视频直播过程中设置的自动合流参数将失效。
|
||||||
|
extra - 扩展字段,默认为空
|
||||||
|
*/
|
||||||
|
rtcRoom.getLocalUser().responseJoinOtherRoom(liveUid, liveUid, agree, agree, extra, callback);
|
||||||
|
} else {
|
||||||
|
callback.onFailed(RTCErrorCode.RongRTCCodeIMError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请PK
|
||||||
|
*
|
||||||
|
* @param liveUid 对方房间号
|
||||||
|
* @param inviterAutoMix 是否将邀请者音视频资源发送到被邀请人房间中合流
|
||||||
|
* @param extra 扩展参数
|
||||||
|
* @param callback 回调
|
||||||
|
*/
|
||||||
|
public void requestJoinOtherRoom(String liveUid, boolean inviterAutoMix, String extra, IRCRTCResultCallback callback) {
|
||||||
|
if (requestUid.contains(liveUid)) {
|
||||||
|
callback.onFailed(RTCErrorCode.RongRTCCodeJoinRepeatedRoom);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (rtcRoom != null && rtcRoom.getLocalUser() != null) {
|
||||||
|
/*
|
||||||
|
inviteeRoomId - 被邀请者所在房间 id
|
||||||
|
inviteeUserId - 被邀请用户 id
|
||||||
|
inviterAutoMix - 是否将邀请者音视频资源发送到被邀请人房间中合流
|
||||||
|
1: inviterAutoMix为true时:
|
||||||
|
1.1:如果被邀请方在加入邀请方房间之前发布了资源,当被邀请方加入邀请者房间成功后,服务器会把被邀请方流资源合并到邀请方视图 ·(默认仅悬浮布局合流)上。
|
||||||
|
1.2:如果被邀请方在加入邀请方房间之前没有发布过资源,将会在被邀请方发布资源成功后,服务器会把被邀请方流资源合并到邀请方视图(默认仅悬浮布局合流)上。
|
||||||
|
2:无论为true或false,双方都可以使用RCRTCLiveInfo.setMixConfig(RCRTCMixConfig, IRCRTCResultCallback) 方法主动设置合流布局。一旦主动设置过合流布局,后续音视频直播过程中设置的自动合流参数将失效。
|
||||||
|
extra - 扩展字段,默认为空
|
||||||
|
*/
|
||||||
|
rtcRoom.getLocalUser().requestJoinOtherRoom(liveUid, liveUid, inviterAutoMix, extra, new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
callback.onSuccess();
|
||||||
|
if (!RandomPkManager.getInstance().isRandomModel()) {
|
||||||
|
ToastUtil.show("发起邀请成功");
|
||||||
|
}
|
||||||
|
requestUid.add(liveUid);
|
||||||
|
startRequestTimeoutTask(liveUid);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
if (!RandomPkManager.getInstance().isRandomModel()) {
|
||||||
|
ToastUtil.show("邀请失败 " + errorCode.getValue());
|
||||||
|
}
|
||||||
|
if (RandomPkManager.getInstance().isRequestPk()) {
|
||||||
|
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||||
|
}
|
||||||
|
requestUid.remove(liveUid);
|
||||||
|
callback.onFailed(errorCode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
callback.onFailed(RTCErrorCode.RongRTCCodeIMError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册监听对方通知类,还没搞清楚具体用法,先搁置
|
||||||
|
*
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
public void registerRoomListener(IRCRTCRoomEventsListener listener) {
|
||||||
|
if (rtcRoom != null && rtcRoom.getLocalUser() != null) {
|
||||||
|
rtcRoom.registerRoomListener(new IRCRTCRoomEventsListener() {
|
||||||
|
@Override
|
||||||
|
public void onRemoteUserPublishResource(RCRTCRemoteUser remoteUser, List<RCRTCInputStream> streams) {
|
||||||
|
listener.onRemoteUserPublishResource(remoteUser, streams);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRemoteUserMuteAudio(RCRTCRemoteUser remoteUser, RCRTCInputStream stream, boolean mute) {
|
||||||
|
listener.onRemoteUserMuteAudio(remoteUser, stream, mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRemoteUserMuteVideo(RCRTCRemoteUser remoteUser, RCRTCInputStream stream, boolean mute) {
|
||||||
|
listener.onRemoteUserMuteVideo(remoteUser, stream, mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRemoteUserUnpublishResource(RCRTCRemoteUser remoteUser, List<RCRTCInputStream> streams) {
|
||||||
|
listener.onRemoteUserUnpublishResource(remoteUser, streams);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUserJoined(RCRTCRemoteUser remoteUser) {
|
||||||
|
listener.onUserJoined(remoteUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUserLeft(RCRTCRemoteUser remoteUser) {
|
||||||
|
listener.onUserLeft(remoteUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUserOffline(RCRTCRemoteUser remoteUser) {
|
||||||
|
listener.onUserOffline(remoteUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPublishLiveStreams(List<RCRTCInputStream> streams) {
|
||||||
|
listener.onPublishLiveStreams(streams);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUnpublishLiveStreams(List<RCRTCInputStream> streams) {
|
||||||
|
listener.onUnpublishLiveStreams(streams);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消邀请
|
||||||
|
*
|
||||||
|
* @param liveUid 房间号
|
||||||
|
* @param extra 扩展参数
|
||||||
|
* @param callback 回调
|
||||||
|
*/
|
||||||
|
public void cancelRequestJoinOtherRoom(String liveUid, String extra, IRCRTCResultCallback callback) {
|
||||||
|
if (rtcRoom != null && rtcRoom.getLocalUser() != null) {
|
||||||
|
rtcRoom.getLocalUser().cancelRequestJoinOtherRoom(liveUid, liveUid, extra, new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
callback.onSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
callback.onFailed(errorCode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
callback.onFailed(RTCErrorCode.RongRTCCodeIMError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void callPkSuccess(String liveUid) {
|
||||||
|
requestUid.remove(liveUid);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startRequestTimeoutTask(String liveUid) {
|
||||||
|
new Timer().schedule(new TimerTask() {
|
||||||
|
int waitTime = 15;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (!requestUid.contains(liveUid)) {
|
||||||
|
cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (waitTime-- == 0) {
|
||||||
|
//callback.onFailed(JOIN_CHAT_ROOM_TIMEOUT);
|
||||||
|
cancelRequestJoinOtherRoom(liveUid, "extra", new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
requestUid.remove(liveUid);
|
||||||
|
if (RandomPkManager.getInstance().isRandomModel()) {
|
||||||
|
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
requestUid.remove(liveUid);
|
||||||
|
if (RandomPkManager.getInstance().isRandomModel()) {
|
||||||
|
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 1000, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void leaveOtherRoom(String roomId,
|
||||||
|
boolean notifyFinished,
|
||||||
|
IRCRTCResultCallback callBack) {
|
||||||
|
RCRTCEngine.getInstance().leaveOtherRoom(roomId, notifyFinished, new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
callBack.onSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode rtcErrorCode) {
|
||||||
|
callBack.onFailed(rtcErrorCode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,9 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class NewLevelManager extends BaseCacheManager {
|
public class NewLevelManager extends BaseCacheManager {
|
||||||
private final String KEY_USER_LEVEL = "keyUserLevel";
|
private final String KEY_USER_LEVEL = "keyUserLevel";
|
||||||
|
private final String KEY_ANCHOR_LEVEL = "keyAnchorLevel";
|
||||||
private List<NewLevelModel> newLevelModels = new ArrayList<>();
|
private List<NewLevelModel> newLevelModels = new ArrayList<>();
|
||||||
|
private List<NewLevelModel> keyAnchorLevel = new ArrayList<>();
|
||||||
|
|
||||||
public NewLevelManager(Context context) {
|
public NewLevelManager(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -41,5 +43,24 @@ public class NewLevelManager extends BaseCacheManager {
|
|||||||
return getList(KEY_USER_LEVEL, new TypeToken<List<NewLevelModel>>() {
|
return getList(KEY_USER_LEVEL, new TypeToken<List<NewLevelModel>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 缓存等级图标
|
||||||
|
*
|
||||||
|
* @param json
|
||||||
|
*/
|
||||||
|
public void UpAnchorDataLevel(String json) {
|
||||||
|
newLevelModels = new Gson().fromJson(json, new TypeToken<List<NewLevelModel>>() {
|
||||||
|
}.getType());
|
||||||
|
put(KEY_ANCHOR_LEVEL, newLevelModels);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取等级数据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<NewLevelModel> getNewAnchorLevelModels() {
|
||||||
|
return getList(KEY_ANCHOR_LEVEL, new TypeToken<List<NewLevelModel>>() {
|
||||||
|
}.getType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,470 @@
|
|||||||
|
package com.yunbao.common.manager;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.yunbao.common.CommonAppContext;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.RankPkInfoBean;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机PK管理类
|
||||||
|
*/
|
||||||
|
public class RandomPkManager {
|
||||||
|
public final static int PK_STATUS_DEFAULT = -1;//默认状态,一般为为开始匹配
|
||||||
|
public final static int PK_STATUS_REQUEST = 0;//已发出匹配请求
|
||||||
|
public final static int PK_STATUS_START = 1;//匹配到用户
|
||||||
|
public final static int PK_STATUS_CLOSE = 2;//PK结束
|
||||||
|
public final static int PK_STATUS_REFUSE = 3;//对方拒绝
|
||||||
|
public final static int PK_STATUS_EXIT_ING = 4;//退出匹配中
|
||||||
|
|
||||||
|
private static RandomPkManager manager;
|
||||||
|
private int min = -1;//匹配计时器 分钟
|
||||||
|
private int sec = -1;//匹配计时器 秒钟
|
||||||
|
private int status = PK_STATUS_DEFAULT;
|
||||||
|
private Timer timer;
|
||||||
|
private TimerTask task;
|
||||||
|
private final List<OnRandomPkTimer> randomPkTimer = new ArrayList<>();//监听器集合
|
||||||
|
private String pkUid;//对方房间ID
|
||||||
|
public static String debugUid;
|
||||||
|
private RankPkInfoBean rankPkInfoBean;//排位赛信息
|
||||||
|
private int exitTimer;//退出倒计时
|
||||||
|
private TimerTask exitTask = null;//退出任务
|
||||||
|
Handler handler = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
|
private RandomPkManager() {
|
||||||
|
getRankInfo();
|
||||||
|
initTask();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RandomPkManager getInstance() {
|
||||||
|
if (manager == null) {
|
||||||
|
manager = new RandomPkManager();
|
||||||
|
}
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加监听器
|
||||||
|
*/
|
||||||
|
public void addOnRandomPkTimer(OnRandomPkTimer randomPkTimer) {
|
||||||
|
if (randomPkTimer != null) {
|
||||||
|
this.randomPkTimer.add(randomPkTimer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除监听器
|
||||||
|
*/
|
||||||
|
public void unregisterOnRandomPkTimer(OnRandomPkTimer randomPkTimer) {
|
||||||
|
if (randomPkTimer != null) {
|
||||||
|
this.randomPkTimer.remove(randomPkTimer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化参数
|
||||||
|
*/
|
||||||
|
private void initVal() {
|
||||||
|
min = -1;
|
||||||
|
sec = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化任务
|
||||||
|
*/
|
||||||
|
private void initTask() {
|
||||||
|
if (task != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
task = new TimerTask() {
|
||||||
|
boolean isStartPk = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
sec++;
|
||||||
|
if (sec % 60 == 0) {
|
||||||
|
min++;
|
||||||
|
sec = 0;
|
||||||
|
}
|
||||||
|
handler.post(() -> {
|
||||||
|
for (OnRandomPkTimer onRandomPkTimer : randomPkTimer) {
|
||||||
|
onRandomPkTimer.onTimer(String.format(Locale.CHINA, "%02d:%02d", min, sec));
|
||||||
|
}
|
||||||
|
if (!isStartPk) {
|
||||||
|
nextPk();
|
||||||
|
isStartPk = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化匹配时间
|
||||||
|
*/
|
||||||
|
public String getTimer() {
|
||||||
|
return String.format(Locale.CHINA, "%02d:%02d", min, sec);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Runnable pkRunnable = this::next;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对方拒绝,开始下一轮匹配
|
||||||
|
*/
|
||||||
|
private void nextPk() {
|
||||||
|
if (status != PK_STATUS_DEFAULT && status != PK_STATUS_REFUSE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handler.postDelayed(pkRunnable, 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void next() {
|
||||||
|
if (task == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
status = PK_STATUS_REQUEST;
|
||||||
|
LiveNetManager.get(CommonAppContext.getTopActivity())
|
||||||
|
.randomPK(new HttpCallback<String>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String data) {
|
||||||
|
try {
|
||||||
|
Integer.parseInt(data);//检测返回的data是否为数字uid,不是的话开始下一轮
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
status = PK_STATUS_DEFAULT;
|
||||||
|
nextPk();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pkUid = data;
|
||||||
|
if (debugUid != null) {
|
||||||
|
pkUid = data = debugUid;
|
||||||
|
}
|
||||||
|
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||||
|
pkTimer.onStartPK(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为排位赛模式
|
||||||
|
*/
|
||||||
|
public boolean isRankModel() {
|
||||||
|
return rankPkInfoBean != null && rankPkInfoBean.isRankPKTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为随机PK模式
|
||||||
|
*/
|
||||||
|
public boolean isRandomModel() {
|
||||||
|
boolean isRandom = status == PK_STATUS_START || status == PK_STATUS_REQUEST || status == PK_STATUS_EXIT_ING;
|
||||||
|
Log.i("随机PK", "isRandomModel: " + isRandom + " status = " + status);
|
||||||
|
return isRandom;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始匹配
|
||||||
|
*/
|
||||||
|
public boolean start() {
|
||||||
|
if (status == PK_STATUS_START) {
|
||||||
|
ToastUtil.show("PK中");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (status == PK_STATUS_EXIT_ING) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (task != null) {
|
||||||
|
task.cancel();
|
||||||
|
}
|
||||||
|
task = null;
|
||||||
|
initTask();
|
||||||
|
initVal();
|
||||||
|
timer = new Timer();
|
||||||
|
timer.schedule(task, 0, 1000);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getRankInfo() {
|
||||||
|
LiveNetManager.get(CommonAppContext.getTopActivity())
|
||||||
|
.getRankPkInfoBean(new HttpCallback<RankPkInfoBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(RankPkInfoBean data) {
|
||||||
|
rankPkInfoBean = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知所有监听者,开始退出匹配
|
||||||
|
*/
|
||||||
|
private void callEndPkStart() {
|
||||||
|
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||||
|
pkTimer.onPkEndStart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知所有监听者,退出匹配倒计时
|
||||||
|
*/
|
||||||
|
private void callEndPkTimer(String time) {
|
||||||
|
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||||
|
pkTimer.onPkEndTimer(time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知所有监听者,退出匹配成功
|
||||||
|
*/
|
||||||
|
private void callEndPkSuccess() {
|
||||||
|
status = PK_STATUS_DEFAULT;
|
||||||
|
rankPkInfoBean = null;
|
||||||
|
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||||
|
pkTimer.onPkEndSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private TimerTask createExitTask() {
|
||||||
|
return new TimerTask() {
|
||||||
|
|
||||||
|
Handler handler = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
handler.post(() -> {
|
||||||
|
exitTimer--;
|
||||||
|
callEndPkTimer(exitTimer + "");
|
||||||
|
if (exitTimer == 0) {
|
||||||
|
end();
|
||||||
|
callEndPkSuccess();
|
||||||
|
cancel();
|
||||||
|
exitTask = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出匹配
|
||||||
|
*/
|
||||||
|
public void exitPk() {
|
||||||
|
if (status == PK_STATUS_EXIT_ING) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
callEndPkStart();
|
||||||
|
status = PK_STATUS_EXIT_ING;
|
||||||
|
exitTimer = 11;
|
||||||
|
exitTask = createExitTask();
|
||||||
|
new Timer().schedule(exitTask, 0, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出连麦
|
||||||
|
*/
|
||||||
|
public void end() {
|
||||||
|
if (task != null) {
|
||||||
|
task.cancel();
|
||||||
|
}
|
||||||
|
task = null;
|
||||||
|
status = PK_STATUS_DEFAULT;
|
||||||
|
pkUid = null;
|
||||||
|
callEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否正在匹配中
|
||||||
|
*/
|
||||||
|
public boolean isRequestPk() {
|
||||||
|
return status == PK_STATUS_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知所有监听者,结束匹配
|
||||||
|
*/
|
||||||
|
private void callEnd() {
|
||||||
|
if (task != null) {
|
||||||
|
task.cancel();
|
||||||
|
task = null;
|
||||||
|
}
|
||||||
|
handler.post(() -> {
|
||||||
|
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||||
|
pkTimer.onPkEnd();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知所有监听者,开始匹配
|
||||||
|
*/
|
||||||
|
private void callStart() {
|
||||||
|
if (task != null) {
|
||||||
|
task.cancel();
|
||||||
|
task = null;
|
||||||
|
}
|
||||||
|
handler.post(() -> {
|
||||||
|
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||||
|
pkTimer.onPking();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
LiveNetManager.get(CommonAppContext.getTopActivity())
|
||||||
|
.startRandomPK(pkUid, new HttpCallback<Boolean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Boolean data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(R.string.net_error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知所有监听者,对方拒绝PK
|
||||||
|
*/
|
||||||
|
private void callRefuse() {
|
||||||
|
handler.post(() -> {
|
||||||
|
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||||
|
pkTimer.onRefuse();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置PK状态
|
||||||
|
*/
|
||||||
|
public void setPkStatus(int status) {
|
||||||
|
if (!isRandomModel()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.status == PK_STATUS_DEFAULT || this.status == PK_STATUS_EXIT_ING) {//默认状态下不响应随机PK接口
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.status = status;
|
||||||
|
switch (status) {
|
||||||
|
case PK_STATUS_START:
|
||||||
|
callStart();
|
||||||
|
break;
|
||||||
|
case PK_STATUS_CLOSE:
|
||||||
|
callEnd();
|
||||||
|
break;
|
||||||
|
case PK_STATUS_REFUSE:
|
||||||
|
//callRefuse();
|
||||||
|
nextPk();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否正在退出匹配中
|
||||||
|
*/
|
||||||
|
public boolean isExiting() {
|
||||||
|
return status == PK_STATUS_EXIT_ING;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取退出匹配倒计时
|
||||||
|
*/
|
||||||
|
public String getExitTimer() {
|
||||||
|
return exitTimer + "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空状态,下播时调用
|
||||||
|
*/
|
||||||
|
public void release() {
|
||||||
|
status = PK_STATUS_REQUEST;
|
||||||
|
if (task != null) {
|
||||||
|
task.cancel();
|
||||||
|
}
|
||||||
|
if (exitTask != null) {
|
||||||
|
exitTask.cancel();
|
||||||
|
}
|
||||||
|
randomPkTimer.clear();
|
||||||
|
rankPkInfoBean = null;
|
||||||
|
pkUid = null;
|
||||||
|
handler.removeCallbacks(pkRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static abstract class OnRandomPkTimer {
|
||||||
|
/**
|
||||||
|
* 匹配倒计时
|
||||||
|
*/
|
||||||
|
public void onTimer(String time) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配到对方
|
||||||
|
*
|
||||||
|
* @param pkUid 对方uid
|
||||||
|
*/
|
||||||
|
public void onStartPK(String pkUid) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配中
|
||||||
|
*/
|
||||||
|
public void onPking() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连麦结束
|
||||||
|
*/
|
||||||
|
public void onPkEnd() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对方拒绝PK
|
||||||
|
*/
|
||||||
|
public void onRefuse() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出匹配倒计时
|
||||||
|
*/
|
||||||
|
public void onPkEndTimer(String time) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始退出匹配
|
||||||
|
*/
|
||||||
|
public void onPkEndStart() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出匹配成功
|
||||||
|
*/
|
||||||
|
public void onPkEndSuccess() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -98,6 +98,9 @@ public class MessageIMManager {
|
|||||||
public void getSystemMessages() {
|
public void getSystemMessages() {
|
||||||
systemNumber = 0;
|
systemNumber = 0;
|
||||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||||
|
if (userInfo == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
||||||
.params("uid", userInfo.getId())
|
.params("uid", userInfo.getId())
|
||||||
.params("token", userInfo.getToken())
|
.params("token", userInfo.getToken())
|
||||||
|
|||||||
@@ -3,16 +3,8 @@ package com.yunbao.common.manager.imrongcloud;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.adjust.sdk.Adjust;
|
|
||||||
import com.adjust.sdk.AdjustEvent;
|
|
||||||
import com.facebook.appevents.AppEventsLogger;
|
|
||||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.yunbao.common.CommonAppContext;
|
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
|
||||||
import com.yunbao.common.http.HttpCallback;
|
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -36,7 +28,7 @@ public class PDMessageInterceptor implements MessageInterceptor {
|
|||||||
TextMessage textMessage = (TextMessage) message.getContent();
|
TextMessage textMessage = (TextMessage) message.getContent();
|
||||||
String context = textMessage.getContent();
|
String context = textMessage.getContent();
|
||||||
//符合条件的接受消息不做展示
|
//符合条件的接受消息不做展示
|
||||||
if (context.contains("LivePK")) {
|
if (context.contains("LivePK")||context.contains("LiveDRPK")||context.contains("LiveRandomPK")) {
|
||||||
Message[] messages = new Message[]{message};
|
Message[] messages = new Message[]{message};
|
||||||
Log.e("PDMessageInterceptor", textMessage.getContent());
|
Log.e("PDMessageInterceptor", textMessage.getContent());
|
||||||
//删除消息
|
//删除消息
|
||||||
|
|||||||
@@ -295,21 +295,21 @@ public class PayPresenter {
|
|||||||
if (mActivity == null || TextUtils.isEmpty(mServiceNameAli)|| TextUtils.isEmpty(mAliCallbackUrl)) {
|
if (mActivity == null || TextUtils.isEmpty(mServiceNameAli)|| TextUtils.isEmpty(mAliCallbackUrl)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!CommonAppConfig.isAppExist(Constants.PACKAGE_NAME_ALI)) {
|
// if (!CommonAppConfig.isAppExist(Constants.PACKAGE_NAME_ALI)) {
|
||||||
ToastUtil.show(R.string.coin_ali_not_install);
|
// ToastUtil.show(R.string.coin_ali_not_install);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if (TextUtils.isEmpty(mAliPartner) || TextUtils.isEmpty(mAliSellerId) || TextUtils.isEmpty(mAliPrivateKey)) {
|
if (TextUtils.isEmpty(mAliPartner) || TextUtils.isEmpty(mAliSellerId) || TextUtils.isEmpty(mAliPrivateKey)) {
|
||||||
ToastUtil.show(Constants.PAY_ALI_NOT_ENABLE);
|
ToastUtil.show(Constants.PAY_ALI_NOT_ENABLE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AliPayBuilder builder = new AliPayBuilder(mActivity, mAliPartner, mAliSellerId, mAliPrivateKey);
|
// AliPayBuilder builder = new AliPayBuilder(mActivity, mAliPartner, mAliSellerId, mAliPrivateKey);
|
||||||
builder.setMoney(money);
|
// builder.setMoney(money);
|
||||||
builder.setGoodsName(goodsName);
|
// builder.setGoodsName(goodsName);
|
||||||
builder.setCallbackUrl(mAliCallbackUrl);
|
// builder.setCallbackUrl(mAliCallbackUrl);
|
||||||
builder.setOrderParams(StringUtil.contact(mServiceNameAli, orderParams));
|
// builder.setOrderParams(StringUtil.contact(mServiceNameAli, orderParams));
|
||||||
builder.setPayCallback(mPayCallback);
|
// builder.setPayCallback(mPayCallback);
|
||||||
builder.pay();
|
// builder.pay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,213 +22,214 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2017/9/21.
|
* Created by cxf on 2017/9/21.
|
||||||
|
* 禁用支付宝
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class AliPayBuilder {
|
public class AliPayBuilder {
|
||||||
|
//
|
||||||
private Activity mActivity;
|
// private Activity mActivity;
|
||||||
private String mPartner;// 商户ID
|
// private String mPartner;// 商户ID
|
||||||
private String mSellerId; // 商户收款账号
|
// private String mSellerId; // 商户收款账号
|
||||||
private String mPrivateKey; // 商户私钥,pkcs8格式
|
// private String mPrivateKey; // 商户私钥,pkcs8格式
|
||||||
private String mPayInfo;//支付宝订单信息 包括 商品信息,订单签名,签名类型
|
// private String mPayInfo;//支付宝订单信息 包括 商品信息,订单签名,签名类型
|
||||||
private String mGoodsName;//商品名称
|
// private String mGoodsName;//商品名称
|
||||||
private String mMoney;//要支付的金额
|
// private String mMoney;//要支付的金额
|
||||||
private String mOrderParams;//订单获取订单需要的参数
|
// private String mOrderParams;//订单获取订单需要的参数
|
||||||
private String mCallbackUrl;//支付宝充值回调地址
|
// private String mCallbackUrl;//支付宝充值回调地址
|
||||||
private PayHandler mPayHandler;
|
// private PayHandler mPayHandler;
|
||||||
|
//
|
||||||
public AliPayBuilder(Activity activity, String partner, String sellerId, String privateKey) {
|
// public AliPayBuilder(Activity activity, String partner, String sellerId, String privateKey) {
|
||||||
mActivity = new WeakReference<>(activity).get();
|
// mActivity = new WeakReference<>(activity).get();
|
||||||
mPartner = partner;
|
// mPartner = partner;
|
||||||
mSellerId = sellerId;
|
// mSellerId = sellerId;
|
||||||
mPrivateKey = privateKey;
|
// mPrivateKey = privateKey;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public AliPayBuilder setMoney(String money) {
|
// public AliPayBuilder setMoney(String money) {
|
||||||
mMoney = money;
|
// mMoney = money;
|
||||||
return this;
|
// return this;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public AliPayBuilder setGoodsName(String goodsName) {
|
// public AliPayBuilder setGoodsName(String goodsName) {
|
||||||
mGoodsName = goodsName;
|
// mGoodsName = goodsName;
|
||||||
return this;
|
// return this;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public AliPayBuilder setOrderParams(String orderParams) {
|
// public AliPayBuilder setOrderParams(String orderParams) {
|
||||||
mOrderParams = orderParams;
|
// mOrderParams = orderParams;
|
||||||
return this;
|
// return this;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
public AliPayBuilder setPayCallback(PayCallback callback) {
|
// public AliPayBuilder setPayCallback(PayCallback callback) {
|
||||||
mPayHandler = new PayHandler(callback);
|
// mPayHandler = new PayHandler(callback);
|
||||||
return this;
|
// return this;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public void setCallbackUrl(String callbackUrl) {
|
// public void setCallbackUrl(String callbackUrl) {
|
||||||
mCallbackUrl = callbackUrl;
|
// mCallbackUrl = callbackUrl;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 从服务器端获取订单号,即下单
|
// * 从服务器端获取订单号,即下单
|
||||||
*/
|
// */
|
||||||
public void pay() {
|
// public void pay() {
|
||||||
if (TextUtils.isEmpty(mOrderParams) || TextUtils.isEmpty(mMoney) || TextUtils.isEmpty(mGoodsName)|| TextUtils.isEmpty(mCallbackUrl)) {
|
// if (TextUtils.isEmpty(mOrderParams) || TextUtils.isEmpty(mMoney) || TextUtils.isEmpty(mGoodsName)|| TextUtils.isEmpty(mCallbackUrl)) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
CommonHttpUtil.getAliOrder(mOrderParams, new HttpCallback() {
|
// CommonHttpUtil.getAliOrder(mOrderParams, new HttpCallback() {
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0 && info.length > 0) {
|
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
|
||||||
String orderInfo = createAliOrder(obj.getString("orderid"));//商品信息
|
|
||||||
String sign = getOrderSign(orderInfo);//订单签名
|
|
||||||
if (TextUtils.isEmpty(sign)) {
|
|
||||||
ToastUtil.show("商户私钥错误,订单签名失败");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
sign = urlEncode(sign);
|
|
||||||
String signType = "sign_type=\"RSA\"";//签名类型
|
|
||||||
mPayInfo = orderInfo + "&sign=\"" + sign + "\"&" + signType;
|
|
||||||
L.e("支付宝订单信息----->" + mPayInfo);
|
|
||||||
invokeAliPay();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean showLoadingDialog() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Dialog createLoadingDialog() {
|
|
||||||
return DialogUitl.loadingDialog(mActivity);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据订单号和商品信息生成支付宝格式的订单信息
|
|
||||||
*
|
|
||||||
* @param orderId 服务器返回的订单号
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String createAliOrder(String orderId) {
|
|
||||||
// 合作者身份ID
|
|
||||||
String orderInfo = "partner=" + "\"" + mPartner + "\"";
|
|
||||||
|
|
||||||
// 卖家支付宝账号
|
|
||||||
orderInfo += "&seller_id=" + "\"" + mSellerId + "\"";
|
|
||||||
|
|
||||||
// 商户网站唯一订单号
|
|
||||||
orderInfo += "&out_trade_no=" + "\"" + orderId + "\"";
|
|
||||||
|
|
||||||
// 商品名称
|
|
||||||
orderInfo += "&subject=" + "\"" + mGoodsName + "\"";
|
|
||||||
|
|
||||||
// 商品详情
|
|
||||||
orderInfo += "&body=" + "\"" + mGoodsName + "\"";
|
|
||||||
|
|
||||||
// 商品金额
|
|
||||||
orderInfo += "&total_fee=" + "\"" + mMoney + "\"";
|
|
||||||
|
|
||||||
// 服务器异步通知页面路径 //服务器异步通知页面路径 参数 notify_url,如果商户没设定,则不会进行该操作
|
|
||||||
orderInfo += "¬ify_url=" + "\"" + mCallbackUrl + "\"";
|
|
||||||
|
|
||||||
// 接口名称, 固定值
|
|
||||||
orderInfo += "&service=\"mobile.securitypay.pay\"";
|
|
||||||
|
|
||||||
// 支付类型, 固定值
|
|
||||||
orderInfo += "&payment_type=\"1\"";
|
|
||||||
|
|
||||||
// 参数编码, 固定值
|
|
||||||
orderInfo += "&_input_charset=\"utf-8\"";
|
|
||||||
|
|
||||||
// 设置未付款交易的超时时间
|
|
||||||
// 默认30分钟,一旦超时,该笔交易就会自动被关闭。
|
|
||||||
// 取值范围:1m〜15d。
|
|
||||||
// m-分钟,h-小时,d-天,1c-当天(无论交易何时创建,都在0点关闭)。
|
|
||||||
// 该参数数值不接受小数点,如1.5h,可转换为90m。
|
|
||||||
orderInfo += "&it_b_pay=\"30m\"";
|
|
||||||
|
|
||||||
// 支付宝处理完请求后,当前页面跳转到商户指定页面的路径,可空
|
|
||||||
orderInfo += "&return_url=\"m.alipay.com\"";
|
|
||||||
|
|
||||||
// 调用银行卡支付,需配置此参数,参与签名, 固定值
|
|
||||||
// orderInfo += "&paymethod=\"expressGateway\"";
|
|
||||||
|
|
||||||
return orderInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据订单信息生成订单的签名
|
|
||||||
*
|
|
||||||
* @param orderInfo 订单信息
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String getOrderSign(String orderInfo) {
|
|
||||||
return SignUtils.sign(orderInfo, mPrivateKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对订单签名进行urlencode转码
|
|
||||||
*
|
|
||||||
* @param sign 签名
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String urlEncode(String sign) {
|
|
||||||
try {
|
|
||||||
sign = URLEncoder.encode(sign, "UTF-8");
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return sign;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 调用支付宝sdk
|
|
||||||
*/
|
|
||||||
private void invokeAliPay() {
|
|
||||||
// new Thread(new Runnable() {
|
|
||||||
// @Override
|
// @Override
|
||||||
// public void run() {
|
// public void onSuccess(int code, String msg, String[] info) {
|
||||||
//// PayTask alipay = new PayTask(mActivity);
|
// if (code == 0 && info.length > 0) {
|
||||||
// //执行支付,这是一个耗时操作,最后返回支付的结果,用handler发送到主线程
|
// JSONObject obj = JSON.parseObject(info[0]);
|
||||||
//// Map<String, String> result = alipay.payV2(mPayInfo, true);
|
// String orderInfo = createAliOrder(obj.getString("orderid"));//商品信息
|
||||||
//// L.e("支付宝返回结果----->" + result);
|
// String sign = getOrderSign(orderInfo);//订单签名
|
||||||
//// if (mPayHandler != null) {
|
// if (TextUtils.isEmpty(sign)) {
|
||||||
//// Message msg = Message.obtain();
|
// ToastUtil.show("商户私钥错误,订单签名失败");
|
||||||
//// msg.obj = result;
|
// return;
|
||||||
//// mPayHandler.sendMessage(msg);
|
// }
|
||||||
//// }
|
// sign = urlEncode(sign);
|
||||||
//// }
|
// String signType = "sign_type=\"RSA\"";//签名类型
|
||||||
// }).start();
|
// mPayInfo = orderInfo + "&sign=\"" + sign + "\"&" + signType;
|
||||||
}
|
// L.e("支付宝订单信息----->" + mPayInfo);
|
||||||
|
// invokeAliPay();
|
||||||
|
// }
|
||||||
private static class PayHandler extends Handler {
|
// }
|
||||||
|
//
|
||||||
private PayCallback mPayCallback;
|
// @Override
|
||||||
|
// public boolean showLoadingDialog() {
|
||||||
public PayHandler(PayCallback payCallback) {
|
// return true;
|
||||||
mPayCallback = new WeakReference<>(payCallback).get();
|
// }
|
||||||
}
|
//
|
||||||
|
// @Override
|
||||||
@Override
|
// public Dialog createLoadingDialog() {
|
||||||
public void handleMessage(Message msg) {
|
// return DialogUitl.loadingDialog(mActivity);
|
||||||
if (mPayCallback != null) {
|
// }
|
||||||
@SuppressWarnings("unchecked")
|
//
|
||||||
Map<String, String> result = (Map<String, String>) msg.obj;
|
//
|
||||||
if ("9000".equals(result.get("resultStatus"))) {
|
// });
|
||||||
mPayCallback.onSuccess();
|
// }
|
||||||
} else {
|
//
|
||||||
mPayCallback.onFailed();
|
// /**
|
||||||
}
|
// * 根据订单号和商品信息生成支付宝格式的订单信息
|
||||||
}
|
// *
|
||||||
mPayCallback = null;
|
// * @param orderId 服务器返回的订单号
|
||||||
}
|
// * @return
|
||||||
}
|
// */
|
||||||
|
// private String createAliOrder(String orderId) {
|
||||||
|
// // 合作者身份ID
|
||||||
|
// String orderInfo = "partner=" + "\"" + mPartner + "\"";
|
||||||
|
//
|
||||||
|
// // 卖家支付宝账号
|
||||||
|
// orderInfo += "&seller_id=" + "\"" + mSellerId + "\"";
|
||||||
|
//
|
||||||
|
// // 商户网站唯一订单号
|
||||||
|
// orderInfo += "&out_trade_no=" + "\"" + orderId + "\"";
|
||||||
|
//
|
||||||
|
// // 商品名称
|
||||||
|
// orderInfo += "&subject=" + "\"" + mGoodsName + "\"";
|
||||||
|
//
|
||||||
|
// // 商品详情
|
||||||
|
// orderInfo += "&body=" + "\"" + mGoodsName + "\"";
|
||||||
|
//
|
||||||
|
// // 商品金额
|
||||||
|
// orderInfo += "&total_fee=" + "\"" + mMoney + "\"";
|
||||||
|
//
|
||||||
|
// // 服务器异步通知页面路径 //服务器异步通知页面路径 参数 notify_url,如果商户没设定,则不会进行该操作
|
||||||
|
// orderInfo += "¬ify_url=" + "\"" + mCallbackUrl + "\"";
|
||||||
|
//
|
||||||
|
// // 接口名称, 固定值
|
||||||
|
// orderInfo += "&service=\"mobile.securitypay.pay\"";
|
||||||
|
//
|
||||||
|
// // 支付类型, 固定值
|
||||||
|
// orderInfo += "&payment_type=\"1\"";
|
||||||
|
//
|
||||||
|
// // 参数编码, 固定值
|
||||||
|
// orderInfo += "&_input_charset=\"utf-8\"";
|
||||||
|
//
|
||||||
|
// // 设置未付款交易的超时时间
|
||||||
|
// // 默认30分钟,一旦超时,该笔交易就会自动被关闭。
|
||||||
|
// // 取值范围:1m〜15d。
|
||||||
|
// // m-分钟,h-小时,d-天,1c-当天(无论交易何时创建,都在0点关闭)。
|
||||||
|
// // 该参数数值不接受小数点,如1.5h,可转换为90m。
|
||||||
|
// orderInfo += "&it_b_pay=\"30m\"";
|
||||||
|
//
|
||||||
|
// // 支付宝处理完请求后,当前页面跳转到商户指定页面的路径,可空
|
||||||
|
// orderInfo += "&return_url=\"m.alipay.com\"";
|
||||||
|
//
|
||||||
|
// // 调用银行卡支付,需配置此参数,参与签名, 固定值
|
||||||
|
// // orderInfo += "&paymethod=\"expressGateway\"";
|
||||||
|
//
|
||||||
|
// return orderInfo;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 根据订单信息生成订单的签名
|
||||||
|
// *
|
||||||
|
// * @param orderInfo 订单信息
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// private String getOrderSign(String orderInfo) {
|
||||||
|
// return SignUtils.sign(orderInfo, mPrivateKey);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 对订单签名进行urlencode转码
|
||||||
|
// *
|
||||||
|
// * @param sign 签名
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// private String urlEncode(String sign) {
|
||||||
|
// try {
|
||||||
|
// sign = URLEncoder.encode(sign, "UTF-8");
|
||||||
|
// } catch (UnsupportedEncodingException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// return sign;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 调用支付宝sdk
|
||||||
|
// */
|
||||||
|
// private void invokeAliPay() {
|
||||||
|
//// new Thread(new Runnable() {
|
||||||
|
//// @Override
|
||||||
|
//// public void run() {
|
||||||
|
////// PayTask alipay = new PayTask(mActivity);
|
||||||
|
//// //执行支付,这是一个耗时操作,最后返回支付的结果,用handler发送到主线程
|
||||||
|
////// Map<String, String> result = alipay.payV2(mPayInfo, true);
|
||||||
|
////// L.e("支付宝返回结果----->" + result);
|
||||||
|
////// if (mPayHandler != null) {
|
||||||
|
////// Message msg = Message.obtain();
|
||||||
|
////// msg.obj = result;
|
||||||
|
////// mPayHandler.sendMessage(msg);
|
||||||
|
////// }
|
||||||
|
////// }
|
||||||
|
//// }).start();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// private static class PayHandler extends Handler {
|
||||||
|
//
|
||||||
|
// private PayCallback mPayCallback;
|
||||||
|
//
|
||||||
|
// public PayHandler(PayCallback payCallback) {
|
||||||
|
// mPayCallback = new WeakReference<>(payCallback).get();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void handleMessage(Message msg) {
|
||||||
|
// if (mPayCallback != null) {
|
||||||
|
// @SuppressWarnings("unchecked")
|
||||||
|
// Map<String, String> result = (Map<String, String>) msg.obj;
|
||||||
|
// if ("9000".equals(result.get("resultStatus"))) {
|
||||||
|
// mPayCallback.onSuccess();
|
||||||
|
// } else {
|
||||||
|
// mPayCallback.onFailed();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// mPayCallback = null;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,184 @@
|
|||||||
|
package com.yunbao.common.utils;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.view.Display;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class APKDownloadUtil {
|
||||||
|
/**
|
||||||
|
* APK文件下载
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
*/
|
||||||
|
public void downloadAPK(Activity context, String url, OnUpdateListener listener) {
|
||||||
|
Request request = new Request.Builder().url(url)
|
||||||
|
.addHeader("Accept-Encoding", "identity").build();
|
||||||
|
File downloadFile = new File(context.getCacheDir(), "update_app.apk");
|
||||||
|
try {
|
||||||
|
if (!downloadFile.exists()
|
||||||
|
&& !downloadFile.createNewFile()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
showDialod(context);
|
||||||
|
new OkHttpClient().newCall(request).enqueue(new Callback() {
|
||||||
|
private Handler handler = new Handler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
// 下载失败
|
||||||
|
handler.post(() -> {
|
||||||
|
listener.updateFailure(-1, e.getMessage());
|
||||||
|
progressDialog.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) {
|
||||||
|
Looper.prepare();
|
||||||
|
byte[] buf = new byte[2048];
|
||||||
|
int len;
|
||||||
|
try (InputStream inputStream = response.body().byteStream();
|
||||||
|
FileOutputStream outputStream = new FileOutputStream(downloadFile)) {
|
||||||
|
long total = response.body().contentLength();
|
||||||
|
long sum = 0;
|
||||||
|
while ((len = inputStream.read(buf)) != -1) {
|
||||||
|
outputStream.write(buf, 0, len);
|
||||||
|
sum += len;
|
||||||
|
int progress = (int) (sum * 1.0f / total * 100);
|
||||||
|
// 下载中
|
||||||
|
handler.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
tvProgress.setText(progress + "%");
|
||||||
|
progressBar.setProgress(progress);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
outputStream.flush();
|
||||||
|
//启动安装app
|
||||||
|
installApk(context, downloadFile, context.getPackageName() + ".fileprovider");
|
||||||
|
handler.post(() -> progressDialog.dismiss());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
new Handler().post(() -> {
|
||||||
|
listener.updateFailure(-1, e.getMessage());
|
||||||
|
progressDialog.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新监听
|
||||||
|
*/
|
||||||
|
public interface OnUpdateListener {
|
||||||
|
void updateFailure(int code, String error);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 启动app安装
|
||||||
|
// *
|
||||||
|
// * @param context
|
||||||
|
// * @param filePath
|
||||||
|
// */
|
||||||
|
// private static void startInstall(Context context, File filePath) {
|
||||||
|
//
|
||||||
|
// Intent install = new Intent(Intent.ACTION_VIEW);
|
||||||
|
// install.setDataAndType(Uri.parse("file://" + filePath.getAbsolutePath()),
|
||||||
|
// "application/vnd.android.package-archive");
|
||||||
|
// install.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
// context.startActivity(install);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安装apk
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @param file
|
||||||
|
*/
|
||||||
|
public void installApk(Context context, File file, String authority) {
|
||||||
|
Intent intent = getInstallIntent(context, file, authority);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取安装Intent
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @param file
|
||||||
|
* @param authority
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Intent getInstallIntent(Context context, File file, String authority) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
Uri uriData;
|
||||||
|
String type = "application/vnd.android.package-archive";
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
uriData = FileProvider.getUriForFile(context, authority, file);
|
||||||
|
} else {
|
||||||
|
uriData = Uri.fromFile(file);
|
||||||
|
}
|
||||||
|
intent.setDataAndType(uriData, type);
|
||||||
|
return intent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextView tvProgress;
|
||||||
|
public ProgressBar progressBar;
|
||||||
|
public Dialog progressDialog;
|
||||||
|
|
||||||
|
private void showDialod(Activity context) {
|
||||||
|
if (progressDialog == null) {
|
||||||
|
progressDialog = new Dialog(context, R.style.dialog);
|
||||||
|
View view = LayoutInflater.from(context).inflate(R.layout.dialog_progress, null);
|
||||||
|
tvProgress = view.findViewById(R.id.tvProgress);
|
||||||
|
progressBar = view.findViewById(R.id.progressBar);
|
||||||
|
progressDialog.setContentView(view);
|
||||||
|
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||||
|
Display display = wm.getDefaultDisplay();
|
||||||
|
int width = display.getWidth();
|
||||||
|
Window window = progressDialog.getWindow();// 这部分是设置dialog宽高的,宽高是我从sharedpreferences里面获取到的。之前程序启动的时候有获取
|
||||||
|
window.getDecorView().setPadding(0, 0, 0, 0);
|
||||||
|
WindowManager.LayoutParams lp = window.getAttributes();
|
||||||
|
lp.width = width / 4 * 3;
|
||||||
|
window.setAttributes(lp);
|
||||||
|
}
|
||||||
|
progressDialog.setCancelable(false);
|
||||||
|
progressDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,8 +5,15 @@ import android.app.ActivityManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Point;
|
||||||
|
import android.net.TrafficStats;
|
||||||
import android.text.format.Formatter;
|
import android.text.format.Formatter;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备通用类
|
* 设备通用类
|
||||||
@@ -36,6 +43,19 @@ public class DeviceUtils {
|
|||||||
return displayMetrics.heightPixels;
|
return displayMetrics.heightPixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取屏幕真实高度
|
||||||
|
*
|
||||||
|
* @param activity activity
|
||||||
|
* @return 屏幕高度
|
||||||
|
*/
|
||||||
|
public static int getScreenRealHeight(Activity activity) {
|
||||||
|
WindowManager service = (WindowManager) activity.getSystemService(Context.WINDOW_SERVICE);
|
||||||
|
Point point = new Point();
|
||||||
|
service.getDefaultDisplay().getRealSize(point);
|
||||||
|
return point.y;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据手机的分辨率从 dp 的单位 转成为 px(像素)
|
* 根据手机的分辨率从 dp 的单位 转成为 px(像素)
|
||||||
*
|
*
|
||||||
@@ -81,10 +101,41 @@ public class DeviceUtils {
|
|||||||
am.getMemoryInfo(mi);
|
am.getMemoryInfo(mi);
|
||||||
return mi.lowMemory;
|
return mi.lowMemory;
|
||||||
}
|
}
|
||||||
public static String getMemory(Context context) {
|
|
||||||
|
/**
|
||||||
|
* 获取可用内存 格式化
|
||||||
|
*/
|
||||||
|
public static String getMemoryToFormat(Context context) {
|
||||||
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||||
am.getMemoryInfo(mi);
|
am.getMemoryInfo(mi);
|
||||||
return Formatter.formatFileSize(context, mi.availMem);// 将获取的内存大小规格化
|
return Formatter.formatFileSize(context, mi.availMem);// 将获取的内存大小规格化
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取可用内存
|
||||||
|
*/
|
||||||
|
public static String getMemory(Context context) {
|
||||||
|
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
|
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||||
|
am.getMemoryInfo(mi);
|
||||||
|
return mi.availMem + "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static long lastTotalRxBytes = 0;
|
||||||
|
private static long lastTimeStamp = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上传网速
|
||||||
|
*/
|
||||||
|
public static long getNetSpeed(Context context) {
|
||||||
|
long nowTotalRxBytes = TrafficStats.getUidTxBytes(context.getApplicationInfo().uid) == TrafficStats.UNSUPPORTED ? 0 : (TrafficStats.getTotalTxBytes() / 1024);
|
||||||
|
long nowTimeStamp = System.currentTimeMillis();
|
||||||
|
long speed = ((nowTotalRxBytes - lastTotalRxBytes) * 1000 / (nowTimeStamp - lastTimeStamp));//毫秒转换
|
||||||
|
lastTimeStamp = nowTimeStamp;
|
||||||
|
lastTotalRxBytes = nowTotalRxBytes;
|
||||||
|
return speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,12 @@ package com.yunbao.common.utils;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.text.InputFilter;
|
import android.text.InputFilter;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
@@ -66,6 +70,21 @@ public class DialogUitl {
|
|||||||
}
|
}
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
public static void showToast(Context context,String content,long delayMillis){
|
||||||
|
Dialog dialog = new Dialog(context, R.style.dialog);
|
||||||
|
dialog.setContentView(R.layout.dialog_toast);
|
||||||
|
dialog.setCancelable(false);
|
||||||
|
dialog.setCanceledOnTouchOutside(false);
|
||||||
|
if (!TextUtils.isEmpty(content)) {
|
||||||
|
TextView titleView = (TextView) dialog.findViewById(R.id.text);
|
||||||
|
if (titleView != null) {
|
||||||
|
titleView.setGravity(Gravity.CENTER);
|
||||||
|
titleView.setText(content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.show();
|
||||||
|
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss,delayMillis);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Dialog loadingDialog(Context context) {
|
public static Dialog loadingDialog(Context context) {
|
||||||
@@ -322,7 +341,9 @@ public class DialogUitl {
|
|||||||
private int mLength;
|
private int mLength;
|
||||||
private SimpleCallback mClickCallback;
|
private SimpleCallback mClickCallback;
|
||||||
private SimpleCallback3 mClickCallback3;
|
private SimpleCallback3 mClickCallback3;
|
||||||
|
private SimpleCallbackView mSimpleCallbackView;
|
||||||
private int mView = 0;
|
private int mView = 0;
|
||||||
|
private CharSequence mSpanned;
|
||||||
|
|
||||||
public Builder(Context context) {
|
public Builder(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@@ -335,6 +356,18 @@ public class DialogUitl {
|
|||||||
|
|
||||||
public Builder setContent(String content) {
|
public Builder setContent(String content) {
|
||||||
mContent = content;
|
mContent = content;
|
||||||
|
this.mSpanned = null;//设置文本则不是使用HTML代码
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder setHtmlCode(CharSequence mSpanned) {
|
||||||
|
this.mSpanned = mSpanned;
|
||||||
|
this.mContent = null;//设置HTML代码则不使用文本
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder setSimpleCallbackView(SimpleCallbackView mSimpleCallbackView) {
|
||||||
|
this.mSimpleCallbackView = mSimpleCallbackView;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,6 +446,9 @@ public class DialogUitl {
|
|||||||
if (!TextUtils.isEmpty(mContent)) {
|
if (!TextUtils.isEmpty(mContent)) {
|
||||||
content.setText(mContent);
|
content.setText(mContent);
|
||||||
}
|
}
|
||||||
|
if (mSpanned != null) {
|
||||||
|
content.setText(mSpanned);
|
||||||
|
}
|
||||||
if (mInputType == INPUT_TYPE_NUMBER) {
|
if (mInputType == INPUT_TYPE_NUMBER) {
|
||||||
content.setInputType(InputType.TYPE_CLASS_NUMBER);
|
content.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||||
} else if (mInputType == INPUT_TYPE_NUMBER_PASSWORD) {
|
} else if (mInputType == INPUT_TYPE_NUMBER_PASSWORD) {
|
||||||
@@ -443,30 +479,52 @@ public class DialogUitl {
|
|||||||
mClickCallback.onConfirmClick(dialog, "");
|
mClickCallback.onConfirmClick(dialog, "");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dialog.dismiss();
|
|
||||||
if (mClickCallback3 != null) {
|
if (mClickCallback3 != null) {
|
||||||
mClickCallback3.onConfirmClick(dialog);
|
mClickCallback3.onConfirmClick(dialog);
|
||||||
}
|
}
|
||||||
|
if (mSimpleCallbackView != null) {
|
||||||
|
mSimpleCallbackView.onConfirmClick(dialog,titleView, content, btnConfirm, btnCancel);
|
||||||
|
}else{
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dialog.dismiss();
|
|
||||||
if (mClickCallback3 != null) {
|
if (mClickCallback3 != null) {
|
||||||
mClickCallback3.onCancel();
|
mClickCallback3.onCancel();
|
||||||
|
dialog.dismiss();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (mClickCallback instanceof SimpleCallback2) {
|
if (mClickCallback instanceof SimpleCallback2) {
|
||||||
((SimpleCallback2) mClickCallback).onCancelClick();
|
((SimpleCallback2) mClickCallback).onCancelClick();
|
||||||
}
|
}
|
||||||
|
if (mSimpleCallbackView != null) {
|
||||||
|
mSimpleCallbackView.onCancel(dialog,titleView, content, btnConfirm, btnCancel);
|
||||||
|
}else{
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if(btnConfirm!=null) {
|
||||||
btnConfirm.setOnClickListener(listener);
|
btnConfirm.setOnClickListener(listener);
|
||||||
|
}
|
||||||
|
if(btnCancel!=null) {
|
||||||
btnCancel.setOnClickListener(listener);
|
btnCancel.setOnClickListener(listener);
|
||||||
|
}
|
||||||
|
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||||
|
@Override
|
||||||
|
public void onShow(DialogInterface dialogInterface) {
|
||||||
|
if (mSimpleCallbackView != null) {
|
||||||
|
mSimpleCallbackView.onShow(dialog,titleView, content, btnConfirm, btnCancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,6 +552,14 @@ public class DialogUitl {
|
|||||||
void onCancel();
|
void onCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface SimpleCallbackView {
|
||||||
|
void onShow(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn);
|
||||||
|
|
||||||
|
void onConfirmClick(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn);
|
||||||
|
|
||||||
|
void onCancel(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 城市选择
|
* 城市选择
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.LiveGiftBean;
|
import com.yunbao.common.bean.LiveGiftBean;
|
||||||
import com.yunbao.common.http.CommonHttpConsts;
|
import com.yunbao.common.http.CommonHttpConsts;
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
import com.yunbao.common.interfaces.CommonCallback;
|
||||||
@@ -59,7 +60,7 @@ public class GiftCacheUtil {
|
|||||||
} else {
|
} else {
|
||||||
DownloadUtil downloadUtil = new DownloadUtil();
|
DownloadUtil downloadUtil = new DownloadUtil();
|
||||||
if (forwhat.equals("1")) {
|
if (forwhat.equals("1")) {
|
||||||
ToastUtil.show("礼物正在获取中...");
|
ToastUtil.show(R.string.gift_way);
|
||||||
}
|
}
|
||||||
downloadUtil.download(CommonHttpConsts.DOWNLOAD_GIF, dir, fileName, url, new DownloadUtil.Callback() {
|
downloadUtil.download(CommonHttpConsts.DOWNLOAD_GIF, dir, fileName, url, new DownloadUtil.Callback() {
|
||||||
String TAG="下载";
|
String TAG="下载";
|
||||||
|
|||||||
@@ -64,15 +64,14 @@ public class JavascriptInterfaceUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static JavascriptInterfaceUtils getInstance() {
|
public static JavascriptInterfaceUtils getInstance() {
|
||||||
if (sInstance == null) {
|
|
||||||
synchronized (CityUtil.class) {
|
synchronized (JavascriptInterfaceUtils.class) {
|
||||||
if (sInstance == null) {
|
|
||||||
sInstance = new JavascriptInterfaceUtils();
|
sInstance = new JavascriptInterfaceUtils();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
@@ -117,8 +116,13 @@ public class JavascriptInterfaceUtils {
|
|||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void androidClickToNewH5PageView(String url) {
|
public void androidClickToNewH5PageView(String url) {
|
||||||
url = CommonAppConfig.HOST + url;
|
url = CommonAppConfig.HOST + url;
|
||||||
|
if (url.contains("?")) {
|
||||||
|
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||||
|
+ CommonAppConfig.getInstance().getToken();
|
||||||
|
} else {
|
||||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||||
+ CommonAppConfig.getInstance().getToken();
|
+ CommonAppConfig.getInstance().getToken();
|
||||||
|
}
|
||||||
if (LiveZhuangBana) {
|
if (LiveZhuangBana) {
|
||||||
RouteUtil.forwardLiveZhuangBanActivity(url, false);
|
RouteUtil.forwardLiveZhuangBanActivity(url, false);
|
||||||
} else {
|
} else {
|
||||||
@@ -135,8 +139,13 @@ public class JavascriptInterfaceUtils {
|
|||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void androidClickToNewH5PageView(String url, String title) {
|
public void androidClickToNewH5PageView(String url, String title) {
|
||||||
url = CommonAppConfig.HOST + url;
|
url = CommonAppConfig.HOST + url;
|
||||||
|
if (url.contains("?")) {
|
||||||
|
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||||
|
+ CommonAppConfig.getInstance().getToken();
|
||||||
|
} else {
|
||||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||||
+ CommonAppConfig.getInstance().getToken();
|
+ CommonAppConfig.getInstance().getToken();
|
||||||
|
}
|
||||||
if (LiveZhuangBana) {
|
if (LiveZhuangBana) {
|
||||||
RouteUtil.forwardLiveZhuangBanActivity(url, title);
|
RouteUtil.forwardLiveZhuangBanActivity(url, title);
|
||||||
} else {
|
} else {
|
||||||
@@ -467,15 +476,23 @@ public class JavascriptInterfaceUtils {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置webView高度
|
||||||
|
* @param useDp 是否用dp换算
|
||||||
|
*/
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void setHeight(String height, String width) {
|
public void setHeight(String height, String width,boolean useDp) {
|
||||||
if ("0".equals(height)) {
|
if ("0".equals(height)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Handler handler = new Handler(Looper.getMainLooper());
|
Handler handler = new Handler(Looper.getMainLooper());
|
||||||
handler.post(() -> {
|
handler.post(() -> {
|
||||||
ViewGroup.LayoutParams params = mWebView.getLayoutParams();
|
ViewGroup.LayoutParams params = mWebView.getLayoutParams();
|
||||||
params.height = DpUtil.dp2px(Integer.parseInt(height));
|
if("-1".equals(height)){
|
||||||
|
params.height=ViewGroup.LayoutParams.MATCH_PARENT;
|
||||||
|
}else {
|
||||||
|
params.height = useDp?DpUtil.dp2px(Integer.parseInt(height)):Integer.parseInt(height);
|
||||||
|
}
|
||||||
mWebView.setLayoutParams(params);
|
mWebView.setLayoutParams(params);
|
||||||
mWebView.setVisibility(View.VISIBLE);
|
mWebView.setVisibility(View.VISIBLE);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
package com.yunbao.common.utils;
|
package com.yunbao.common.utils;
|
||||||
|
|
||||||
import static android.provider.Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION;
|
import static android.provider.Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION;
|
||||||
import static androidx.core.content.PermissionChecker.PERMISSION_GRANTED;
|
|
||||||
import static java.text.DateFormat.DEFAULT;
|
import static java.text.DateFormat.DEFAULT;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.app.Dialog;
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@@ -14,10 +12,10 @@ import android.os.Environment;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
import androidx.core.content.PermissionChecker;
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.callback.StringCallback;
|
import com.lzy.okgo.callback.StringCallback;
|
||||||
import com.lzy.okgo.model.Progress;
|
import com.lzy.okgo.model.Progress;
|
||||||
@@ -31,7 +29,6 @@ import com.yunbao.common.CommonAppConfig;
|
|||||||
import java.io.BufferedOutputStream;
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -42,11 +39,20 @@ import java.nio.file.Files;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipOutputStream;
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2019/6/20.
|
* Created by cxf on 2019/6/20.
|
||||||
*/
|
*/
|
||||||
@@ -150,13 +156,17 @@ public class LogUtil {
|
|||||||
|
|
||||||
|
|
||||||
public static void shareFile(Context context) {
|
public static void shareFile(Context context) {
|
||||||
if(true){
|
try {
|
||||||
|
if (!new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "pdlive.debug").exists()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PermissionChecker.checkCallingOrSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PERMISSION_GRANTED) {
|
} catch (Exception e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* if (PermissionChecker.checkCallingOrSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PERMISSION_GRANTED) {
|
||||||
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 100);
|
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 100);
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
String title = "[PDLIVE]" + CommonAppConfig.getInstance().getUid() + "_";
|
String title = "[PDLIVE]" + CommonAppConfig.getInstance().getUid() + "_";
|
||||||
String today = title + SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).format(new Date());
|
String today = title + SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).format(new Date());
|
||||||
File dir = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator);
|
File dir = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator);
|
||||||
@@ -184,6 +194,17 @@ public class LogUtil {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (zip.exists()) {
|
if (zip.exists()) {
|
||||||
|
DialogUitl.showSimpleDialog(context, "上报日志", new DialogUitl.SimpleCallback() {
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
uploadLog(zip);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
dialog.dismiss();
|
||||||
|
ToastUtil.show("OK");
|
||||||
Intent share = new Intent(Intent.ACTION_SEND);
|
Intent share = new Intent(Intent.ACTION_SEND);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
Uri contentUri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileprovider", zip);
|
Uri contentUri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileprovider", zip);
|
||||||
@@ -211,6 +232,52 @@ public class LogUtil {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private static String TAG="Upload";
|
||||||
|
private static void uploadLog(File log) {
|
||||||
|
|
||||||
|
JSONObject body = new JSONObject();
|
||||||
|
|
||||||
|
MultipartBody requestBody = new MultipartBody.Builder()
|
||||||
|
.addFormDataPart("uid", CommonAppConfig.getInstance().getUid())
|
||||||
|
.addFormDataPart("time", new SimpleDateFormat("yyyy-DD-mm HH:mm:ss", Locale.getDefault()).format(new Date()))
|
||||||
|
.addFormDataPart("isGoogle", CommonAppConfig.IS_GOOGLE_PLAY+"")
|
||||||
|
.addFormDataPart("appVersion", CommonAppConfig.getInstance().getVersion())
|
||||||
|
.addFormDataPart("file","file", RequestBody.create(MediaType.parse("application/octet-stream"),log)) //上报日志文件
|
||||||
|
.build();
|
||||||
|
|
||||||
|
body.put("uid", CommonAppConfig.getInstance().getUid());
|
||||||
|
body.put("time", new SimpleDateFormat("yyyy-DD-mm HH:mm:ss", Locale.getDefault()).format(new Date()));
|
||||||
|
body.put("isGoogle", CommonAppConfig.IS_GOOGLE_PLAY);
|
||||||
|
body.put("appVersion", CommonAppConfig.getInstance().getVersion());
|
||||||
|
|
||||||
|
OkHttpClient client = new OkHttpClient.Builder()
|
||||||
|
.connectTimeout(3, TimeUnit.SECONDS)
|
||||||
|
.build();
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
//.url("https://newht.yaoulive.com/index.php/api/error_log/report") //无法接受文件
|
||||||
|
.url("https://tools.yutou233.cn/public/file/request.do")//临时上报地址,可接受文件
|
||||||
|
.post(requestBody)
|
||||||
|
.build();
|
||||||
|
client.newCall(request)
|
||||||
|
.enqueue(new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NonNull Call call, @NonNull IOException e) {
|
||||||
|
Log.e(TAG, "error",e );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, okhttp3.Response response) throws IOException {
|
||||||
|
String body = response.body().string();
|
||||||
|
Log.i(TAG, "onResponse: "+body);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,209 @@
|
|||||||
|
package com.yunbao.common.utils;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.http.API;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.http.HttpClient;
|
||||||
|
import com.yunbao.common.http.ResponseModel;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleCallback;
|
||||||
|
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.functions.Consumer;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一管理连麦状态
|
||||||
|
*/
|
||||||
|
public class MicStatusManager {
|
||||||
|
public static final int MIC_TYPE_DEFAULT = 0;//默认状态,未连麦
|
||||||
|
public static final int MIC_TYPE_REQUEST = 1;//请求连麦中
|
||||||
|
public static final int MIC_TYPE_OPEN = 2;//连麦中
|
||||||
|
private static MicStatusManager manager;
|
||||||
|
private int micStatus;//连麦状态
|
||||||
|
private String micLiveId;//主播uid
|
||||||
|
private boolean anchorOpenRoom = false;//主播是否开启连麦房
|
||||||
|
private List<OnMicStatusListener> listeners;
|
||||||
|
|
||||||
|
public static MicStatusManager getInstance() {
|
||||||
|
if (manager == null) {
|
||||||
|
manager = new MicStatusManager();
|
||||||
|
}
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MicStatusManager() {
|
||||||
|
listeners = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连麦状态监听器,申请、连麦中触发onStart,退出连麦触发onClose
|
||||||
|
*/
|
||||||
|
public void addOnMicListener(OnMicStatusListener listener) {
|
||||||
|
listeners.add(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeOnMicListener(OnMicStatusListener listener) {
|
||||||
|
listeners.remove(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMicData(int micStatus, String micLiveId) {
|
||||||
|
this.micLiveId = micLiveId;
|
||||||
|
this.micStatus = micStatus;
|
||||||
|
|
||||||
|
for (OnMicStatusListener listener : listeners) {
|
||||||
|
listener.onStart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAnchorOpenRoom() {
|
||||||
|
return anchorOpenRoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnchorOpenRoom(boolean anchorOpenRoom) {
|
||||||
|
this.anchorOpenRoom = anchorOpenRoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
micStatus = 0;
|
||||||
|
micLiveId = "";
|
||||||
|
for (OnMicStatusListener listener : listeners) {
|
||||||
|
listener.onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMicStatus() {
|
||||||
|
return micStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMicLiveId() {
|
||||||
|
return micLiveId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MicStatusManager{" +
|
||||||
|
"micStatus=" + micStatus +
|
||||||
|
", micLiveId='" + micLiveId + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 断开连麦
|
||||||
|
*/
|
||||||
|
public void downMic() {
|
||||||
|
HttpClient.getInstance().get("live.leaveDrLm", "live.leaveDrLm")
|
||||||
|
.params("roomid", micLiveId)
|
||||||
|
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||||
|
.execute(new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
Log.e("ry", code + "退出多人");
|
||||||
|
RCRTCEngine.getInstance().getRoom().getLocalUser().switchToAudience(new IRCRTCSwitchRoleCallback() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当切换失败且SDK处于无法回退状态时回调,该角色已经无法使用当前角色继续进行音视频。
|
||||||
|
* SDK内部会退出房间并清理所有资源,该用户只能重新加入房间才能继续音视频。
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onKicked() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("ry", "下麦成功");
|
||||||
|
// 该用户切换为观众成功,可以以观众身份进行音视频
|
||||||
|
//退出rtc播放
|
||||||
|
RCRTCEngine.getInstance().leaveRoom(new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("ry", "退出多人房间成功");
|
||||||
|
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
MicStatusManager.getInstance().clear();
|
||||||
|
ToastUtil.show("已成功退出語音連麥");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
Log.e("ry", errorCode + "退出多人房间成功");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当切换失败且不影响当前角色继续音视频时回调
|
||||||
|
* @param errorCode 失败错误码
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
Log.e("ry", "下麦失败" + errorCode);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主播关闭连麦权限
|
||||||
|
*/
|
||||||
|
public void closeMic(Context mContext) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.delDrLm()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<BaseModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<BaseModel> stringResponseModel) throws Exception {
|
||||||
|
System.out.println("stringResponseModel.getData() = " + stringResponseModel.getData());
|
||||||
|
anchorOpenRoom = false;
|
||||||
|
}
|
||||||
|
}, Throwable::printStackTrace)
|
||||||
|
.isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否在连麦中
|
||||||
|
*
|
||||||
|
* @param toUid 目标uid
|
||||||
|
*/
|
||||||
|
public boolean isMic(String toUid) {
|
||||||
|
return micStatus == MIC_TYPE_OPEN && !micLiveId.equals(toUid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示退出连麦状态对话框
|
||||||
|
*/
|
||||||
|
public void showDownMicDialog(Context context) {
|
||||||
|
DialogUitl.showSimpleDialog(context, "當前正在連麥中", new DialogUitl.SimpleCallback() {
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
|
// downMic(); //不做下麦跳转
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnMicStatusListener {
|
||||||
|
void onStart();
|
||||||
|
|
||||||
|
void onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,8 +3,10 @@ package com.yunbao.common.utils;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.facade.Postcard;
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.HtmlConfig;
|
import com.yunbao.common.HtmlConfig;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
import com.yunbao.common.bean.LiveBean;
|
||||||
@@ -73,6 +75,15 @@ public class RouteUtil {
|
|||||||
.withBoolean("forwardEntry", true)
|
.withBoolean("forwardEntry", true)
|
||||||
.navigation();
|
.navigation();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 只回到登录页,不提示东西
|
||||||
|
*/
|
||||||
|
public static void forwardEntry2() {
|
||||||
|
ARouter.getInstance().build(PATH_ENTRY)
|
||||||
|
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
|
||||||
|
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
.navigation();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转到个人主页
|
* 跳转到个人主页
|
||||||
@@ -185,13 +196,24 @@ public class RouteUtil {
|
|||||||
* 打开直播页面
|
* 打开直播页面
|
||||||
*/
|
*/
|
||||||
public static void forwardLiveAudienceActivity(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) {
|
public static void forwardLiveAudienceActivity(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) {
|
||||||
ARouter.getInstance().build(PATH_LIVE_AUDIENCE)
|
if (MicStatusManager.getInstance().isMic(mLiveBean.getUid())) {
|
||||||
|
MicStatusManager.getInstance().showDownMicDialog(CommonAppContext.activityWeakReference.get());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Postcard postcard = ARouter.getInstance().build(PATH_LIVE_AUDIENCE)
|
||||||
|
.withBoolean(Constants.NEW_ENTER_ROOM, false)
|
||||||
.withParcelable(Constants.LIVE_BEAN, mLiveBean)
|
.withParcelable(Constants.LIVE_BEAN, mLiveBean)
|
||||||
.withInt(Constants.LIVE_TYPE, mLiveType)
|
.withInt(Constants.LIVE_TYPE, mLiveType)
|
||||||
.withInt(Constants.LIVE_SDK, mLiveSDK)
|
.withInt(Constants.LIVE_SDK, mLiveSDK)
|
||||||
.withInt(Constants.LIVE_TYPE_VAL, mLiveTypeVal)
|
.withInt(Constants.LIVE_TYPE_VAL, mLiveTypeVal);
|
||||||
.navigation();
|
if (mLiveBean.getParams() != null) {
|
||||||
|
for (String key : mLiveBean.getParams().keySet()) {
|
||||||
|
postcard.withString(key, mLiveBean.getParams().get(key));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
postcard.navigation();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 举报个人
|
* 举报个人
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user