Compare commits
303 Commits
master
...
develop_yi
Author | SHA1 | Date | |
---|---|---|---|
![]() |
136b3133ce | ||
![]() |
015922bd90 | ||
![]() |
8aba5ebaa2 | ||
![]() |
db75f129ee | ||
![]() |
6cfc44285e | ||
![]() |
8b33e2536a | ||
![]() |
9d2c83ff6b | ||
![]() |
bf9fd90010 | ||
![]() |
521d351e92 | ||
![]() |
41cd821233 | ||
![]() |
670e305f60 | ||
![]() |
153898c1a1 | ||
![]() |
b463797df9 | ||
![]() |
bcd1e37115 | ||
![]() |
de48c6c071 | ||
![]() |
a9c87c7f76 | ||
![]() |
bae04574bf | ||
![]() |
718e4eb76d | ||
![]() |
4e6a5e0fa5 | ||
![]() |
3a84f71fcd | ||
![]() |
72a362f2a6 | ||
![]() |
f71b49bdcd | ||
![]() |
81310b7d9e | ||
![]() |
305fc47512 | ||
![]() |
237c98c38d | ||
![]() |
ef7603237d | ||
![]() |
0cc5d56f10 | ||
![]() |
9b27d3b395 | ||
![]() |
4feed5409d | ||
![]() |
66fcf3caae | ||
![]() |
74c7b2d3fe | ||
![]() |
b3151fda75 | ||
![]() |
3b7db71b86 | ||
![]() |
4a990a4d62 | ||
![]() |
e79c75fcbf | ||
![]() |
30ec9bcf03 | ||
![]() |
0f6e4f8699 | ||
![]() |
8a70c1bb32 | ||
![]() |
c37ecad328 | ||
![]() |
c0cbc8b62c | ||
![]() |
d73b530915 | ||
![]() |
4788605b46 | ||
![]() |
4f5134a7a1 | ||
![]() |
56d9d8f5da | ||
![]() |
bd6c421995 | ||
![]() |
b27df1cb89 | ||
![]() |
fdc7d338c1 | ||
![]() |
29ced00df8 | ||
![]() |
9591c3dc37 | ||
![]() |
5e57ff80ee | ||
![]() |
9ac9923e3a | ||
![]() |
710868591a | ||
![]() |
3b47be1bd5 | ||
![]() |
33f7c8a7fa | ||
![]() |
fa97defc82 | ||
![]() |
f96458c2ac | ||
![]() |
287222f7ad | ||
![]() |
151e5c11b1 | ||
![]() |
37b3c941e2 | ||
![]() |
1333250224 | ||
![]() |
9bd8136f92 | ||
![]() |
527340a357 | ||
![]() |
beb6c0a846 | ||
![]() |
b260d2e797 | ||
![]() |
81b1cf8124 | ||
![]() |
cbd92a2f10 | ||
![]() |
8f0d723fba | ||
![]() |
db6fdf3266 | ||
![]() |
0c1ba80a40 | ||
![]() |
a7da303a9c | ||
![]() |
3f37821830 | ||
![]() |
56f1ca9f55 | ||
![]() |
b9f130b89e | ||
![]() |
8f31292680 | ||
![]() |
b0d7fdd597 | ||
![]() |
42e26e7f0c | ||
![]() |
3ac10340d6 | ||
![]() |
a10471d1c2 | ||
![]() |
d47536cc13 | ||
![]() |
641c15a91e | ||
![]() |
f29dc93faa | ||
![]() |
42afa779db | ||
![]() |
d300ef179d | ||
![]() |
ecd6b8da81 | ||
![]() |
dec6e5e0c1 | ||
![]() |
18b680db70 | ||
![]() |
0fd330848c | ||
![]() |
d0d2418dbf | ||
![]() |
a129fb405e | ||
![]() |
91b006422c | ||
![]() |
d83dbe2337 | ||
![]() |
ce27034ca6 | ||
![]() |
340403fe0d | ||
![]() |
ac8dc50955 | ||
![]() |
32ef74df3a | ||
![]() |
e4cb690b68 | ||
![]() |
96de9e153c | ||
![]() |
35032c1f8e | ||
![]() |
3e1ab090aa | ||
![]() |
95aeda920a | ||
![]() |
60d6bbeae8 | ||
![]() |
0b339136cc | ||
![]() |
6e7743960c | ||
![]() |
7709020221 | ||
![]() |
b9d59e9477 | ||
![]() |
321fa1b9ea | ||
![]() |
ff746b5a11 | ||
![]() |
802383b9e8 | ||
![]() |
b41a2e0376 | ||
![]() |
732cea412c | ||
![]() |
52db404fc0 | ||
![]() |
2d954d21ef | ||
![]() |
b7eb1e66fa | ||
![]() |
6491efe708 | ||
![]() |
37ed8facf3 | ||
![]() |
6becbb6226 | ||
![]() |
ea19645fe8 | ||
![]() |
d48844dc14 | ||
![]() |
a939c29e3e | ||
![]() |
e55b4d7348 | ||
![]() |
583d5a139b | ||
![]() |
c7dd6ec61c | ||
![]() |
a58165213d | ||
![]() |
f21e117e7f | ||
![]() |
f9bd5b7a9f | ||
![]() |
b9251a89a5 | ||
![]() |
e81d75a8b8 | ||
![]() |
c691e5f570 | ||
![]() |
0e30b8e303 | ||
![]() |
3325ccaee9 | ||
![]() |
277c1a637e | ||
![]() |
8660f0e826 | ||
![]() |
dc46c16f3e | ||
![]() |
1dfa9e9d25 | ||
![]() |
5376774ab6 | ||
![]() |
cfe2a45e4b | ||
![]() |
d8a39a4729 | ||
![]() |
05935ca7f2 | ||
![]() |
f1ae820a5a | ||
![]() |
5cddd9f18d | ||
![]() |
19d6fed2fb | ||
![]() |
fb1bcfb642 | ||
![]() |
046ae8e04e | ||
![]() |
73f7998445 | ||
![]() |
c68419f2af | ||
![]() |
1f65f99221 | ||
![]() |
5125f08a20 | ||
![]() |
1d9e119f89 | ||
![]() |
30e468bdf3 | ||
![]() |
c5862701f5 | ||
![]() |
66dd5a0f16 | ||
![]() |
da8cbda0fa | ||
![]() |
5158ff178e | ||
![]() |
bf5c6436da | ||
![]() |
c65e7bfc3b | ||
![]() |
3f92ca82e9 | ||
![]() |
5909ccbc6c | ||
![]() |
cf2490b9e2 | ||
![]() |
fab25bd4f6 | ||
![]() |
c616082b21 | ||
![]() |
63cedcc467 | ||
![]() |
8d9781cf56 | ||
![]() |
b935216b6e | ||
![]() |
c5155aed0d | ||
![]() |
2e812f60f5 | ||
![]() |
49810b42b0 | ||
![]() |
6ba4f05b17 | ||
![]() |
8ec2e32240 | ||
![]() |
d740e2bcdb | ||
![]() |
f6068d745d | ||
![]() |
8c02426f6d | ||
![]() |
9eb632116e | ||
![]() |
76cca091d6 | ||
![]() |
16f8cf006a | ||
![]() |
92577ba1f1 | ||
![]() |
892b8192cc | ||
![]() |
71b8b4caf6 | ||
![]() |
b9c165f355 | ||
![]() |
b17077fe17 | ||
![]() |
faec2f542e | ||
![]() |
3defba88a5 | ||
![]() |
ca2b411bac | ||
![]() |
86b9f1b35f | ||
![]() |
10e9a630d2 | ||
![]() |
af3f90c0c8 | ||
![]() |
044fe4b53e | ||
![]() |
7fd56533f7 | ||
![]() |
2b078390e4 | ||
![]() |
8990405c6f | ||
![]() |
15cf083657 | ||
![]() |
529d1500ba | ||
![]() |
4c98e9422c | ||
![]() |
3de4273531 | ||
![]() |
60d60d3578 | ||
![]() |
56fdb706b4 | ||
![]() |
c1a1867511 | ||
![]() |
a59a2897e7 | ||
![]() |
28c2841923 | ||
![]() |
b1269a5c2a | ||
![]() |
24606d7b44 | ||
![]() |
f2b755cf77 | ||
![]() |
f7d62e6aa0 | ||
![]() |
2cfc74fa85 | ||
![]() |
3def5cebda | ||
![]() |
d29a2c1245 | ||
![]() |
a304b4b07b | ||
![]() |
87b4ea4935 | ||
![]() |
ee320f0591 | ||
![]() |
d05e8e9a53 | ||
![]() |
31266aaee0 | ||
![]() |
2bb57e2b3f | ||
![]() |
10b48eeb0e | ||
![]() |
7a7a394b03 | ||
![]() |
ce93e02d8a | ||
![]() |
3e07b3d9d7 | ||
![]() |
b8645b2058 | ||
![]() |
2f238e0447 | ||
![]() |
34b061996f | ||
![]() |
58a5556fc0 | ||
![]() |
4f2d895f38 | ||
![]() |
8ee3bcef6e | ||
![]() |
3e29eb1c32 | ||
![]() |
486da1d028 | ||
![]() |
cb21a12b95 | ||
![]() |
ee1d528027 | ||
![]() |
684bd5260d | ||
![]() |
c678061633 | ||
![]() |
e208dc6950 | ||
![]() |
ec9c3a9a42 | ||
![]() |
5298e69eed | ||
![]() |
0bbe0c8b64 | ||
![]() |
20a745e955 | ||
![]() |
e2a667fb90 | ||
![]() |
4716157368 | ||
![]() |
00866e7c73 | ||
![]() |
63bd50479d | ||
![]() |
9dd27c723c | ||
![]() |
362c58da6d | ||
![]() |
4ca4d25644 | ||
![]() |
362fb3b6c3 | ||
![]() |
7dcd553fba | ||
![]() |
ce63fdcd12 | ||
![]() |
bd14980c14 | ||
![]() |
a8b993572c | ||
![]() |
adac9ad536 | ||
![]() |
3be3591b15 | ||
![]() |
1feda0e047 | ||
![]() |
72643d7753 | ||
![]() |
331e3404a6 | ||
![]() |
655f7d9c40 | ||
![]() |
c94b40fe8a | ||
![]() |
e7193e9ef4 | ||
![]() |
5b987ecccc | ||
![]() |
5b7ef4c86d | ||
![]() |
f9254a3f15 | ||
![]() |
87c1dddbab | ||
![]() |
1a363a19e3 | ||
![]() |
8c8f93580d | ||
![]() |
6234480529 | ||
![]() |
cd7b4db946 | ||
![]() |
eb25a1244c | ||
![]() |
83810d088a | ||
![]() |
17c7129f87 | ||
![]() |
0cbdea2e6f | ||
![]() |
fb4aeba530 | ||
![]() |
e807dab42f | ||
![]() |
deac16a90a | ||
![]() |
3642ae2748 | ||
![]() |
7331d8e205 | ||
![]() |
311202c075 | ||
![]() |
119546866c | ||
![]() |
c21768d3d0 | ||
![]() |
860e41c45e | ||
![]() |
bb00f6433f | ||
![]() |
4c17cf30ef | ||
![]() |
48fa73353d | ||
![]() |
da01c04dcc | ||
![]() |
cd0898ae68 | ||
![]() |
df31666b29 | ||
![]() |
4fec80e42a | ||
![]() |
4490a5e54e | ||
![]() |
20fded3771 | ||
![]() |
efeea38cc1 | ||
![]() |
aa2635c652 | ||
![]() |
95d94f95b2 | ||
![]() |
d26205bd1f | ||
![]() |
abbe516b3a | ||
![]() |
ac2f16f308 | ||
![]() |
dae987e9e0 | ||
![]() |
fc0c688916 | ||
![]() |
be16a0a810 | ||
![]() |
fadc41bb84 | ||
![]() |
9290fdbd02 | ||
![]() |
aa94a834ce | ||
![]() |
213cfb97cb | ||
![]() |
0ac2bdc775 | ||
![]() |
b23d8b6fa5 | ||
![]() |
f7b36c40ab | ||
![]() |
fa47dad924 | ||
![]() |
a15ae87fd5 | ||
![]() |
83e4cfc629 | ||
![]() |
0c7fb5dcf1 | ||
![]() |
9d0b9d79e9 |
@@ -2,11 +2,11 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
minSdkVersion MIN_SDK_VERSION.toInteger()
|
||||
targetSdkVersion TARGET_SDK_VERSION.toInteger()
|
||||
|
||||
testApplicationId 'com.soundcloud.android.crop.test'
|
||||
testInstrumentationRunner 'android.test.InstrumentationTestRunner'
|
||||
@@ -20,12 +20,21 @@ android {
|
||||
}
|
||||
|
||||
buildToolsVersion = '30.0.3'
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api 'androidx.annotation:annotation:1.1.0'
|
||||
api 'androidx.annotation:annotation:1.2.0'
|
||||
api 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation "androidx.core:core-ktx:1.3.2"
|
||||
implementation "androidx.core:core-ktx:1.7.0"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
repositories {
|
||||
|
0
app/aab-res-guard-mapping.txt
Normal file
0
app/aab-res-guard-mapping.txt
Normal file
@@ -1,92 +0,0 @@
|
||||
{
|
||||
"agcgw":{
|
||||
"backurl":"connect-drcn.hispace.hicloud.com",
|
||||
"url":"connect-drcn.dbankcloud.cn",
|
||||
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
|
||||
},
|
||||
"agcgw_all":{
|
||||
"CN":"connect-drcn.dbankcloud.cn",
|
||||
"CN_back":"connect-drcn.hispace.hicloud.com",
|
||||
"DE":"connect-dre.dbankcloud.cn",
|
||||
"DE_back":"connect-dre.hispace.hicloud.com",
|
||||
"RU":"connect-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-dra.dbankcloud.cn",
|
||||
"SG_back":"connect-dra.hispace.hicloud.com"
|
||||
},
|
||||
"websocketgw_all":{
|
||||
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
|
||||
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
|
||||
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
|
||||
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
|
||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
||||
},
|
||||
"client":{
|
||||
"cp_id":"890086000300337421",
|
||||
"product_id":"736430079244645870",
|
||||
"client_id":"458482081706542080",
|
||||
"client_secret":"3573E319CDA06E85137A91CF68CF90BA850A639BCA6655A5310B2BCD81BC7213",
|
||||
"project_id":"736430079244645870",
|
||||
"app_id":"102953045",
|
||||
"api_key":"DAEDAN1bqknzqRuvualUo98vO7U9uXBJtBZ0rNQHgSo03bXgkl98tD4sytVBCBB1Y7ha0NcY++dSp9JLsws9BzDN+/fS3v8J9We3nA==",
|
||||
"package_name":"com.voice.magic"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_id":"102953045",
|
||||
"client_type":1
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"102953045",
|
||||
"package_name":"com.voice.magic"
|
||||
},
|
||||
"service":{
|
||||
"analytics":{
|
||||
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
||||
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
||||
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
||||
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"resource_id":"p1",
|
||||
"channel_id":""
|
||||
},
|
||||
"search":{
|
||||
"url":"https://search-drcn.cloud.huawei.com"
|
||||
},
|
||||
"cloudstorage":{
|
||||
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
|
||||
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
|
||||
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
|
||||
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
|
||||
"storage_url_de":"https://ops-dre.agcstorage.link",
|
||||
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||
"storage_url_sg":"https://ops-dra.agcstorage.link",
|
||||
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
|
||||
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
|
||||
},
|
||||
"ml":{
|
||||
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
||||
}
|
||||
},
|
||||
"region":"CN",
|
||||
"configuration_version":"3.0",
|
||||
"appInfos":[
|
||||
{
|
||||
"package_name":"com.voice.magic",
|
||||
"client":{
|
||||
"app_id":"102953045"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"com.voice.magic",
|
||||
"app_id":"102953045"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_type":1,
|
||||
"client_id":"102953045"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
287
app/build.gradle
287
app/build.gradle
@@ -1,49 +1,67 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'com.huawei.agconnect'
|
||||
apply plugin: 'com.tencent.vasdolly'
|
||||
apply from: '../mob.gradle'
|
||||
apply plugin: 'android-junk-code'
|
||||
|
||||
def onlyArm64 = Boolean.parseBoolean(only_arm64)
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: "com.bytedance.android.aabResGuard"
|
||||
apply plugin: "xml-class-guard"
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.voice.magic"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
applicationId "app.yinm.chat"
|
||||
minSdkVersion MIN_SDK_VERSION.toInteger()
|
||||
targetSdkVersion TARGET_SDK_VERSION.toInteger()
|
||||
versionCode Integer.valueOf(version_code)
|
||||
versionName version_name
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
|
||||
ndk {
|
||||
//设置支持的SO库架构
|
||||
if (onlyArm64) {
|
||||
abiFilters "arm64-v8a"
|
||||
} else {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
}
|
||||
|
||||
// ndk {
|
||||
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||||
// }
|
||||
flavorDimensions 'default'
|
||||
}
|
||||
|
||||
// splits {
|
||||
// abi {
|
||||
// enable true
|
||||
// reset()
|
||||
// include 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||||
// universalApk true
|
||||
// }
|
||||
// }
|
||||
|
||||
bundle {
|
||||
density {
|
||||
enableSplit = true
|
||||
}
|
||||
abi {
|
||||
enableSplit = true
|
||||
}
|
||||
}
|
||||
|
||||
//在apk文件后边生成版本号信息
|
||||
android.applicationVariants.all {
|
||||
variant ->
|
||||
variant.outputs.all {
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
outputFileName = "magic_${buildType.name}_v${defaultConfig.versionName}-${date}.apk"
|
||||
android.applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach { output ->
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
|
||||
def outputFile = output.outputFile
|
||||
if (outputFile == null || !outputFile.name.endsWith('.apk')) {
|
||||
return
|
||||
}
|
||||
|
||||
def abi = output.getFilter(com.android.build.OutputFile.ABI)
|
||||
if (abi == null) {
|
||||
abi = "universal"
|
||||
}
|
||||
outputFileName = "yinm_${variant.flavorName}_${buildType.name}_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${abi}_${date}.apk"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
disable 'MissingTranslation'
|
||||
@@ -65,23 +83,13 @@ android {
|
||||
signingConfigs {
|
||||
|
||||
v2 {
|
||||
storeFile file('../magic.jks')
|
||||
storePassword "magic2020"
|
||||
keyAlias "magic"
|
||||
keyPassword "magic2020"
|
||||
storeFile file('../yinm.jks')
|
||||
storePassword "yinm2023"
|
||||
keyAlias "yinm"
|
||||
keyPassword "yinm2023"
|
||||
v2SigningEnabled true
|
||||
v1SigningEnabled true
|
||||
}
|
||||
|
||||
v1 {
|
||||
storeFile file('../magic.jks')
|
||||
storePassword "magic2020"
|
||||
keyAlias "magic"
|
||||
keyPassword "magic2020"
|
||||
v2SigningEnabled false
|
||||
v1SigningEnabled true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@@ -136,7 +144,8 @@ android {
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
buildConfigField "String", "BASE_URL", "\"https://yinyou.api.shengxuanwangluo.com/\""
|
||||
buildConfigField "String", "BASE_URL", "\"https://api.yinm.chat/\""
|
||||
buildConfigField "String", "WEB_URL", "\"https://h5.yinm.chat/\""
|
||||
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_STAGING", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_RELEASE", "BASE_URL"
|
||||
@@ -144,40 +153,74 @@ android {
|
||||
shrinkResources true
|
||||
signingConfig signingConfigs.v2
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
manifestPlaceholders = [CRASHLYTICS_COLLECTION_ENABLED: "true"]
|
||||
firebaseCrashlytics {
|
||||
mappingFileUploadEnabled false
|
||||
}
|
||||
}
|
||||
|
||||
debug {
|
||||
buildConfigField "String", "BASE_URL", "\"http://api.uat.lecheng163.com/\""
|
||||
buildConfigField "String", "BASE_URL", "\"http://beta.api.yinm.chat/\""
|
||||
buildConfigField "String", "WEB_URL", "\"http://beta.api.yinm.chat\""
|
||||
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_STAGING", "\"https://yinyou.api.shengxuanwangluo.com/\""
|
||||
buildConfigField "String", "BASE_URL_RELEASE", "\"https://yinyou.api.shengxuanwangluo.com/\""
|
||||
buildConfigField "String", "BASE_URL_STAGING", "\"https://api.yinm.chat/\""
|
||||
buildConfigField "String", "BASE_URL_RELEASE", "\"https://api.yinm.chat/\""
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
signingConfig signingConfigs.v1
|
||||
signingConfig signingConfigs.v2
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
firebaseCrashlytics {
|
||||
mappingFileUploadEnabled false
|
||||
}
|
||||
manifestPlaceholders = [CRASHLYTICS_COLLECTION_ENABLED: "false"]
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
jvmTarget = "11"
|
||||
}
|
||||
|
||||
buildToolsVersion = '30.0.3'
|
||||
|
||||
productFlavors {
|
||||
official {
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
google_yinm {
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
mlq {
|
||||
ndk {
|
||||
abiFilters 'x86'
|
||||
}
|
||||
}
|
||||
}
|
||||
productFlavors.all { flavor ->
|
||||
flavor.manifestPlaceholders = [
|
||||
// 渠道
|
||||
CHANNEL_VALUE : name,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
def Lombok = "1.18.18"
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
implementation fileTree(dir: 'aliyun-libs', include: ['*.jar', '*.aar'])
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
api 'androidx.multidex:multidex:2.0.1'
|
||||
|
||||
@@ -201,8 +244,7 @@ dependencies {
|
||||
api "com.ms-square:expandableTextView:0.1.4"
|
||||
api "com.jakewharton:butterknife:10.2.3"
|
||||
annotationProcessor "com.jakewharton:butterknife-compiler:10.2.3"
|
||||
implementation "com.llew.huawei:verifier:1.0.3"
|
||||
annotationProcessor 'androidx.annotation:annotation:1.1.0'
|
||||
annotationProcessor 'androidx.annotation:annotation:1.2.0'
|
||||
|
||||
implementation 'io.github.h07000223:flycoTabLayout:3.0.0'
|
||||
|
||||
@@ -216,8 +258,6 @@ dependencies {
|
||||
api 'com.jungly:gridPasswordView:0.3'
|
||||
api 'com.google.android.flexbox:flexbox:3.0.0'
|
||||
|
||||
compileOnly "org.projectlombok:lombok:${Lombok}"
|
||||
annotationProcessor "org.projectlombok:lombok:${Lombok}"
|
||||
implementation 'nl.dionsegijn:konfetti:1.1.2'
|
||||
|
||||
//数字滚动效果
|
||||
@@ -234,61 +274,112 @@ dependencies {
|
||||
|
||||
implementation 'it.sephiroth.android.library.imagezoom:library:1.0.4'
|
||||
|
||||
// 易盾一键登录
|
||||
implementation 'io.github.yidun:quicklogin:3.1.5'
|
||||
|
||||
implementation 'com.github.fodroid:XRadioGroup:v1.5'
|
||||
//华为推送
|
||||
implementation 'com.huawei.hms:push:6.5.0.300'
|
||||
//魅族推送
|
||||
implementation 'com.meizu.flyme.internet:push-internal:4.1.0'
|
||||
//oppo推送需要
|
||||
implementation 'commons-codec:commons-codec:1.6'
|
||||
|
||||
api 'com.tencent.vasdolly:helper:3.0.3'
|
||||
// api 'com.tencent.vasdolly:helper:3.0.3'
|
||||
implementation "io.github.tencent:vap:2.0.24"
|
||||
|
||||
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
|
||||
|
||||
implementation 'com.github.yalantis:ucrop:2.2.7'
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'aliyun-libs', 'com.huawei.agconnect'
|
||||
}
|
||||
mavenCentral()
|
||||
|
||||
}
|
||||
|
||||
channel {
|
||||
//多渠道包的输出目录,默认为new File(project.buildDir,"channel")
|
||||
outputDir = new File(project.buildDir, "channelapk")
|
||||
//多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime}
|
||||
def only64 = onlyArm64 ? "-only64" : ""
|
||||
apkNameFormat = 'magic-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
|
||||
//快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
|
||||
fastMode = false
|
||||
//buildTime的时间格式,默认格式:yyyyMMdd-HHmmss
|
||||
buildTimeDateFormat = 'MMddHHmm'
|
||||
//低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式
|
||||
lowMemory = false
|
||||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
print("variant.name=" + variant.name)
|
||||
switch (variant.name) {//变体名称,如果没有设置productFlavors就是buildType名称,如果有设置productFlavors就是flavor+buildType,例如(freeRelease、proRelease)
|
||||
case "release":
|
||||
androidJunkCode.configMap.put(variant.name, {
|
||||
packageBase = "com.mango.plugin.ui" //生成java类根包名
|
||||
packageCount = 30 //生成包数量
|
||||
activityCountPerPackage = 30 //每个包下生成Activity类数量
|
||||
excludeActivityJavaFile = false
|
||||
//是否排除生成Activity的Java文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题
|
||||
otherCountPerPackage = 50 //每个包下生成其它类的数量
|
||||
methodCountPerClass = 20 //每个类下生成方法数量
|
||||
resPrefix = "mango_" //生成的layout、drawable、string等资源名前缀
|
||||
drawableCount = 300 //生成drawable资源数量
|
||||
stringCount = 300 //生成string数量
|
||||
})
|
||||
break
|
||||
if (variant.name.contains("release") || variant.name.contains("Release")) {
|
||||
androidJunkCode.configMap.put(variant.name, {
|
||||
packageBase = "app.yinm.a.u" //生成java类根包名
|
||||
packageCount = 30 //生成包数量
|
||||
activityCountPerPackage = 30 //每个包下生成Activity类数量
|
||||
excludeActivityJavaFile = false
|
||||
//是否排除生成Activity的Java文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题
|
||||
otherCountPerPackage = 50 //每个包下生成其它类的数量
|
||||
methodCountPerClass = 20 //每个类下生成方法数量
|
||||
resPrefix = "ymc_" //生成的layout、drawable、string等资源名前缀
|
||||
drawableCount = 300 //生成drawable资源数量
|
||||
stringCount = 300 //生成string数量
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aabResGuard {
|
||||
mappingFile = file("aab-res-guard-mapping.txt").toPath()
|
||||
// Mapping file used for incremental obfuscation
|
||||
whiteList = [ // White list rules
|
||||
// 魅力财富icon
|
||||
"*.R.drawable.charm_ic_*",
|
||||
"*.R.drawable.wealth_ic_*",
|
||||
// ----------
|
||||
"*.R.raw.*",
|
||||
"*.R.drawable.icon",
|
||||
//谷歌服务
|
||||
"*.R.string.default_web_client_id",
|
||||
"*.R.string.firebase_database_url",
|
||||
"*.R.string.gcm_defaultSenderId",
|
||||
"*.R.string.google_api_key",
|
||||
"*.R.string.google_app_id",
|
||||
"*.R.string.google_crash_reporting_api_key",
|
||||
"*.R.string.google_storage_bucket",
|
||||
"*.R.string.project_id",
|
||||
//所有涉及到 getResources().getIdentifier 对应的资源ID
|
||||
"*.R.array.a1",
|
||||
"*.R.string.s1",
|
||||
"*.R.mipmap.m1",
|
||||
"*.R.dimen.d1",
|
||||
"*.R.integer.int1",
|
||||
//Firebase Crashlytics
|
||||
"*.R.string.com.crashlytics.*",
|
||||
"*.R.bool.com.crashlytics.useFirebaseAppId",
|
||||
"*.R.string.com.crashlytics.useFirebaseAppId",
|
||||
"*.R.bool.com.crashlytics.CollectDeviceIdentifiers",
|
||||
"*.R.string.com.crashlytics.CollectDeviceIdentifiers",
|
||||
"*.R.bool.com.crashlytics.CollectUserIdentifiers",
|
||||
"*.R.string.com.crashlytics.CollectUserIdentifiers",
|
||||
"*.R.string.com.crashlytics.ApiEndpoint",
|
||||
"*.R.string.io.fabric.android.build_id",
|
||||
"*.R.string.com.crashlytics.android.build_id",
|
||||
"*.R.bool.com.crashlytics.RequireBuildId",
|
||||
"*.R.string.com.crashlytics.RequireBuildId",
|
||||
"*.R.bool.com.crashlytics.CollectCustomLogs",
|
||||
"*.R.string.com.crashlytics.CollectCustomLogs",
|
||||
"*.R.bool.com.crashlytics.Trace",
|
||||
"*.R.string.com.crashlytics.Trace",
|
||||
"*.R.string.com.crashlytics.CollectCustomKeys",
|
||||
"*.R.string.com.google.firebase.crashlytics.mapping_file_id",
|
||||
"*.R.string.com.google.firebase.crashlytics.unity_version"
|
||||
]
|
||||
obfuscatedBundleFileName = "yinm-google.aab" // Obfuscated file name, must end with '.aab'
|
||||
mergeDuplicatedRes = true // Whether to allow the merge of duplicate resources
|
||||
enableFilterFiles = false // Whether to allow filter files
|
||||
filterList = [ // file filter rules
|
||||
// "*/arm64-v8a/*",
|
||||
// "META-INF/*"
|
||||
]
|
||||
|
||||
enableFilterStrings = false // switch of filter strings
|
||||
unusedStringPath = file("unused.txt").toPath() // strings will be filtered in this file
|
||||
languageWhiteList = ["en", "zh"] // keep en,en-xx,zh,zh-xx etc. remove others.
|
||||
}
|
||||
|
||||
//以下均为非必须
|
||||
xmlClassGuard {
|
||||
findAabConstraintReferencedIds = true
|
||||
//用于增量混淆的 mapping 文件
|
||||
mappingFile = file("xml-class-mapping.txt")
|
||||
//更改manifest文件的package属性,即包名
|
||||
packageChange = ["com.nnbc123.app" : "app.yinm.app",
|
||||
"com.nnbc123.core" : "app.yinm.cc",
|
||||
"com.nnbc123.library": "app.yinm.ll"]
|
||||
|
||||
moveDir = []
|
||||
|
||||
generateObfuscateClassStartName = "ZZZZ"
|
||||
|
||||
randomObfuscatePackageNamePlaceholder = ["app.yinm.a.#", "app.yinm.a.a.#", "app.yinm.a.b.#", "app.yinm.a.c.#", "app.yinm.a.d.#", "app.yinm.a.e.#"]
|
||||
|
||||
randomObfuscateClassNamePlaceholder = ["#", "#1", "#2", "#3", "#4", "#5", "#6", "#7", "#8", "#9"]
|
||||
}
|
||||
|
29
app/google-services.json
Normal file
29
app/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "414487219613",
|
||||
"project_id": "yinm-gp-a9649",
|
||||
"storage_bucket": "yinm-gp-a9649.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:414487219613:android:cb64fc92ca04f431c13374",
|
||||
"android_client_info": {
|
||||
"package_name": "app.yinm.chat"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyC8Ekb0HRZzsNq8aBp2qs_97G6h76URl24"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
Binary file not shown.
Binary file not shown.
BIN
app/libs/SudMGP-v1.3.6.1181.aar
Normal file
BIN
app/libs/SudMGP-v1.3.6.1181.aar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
91
app/proguard-rules.pro
vendored
91
app/proguard-rules.pro
vendored
@@ -30,6 +30,10 @@
|
||||
# 保留行号
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
-obfuscationdictionary ./../dictionry.txt
|
||||
-classobfuscationdictionary ./../dictionry.txt
|
||||
-packageobfuscationdictionary ./../dictionry.txt
|
||||
|
||||
#-dontwarn #//dontwarn去掉警告
|
||||
#-dontskipnonpubliclibraryclassmembers
|
||||
#-keep public class * extends android.app.Fragment
|
||||
@@ -65,8 +69,18 @@
|
||||
public static final ** CREATOR;
|
||||
}
|
||||
|
||||
-keep class * implements java.io.Serializable {
|
||||
*;
|
||||
# 保留 Serializable 序列化的类不被混淆
|
||||
-keepnames class * implements java.io.Serializable
|
||||
-keepclassmembers class * implements java.io.Serializable {
|
||||
static final long serialVersionUID;
|
||||
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
||||
!static !transient <fields>;
|
||||
!private <fields>;
|
||||
!private <methods>;
|
||||
private void writeObject(java.io.ObjectOutputStream);
|
||||
private void readObject(java.io.ObjectInputStream);
|
||||
java.lang.Object writeReplace();
|
||||
java.lang.Object readResolve();
|
||||
}
|
||||
##---------------Begin: proguard configuration for Gson ----------
|
||||
# Gson specific classes
|
||||
@@ -114,20 +128,8 @@
|
||||
-dontwarn com.netease.**
|
||||
-keep class com.netease.** {*;}
|
||||
|
||||
# Presenter 相关
|
||||
-keep class com.mango.moshen.base.** { *; }
|
||||
-keep public class * extends com.mango.moshen.base.BaseMvpPresenter
|
||||
-keep public class * extends com.mango.xchat_android_library.base.factory.AbstractMvpPresenter
|
||||
|
||||
# 云信自定义 ViewHolder 配置
|
||||
-dontwarn com.mango.moshen.ui.im.recent.holder.**
|
||||
-keep class com.mango.moshen.ui.im.recent.holder.** {*;}
|
||||
-keep class com.mango.moshen.ui.im.chat.** {*;}
|
||||
-keep class com.mango.moshen.luckymoney.viewholder.** {*;}
|
||||
-keep class com.mango.moshen.share.viewholder.** {*;}
|
||||
-keep class com.mango.moshen.public_chat_hall.msg.viewholder.** {*;}
|
||||
-keep class com.mango.moshen.module_hall.im.msgholder.** {*;}
|
||||
-keep class com.mango.moshen.mentoring_relationship.viewholder.** {*;}
|
||||
-keep public class * extends com.netease.nim.uikit.common.ui.recyclerview.holder.RecyclerViewHolder {*;}
|
||||
-keep public class * extends com.netease.nim.uikit.business.session.viewholder.MsgViewHolderBase {*;}
|
||||
|
||||
@@ -168,16 +170,9 @@
|
||||
#-------------云信相关的混淆配置------------
|
||||
|
||||
|
||||
#-------------TakePhoto的混淆配置------------
|
||||
-keep class com.jph.takephoto.** { *; }
|
||||
-dontwarn com.jph.takephoto.**
|
||||
|
||||
-keep class com.darsh.multipleimageselect.** { *; }
|
||||
-dontwarn com.darsh.multipleimageselect.**
|
||||
|
||||
-keep class com.soundcloud.android.crop.** { *; }
|
||||
-dontwarn com.soundcloud.android.crop.**
|
||||
|
||||
#-------------TakePhoto的混淆配置------------
|
||||
|
||||
|
||||
@@ -207,9 +202,6 @@
|
||||
<init>(...);
|
||||
}
|
||||
|
||||
-dontwarn com.mango.moshen.bindadapter.**
|
||||
-keep class com.mango.moshen.bindadapter.** {*;}
|
||||
|
||||
# Ping++ 混淆过滤
|
||||
-dontwarn com.pingplusplus.**
|
||||
-keep class com.pingplusplus.** {*;}
|
||||
@@ -237,10 +229,24 @@
|
||||
}
|
||||
|
||||
|
||||
# @Keep
|
||||
-keep,allowobfuscation @interface android.support.annotation.Keep
|
||||
-keep @android.support.annotation.Keep class *
|
||||
-keepclassmembers class * {
|
||||
@android.support.annotation.Keep *;
|
||||
}
|
||||
|
||||
-keep,allowobfuscation @interface androidx.annotation.Keep
|
||||
-keep @androidx.annotation.Keep class *
|
||||
-keepclassmembers class * {
|
||||
@androidx.annotation.Keep *;
|
||||
}
|
||||
|
||||
# TODO 网络加载 一些业务bean gson 时候混淆问题
|
||||
-keep class org.json.** {*;}
|
||||
-dontwarn com.moshen.core.**
|
||||
-keep class com.mango.core.** {*;}
|
||||
-keep class **.bean.** {*;}
|
||||
-keep class **.result.** {*;}
|
||||
-keep class **.entity.** {*;}
|
||||
|
||||
|
||||
#百度统计
|
||||
@@ -313,10 +319,6 @@
|
||||
-keep class com.amap.api.fence.**{*;}
|
||||
-keep class com.autonavi.aps.amapapi.model.**{*;}
|
||||
|
||||
#暂时keep这个View排查华为oom问题
|
||||
-keep class com.mango.moshen.avroom.widget.MicroView{*;}
|
||||
-keep class com.mango.moshen.ui.widget.rollviewpager.RollPagerView{*;}
|
||||
|
||||
#linkedMe
|
||||
-keep class com.microquation.linkedme.android.** { *; }
|
||||
|
||||
@@ -333,7 +335,13 @@
|
||||
-dontwarn com.sdk.**
|
||||
-keep class com.sdk.** { *;}
|
||||
-keep class cn.com.chinatelecom.account.**{*;}
|
||||
-keep public class * extends android.view.View
|
||||
-keep public class * extends android.view.View {
|
||||
*** get*();
|
||||
void set*(***);
|
||||
public <init>(android.content.Context);
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
-keep class com.netease.nis.quicklogin.entity.**{*;}
|
||||
-keep class com.netease.nis.quicklogin.listener.**{*;}
|
||||
-keep class com.netease.nis.quicklogin.QuickLogin{
|
||||
@@ -373,8 +381,6 @@
|
||||
-dontwarn com.meizu.cloud.**
|
||||
-keep class com.meizu.cloud.** {*;}
|
||||
|
||||
-keep class com.mango.moshen.ui.widget.AppBarLayoutBehavior {*;}
|
||||
|
||||
#ViewBinding使用的反射生成的对应Binding
|
||||
-keepclassmembers class * implements androidx.viewbinding.ViewBinding {
|
||||
public static ** inflate(***);
|
||||
@@ -436,9 +442,6 @@
|
||||
# linkedme
|
||||
-keep class com.microquation.linkedme.android.** { *; }
|
||||
|
||||
# 数美天网
|
||||
-keep class com.ishumei.dfp.SMSDK { *; }
|
||||
|
||||
-dontwarn com.alibaba.**
|
||||
-dontwarn com.taobao.**
|
||||
-dontwarn com.google.**
|
||||
@@ -453,5 +456,19 @@
|
||||
-keep class android.support.v8.renderscript.** { *; }
|
||||
-keep class androidx.renderscript.** { *; }
|
||||
|
||||
-keep class com.yinyou.plugin.**{*;}
|
||||
-keep class app.yinm.plugin.ui.**{*;}
|
||||
|
||||
-dontwarn com.qiyukf.**
|
||||
-keep class com.qiyukf.** {*;}
|
||||
-dontwarn org.slf4j.**
|
||||
-keep class org.slf4j.** { *; }
|
||||
|
||||
# For BannerViewPager
|
||||
-keep class androidx.recyclerview.widget.** { *; }
|
||||
-keep class androidx.viewpager2.widget.** { *; }
|
||||
-keep class io.agora.**{*;}
|
||||
-keepattributes SourceFile,LineNumberTable # Keep file names and line numbers.
|
||||
-keep public class * extends java.lang.Exception # Optional: Keep custom exceptions.
|
||||
|
||||
-keep class com.google.android.exoplayer2.** {*;}
|
||||
-keep interface com.google.android.exoplayer2.**
|
||||
|
@@ -1,28 +0,0 @@
|
||||
package com.mango.moshen;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.mango.moshen_android_client", appContext.getPackageName());
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.nnbc123.app;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.nnbc123.app_android_client", appContext.getPackageName());
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/dialog_charge_bg_checked" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/dialog_charge_bg_checked" android:state_checked="true" />
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#ffffe710" />
|
||||
<solid android:color="#26ffe710" />
|
||||
<corners android:bottomLeftRadius="8dp" android:bottomRightRadius="8dp" android:topLeftRadius="8dp" android:topRightRadius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
<corners android:radius="8dp"/>
|
||||
<solid android:color="#fff8f8fa" />
|
||||
<corners android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" android:topLeftRadius="10dp" android:topRightRadius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
9
app/src/common/res/drawable/shape_black_t35_12.xml
Normal file
9
app/src/common/res/drawable/shape_black_t35_12.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners
|
||||
android:radius="@dimen/dp_12"
|
||||
/>
|
||||
<solid
|
||||
android:color="@color/black_transparent_35"
|
||||
/>
|
||||
</shape>
|
6
app/src/common/res/drawable/shape_ffe974_corner_12dp.xml
Normal file
6
app/src/common/res/drawable/shape_ffe974_corner_12dp.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="@dimen/dp_12" />
|
||||
<stroke android:color="#FFE974" android:width="1px"/>
|
||||
<solid android:color="#0D002F"/>
|
||||
</shape>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
BIN
app/src/main/assets/svga/home_avatar_online.svga
Normal file
BIN
app/src/main/assets/svga/home_avatar_online.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/home_living.svga
Normal file
BIN
app/src/main/assets/svga/home_living.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/home_living_white.svga
Normal file
BIN
app/src/main/assets/svga/home_living_white.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/home_voice_playing.svga
Normal file
BIN
app/src/main/assets/svga/home_voice_playing.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/kitchen_notify.svga
Normal file
BIN
app/src/main/assets/svga/kitchen_notify.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/living_black.svga
Normal file
BIN
app/src/main/assets/svga/living_black.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/living_white.svga
Normal file
BIN
app/src/main/assets/svga/living_white.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/login.svga
Normal file
BIN
app/src/main/assets/svga/login.svga
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
app/src/main/assets/svga/refresh_header.svga
Normal file
BIN
app/src/main/assets/svga/refresh_header.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/user_in_live.svga
Normal file
BIN
app/src/main/assets/svga/user_in_live.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/vap/gold_box_open.mp4
Normal file
BIN
app/src/main/assets/vap/gold_box_open.mp4
Normal file
Binary file not shown.
@@ -1,10 +0,0 @@
|
||||
package com.jph.takephoto.permission;
|
||||
|
||||
import com.jph.takephoto.model.InvokeParam;
|
||||
|
||||
/**
|
||||
* 授权管理回调
|
||||
*/
|
||||
public interface InvokeListener {
|
||||
PermissionManager.TPermissionType invoke(InvokeParam invokeParam);
|
||||
}
|
@@ -1,93 +0,0 @@
|
||||
package com.jph.takephoto.uitl;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
|
||||
import com.darsh.multipleimageselect.activities.AlbumSelectActivity;
|
||||
import com.darsh.multipleimageselect.helpers.Constants;
|
||||
import com.jph.takephoto.model.CropOptions;
|
||||
import com.jph.takephoto.model.TContextWrap;
|
||||
|
||||
/**
|
||||
* Intent工具类用于生成拍照、
|
||||
* 从相册选择照片,裁剪照片所需的Intent
|
||||
* Author: JPH
|
||||
* Date: 2016/6/7 0007 13:41
|
||||
*/
|
||||
public class IntentUtils {
|
||||
private static final String TAG = IntentUtils.class.getName();
|
||||
|
||||
/**
|
||||
* 获取图片多选的Intent
|
||||
* @param limit 最多选择图片张数的限制
|
||||
* */
|
||||
public static Intent getPickMultipleIntent(TContextWrap contextWrap, int limit){
|
||||
Intent intent = new Intent(contextWrap.getActivity(), AlbumSelectActivity.class);
|
||||
intent.putExtra(Constants.INTENT_EXTRA_LIMIT, limit>0? limit:1);
|
||||
return intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取裁剪照片的Intent
|
||||
* @param targetUri 要裁剪的照片
|
||||
* @param outPutUri 裁剪完成的照片
|
||||
* @param options 裁剪配置
|
||||
* @return
|
||||
*/
|
||||
public static Intent getCropIntentWithOtherApp(Uri targetUri, Uri outPutUri, CropOptions options) {
|
||||
boolean isReturnData = TUtils.isReturnData();
|
||||
Log.w(TAG, "getCaptureIntentWithCrop:isReturnData:" + (isReturnData ? "true" : "false"));
|
||||
Intent intent = new Intent("com.android.camera.action.CROP");
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
intent.setDataAndType(targetUri, "image/*");
|
||||
intent.putExtra("crop", "true");
|
||||
if (options.getAspectX()*options.getAspectY()>0){
|
||||
intent.putExtra("aspectX", options.getAspectX());
|
||||
intent.putExtra("aspectY", options.getAspectY());
|
||||
}
|
||||
if (options.getOutputX()*options.getOutputY()>0){
|
||||
intent.putExtra("outputX", options.getOutputX());
|
||||
intent.putExtra("outputY", options.getOutputY());
|
||||
}
|
||||
intent.putExtra("scale", true);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outPutUri);
|
||||
intent.putExtra("return-data", isReturnData);
|
||||
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
|
||||
intent.putExtra("noFaceDetection", true); // no face detection
|
||||
return intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取拍照的Intent
|
||||
* @return
|
||||
*/
|
||||
public static Intent getCaptureIntent(Uri outPutUri) {
|
||||
Intent intent = new Intent();
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);//设置Action为拍照
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outPutUri);//将拍取的照片保存到指定URI
|
||||
return intent;
|
||||
}
|
||||
/**
|
||||
* 获取选择照片的Intent
|
||||
* @return
|
||||
*/
|
||||
public static Intent getPickIntentWithGallery() {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_PICK);//Pick an item from the data
|
||||
intent.setType("image/*");//从所有图片中进行选择
|
||||
return intent;
|
||||
}
|
||||
/**
|
||||
* 获取从文件中选择照片的Intent
|
||||
* @return
|
||||
*/
|
||||
public static Intent getPickIntentWithDocuments() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("image/*");
|
||||
return intent;
|
||||
}
|
||||
}
|
@@ -1,77 +0,0 @@
|
||||
package com.mango.moshen;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import com.microquation.linkedme.android.LinkedME;
|
||||
import com.microquation.linkedme.android.util.LinkProperties;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.mango.moshen.base.BaseActivity;
|
||||
import com.mango.core.linked.LinkedModel;
|
||||
import com.mango.core.linked.bean.LinkedInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Created by chenran on 2017/8/5.
|
||||
*/
|
||||
|
||||
public class MiddleActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getIntent() != null) {
|
||||
//获取与深度链接相关的值
|
||||
LinkProperties linkProperties = getIntent().getParcelableExtra(LinkedME.LM_LINKPROPERTIES);
|
||||
if (linkProperties != null) {
|
||||
Log.i("LinkedME-Demo", "Channel " + linkProperties.getChannel());
|
||||
Log.i("LinkedME-Demo", "control params " + linkProperties.getControlParams());
|
||||
Log.i("LinkedME-Demo", "link(深度链接) " + linkProperties.getLMLink());
|
||||
Log.i("LinkedME-Demo", "是否为新安装 " + linkProperties.isLMNewUser());
|
||||
//获取自定义参数封装成的hashmap对象,参数键值对由集成方定义
|
||||
|
||||
HashMap<String, String> hashMap = linkProperties.getControlParams();
|
||||
LogUtil.print("linkedme", hashMap);
|
||||
//根据key获取传入的参数的值,该key关键字View可为任意值,由集成方规定,请与web端商议,一致即可
|
||||
LinkedInfo linkedInfo = new LinkedInfo();
|
||||
linkedInfo.setNewUser(linkProperties.isLMNewUser());
|
||||
String roomuid = hashMap.get("roomuid");
|
||||
String uid = hashMap.get("uid");
|
||||
String channel = hashMap.get("linkedmeChannel");
|
||||
String type = hashMap.get("type");
|
||||
String familyId = hashMap.get("familyId");
|
||||
String url = hashMap.get("url");
|
||||
String worldId = hashMap.get("worldId");
|
||||
String dynamicId = hashMap.get("dynamicId");
|
||||
String inviteCode = hashMap.get("inviteCode");
|
||||
if (roomuid != null) {
|
||||
linkedInfo.setRoomUid(roomuid);
|
||||
}
|
||||
if (uid != null) {
|
||||
linkedInfo.setUid(uid);
|
||||
}
|
||||
if (type != null) {
|
||||
linkedInfo.setType(type);
|
||||
}
|
||||
if (familyId != null) {
|
||||
linkedInfo.setFamilyId(familyId);
|
||||
}
|
||||
if (url != null) {
|
||||
linkedInfo.setUrl(url);
|
||||
}
|
||||
if (worldId != null) {
|
||||
linkedInfo.setWorldId(worldId);
|
||||
}
|
||||
if (dynamicId != null) {
|
||||
linkedInfo.setDynamicId(dynamicId);
|
||||
}
|
||||
|
||||
linkedInfo.setInviteCode(inviteCode);
|
||||
|
||||
LinkedModel.get().setLinkedInfo(linkedInfo);
|
||||
}
|
||||
}
|
||||
finish();
|
||||
}
|
||||
}
|
@@ -1,55 +0,0 @@
|
||||
package com.mango.moshen.application;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||
import com.mango.moshen.utils.ActWhiteListMrg;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
/**
|
||||
* create by lvzebiao @2019/8/8
|
||||
*/
|
||||
public class ActivityStackManager {
|
||||
|
||||
/**
|
||||
* 用于保持最顶的Activity实例,排除中转的activity
|
||||
* 比如{@link com.mango.moshen.MiddleActivity}
|
||||
*/
|
||||
@Getter
|
||||
private WeakReference<Activity> topUpgradeWeakRef;
|
||||
|
||||
@Getter
|
||||
private WeakReference<Activity> avRoomActWeakRef;
|
||||
|
||||
public void setTopUpgradeActivity(Activity activity) {
|
||||
if (!ActWhiteListMrg.isTempActivity(activity)) {
|
||||
topUpgradeWeakRef = new WeakReference<>(activity);
|
||||
}
|
||||
}
|
||||
|
||||
public void addActivity(Activity activity){
|
||||
if (activity instanceof AVRoomActivity) {
|
||||
avRoomActWeakRef = new WeakReference<>(activity);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeActivity(Activity activity){
|
||||
if (activity instanceof AVRoomActivity) {
|
||||
avRoomActWeakRef = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class Helper {
|
||||
public static final ActivityStackManager INSTANCE = new ActivityStackManager();
|
||||
}
|
||||
|
||||
public static ActivityStackManager getInstance() {
|
||||
return Helper.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
@@ -1,639 +0,0 @@
|
||||
package com.mango.moshen.application;
|
||||
|
||||
import static com.mango.xchat_android_constants.XChatConstants.HW_APP_ID;
|
||||
import static com.mango.xchat_android_constants.XChatConstants.HW_CERTIFICATE_NAME;
|
||||
import static com.mango.xchat_android_constants.XChatConstants.OPPO_APP_ID;
|
||||
import static com.mango.xchat_android_constants.XChatConstants.OPPO_APP_KEY;
|
||||
import static com.mango.xchat_android_constants.XChatConstants.OPPO_CERTIFICATE_NAME;
|
||||
import static com.mango.xchat_android_constants.XChatConstants.OPPO_SECRET;
|
||||
import static com.mango.xchat_android_constants.XChatConstants.VIVO_CERTIFICATE_NAME;
|
||||
import static com.mango.xchat_android_constants.XChatConstants.XM_APP_ID;
|
||||
import static com.mango.xchat_android_constants.XChatConstants.XM_APP_KEY;
|
||||
import static com.mango.xchat_android_constants.XChatConstants.XM_CERTIFICATE_NAME;
|
||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_OPEN_ROOM_NOTI;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.net.http.HttpResponseCache;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
import com.bumptech.glide.request.target.ViewTarget;
|
||||
import com.bytedance.hume.readapk.HumeSDK;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.heytap.msp.push.HeytapPushManager;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.huawei.hms.support.common.ActivityMgr;
|
||||
import com.llew.huawei.verifier.LoadedApkHuaWei;
|
||||
import com.microquation.linkedme.android.LinkedME;
|
||||
import com.mob.MobSDK;
|
||||
import com.netease.nim.uikit.api.NimUIKit;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nimlib.sdk.NIMClient;
|
||||
import com.netease.nimlib.sdk.NotificationFoldStyle;
|
||||
import com.netease.nimlib.sdk.SDKOptions;
|
||||
import com.netease.nimlib.sdk.StatusBarNotificationConfig;
|
||||
import com.netease.nimlib.sdk.mixpush.MixPushConfig;
|
||||
import com.netease.nimlib.sdk.mixpush.NIMPushClient;
|
||||
import com.netease.nimlib.sdk.msg.MessageNotifierCustomization;
|
||||
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
|
||||
import com.netease.nimlib.sdk.msg.model.IMMessage;
|
||||
import com.netease.nimlib.sdk.util.NIMUtil;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.orhanobut.logger.AndroidLogAdapter;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.scwang.smartrefresh.header.MaterialHeader;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
|
||||
import com.tencent.bugly.Bugly;
|
||||
import com.tencent.bugly.beta.Beta;
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.tencent.vasdolly.helper.ChannelReaderUtil;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.mango.moshen.BuildConfig;
|
||||
import com.mango.moshen.MainActivity;
|
||||
import com.mango.moshen.MiddleActivity;
|
||||
import com.mango.moshen.NimMiddleActivity;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.module_hall.HallDataManager;
|
||||
import com.mango.moshen.other.activity.SplashActivity;
|
||||
import com.mango.moshen.quick_pass.QuickPassLoginAct;
|
||||
import com.mango.moshen.radish.wallet.RadishWalletManager;
|
||||
import com.mango.moshen.utils.PushMessageHandler;
|
||||
import com.mango.xchat_android_constants.XChatConstants;
|
||||
import com.mango.core.Constants;
|
||||
import com.mango.core.DemoCache;
|
||||
import com.mango.core.Env;
|
||||
import com.mango.core.UriProvider;
|
||||
import com.mango.core.auth.AuthModel;
|
||||
import com.mango.core.bean.response.ServiceResult;
|
||||
import com.mango.core.channel.ChannelModel;
|
||||
import com.mango.core.family.model.FamilyModel;
|
||||
import com.mango.core.gift.GiftModel;
|
||||
import com.mango.core.im.custom.bean.CustomAttachment;
|
||||
import com.mango.core.im.custom.bean.OpenSignInAttachment;
|
||||
import com.mango.core.initial.InitialModel;
|
||||
import com.mango.core.interceptor.NoParamsInterceptor;
|
||||
import com.mango.core.interceptor.ParamsInterceptor;
|
||||
import com.mango.core.manager.IMMessageManager;
|
||||
import com.mango.core.manager.IMSystemMsgManager;
|
||||
import com.mango.core.market_verify.MarketVerifyModel;
|
||||
import com.mango.core.mentoring_relationship.model.MentoringRelationshipModel;
|
||||
import com.mango.core.pay.PayModel;
|
||||
import com.mango.core.public_chat_hall.model.PublicChatHallModel;
|
||||
import com.mango.core.radish.RadishModel;
|
||||
import com.mango.core.radish.signin.bean.ImNotice;
|
||||
import com.mango.core.room.face.DynamicFaceModel;
|
||||
import com.mango.core.statistic.StatisticManager;
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.mango.core.user.UserModel;
|
||||
import com.mango.core.user.event.NeedCompleteInfoEvent;
|
||||
import com.mango.core.utils.SharedPreferenceUtils;
|
||||
import com.mango.core.utils.net.ServerException;
|
||||
import com.mango.xchat_android_library.net.rxnet.RxNet;
|
||||
import com.mango.xchat_android_library.net.rxnet.converter.GsonConverterPlugins;
|
||||
import com.mango.xchat_android_library.utils.AppMetaDataUtil;
|
||||
import com.mango.xchat_android_library.utils.AppUtils;
|
||||
import com.mango.xchat_android_library.utils.DeviceUuidFactory;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
import com.mango.xchat_android_library.utils.SystemUtils;
|
||||
import com.mango.xchat_android_library.utils.VersionUtil;
|
||||
import com.mango.xchat_android_library.utils.codec.MD5Utils;
|
||||
import com.mango.xchat_android_library.utils.config.BasicConfig;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmConfiguration;
|
||||
|
||||
/**
|
||||
* @author chenran
|
||||
* @date 2017/2/11
|
||||
*/
|
||||
|
||||
public class XChatApplication extends Application {
|
||||
public static final String TAG = "XChatApplication";
|
||||
private static final MessageNotifierCustomization messageNotifierCustomization = new MessageNotifierCustomization() {
|
||||
@Override
|
||||
public String makeNotifyContent(String nick, IMMessage message) {
|
||||
if (message.getMsgType() == MsgTypeEnum.custom) {
|
||||
CustomAttachment customAttachment = (CustomAttachment) message.getAttachment();
|
||||
if (customAttachment.getFirst() == CUSTOM_MSG_HEADER_TYPE_OPEN_ROOM_NOTI) {
|
||||
return message.getFromNick();
|
||||
} else if (customAttachment instanceof OpenSignInAttachment) {
|
||||
return getContentFromOpenSignIn(customAttachment);
|
||||
}
|
||||
}
|
||||
// 采用SDK默认文案
|
||||
return "收到一条消息";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String makeTicker(String nick, IMMessage message) {
|
||||
if (message.getMsgType() == MsgTypeEnum.custom) {
|
||||
CustomAttachment customAttachment = (CustomAttachment) message.getAttachment();
|
||||
if (customAttachment != null) {
|
||||
if (customAttachment.getFirst() == CUSTOM_MSG_HEADER_TYPE_OPEN_ROOM_NOTI) {
|
||||
return message.getFromNick();
|
||||
} else if (customAttachment instanceof OpenSignInAttachment) {
|
||||
return getContentFromOpenSignIn(customAttachment);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 采用SDK默认文案
|
||||
return "收到一条消息";
|
||||
}
|
||||
|
||||
private String getContentFromOpenSignIn(CustomAttachment attachment) {
|
||||
String result = null;
|
||||
if (attachment instanceof OpenSignInAttachment) {
|
||||
ImNotice notice = ((OpenSignInAttachment) attachment).getImNotice();
|
||||
if (notice != null) {
|
||||
result = notice.getContent();
|
||||
}
|
||||
}
|
||||
if (TextUtils.isEmpty(result)) {
|
||||
result = "收到一条消息";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String makeRevokeMsgTip(String s, IMMessage imMessage) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
private static XChatApplication instance;
|
||||
//生命周期监听
|
||||
private static ActivityLifeManager lifeManager;
|
||||
private static boolean isInitOtherSDK = false;
|
||||
|
||||
//static 代码段可以防止内存泄露
|
||||
static {
|
||||
SmartRefreshLayout.setDefaultRefreshHeaderCreater(
|
||||
(context, layout) -> {
|
||||
layout.setEnableHeaderTranslationContent(false);
|
||||
MaterialHeader materialHeader = new MaterialHeader(context);
|
||||
materialHeader.setShowBezierWave(false);
|
||||
return materialHeader;
|
||||
});
|
||||
SmartRefreshLayout.setDefaultRefreshFooterCreater(
|
||||
(context, layout) -> new ClassicsFooter(context).setDrawableSize(20));
|
||||
}
|
||||
|
||||
public static XChatApplication instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void initOtherSDK() {
|
||||
if (isInitOtherSDK) return;
|
||||
isInitOtherSDK = true;
|
||||
Context context = BasicConfig.INSTANCE.getAppContext();
|
||||
Application application = (Application) context.getApplicationContext();
|
||||
// 初始化 sp
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
String channel = "";
|
||||
channel = ChannelReaderUtil.getChannel(instance);
|
||||
if (TextUtils.isEmpty(channel)) {
|
||||
channel = "official";
|
||||
}
|
||||
|
||||
BasicConfig.INSTANCE.setOriginalChannel(channel);
|
||||
|
||||
//头条分包渠道
|
||||
if (BasicConfig.INSTANCE.isByteDanceChannel()) {
|
||||
String byteDanceChannel = HumeSDK.getChannel(context);
|
||||
if (!TextUtils.isEmpty(byteDanceChannel)) {
|
||||
channel = byteDanceChannel;
|
||||
}
|
||||
}
|
||||
BasicConfig.INSTANCE.setChannel(channel);
|
||||
|
||||
initEnv();
|
||||
|
||||
ActivityMgr.INST.init((Application) context);
|
||||
//延迟初始化云信
|
||||
NIMClient.init(context, null, options());
|
||||
|
||||
//logger 配置
|
||||
Logger.addLogAdapter(new AndroidLogAdapter() {
|
||||
@Override
|
||||
public boolean isLoggable(int priority, String tag) {
|
||||
return BuildConfig.DEBUG;
|
||||
}
|
||||
});
|
||||
|
||||
ToastUtils.init(application);
|
||||
|
||||
if (inMainProcess(context)) {
|
||||
HeytapPushManager.init(context, true);
|
||||
|
||||
DemoCache.saveLaunchCount();
|
||||
// 注册自定义推送消息处理,这个是可选项
|
||||
NIMPushClient.registerMixPushMessageHandler(new PushMessageHandler());
|
||||
|
||||
RxJavaPlugins.setErrorHandler(throwable -> {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.e(TAG, "the subscribe() method default error handler", throwable);
|
||||
}
|
||||
});
|
||||
|
||||
//需要完善资料错误码全局处理
|
||||
GsonConverterPlugins.setResultHandler(result -> {
|
||||
if (result instanceof ServiceResult<?>) {
|
||||
ServiceResult<?> serviceResult = (ServiceResult<?>) result;
|
||||
if (serviceResult.getCode() == ServiceResult.CODE_NEED_COMPLETE_USER_INFO) {
|
||||
SingleToastUtil.showToast(serviceResult.getMessage());
|
||||
EventBus.getDefault().post(new NeedCompleteInfoEvent());
|
||||
throw new ServerException(serviceResult.getMessage(), serviceResult.getCode());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
GsonConverterPlugins.lockdown();
|
||||
|
||||
//fixed: Glide Exception:"You must not call setTag() on a view Glide is targeting"
|
||||
ViewTarget.setTagId(R.id.tag_glide);
|
||||
|
||||
init(channel);
|
||||
|
||||
if (!TextUtils.isEmpty(channel)) {
|
||||
CrashReport.setAppChannel(context, channel);
|
||||
}
|
||||
initBuglyUpdate();
|
||||
Bugly.init(context, BuildConfig.DEBUG ? XChatConstants.BUGLY_KEY_DEBUG : XChatConstants.BUGLY_KEY_RELEASE, BuildConfig.DEBUG);
|
||||
|
||||
//生命周期监听
|
||||
if (lifeManager == null) {
|
||||
lifeManager = new ActivityLifeManager();
|
||||
}
|
||||
registerActivityLifecycleCallback(lifeManager);
|
||||
dealHuaWeiCrash();
|
||||
initLinkedMe();
|
||||
LinkedME.getInstance().setImmediate(true);
|
||||
MobSDK.init(context);
|
||||
MobSDK.submitPolicyGrantResult(true);
|
||||
// 友盟统计初始化
|
||||
UMConfigure.init(context, XChatConstants.UMENG_APP_KEY,
|
||||
BasicConfig.INSTANCE.getChannel(), UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||
// 选用MANUAL页面采集模式
|
||||
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.MANUAL);
|
||||
// 支持在子进程中统计自定义事件
|
||||
UMConfigure.setProcessEvent(true);
|
||||
// 日志加密
|
||||
UMConfigure.setEncryptEnabled(true);
|
||||
// 集成测试
|
||||
UMConfigure.setLogEnabled(BuildConfig.DEBUG);
|
||||
}
|
||||
|
||||
LogUtils.d("init time = " + (System.currentTimeMillis() - startTime) + "ms");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化linkedMe
|
||||
*/
|
||||
private static void initLinkedMe() {
|
||||
LinkedME.getInstance(BasicConfig.INSTANCE.getAppContext(), XChatConstants.LINKED_ME_KEY);
|
||||
if (isDebug()) {
|
||||
//设置debug模式下打印LinkedME日志
|
||||
LinkedME.getInstance().setDebug();
|
||||
}
|
||||
//初始时请设置为false
|
||||
LinkedME.getInstance().setImmediate(false);
|
||||
//设置处理跳转逻辑的中转页,MiddleActivity详见后续配置
|
||||
LinkedME.getInstance().setHandleActivity(MiddleActivity.class.getName());
|
||||
}
|
||||
|
||||
private static void initEnv() {
|
||||
//首先初始化环境
|
||||
Env.initEnv(BuildConfig.BUILD_TYPE, BuildConfig.DEBUG);
|
||||
//切换生产坏境和测试环境 true/测试环境 false/生产环境
|
||||
BasicConfig.INSTANCE.setDebuggable(Env.isDebug());
|
||||
BasicConfig.INSTANCE.setRootDir(Constants.ERBAN_DIR_NAME);
|
||||
BasicConfig.INSTANCE.setLogDir(Constants.LOG_DIR);
|
||||
BasicConfig.INSTANCE.setConfigDir(Constants.CONFIG_DIR);
|
||||
BasicConfig.INSTANCE.setVoiceDir(Constants.VOICE_DIR);
|
||||
BasicConfig.INSTANCE.setCacheDir(Constants.CACHE_DIR);
|
||||
BasicConfig.INSTANCE.setImageDir(Constants.IMAGE_CACHE_DIR);
|
||||
}
|
||||
|
||||
|
||||
private static void dealHuaWeiCrash() {
|
||||
String brand = Build.BRAND;
|
||||
String manufacturer = Build.MANUFACTURER;
|
||||
if (!TextUtils.isEmpty(brand) && (
|
||||
"HUAWEI".toLowerCase().equals(brand.toLowerCase())
|
||||
|| "HONOR".toLowerCase().equals(brand.toLowerCase())
|
||||
|| "HUAWEI".equals(manufacturer))) {
|
||||
LoadedApkHuaWei.hookHuaWeiVerifier((Application) BasicConfig.INSTANCE.getAppContext().getApplicationContext());
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
|
||||
public static void registerActivityLifecycleCallback(Application.ActivityLifecycleCallbacks callbacks) {
|
||||
((Application) BasicConfig.INSTANCE.getAppContext().getApplicationContext()).registerActivityLifecycleCallbacks(callbacks);
|
||||
}
|
||||
|
||||
/**
|
||||
* 云信配置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static SDKOptions options() {
|
||||
SDKOptions options = new SDKOptions();
|
||||
options.disableAwake = true;
|
||||
options.asyncInitSDK = true;
|
||||
// options.customPushContentType = "";
|
||||
if (isDebug()) {
|
||||
options.checkManifestConfig = true;
|
||||
}
|
||||
// 如果将新消息通知提醒托管给 SDK 完成,需要添加以下配置。否则无需设置。
|
||||
StatusBarNotificationConfig config = new StatusBarNotificationConfig();
|
||||
// 点击通知栏跳转到该Activity
|
||||
config.notificationEntrance = NimMiddleActivity.class;
|
||||
// config.notificationSmallIconId = R.drawable.icon_msg_normal;
|
||||
// 呼吸灯配置
|
||||
config.ledARGB = Color.GREEN;
|
||||
config.ledOnMs = 1000;
|
||||
config.ledOffMs = 1500;
|
||||
config.notificationFoldStyle = NotificationFoldStyle.CONTACT;
|
||||
// 通知铃声的uri字符串
|
||||
config.notificationSound = "android.resource://com.netease.nim.demo/raw/msg";
|
||||
options.statusBarNotificationConfig = config;
|
||||
// 定制通知栏提醒文案(可选,如果不定制将采用SDK默认文案)
|
||||
options.messageNotifierCustomization = messageNotifierCustomization;
|
||||
|
||||
options.appKey = Constants.nimAppKey;
|
||||
|
||||
// 配置保存图片,文件,log 等数据的目录
|
||||
// 如果 options 中没有设置这个值,SDK 会使用下面代码示例中的位置作为 SDK 的数据目录。
|
||||
// 该目录目前包含 log, file, image, audio, video, thumb 这6个目录。
|
||||
// 如果第三方 APP 需要缓存清理功能, 清理这个目录下面个子目录的内容即可。
|
||||
String sdkPath = null;
|
||||
try {
|
||||
sdkPath = Environment.getExternalStorageDirectory() + "/" + BasicConfig.INSTANCE.getAppContext().getPackageName() + "/nim";
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
|
||||
}
|
||||
options.sdkStorageRootPath = sdkPath;
|
||||
|
||||
// 配置是否需要预下载附件缩略图,默认为 true
|
||||
options.preloadAttach = true;
|
||||
|
||||
// 配置附件缩略图的尺寸大小。表示向服务器请求缩略图文件的大小
|
||||
// 该值一般应根据屏幕尺寸来确定, 默认值为 Screen.width / 2
|
||||
int widthPixels = BasicConfig.INSTANCE.getAppContext().getResources().getDisplayMetrics().widthPixels;
|
||||
options.thumbnailSize = widthPixels / 2;
|
||||
// // save cache,留做切换账号备用
|
||||
DemoCache.setNotificationConfig(config);
|
||||
|
||||
MixPushConfig mixPushConfig = new MixPushConfig();
|
||||
//华为推送
|
||||
mixPushConfig.hwAppId = HW_APP_ID;
|
||||
mixPushConfig.hwCertificateName = HW_CERTIFICATE_NAME;
|
||||
//小米推送
|
||||
mixPushConfig.xmAppId = XM_APP_ID;
|
||||
mixPushConfig.xmAppKey = XM_APP_KEY;
|
||||
mixPushConfig.xmCertificateName = XM_CERTIFICATE_NAME;
|
||||
|
||||
//vivo推送
|
||||
mixPushConfig.vivoCertificateName = VIVO_CERTIFICATE_NAME;
|
||||
//oppo推送
|
||||
mixPushConfig.oppoAppId = OPPO_APP_ID;
|
||||
mixPushConfig.oppoAppKey = OPPO_APP_KEY;
|
||||
mixPushConfig.oppoAppSercet = OPPO_SECRET;
|
||||
mixPushConfig.oppoCertificateName = OPPO_CERTIFICATE_NAME;
|
||||
options.mixPushConfig = mixPushConfig;
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前进程是否主进程
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
private static boolean inMainProcess(Context context) {
|
||||
String packageName = context.getPackageName();
|
||||
String processName = NIMUtil.getProcessName(context);
|
||||
return packageName.equals(processName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化bugly版本升级
|
||||
*/
|
||||
private static void initBuglyUpdate() {
|
||||
/***** Beta高级设置 *****/
|
||||
/**
|
||||
* true表示app启动自动初始化升级模块;
|
||||
* false不会自动初始化;
|
||||
* 开发者如果担心sdk初始化影响app启动速度,可以设置为false,
|
||||
* 在后面某个时刻手动调用Beta.init(getApplicationContext(),false);
|
||||
*/
|
||||
// Beta.autoInit = true;
|
||||
/**
|
||||
* true表示初始化时自动检查升级;
|
||||
* false表示不会自动检查升级,需要手动调用Beta.checkUpgrade()方法;
|
||||
*/
|
||||
// Beta.autoCheckUpgrade = true;
|
||||
/**
|
||||
* 设置升级检查周期为60s(默认检查周期为0s),60s内SDK不重复向后台请求策略);
|
||||
*/
|
||||
// Beta.upgradeCheckPeriod = 60 * 1000;
|
||||
|
||||
/**
|
||||
* 设置启动延时为1s(默认延时3s),APP启动1s后初始化SDK,避免影响APP启动速度;
|
||||
*/
|
||||
Beta.initDelay = 6 * 1000;
|
||||
|
||||
/**
|
||||
* 设置sd卡的Download为更新资源保存目录;
|
||||
* 后续更新资源会保存在此目录,需要在manifest中添加WRITE_EXTERNAL_STORAGE权限;
|
||||
*/
|
||||
// Beta.storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||
|
||||
/**
|
||||
* 点击过确认的弹窗在APP下次启动自动检查更新时会再次显示;
|
||||
*/
|
||||
Beta.showInterruptedStrategy = true;
|
||||
|
||||
/**
|
||||
* 只允许在MainActivity上显示更新弹窗,其他activity上不显示弹窗;
|
||||
* 不设置会默认所有activity都可以显示弹窗;
|
||||
* 2021/6/22 增加登录页面也可以弹出,万一域名挂了还可以用bugly更新!!
|
||||
*/
|
||||
Beta.canShowUpgradeActs.add(MainActivity.class);
|
||||
Beta.canShowUpgradeActs.add(QuickPassLoginAct.class);
|
||||
/**
|
||||
* 自定义布局
|
||||
*/
|
||||
Beta.upgradeDialogLayoutId = R.layout.upgrade_dialog;//关键代码写这个布局添加自己想要的
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化RxNet
|
||||
*
|
||||
* @param context
|
||||
* @param url
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
public static void initRxNet(Context context, String url) {
|
||||
Map<String, String> httpParams = new ConcurrentHashMap<>();
|
||||
httpParams.put("os", "android");
|
||||
httpParams.put("osVersion", Build.VERSION.RELEASE);
|
||||
httpParams.put("app", XChatConstants.APP_MARK);
|
||||
httpParams.put("ispType", String.valueOf(SystemUtils.getIspType(context)));
|
||||
httpParams.put("netType", String.valueOf(SystemUtils.getNetworkType(context)));
|
||||
httpParams.put("model", SystemUtils.getPhoneModel());
|
||||
httpParams.put("appVersion", VersionUtil.getLocalName(context));
|
||||
httpParams.put("appVersionCode", String.valueOf(AppUtils.getVersionCode(context)));
|
||||
httpParams.put("deviceId", DeviceUuidFactory.getDeviceId(context));
|
||||
httpParams.put("androidId", MD5Utils.getMD5String(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID)));
|
||||
httpParams.put("channel", AppMetaDataUtil.getChannelID());
|
||||
RxNet.init(context)
|
||||
.debug(BuildConfig.DEBUG)
|
||||
.setBaseUrl(url)
|
||||
.addInterceptors(new ParamsInterceptor(httpParams))
|
||||
.addInterceptors(new NoParamsInterceptor())//注意:拦截器的添加顺序,请求的拦截顺序
|
||||
.build();
|
||||
//单例的model 初始化
|
||||
initModel();
|
||||
}
|
||||
|
||||
private static void init(String channel) {
|
||||
initNimUIKit();
|
||||
UriProvider.initUri(BuildConfig.BASE_URL_DEBUG, BuildConfig.BASE_URL_STAGING, BuildConfig.BASE_URL_RELEASE);
|
||||
SVGAParser.Companion.shareParser().init(BasicConfig.INSTANCE.getAppContext());
|
||||
try {
|
||||
/** svga动画缓存路径 */
|
||||
File cacheDir = new File(BasicConfig.INSTANCE.getAppContext().getApplicationContext().getExternalCacheDir(), "http");
|
||||
if (!cacheDir.exists()) cacheDir.mkdirs();
|
||||
HttpResponseCache.install(cacheDir, 1024 * 1024 * 128);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "testtest", e);
|
||||
}
|
||||
|
||||
initRxNet(BasicConfig.INSTANCE.getAppContext(), UriProvider.JAVA_WEB_URL);
|
||||
|
||||
/**
|
||||
* 使用到realm 数据库,这里配置数据库 这里必须先于模块初始化前进行初始化配置
|
||||
*/
|
||||
Realm.init(BasicConfig.INSTANCE.getAppContext());
|
||||
RealmConfiguration config = new RealmConfiguration.Builder()
|
||||
.name("accompany.realm")
|
||||
.deleteRealmIfMigrationNeeded()
|
||||
.build();
|
||||
Realm.setDefaultConfiguration(config);
|
||||
|
||||
|
||||
LogUtil.i(TAG, channel);
|
||||
//APP启动埋点
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_APP_LAUNCH, "应用启动");
|
||||
}
|
||||
|
||||
/**
|
||||
* 一些单例的 model
|
||||
*/
|
||||
private static void initModel() {
|
||||
DynamicFaceModel.get().init();
|
||||
PayModel.get();
|
||||
UserModel.get();
|
||||
//ui层的萝卜钱包
|
||||
RadishWalletManager.get();
|
||||
//model层的
|
||||
RadishModel.get();
|
||||
|
||||
IMMessageManager.get().init();
|
||||
IMSystemMsgManager.get().init();
|
||||
|
||||
FamilyModel.Instance();
|
||||
AuthModel.get();
|
||||
|
||||
ChannelModel.get();
|
||||
MarketVerifyModel.get();
|
||||
GiftModel.get();
|
||||
PublicChatHallModel.get();
|
||||
// 模厅
|
||||
HallDataManager.get().application();
|
||||
// 师徒
|
||||
MentoringRelationshipModel.get();
|
||||
//全局处理
|
||||
GlobalHandleManager.get().init();
|
||||
|
||||
InitialModel.get().init(true);
|
||||
|
||||
}
|
||||
|
||||
private static void initNimUIKit() {
|
||||
// 初始化
|
||||
NimUIKit.init(BasicConfig.INSTANCE.getAppContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* debug 环境 受到实验室模式影响
|
||||
*/
|
||||
public static boolean isDebug() {
|
||||
return Env.isDebug();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是真实的debug的环境 不受实验室模式影响
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static boolean isRealDebug() {
|
||||
return Env.isRealDebug();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户没同意隐私协议之前,啥也不干!!
|
||||
*/
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
instance = this;
|
||||
BasicConfig.INSTANCE.setAppContext(this.getApplicationContext());
|
||||
SharedPreferenceUtils.init(this);
|
||||
boolean isShowPrivacyAgreement = (boolean) SharedPreferenceUtils.get(SplashActivity.SHOW_PRIVACY_AGREEMENT, true);
|
||||
if (!isShowPrivacyAgreement) {
|
||||
initOtherSDK();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
MultiDex.install(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTerminate() {
|
||||
super.onTerminate();
|
||||
CrashReport.closeBugly();
|
||||
if (lifeManager != null) {
|
||||
unregisterActivityLifecycleCallbacks(lifeManager);
|
||||
}
|
||||
GlobalHandleManager.get().unInit();
|
||||
}
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
package com.mango.moshen.audio.helper;
|
||||
|
||||
/**
|
||||
* create by lvzebiao @2019/6/11
|
||||
*/
|
||||
public interface OnRefreshListener {
|
||||
|
||||
void refresh();
|
||||
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.mango.moshen.audio.presenter;
|
||||
|
||||
import com.mango.moshen.audio.view.IMyVoiceView;
|
||||
import com.mango.moshen.base.BaseMvpPresenter;
|
||||
import com.mango.core.audio.AudioModel;
|
||||
import com.mango.core.audio.bean.UserVoiceInfo;
|
||||
import com.mango.core.auth.AuthModel;
|
||||
import com.mango.core.utils.net.DontWarnObserver;
|
||||
import com.mango.xchat_android_library.base.PresenterEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 我的声音页面
|
||||
*/
|
||||
public class MyVoicePresenter extends BaseMvpPresenter<IMyVoiceView> {
|
||||
|
||||
public void getUserVoiceInfo() {
|
||||
getMvpView().showLoadingView();
|
||||
AudioModel.get().getMyVoiceInfoList(AuthModel.get().getCurrentUid())
|
||||
.compose(bindUntilEvent(PresenterEvent.DESTROY))
|
||||
.subscribe(new DontWarnObserver<List<UserVoiceInfo>>() {
|
||||
@Override
|
||||
public void accept(List<UserVoiceInfo> userVoiceInfos, String error) {
|
||||
super.accept(userVoiceInfos, error);
|
||||
if (getMvpView() == null) {
|
||||
return;
|
||||
}
|
||||
getMvpView().hideLoadingView();
|
||||
getMvpView().showVoiceInfo(userVoiceInfos);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
package com.mango.moshen.audio.view;
|
||||
|
||||
import com.mango.core.audio.bean.VoiceMatchInfo;
|
||||
|
||||
/**
|
||||
* create by lvzebiao @2019/6/19
|
||||
*/
|
||||
public interface IBottleOpListener {
|
||||
|
||||
void onLimit(boolean isRight);
|
||||
|
||||
void onLikeOrUnLike(VoiceMatchInfo info, boolean isRight, boolean needLoading);
|
||||
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
package com.mango.moshen.audio.view;
|
||||
|
||||
import com.mango.core.audio.bean.UserVoiceInfo;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 我的声音页面
|
||||
*/
|
||||
public interface IMyVoiceView extends IMvpBaseView {
|
||||
/**
|
||||
* 显示声音数据消息
|
||||
*/
|
||||
void showVoiceInfo(List<UserVoiceInfo> voiceList);
|
||||
|
||||
/**
|
||||
* 请稍后
|
||||
*/
|
||||
void showLoadingView();
|
||||
|
||||
void hideLoadingView();
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
package com.mango.moshen.avroom;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import com.mango.moshen.avroom.widget.ViewItem;
|
||||
import com.mango.moshen.ui.widget.GiftDialog;
|
||||
|
||||
/**
|
||||
* 用户卡片的管理
|
||||
* Created by lvzebiao on 2018/11/12.
|
||||
*/
|
||||
|
||||
public class UserCardButtonManager {
|
||||
|
||||
|
||||
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils
|
||||
import com.mango.core.home.bean.HomeRoomInfo
|
||||
import com.mango.core.utils.subAndReplaceDot
|
||||
|
||||
class ExitRoomAdapter :
|
||||
BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.item_exit_room) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: HomeRoomInfo) {
|
||||
|
||||
ImageLoadUtils.loadImage(mContext, item.avatar, helper.getView(R.id.iv_avatar))
|
||||
ImageLoadUtils.loadImage(mContext, item.tagPict, helper.getView(R.id.iv_tag))
|
||||
helper.setText(R.id.tv_online_num, item.onlineNum.toString())
|
||||
.setText(R.id.tv_title, item.title.subAndReplaceDot(8))
|
||||
}
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter;
|
||||
|
||||
import com.mango.core.room.queue.bean.MicMemberInfo;
|
||||
|
||||
/**
|
||||
* Created by lvzebiao on 2018/11/5.
|
||||
*/
|
||||
public interface OnMicroItemClickListener {
|
||||
void onAvatarBtnClick(int position);
|
||||
|
||||
void onUpMicBtnClick(int position, MicMemberInfo chatRoomMember);
|
||||
|
||||
void onLockBtnClick(int position);
|
||||
|
||||
void onRoomSettingsClick();
|
||||
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 右滑操作的,写了暂时不用
|
||||
* Created by lvzebiao
|
||||
*/
|
||||
|
||||
public class RoomBlackListAdapter extends BaseQuickAdapter<ChatRoomMember, BaseViewHolder>{
|
||||
|
||||
private Context context;
|
||||
|
||||
private int itemWidth;
|
||||
|
||||
public RoomBlackListAdapter(Context context) {
|
||||
super(R.layout.list_item_room_black);
|
||||
this.context = context;
|
||||
itemWidth = UIUtil.getScreenWidth(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, ChatRoomMember chatRoomMember) {
|
||||
helper.setText(R.id.nick, chatRoomMember.getNick());
|
||||
ImageLoadUtils.loadAvatar(context, chatRoomMember.getAvatar(), helper.getView(R.id.avatar));
|
||||
helper.getView(R.id.layout_item).getLayoutParams().width = itemWidth;
|
||||
}
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomRankFragmentPageAdapter extends FragmentPagerAdapter {
|
||||
|
||||
private List<Fragment> fragmentList;
|
||||
|
||||
public RoomRankFragmentPageAdapter(FragmentManager fm, List<Fragment> fragmentList) {
|
||||
super(fm);
|
||||
this.fragmentList = fragmentList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return fragmentList.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fragmentList.size();
|
||||
}
|
||||
}
|
@@ -1,63 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.fragment.RoomRankDialogUtils;
|
||||
import com.mango.moshen.common.widget.CircleImageView;
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils;
|
||||
import com.mango.core.room.bean.RoomRankHalfHourRankInfo;
|
||||
import com.mango.core.room.bean.RoomRankMultiItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class RoomRankHalfHourListAdapter extends BaseMultiItemQuickAdapter<RoomRankMultiItem, BaseViewHolder> {
|
||||
|
||||
public final static int TYPE_TIPS = 4;
|
||||
|
||||
public RoomRankHalfHourListAdapter(Context context) {
|
||||
super(new ArrayList<>());
|
||||
addItemType(RoomRankMultiItem.TYPE_LINEAR, R.layout.item_room_rank_layout);
|
||||
addItemType(RoomRankMultiItem.TYPE_EMPTY, R.layout.item_empty_list);
|
||||
addItemType(TYPE_TIPS, R.layout.item_rank_half_tips);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder baseViewHolder, RoomRankMultiItem roomConsumeInfo) {
|
||||
if (roomConsumeInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (roomConsumeInfo.getItemType() == RoomRankMultiItem.TYPE_LINEAR) {
|
||||
setLinearData(baseViewHolder, roomConsumeInfo);
|
||||
} else if (roomConsumeInfo.getItemType() == RoomRankMultiItem.TYPE_EMPTY) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void setLinearData(BaseViewHolder baseViewHolder, RoomRankMultiItem roomConsumeInfo) {
|
||||
if (roomConsumeInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
RoomRankHalfHourRankInfo roomRankHalfHourRankInfo = (RoomRankHalfHourRankInfo) roomConsumeInfo.getData();
|
||||
if (roomRankHalfHourRankInfo == null)
|
||||
return;
|
||||
|
||||
// 值
|
||||
TextView valueTV = baseViewHolder.getView(R.id.tv_room_rank_value);
|
||||
valueTV.setText(RoomRankDialogUtils.getRoomRankValueText(roomRankHalfHourRankInfo.getTotalNum()));
|
||||
|
||||
int drawable = RoomRankDialogUtils.getNumberImage(roomRankHalfHourRankInfo.getSeqNo());
|
||||
if (drawable != 0)
|
||||
baseViewHolder.setImageResource(R.id.iv_number, drawable);
|
||||
// 标题
|
||||
baseViewHolder.setText(R.id.tv_room_rank_title, roomRankHalfHourRankInfo.getRoomTitle());
|
||||
// 头像
|
||||
CircleImageView avatarView = baseViewHolder.getView(R.id.iv_room_rank_avatar);
|
||||
ImageLoadUtils.loadAvatar(mContext, roomRankHalfHourRankInfo.getAvatar(), avatarView, true);
|
||||
baseViewHolder.setText(R.id.tv_room_rank_id, "ID:" + roomRankHalfHourRankInfo.getErbanNo());
|
||||
}
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
package com.mango.moshen.avroom.anotherroompk
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils
|
||||
import com.mango.core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.mango.core.utils.subAndReplaceDot
|
||||
|
||||
class RoomPKSearchAdapter :
|
||||
BaseQuickAdapter<SimpleRoomInfo, BaseViewHolder>(R.layout.item_room_pk_search) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: SimpleRoomInfo) {
|
||||
helper.setText(R.id.tv_room_title,item.title.subAndReplaceDot(7))
|
||||
.setText(R.id.tv_room_id,"ID:${item.erbanNo}")
|
||||
.setChecked(R.id.check_box,item.checked)
|
||||
ImageLoadUtils.loadImage(mContext,item.avatar,helper.getView(R.id.iv_avatar))
|
||||
helper.addOnClickListener(R.id.iv_avatar,R.id.check_box)
|
||||
}
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
package com.mango.moshen.avroom.anotherroompk
|
||||
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.DialogRoomPkRuleBinding
|
||||
|
||||
class RoomPkRuleDialog : BaseDialog<DialogRoomPkRuleBinding>() {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(): RoomPkRuleDialog {
|
||||
return RoomPkRuleDialog()
|
||||
}
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.mango.moshen.avroom.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.method.ScrollingMovementMethod;
|
||||
import android.view.View;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.databinding.DialogDatingVipRuleBinding;
|
||||
import com.mango.moshen.treasure_box.widget.dialog.BaseBindingDialog;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_dating_vip_rule)
|
||||
public class DatingVipRuleDialog extends BaseBindingDialog<DialogDatingVipRuleBinding> implements View.OnClickListener {
|
||||
|
||||
|
||||
public DatingVipRuleDialog(Context context) {
|
||||
super(context, R.style.DialogFragment);
|
||||
}
|
||||
|
||||
public static DatingVipRuleDialog newInstance(Context context) {
|
||||
return new DatingVipRuleDialog(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
binding.setClick(this);
|
||||
binding.tvRule.setMovementMethod(ScrollingMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
closeDialog();
|
||||
}
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
package com.mango.moshen.avroom.dialog
|
||||
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.DialogNewUserGiftBinding
|
||||
import com.mango.moshen.ui.utils.load
|
||||
import com.mango.core.gift.bean.GiftInfo
|
||||
import com.mango.core.statistic.StatisticManager
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||
|
||||
class NewUserGiftDialog(val giftInfo: GiftInfo) :
|
||||
BaseDialog<DialogNewUserGiftBinding>() {
|
||||
|
||||
override fun init() {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_NUGIVE_POP_SHOW, "房间礼物赠送弹窗曝光")
|
||||
binding.ivClose.setOnClickListener {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_NUGIVE_POP_CLICK, "房间礼物赠送弹窗关闭点击")
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
binding.ivGift.load(giftInfo.giftUrl)
|
||||
binding.tvGiftName.text = "${giftInfo.giftName}*${giftInfo.count}"
|
||||
}
|
||||
|
||||
}
|
@@ -1,44 +0,0 @@
|
||||
package com.mango.moshen.avroom.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.databinding.DialogRequestUpmicBinding
|
||||
import com.mango.moshen.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.mango.core.manager.AvRoomDataManager
|
||||
import com.mango.core.manager.IMNetEaseManager
|
||||
import com.mango.core.user.bean.BaseInfo
|
||||
import com.mango.core.user.bean.UserInfo
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_request_upmic)
|
||||
class RequestUpMicDialog(context: Context) :
|
||||
BaseBindingDialog<DialogRequestUpmicBinding>(context, R.style.dialog),
|
||||
View.OnClickListener {
|
||||
private var userInfo: UserInfo? = null
|
||||
override fun init() {
|
||||
binding.click = this
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.btn_cancel -> {
|
||||
closeDialog()
|
||||
}
|
||||
R.id.btn_ok -> {
|
||||
userInfo?.let {
|
||||
val baseInfo = BaseInfo(it.uid, it.nick)
|
||||
val position = AvRoomDataManager.get().findFreePosition()
|
||||
if ( position == Int.MIN_VALUE) return@let
|
||||
IMNetEaseManager.get().inviteMicroPhoneBySdk(baseInfo, position ).subscribe()
|
||||
}
|
||||
closeDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setUser(userInfo: UserInfo) {
|
||||
this.userInfo = userInfo
|
||||
binding.user = userInfo
|
||||
}
|
||||
}
|
@@ -1,272 +0,0 @@
|
||||
package com.mango.moshen.avroom.firstcharge
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.text.Spannable
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.PopupWindow
|
||||
import android.widget.TextView
|
||||
import com.google.android.flexbox.AlignItems
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.google.android.flexbox.JustifyContent
|
||||
import com.mango.core.UriProvider
|
||||
import com.mango.core.auth.AuthModel
|
||||
import com.mango.core.pay.PayModel
|
||||
import com.mango.core.pay.PaymentActivity
|
||||
import com.mango.core.pay.bean.FirstChargeGoods
|
||||
import com.mango.core.pay.bean.FirstChargeReward
|
||||
import com.mango.core.pay.bean.PaymentResult
|
||||
import com.mango.core.pay.event.FirstChargeEvent
|
||||
import com.mango.core.pay.model.unionpay.UnionPayModel
|
||||
import com.mango.core.statistic.StatisticManager
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||
import com.mango.core.utils.toast
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.bank_card.activity.AddBankCardAgreementActivity
|
||||
import com.mango.moshen.base.BaseViewBindingActivity
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager.AbsOkDialogListener
|
||||
import com.mango.moshen.databinding.DialogFirstChargeBinding
|
||||
import com.mango.moshen.ui.setting.ModifyPwdActivity
|
||||
import com.mango.moshen.ui.utils.RVDelegate
|
||||
import com.mango.moshen.ui.webview.CommonWebViewActivity
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.mango.xchat_android_library.utils.JavaUtil
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_first_charge)
|
||||
class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>() {
|
||||
|
||||
private var goodsList: List<FirstChargeGoods>? = null
|
||||
|
||||
private var currGoods: FirstChargeGoods? = null
|
||||
private lateinit var rewardAdapter: RewardAdapter
|
||||
private lateinit var rvDelegate: RVDelegate<FirstChargeReward>
|
||||
private lateinit var helpPopupWindow: PopupWindow
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, FirstChargeDialog::class.java)
|
||||
context.startActivity(starter)
|
||||
StatisticManager.Instance()
|
||||
.onEvent(
|
||||
StatisticsProtocol.EVENT_ROOM_POP_CLICK,
|
||||
"房间pop点击",
|
||||
mapOf("name" to "新人充值")
|
||||
)
|
||||
}
|
||||
|
||||
private const val BIND_CODE_GOLD = 200
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
//这里的height用MATCH_PARENT状态栏会被顶上去,不知道什么鬼
|
||||
val height = ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(context)
|
||||
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, height)
|
||||
window.setGravity(Gravity.CENTER)
|
||||
EventBus.getDefault().register(this)
|
||||
binding.rbPlanA.setOnClickListener {
|
||||
binding.rbPlanA.isChecked = true
|
||||
binding.rbPlanB.isChecked = false
|
||||
binding.rbPlanC.isChecked = false
|
||||
updateCurrGoods(goodsList?.getOrNull(0))
|
||||
}
|
||||
binding.rbPlanB.setOnClickListener {
|
||||
binding.rbPlanA.isChecked = false
|
||||
binding.rbPlanB.isChecked = true
|
||||
binding.rbPlanC.isChecked = false
|
||||
updateCurrGoods(goodsList?.getOrNull(1))
|
||||
}
|
||||
binding.rbPlanC.setOnClickListener {
|
||||
binding.rbPlanA.isChecked = false
|
||||
binding.rbPlanB.isChecked = false
|
||||
binding.rbPlanC.isChecked = true
|
||||
updateCurrGoods(goodsList?.getOrNull(2))
|
||||
}
|
||||
binding.ivHelp.setOnClickListener { showHelpPopup() }
|
||||
binding.tvCharge.setOnClickListener {
|
||||
currGoods?.let {
|
||||
SelectPayTypeDialog.newInstance(it.chargeProdId, "¥${it.chargeMoney}")
|
||||
.show(this)
|
||||
} ?: run {
|
||||
"请选择充值产品!".toast()
|
||||
}
|
||||
}
|
||||
|
||||
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||
.setAdapter(
|
||||
RewardAdapter((ScreenUtil.screenWidth * 0.66f / 3f).toInt())
|
||||
.also { rewardAdapter = it }
|
||||
)
|
||||
.setLayoutManager(FlexboxLayoutManager(context).apply {
|
||||
alignItems = AlignItems.STRETCH
|
||||
justifyContent = JustifyContent.SPACE_EVENLY
|
||||
})
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.build()
|
||||
dialogManager.showProgressDialog(this)
|
||||
PayModel.get().firstChargeList
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
initData(it)
|
||||
dialogManager.dismissDialog()
|
||||
}, {
|
||||
it.printStackTrace()
|
||||
dialogManager.dismissDialog()
|
||||
SingleToastUtil.showToast(it.message)
|
||||
finish()
|
||||
})
|
||||
|
||||
binding.viewBg.setOnClickListener {
|
||||
//do nothing
|
||||
}
|
||||
binding.root.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initData(goodsList: List<FirstChargeGoods>) {
|
||||
this.goodsList = goodsList
|
||||
binding.rbPlanA.isChecked = true
|
||||
updateCurrGoods(goodsList.getOrNull(0))
|
||||
when (goodsList.size) {
|
||||
1 -> {
|
||||
binding.rbPlanB.visibility = View.GONE
|
||||
binding.rbPlanC.visibility = View.GONE
|
||||
binding.rbPlanA.text = "${goodsList[0].chargeMoney}元"
|
||||
}
|
||||
2 -> {
|
||||
binding.rbPlanC.visibility = View.GONE
|
||||
binding.rbPlanA.text = "${goodsList[0].chargeMoney}元"
|
||||
binding.rbPlanB.text = "${goodsList[1].chargeMoney}元"
|
||||
}
|
||||
3 -> {
|
||||
binding.rbPlanA.text = "${goodsList[0].chargeMoney}元"
|
||||
binding.rbPlanB.text = "${goodsList[1].chargeMoney}元"
|
||||
binding.rbPlanC.text = "${goodsList[2].chargeMoney}元"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateCurrGoods(firstChargeGoods: FirstChargeGoods?) {
|
||||
firstChargeGoods?.let {
|
||||
currGoods = it
|
||||
val giveMoneyIndex = it.chargeProdTitle.lastIndexOf(it.giveMoney)
|
||||
if (giveMoneyIndex == -1) {
|
||||
binding.tvTitle.text = it.chargeProdTitle
|
||||
} else {
|
||||
val builder = SpannableStringBuilder(it.chargeProdTitle)
|
||||
builder.setSpan(
|
||||
ForegroundColorSpan(Color.parseColor("#FFA027")), giveMoneyIndex,
|
||||
giveMoneyIndex + (it.giveMoney?.length ?: 0),
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
binding.tvTitle.text = builder
|
||||
}
|
||||
rewardAdapter.setNewData(it.firstChargeRewardList)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showHelpPopup() {
|
||||
if (currGoods == null) {
|
||||
SingleToastUtil.showToast("数据加载中,请稍后...")
|
||||
return
|
||||
}
|
||||
val contentView: View
|
||||
if (!this::helpPopupWindow.isInitialized) {
|
||||
contentView =
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.layout_first_charge_help_view, null)
|
||||
contentView.findViewById<TextView>(R.id.tv_content).text =
|
||||
currGoods?.chargeProdDesc?.replace("\\n", "\n")?.replace("\\r", "\r")
|
||||
helpPopupWindow =
|
||||
PopupWindow(
|
||||
contentView,
|
||||
ScreenUtil.dip2px(150f),
|
||||
WindowManager.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
helpPopupWindow.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
helpPopupWindow.isOutsideTouchable = true
|
||||
helpPopupWindow.isFocusable = true
|
||||
}
|
||||
|
||||
try {
|
||||
helpPopupWindow.showAsDropDown(binding.viewAnchor, 0, 0, Gravity.BOTTOM)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
dialogManager.dismissDialog()
|
||||
if (resultCode != RESULT_OK) {
|
||||
return
|
||||
}
|
||||
//支付页面返回处理
|
||||
if (requestCode == PaymentActivity.REQUEST_CODE_PAY) {
|
||||
if (data != null && data.extras != null) {
|
||||
val paymentResult: PaymentResult? =
|
||||
data.getParcelableExtra(PaymentActivity.KEY_PAY_RESULT)
|
||||
if (paymentResult != null) {
|
||||
// 充值金额超过限定时,就必须先实名认证
|
||||
when (JavaUtil.str2int(paymentResult.code)) {
|
||||
PayModel.NOT_REAL_NAME_BEFORE_CHARGING -> dialogManager.showTipsDialog(
|
||||
getString(R.string.tips_need_to_certification),
|
||||
getString(R.string.go_to_certification),
|
||||
object : AbsOkDialogListener() {
|
||||
override fun onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(
|
||||
this@FirstChargeDialog,
|
||||
UriProvider.getTutuRealNamePage()
|
||||
)
|
||||
}
|
||||
})
|
||||
UnionPayModel.CODE_NEED_BIND_BANK_CARD_FIRST -> dialogManager.showTipsDialog(
|
||||
getString(R.string.tips_need_bind_bank_card_first),
|
||||
object : AbsOkDialogListener() {
|
||||
override fun onOk() {
|
||||
// 跳去添加银行卡页面
|
||||
AddBankCardAgreementActivity.start(this@FirstChargeDialog)
|
||||
}
|
||||
})
|
||||
else -> {
|
||||
toast(paymentResult.msg)
|
||||
//重新获取钱包信息
|
||||
PayModel.get().getWalletInfo(AuthModel.get().currentUid).subscribe()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (requestCode == BIND_CODE_GOLD) {
|
||||
ModifyPwdActivity.start(this, ModifyPwdActivity.FOGERT_PAY_PWD)
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFirstRechargeEvent(event: FirstChargeEvent?) {
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
package com.mango.moshen.avroom.firstcharge
|
||||
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.mango.moshen.R
|
||||
import com.mango.core.pay.bean.FirstChargeReward
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils
|
||||
import com.mango.core.utils.TextUtils
|
||||
|
||||
class RewardAdapter(private val itemWidth: Int) :
|
||||
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_first_charge_reward) {
|
||||
override fun convert(helper: BaseViewHolder, item: FirstChargeReward) {
|
||||
helper.itemView.updateLayoutParams<RecyclerView.LayoutParams> {
|
||||
width = itemWidth
|
||||
}
|
||||
ImageLoadUtils.loadImage(
|
||||
mContext,
|
||||
item.showPir,
|
||||
helper.getView(R.id.iv_pic),
|
||||
R.drawable.default_cover
|
||||
)
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, item.showTime)
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
}
|
@@ -1,181 +0,0 @@
|
||||
package com.mango.moshen.avroom.firstcharge
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.res.ColorStateList
|
||||
import android.os.Bundle
|
||||
import android.text.style.TextAppearanceSpan
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.core.graphics.toColorInt
|
||||
import androidx.core.view.isVisible
|
||||
import com.mango.core.Constants
|
||||
import com.mango.core.pay.PayModel
|
||||
import com.mango.core.pay.PaymentActivity
|
||||
import com.mango.core.pay.bean.WalletInfo
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.DialogSelectPayTypeBinding
|
||||
import com.mango.moshen.ui.pay.ChargeActivity
|
||||
import com.mango.moshen.utils.SpannableBuilder
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.mango.xchat_android_library.utils.FormatUtils
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
|
||||
/**
|
||||
* 充值方式选择弹窗
|
||||
*/
|
||||
@ActLayoutRes(R.layout.dialog_select_pay_type)
|
||||
class SelectPayTypeDialog : BaseDialog<DialogSelectPayTypeBinding>() {
|
||||
|
||||
private val chargeProdId by lazy { requireArguments().getString("chargeProdId", "") }
|
||||
private val descText by lazy { requireArguments().getString("descText", "") }
|
||||
private val money by lazy { requireArguments().getInt("money", 0) }
|
||||
private val showDiamondCharge by lazy {
|
||||
requireArguments().getBoolean(
|
||||
"showDiamondCharge",
|
||||
false
|
||||
)
|
||||
}
|
||||
private var removeView: View? = null
|
||||
|
||||
private var onDiamondChargeClick: (() -> Unit)? = null
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(
|
||||
chargeProdId: String,
|
||||
descText: String,
|
||||
showDiamondCharge: Boolean = false,
|
||||
money: Int = 0
|
||||
): SelectPayTypeDialog {
|
||||
return SelectPayTypeDialog().apply {
|
||||
arguments = Bundle().apply {
|
||||
putString("chargeProdId", chargeProdId)
|
||||
putString("descText", descText)
|
||||
putBoolean("showDiamondCharge", showDiamondCharge)
|
||||
putInt("money", money)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var payChannel = ""
|
||||
|
||||
fun setOnDiamondChargeClick(onDiamondChargeClick: (() -> Unit)) {
|
||||
this.onDiamondChargeClick = onDiamondChargeClick
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
gravity = Gravity.BOTTOM
|
||||
super.onStart()
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
PayModel.get().walletInfo
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
setWalletData(it)
|
||||
}, {
|
||||
SingleToastUtil.showToast(it.message)
|
||||
it.printStackTrace()
|
||||
})
|
||||
binding.tvConfirm.setOnClickListener {
|
||||
if (payChannel.isEmpty()) {
|
||||
SingleToastUtil.showToast("数据初始化中,请稍后~")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (binding.rbAlipay.isChecked) {
|
||||
PaymentActivity.start(requireActivity(), Constants.CHARGE_ALIPAY, chargeProdId)
|
||||
} else if (binding.rbDiamond.isChecked) {
|
||||
onDiamondChargeClick?.invoke()
|
||||
} else {
|
||||
PaymentActivity.start(requireActivity(), Constants.CHARGE_WX, chargeProdId)
|
||||
}
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
|
||||
binding.tvMore.setOnClickListener {
|
||||
removeView?.let {
|
||||
binding.rg.addView(it)
|
||||
binding.tvMore.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
binding.ivClose.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
|
||||
if (showDiamondCharge) {
|
||||
binding.rg.setOnCheckedChangeListener { _, _ ->
|
||||
if (binding.rbDiamond.isChecked) {
|
||||
binding.tvDesc.text = "${money * 10}钻石"
|
||||
} else {
|
||||
binding.tvDesc.text = descText
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.tvDesc.text = descText
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* defaultPay 1:默认支付宝,2:默认微信
|
||||
*/
|
||||
private fun setWalletData(walletInfo: WalletInfo) {
|
||||
binding.rg.visibility = View.VISIBLE
|
||||
var defaultDiamond = false
|
||||
if (showDiamondCharge) {
|
||||
binding.rbDiamond.isVisible = true
|
||||
val states = arrayOf(intArrayOf(android.R.attr.state_enabled))
|
||||
val colors = intArrayOf("#8A8CAB".toColorInt())
|
||||
binding.rbDiamond.text = SpannableBuilder()
|
||||
.append("钻石支付")
|
||||
.append(
|
||||
"(${FormatUtils.formatBigInteger(walletInfo.diamondNum)}钻石)",
|
||||
TextAppearanceSpan(
|
||||
null,
|
||||
0,
|
||||
ScreenUtil.sp2px(10f),
|
||||
ColorStateList(states, colors),
|
||||
null
|
||||
)
|
||||
)
|
||||
.build()
|
||||
defaultDiamond = money != 0 && money * 10 <= walletInfo.diamondNum
|
||||
binding.rbDiamond.isChecked = defaultDiamond
|
||||
} else {
|
||||
binding.rbDiamond.isVisible = false
|
||||
}
|
||||
when (walletInfo.defaultPay) {
|
||||
ChargeActivity.ALI_PAY_CLOSE -> {
|
||||
payChannel = Constants.CHARGE_ALIPAY
|
||||
removeView = binding.rbAlipay
|
||||
binding.rg.removeView(binding.rbAlipay)
|
||||
binding.rbWechat.isChecked = !defaultDiamond
|
||||
binding.tvMore.visibility = View.VISIBLE
|
||||
}
|
||||
ChargeActivity.WX_PAY_CLOSE -> {
|
||||
payChannel = Constants.CHARGE_WX
|
||||
removeView = binding.rbWechat
|
||||
binding.rg.removeView(binding.rbWechat)
|
||||
binding.rbAlipay.isChecked = !defaultDiamond
|
||||
binding.tvMore.visibility = View.VISIBLE
|
||||
}
|
||||
ChargeActivity.WX_PAY_OPEN -> {
|
||||
payChannel = Constants.CHARGE_WX
|
||||
binding.rbWechat.isChecked = !defaultDiamond
|
||||
binding.rg.removeView(binding.rbAlipay)
|
||||
binding.rg.addView(binding.rbAlipay)
|
||||
}
|
||||
else -> {
|
||||
payChannel = Constants.CHARGE_ALIPAY
|
||||
binding.rbAlipay.isChecked = !defaultDiamond
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,687 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewStub;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||
import com.mango.moshen.avroom.activity.RoomOnlineUserActivity;
|
||||
import com.mango.moshen.avroom.adapter.SelectGameAdapter;
|
||||
import com.mango.moshen.avroom.dialog.ExitRoomPopupWindow;
|
||||
import com.mango.moshen.avroom.widget.GiftV2View;
|
||||
import com.mango.moshen.base.BaseFragment;
|
||||
import com.mango.moshen.databinding.FragmentChatroomGameMainBinding;
|
||||
import com.mango.moshen.friend.view.SelectFriendActivity;
|
||||
import com.mango.moshen.home.helper.OpenRoomHelper;
|
||||
import com.mango.moshen.ui.widget.ShareDialog;
|
||||
import com.mango.moshen.utils.RegexUtil;
|
||||
import com.mango.core.gift.bean.GiftMultiReceiverInfo;
|
||||
import com.mango.core.gift.bean.GiftReceiveInfo;
|
||||
import com.mango.core.gift.bean.LuckyBagGifts;
|
||||
import com.mango.core.gift.bean.MultiGiftReceiveInfo;
|
||||
import com.mango.core.home.event.FollowRoomEvent;
|
||||
import com.mango.core.home.event.ShareRoomEvent;
|
||||
import com.mango.core.home.model.CollectionRoomModel;
|
||||
import com.mango.core.im.custom.bean.CustomAttachment;
|
||||
import com.mango.core.im.custom.bean.RoomInfoAttachment;
|
||||
import com.mango.core.magic.bean.MagicReceivedInfo;
|
||||
import com.mango.core.magic.bean.MultiMagicReceivedInfo;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.manager.IMNetEaseManager;
|
||||
import com.mango.core.manager.RoomEvent;
|
||||
import com.mango.core.praise.PraiseModel;
|
||||
import com.mango.core.room.bean.RoomInfo;
|
||||
import com.mango.core.room.bean.RoomModeType;
|
||||
import com.mango.core.room.game.GameInfo;
|
||||
import com.mango.core.room.game.GameModel;
|
||||
import com.mango.core.room.queuing_mic.event.HasAnimationEffect;
|
||||
import com.mango.core.share.ShareModel;
|
||||
import com.mango.core.statistic.StatisticManager;
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.mango.core.super_admin.util.SuperAdminUtil;
|
||||
import com.mango.core.user.UserModel;
|
||||
import com.mango.core.user.bean.UserInfo;
|
||||
import com.mango.xchat_android_library.utils.JavaUtil;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import cn.sharesdk.framework.Platform;
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Action;
|
||||
|
||||
/**
|
||||
* 轰趴房
|
||||
* Created by 2016/9/22.
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
public class HomePartyFragment extends BaseFragment implements View.OnClickListener, ShareDialog.OnShareDialogItemClick {
|
||||
|
||||
private Fragment roomFragment;
|
||||
|
||||
private TextView roomTitle;
|
||||
private TextView roomId;
|
||||
private ImageView ivFollowRoom;
|
||||
private AppCompatImageView mIvGoodNumber;
|
||||
|
||||
private ImageView roomMore;
|
||||
private GiftV2View giftView;
|
||||
private ViewStub mVsGift2View;
|
||||
|
||||
private SVGAImageView svgaRoomBg;
|
||||
private String[] bgPicture = new String[]{""};
|
||||
|
||||
private UserInfo mUserInfo;
|
||||
private FragmentChatroomGameMainBinding gameMainBinding;
|
||||
|
||||
private ShareDialog shareDialog;
|
||||
|
||||
//收藏房间
|
||||
private String FOLLOW_ROOM_TYPE = "";
|
||||
private SelectGameAdapter gameAdapter;
|
||||
|
||||
|
||||
public static HomePartyFragment newInstance() {
|
||||
HomePartyFragment homePartyFragment = new HomePartyFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
homePartyFragment.setArguments(bundle);
|
||||
return homePartyFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
// clear views
|
||||
roomTitle.setText("");
|
||||
setRoomId(0, 0);
|
||||
updateOnlineNumberView(0);
|
||||
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||
((HomePartyRoomFragment) roomFragment).onNewIntent(intent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
private void setRoomId(long id, int onlineNumber) {
|
||||
String htmlText = "ID:" + id;
|
||||
roomId.setText(htmlText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_chatroom_game_main;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
gameMainBinding = DataBindingUtil.bind(mView);
|
||||
roomTitle = mView.findViewById(R.id.room_title);
|
||||
setupRoomTitleMarquee();
|
||||
roomMore = mView.findViewById(R.id.room_more);
|
||||
roomId = mView.findViewById(R.id.room_id);
|
||||
mVsGift2View = mView.findViewById(R.id.vs_gift_view);
|
||||
mIvGoodNumber = mView.findViewById(R.id.iv_good_number);
|
||||
ivFollowRoom = mView.findViewById(R.id.iv_follow_room);
|
||||
svgaRoomBg = mView.findViewById(R.id.svga_image_view_bg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加跑马灯
|
||||
* 以及反射一些参数影响跑马灯
|
||||
*/
|
||||
private void setupRoomTitleMarquee() {
|
||||
try {
|
||||
ViewConfiguration configuration = ViewConfiguration.get(getContext());
|
||||
Class claz = configuration.getClass();
|
||||
Field field = claz.getDeclaredField("mFadingMarqueeEnabled");
|
||||
field.setAccessible(true);
|
||||
field.set(configuration, true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
roomTitle.setSelected(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
roomMore.setOnClickListener(this);
|
||||
ivFollowRoom.setOnClickListener(this);
|
||||
gameMainBinding.llRoomInfo.setOnClickListener(this);
|
||||
gameMainBinding.ivBack.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void initiate() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
if (!AvRoomDataManager.get().haveSelfChange) {
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect = AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect();
|
||||
}
|
||||
}
|
||||
|
||||
private void initRvGame() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null || gameAdapter != null) return;
|
||||
gameMainBinding.rvGame.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
gameMainBinding.rvGame.setAdapter(gameAdapter = new SelectGameAdapter());
|
||||
gameMainBinding.llSelectGame.setOnClickListener(v -> {
|
||||
if (gameMainBinding.rvGame.getVisibility() == View.VISIBLE) {
|
||||
gameMainBinding.rvGame.setVisibility(View.GONE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
|
||||
} else {
|
||||
if (!isShowChangeGame()) {
|
||||
SingleToastUtil.showToast("请关闭其他模式再切换游戏!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isGamePlaying()) {
|
||||
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!");
|
||||
} else {
|
||||
gameMainBinding.rvGame.setVisibility(View.VISIBLE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gameAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
if (AvRoomDataManager.get().isGamePlaying()) {
|
||||
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!");
|
||||
}
|
||||
if (!isShowChangeGame()) {
|
||||
SingleToastUtil.showToast("请关闭其他模式再切换游戏!");
|
||||
return;
|
||||
}
|
||||
|
||||
GameInfo gameInfo = gameAdapter.getItem(position);
|
||||
if (gameInfo != null) {
|
||||
int type;
|
||||
long mgId = 0;
|
||||
if (Objects.equals("扩列交友", gameInfo.getName())) {
|
||||
type = RoomInfo.ROOMTYPE_HOME_PARTY;
|
||||
} else {
|
||||
type = RoomInfo.ROOMTYPE_GAME;
|
||||
mgId = JavaUtil.str2long(gameInfo.getMgId());
|
||||
}
|
||||
gameMainBinding.rvGame.setVisibility(View.GONE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
|
||||
OpenRoomHelper.updateRoomInfo(
|
||||
getBaseActivity(),
|
||||
AvRoomDataManager.get().mCurrentRoomInfo,
|
||||
type,
|
||||
mgId,
|
||||
false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//这里的2和4是服务端定义的错误状态 关闭排麦模式和关闭PK模式!
|
||||
private boolean isShowChangeGame() {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
return currentRoomInfo != null &&
|
||||
AvRoomDataManager.get().isRoomOwner() &&
|
||||
currentRoomInfo.getIsPermitRoom() != 1 &&
|
||||
currentRoomInfo.getType() != RoomInfo.ROOM_TYPE_SINGLE &&
|
||||
(currentRoomInfo.getRoomModeType() == RoomModeType.NORMAL_MODE ||
|
||||
currentRoomInfo.getRoomModeType() == 2 ||
|
||||
currentRoomInfo.getRoomModeType() == 4);
|
||||
}
|
||||
|
||||
public void setRoomBg(RoomInfo roomInfo) {
|
||||
if (svgaRoomBg == null) return;
|
||||
updateView(roomInfo);
|
||||
AVRoomActivity.setBackBg(mContext, roomInfo, svgaRoomBg, bgPicture);
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
updateView(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(roomEvent -> {
|
||||
if (roomEvent == null) return;
|
||||
int event = roomEvent.getEvent();
|
||||
switch (event) {
|
||||
case RoomEvent.ENTER_ROOM:
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
updateOnlineNumberView(AvRoomDataManager.get().mCurrentRoomInfo.onlineNum);
|
||||
}
|
||||
addTipMsg();
|
||||
case RoomEvent.ROOM_INFO_UPDATE:
|
||||
setRoomBg(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
break;
|
||||
case RoomEvent.RECEIVE_NORMALE_GIFT:
|
||||
onReceiveGiftMsg(roomEvent.getGiftReceiveInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVE_MUTLT_NORMALEI_GIFT://普通多人
|
||||
onReceiveMultiGiftMsg(roomEvent.getGiftMultiReceiverInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVE_ALL_MIC__NORMALEI_GIFT://普通全麦
|
||||
onReceiveAllMicGiftMsg(roomEvent.getMultiGiftReceiveInfo());
|
||||
break;
|
||||
//福袋礼物
|
||||
case RoomEvent.RECEIVE_LUCKY_GIFT:
|
||||
case RoomEvent.RECEIVE_MULTI_LUCKY_GIFT:
|
||||
case RoomEvent.RECEIVE_ALL_MIC_LUCKY_GIFT:
|
||||
onReceiveLuckyGiftToMultiMsg(roomEvent.getLuckygiftMultiReceiverInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVED_SINGLE_MAGIC:
|
||||
onReceiveMagicMsg(roomEvent.getMagicReceivedInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVED_ALL_MIC_MAGIC:
|
||||
onReceiveMultiMagicMsg(roomEvent.getMultiMagicReceivedInfo());
|
||||
break;
|
||||
case RoomEvent.FANS_TEAM_JOIN:
|
||||
onReceiveFansTeamJoinMsg(roomEvent.getChatRoomMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void onReceiveLuckyGiftToMultiMsg(LuckyBagGifts giftMultiReceiverInfo) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveLuckyGiftToMultiMsg(giftMultiReceiverInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入房间时的提示信息
|
||||
*/
|
||||
private void addTipMsg() {
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null && AvRoomDataManager.get().mCurrentRoomInfo.isCloseScreen()) {
|
||||
MsgAttachment attachment = new RoomInfoAttachment(CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO,
|
||||
CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_SCREEN);
|
||||
ChatRoomMessage closeMsg = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
closeMsg.setContent("管理员已关闭聊天公屏");
|
||||
IMNetEaseManager.get().addCloseScreenMessages(closeMsg);
|
||||
} else if (AvRoomDataManager.get().mCurrentRoomInfo != null && !AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect()) {
|
||||
ChatRoomMessage tipMessage = ChatRoomMessageBuilder.createTipMessage("");
|
||||
tipMessage.setContent("礼物特效");
|
||||
IMNetEaseManager.get().addCloseScreenMessages(tipMessage);
|
||||
}
|
||||
}
|
||||
|
||||
private void setIdOnlineData() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
|
||||
UserModel.get().getUserInfo(roomInfo.getUid()).subscribe(new SingleObserver<UserInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mCompositeDisposable.add(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(UserInfo userInfo) {
|
||||
mUserInfo = userInfo;
|
||||
setRoomId(mUserInfo.getErbanNo(), roomInfo.onlineNum);
|
||||
mIvGoodNumber.setVisibility(mUserInfo.isHasPrettyErbanNo() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
setRoomId(0, roomInfo.onlineNum);
|
||||
mIvGoodNumber.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
gameMainBinding.setRoomInfo(roomInfo);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void updateView(RoomInfo currentRoomInfo) {
|
||||
if (currentRoomInfo != null) {
|
||||
|
||||
Fragment tempFragment = roomFragment;
|
||||
switch (currentRoomInfo.getType()) {
|
||||
case RoomInfo.ROOMTYPE_GAME:
|
||||
if (!(tempFragment instanceof GameRoomFragment)) {
|
||||
tempFragment = GameRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
case RoomInfo.ROOM_TYPE_SINGLE:
|
||||
if (!(tempFragment instanceof SingleRoomFragment)) {
|
||||
tempFragment = SingleRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (!(tempFragment instanceof HomePartyRoomFragment)) {
|
||||
tempFragment = HomePartyRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (tempFragment != roomFragment) {
|
||||
roomFragment = tempFragment;
|
||||
getChildFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.container, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
gameMainBinding.setRoomInfo(currentRoomInfo);
|
||||
updateHasAnimationEffect();
|
||||
roomTitle.setText(RegexUtil.getPrintableString(currentRoomInfo.getTitle()));
|
||||
if (!StringUtil.isEmpty(currentRoomInfo.getRoomPwd())) {
|
||||
roomTitle.setCompoundDrawablesWithIntrinsicBounds(null, null,
|
||||
getResources().getDrawable(R.drawable.icon_room_lock), null);
|
||||
} else {
|
||||
roomTitle.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
|
||||
}
|
||||
|
||||
|
||||
ivFollowRoom.setVisibility(AvRoomDataManager.get().isRoomOwner() ? View.GONE : View.VISIBLE);
|
||||
FOLLOW_ROOM_TYPE = AvRoomDataManager.get().isRoomFans ? "2" : "1";
|
||||
ivFollowRoom.setImageResource(AvRoomDataManager.get().isRoomFans ? R.drawable.icon_room_liked : R.drawable.icon_room_like);
|
||||
|
||||
setIdOnlineData();
|
||||
if (isShowChangeGame()) {
|
||||
initRvGame();
|
||||
gameMainBinding.llChangeGame.setVisibility(View.VISIBLE);
|
||||
if (AvRoomDataManager.get().isOpenGame()) {
|
||||
gameMainBinding.tvCurrGame.setText(currentRoomInfo.getMgName());
|
||||
} else {
|
||||
gameMainBinding.tvCurrGame.setText("扩列交友");
|
||||
}
|
||||
GameModel.INSTANCE.getGameList()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(gameInfos -> {
|
||||
if (AvRoomDataManager.get().isOpenGame()) {
|
||||
for (int i = 0; i < gameInfos.size(); i++) {
|
||||
GameInfo gameInfo = gameInfos.get(i);
|
||||
if (JavaUtil.str2long(gameInfo.getMgId()) == currentRoomInfo.getMgId()) {
|
||||
gameInfos.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
GameInfo gameInfo = new GameInfo();
|
||||
gameInfo.setName("扩列交友");
|
||||
gameInfos.add(gameInfo);
|
||||
}
|
||||
gameAdapter.setNewData(gameInfos);
|
||||
});
|
||||
} else {
|
||||
gameMainBinding.llChangeGame.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateHasAnimationEffect() {
|
||||
if (!AvRoomDataManager.get().haveSelfChange && AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect = AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect();
|
||||
}
|
||||
gameMainBinding.setHasAnimationEffect(AvRoomDataManager.get().mIsNeedGiftEffect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新特效开关提示
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void updateHasAnimation(HasAnimationEffect event) {
|
||||
updateHasAnimationEffect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.room_more:
|
||||
ExitRoomPopupWindow.newInstance((AVRoomActivity) requireActivity())
|
||||
.showAtLocation(gameMainBinding.getRoot(), Gravity.END, 0, 0);
|
||||
break;
|
||||
case R.id.ll_room_info:
|
||||
RoomOnlineUserActivity.start(getActivity());
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_ONLINE_LIST_CLICK, "房间在线列表点击");
|
||||
break;
|
||||
case R.id.iv_follow_room:
|
||||
followRoom();
|
||||
break;
|
||||
case R.id.iv_back:
|
||||
if (getActivity() instanceof AVRoomActivity) {
|
||||
((AVRoomActivity) getActivity()).onBackPressed();
|
||||
}
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_RETURN_CLICK, "房间返回按钮点击");
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public void dismissSendRedPackageDialog() {
|
||||
if (roomFragment instanceof BaseRoomFragment) {
|
||||
((BaseRoomFragment) roomFragment).clearDialog();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏房间
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void followRoom() {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoomInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, String> arguments = new HashMap<>();
|
||||
arguments.put("room_id", String.valueOf(mUserInfo == null ? currentRoomInfo.getUid() : mUserInfo.getErbanNo()));
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_COLLECT_ICON_CLICK, "语音房_收藏顶部按钮", arguments);
|
||||
|
||||
CollectionRoomModel.get().followRoom(FOLLOW_ROOM_TYPE, currentRoomInfo.getUid())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doOnError(throwable -> {
|
||||
toast(throwable.getMessage());
|
||||
})
|
||||
.subscribe(s -> {
|
||||
AvRoomDataManager.get().isRoomFans = !AvRoomDataManager.get().isRoomFans;
|
||||
FOLLOW_ROOM_TYPE = AvRoomDataManager.get().isRoomFans ? "2" : "1";
|
||||
ivFollowRoom.setImageResource(AvRoomDataManager.get().isRoomFans ? R.drawable.icon_room_liked : R.drawable.icon_room_like);
|
||||
if (AvRoomDataManager.get().isRoomFans) {
|
||||
SingleToastUtil.showToast("收藏成功!");
|
||||
PraiseModel.get().setFollowRoomSuccessRoomTip(currentRoomInfo.getUid());
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_FOLLOW_BUTTON_CLICK, "语音房_收藏顶部按钮");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onFollowRoomEvent(FollowRoomEvent event) {
|
||||
ivFollowRoom.setImageResource(AvRoomDataManager.get().isRoomFans ? R.drawable.icon_room_liked : R.drawable.icon_room_like);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onShareRoomEvent(ShareRoomEvent event) {
|
||||
shareRoom();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享房间
|
||||
*/
|
||||
public void shareRoom() {
|
||||
if (shareDialog != null && shareDialog.isShowing()) {
|
||||
shareDialog.dismiss();
|
||||
}
|
||||
shareDialog = new ShareDialog(getActivity());
|
||||
shareDialog.setOnShareDialogItemClick(this);
|
||||
shareDialog.show();
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_SHARE_CLICK, "语音房_分享");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInAppSharingItemClick() {
|
||||
shareDialog.dismiss();
|
||||
SelectFriendActivity.startForSharingRoom(getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharePlatformClick(Platform platform) {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoomInfo != null) {
|
||||
UserModel.get().getUserInfo(currentRoomInfo.getUid())
|
||||
.flatMap(userInfo -> ShareModel.get().shareRoom(
|
||||
platform,
|
||||
currentRoomInfo.getUid(),
|
||||
userInfo.getErbanNo(),
|
||||
currentRoomInfo.getTitle(),
|
||||
currentRoomInfo.getAvatar()
|
||||
))
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doAfterTerminate(new Action() {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
getDialogManager().dismissDialog();
|
||||
}
|
||||
})
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
toast(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
toast(e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (giftView != null) {
|
||||
giftView.release();
|
||||
}
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
roomFragment.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
public void onRoomOnlineNumberSuccess(int onlineNumber) {
|
||||
updateOnlineNumberView(onlineNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通多人
|
||||
*
|
||||
* @param giftMultiReceiverInfo
|
||||
*/
|
||||
private void onReceiveMultiGiftMsg(GiftMultiReceiverInfo giftMultiReceiverInfo) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveGiftToMultiMsg(giftMultiReceiverInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通全麦
|
||||
*
|
||||
* @param multiGiftReceiveInfo
|
||||
*/
|
||||
private void onReceiveAllMicGiftMsg(MultiGiftReceiveInfo multiGiftReceiveInfo) {
|
||||
if (multiGiftReceiveInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMultiGiftMsg(multiGiftReceiveInfo);
|
||||
}
|
||||
|
||||
private void onReceiveGiftMsg(GiftReceiveInfo giftReceiveInfo) {
|
||||
if (giftReceiveInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveGiftMsg(giftReceiveInfo);
|
||||
}
|
||||
|
||||
private void onReceiveMagicMsg(MagicReceivedInfo magicReceivedInfo) {
|
||||
if (magicReceivedInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMagicMsg(magicReceivedInfo);
|
||||
}
|
||||
|
||||
|
||||
private void onReceiveMultiMagicMsg(MultiMagicReceivedInfo multiMagicReceivedInfo) {
|
||||
if (multiMagicReceivedInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMultiMagicMsg(multiMagicReceivedInfo);
|
||||
}
|
||||
|
||||
private void onReceiveFansTeamJoinMsg(ChatRoomMessage message) {
|
||||
if (message == null || !isResumed())
|
||||
return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveFansTeamOpenMsg(message);
|
||||
}
|
||||
|
||||
private void updateOnlineNumberView(int onlineNumber) {
|
||||
if (!SuperAdminUtil.isSuperAdmin()) {
|
||||
if (onlineNumber < 1) {
|
||||
onlineNumber = 1;
|
||||
}
|
||||
}
|
||||
gameMainBinding.roomNums.setText("在线" + onlineNumber);
|
||||
}
|
||||
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
public interface IRoomRankDialogChangePageListener {
|
||||
void onChangePage(int pos);
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
public interface IRoomRankDialogDismissListener {
|
||||
void onDismiss();
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import com.mango.core.room.bean.RoomRankHalfHourMeInfo;
|
||||
import com.mango.core.room.bean.RoomRankHalfHourRankInfo;
|
||||
import com.mango.core.room.bean.RoomRankMultiItem;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IRoomRankHalfHourView extends IMvpBaseView {
|
||||
void showMeInfo(RoomRankHalfHourMeInfo dataInfo/*, int progress, String onListTip*/);
|
||||
|
||||
void showTop3Info(List<RoomRankHalfHourRankInfo> dataInfoList);
|
||||
|
||||
void showRankListInfo(List<RoomRankMultiItem> dataList);
|
||||
|
||||
void loadDataFailure();
|
||||
}
|
@@ -1,41 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.mango.moshen.avroom.widget.RankNavigatorAdapter;
|
||||
import com.mango.moshen.base.BaseBindingFragment;
|
||||
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.mango.core.room.bean.RoomContributeDataInfo;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.mango.moshen.databinding.FragmentRoomCharmListBinding;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ActLayoutRes(R.layout.fragment_room_charm_list)
|
||||
public class RoomCharmListFragment extends BaseBindingFragment<FragmentRoomCharmListBinding> {
|
||||
|
||||
public static RoomCharmListFragment newInstance() {
|
||||
return new RoomCharmListFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
ArrayList<Fragment> fragments = new ArrayList<>(2);
|
||||
fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING));
|
||||
fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING));
|
||||
mBinding.vpCharmRankings.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), fragments));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(false);
|
||||
|
||||
RankNavigatorAdapter indicator = new RankNavigatorAdapter(false);
|
||||
indicator.setOnItemSelectListener(position -> mBinding.vpCharmRankings.setCurrentItem(position));
|
||||
commonNavigator.setAdapter(indicator);
|
||||
mBinding.viewIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(mBinding.viewIndicator, mBinding.vpCharmRankings);
|
||||
}
|
||||
|
||||
}
|
@@ -1,61 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.mango.moshen.avroom.widget.RankNavigatorAdapter;
|
||||
import com.mango.moshen.base.BaseMvpFragment;
|
||||
import com.mango.moshen.ui.widget.magicindicator.MagicIndicator;
|
||||
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.room.bean.RoomContributeDataInfo;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by MadisonRong on 25/04/2018.
|
||||
*/
|
||||
public class RoomContributeListFragment extends BaseMvpFragment implements IMvpBaseView {
|
||||
|
||||
private ViewPager viewPager;
|
||||
private MagicIndicator viewIndicator;
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
viewIndicator = mView.findViewById(R.id.view_indicator);
|
||||
viewPager = mView.findViewById(R.id.vp_contribute_rankings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
ArrayList<Fragment> fragments = new ArrayList<>(2);
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING));
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING));
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_MONTH_RANKING));
|
||||
}
|
||||
viewPager.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), fragments));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(false);
|
||||
RankNavigatorAdapter indicator = new RankNavigatorAdapter(AvRoomDataManager.get().isDatingMode());
|
||||
indicator.setOnItemSelectListener(position -> viewPager.setCurrentItem(position));
|
||||
commonNavigator.setAdapter(indicator);
|
||||
viewIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(viewIndicator, viewPager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_room_contribute;
|
||||
}
|
||||
|
||||
}
|
@@ -1,99 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.appcompat.app.AppCompatDialogFragment;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.adapter.RoomRankFragmentPageAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RoomRankDialogFragment extends AppCompatDialogFragment implements IRoomRankDialogDismissListener, IRoomRankDialogChangePageListener {
|
||||
|
||||
private ViewPager mViewPager;
|
||||
|
||||
|
||||
public static RoomRankDialogFragment newInstance() {
|
||||
Bundle args = new Bundle();
|
||||
RoomRankDialogFragment fragment = new RoomRankDialogFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
if (getActivity() != null) {
|
||||
Dialog dialog = new Dialog(getActivity(), R.style.room_rank_dialog);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(R.layout.dialog_fragment_room_rank);
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
|
||||
// 设置弹出框布局参数,宽度铺满全屏,底部。
|
||||
Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.BOTTOM;
|
||||
wlp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
window.setDimAmount(0.3f);
|
||||
window.setAttributes(wlp);
|
||||
window.setBackgroundDrawableResource(R.drawable.bg_room_rank);
|
||||
return dialog;
|
||||
} else {
|
||||
return super.onCreateDialog(savedInstanceState);
|
||||
}
|
||||
} else {
|
||||
return super.onCreateDialog(savedInstanceState);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.dialog_fragment_room_rank, container, false);
|
||||
mViewPager = view.findViewById(R.id.vp_room_rank);
|
||||
List<Fragment> fragmentList = new ArrayList<>();
|
||||
if (getChildFragmentManager().getFragments() != null && getChildFragmentManager().getFragments().size() != 0) {
|
||||
fragmentList = getChildFragmentManager().getFragments();
|
||||
} else {
|
||||
RoomRankListFragment roomInsideFragment = RoomRankListFragment.newInstance();
|
||||
roomInsideFragment.setDismissListener(this);
|
||||
roomInsideFragment.setChangePageListener(this);
|
||||
fragmentList.add(roomInsideFragment);
|
||||
}
|
||||
mViewPager.setAdapter(new RoomRankFragmentPageAdapter(getChildFragmentManager(), fragmentList));
|
||||
mViewPager.setOffscreenPageLimit(fragmentList.size());
|
||||
mViewPager.setCurrentItem(0, false);
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setCancelable(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangePage(int pos) {
|
||||
mViewPager.setCurrentItem(pos, false);
|
||||
}
|
||||
}
|
@@ -1,64 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class RoomRankDialogUtils {
|
||||
public static String getRoomRankValueText(int value) {
|
||||
if (value >= 10000) {
|
||||
BigDecimal bigDecimal = new BigDecimal(value / 10000.0);
|
||||
double doubleValue = bigDecimal.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
return String.valueOf(doubleValue) + "万";
|
||||
} else {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getNumberImage(int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return R.drawable.ic_rank_1;
|
||||
case 2:
|
||||
return R.drawable.ic_rank_2;
|
||||
case 3:
|
||||
return R.drawable.ic_rank_3;
|
||||
case 4:
|
||||
return R.drawable.ic_rank_4;
|
||||
case 5:
|
||||
return R.drawable.ic_rank_5;
|
||||
case 6:
|
||||
return R.drawable.ic_rank_6;
|
||||
case 7:
|
||||
return R.drawable.ic_rank_7;
|
||||
case 8:
|
||||
return R.drawable.ic_rank_8;
|
||||
case 9:
|
||||
return R.drawable.ic_rank_9;
|
||||
case 10:
|
||||
return R.drawable.ic_rank_10;
|
||||
case 11:
|
||||
return R.drawable.ic_rank_11;
|
||||
case 12:
|
||||
return R.drawable.ic_rank_12;
|
||||
case 13:
|
||||
return R.drawable.ic_rank_13;
|
||||
case 14:
|
||||
return R.drawable.ic_rank_14;
|
||||
case 15:
|
||||
return R.drawable.ic_rank_15;
|
||||
case 16:
|
||||
return R.drawable.ic_rank_16;
|
||||
case 17:
|
||||
return R.drawable.ic_rank_17;
|
||||
case 18:
|
||||
return R.drawable.ic_rank_18;
|
||||
case 19:
|
||||
return R.drawable.ic_rank_19;
|
||||
case 20:
|
||||
return R.drawable.ic_rank_20;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,79 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.View;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.mango.moshen.avroom.widget.RoomRankNavigatorAdapter;
|
||||
import com.mango.moshen.base.BaseBindingFragment;
|
||||
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.mango.moshen.databinding.FragmentRoomRankListBinding;
|
||||
|
||||
@ActLayoutRes(R.layout.fragment_room_rank_list)
|
||||
public class RoomRankListFragment extends BaseBindingFragment<FragmentRoomRankListBinding> implements View.OnClickListener, IRoomRankDialogDismissListener{
|
||||
|
||||
public static RoomRankListFragment newInstance() {
|
||||
return new RoomRankListFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
mBinding.setClick(this);
|
||||
List<Fragment> list = new ArrayList<>(2);
|
||||
list.add(new RoomContributeListFragment());
|
||||
list.add(RoomCharmListFragment.newInstance());
|
||||
mBinding.viewPager.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), list));
|
||||
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(true);
|
||||
|
||||
RoomRankNavigatorAdapter indicator = new RoomRankNavigatorAdapter();
|
||||
indicator.setOnItemSelectListener(position -> mBinding.viewPager.setCurrentItem(position));
|
||||
commonNavigator.setAdapter(indicator);
|
||||
mBinding.miRoomRank.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(mBinding.miRoomRank, mBinding.viewPager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.tv_room_rank_half_hour_tab:
|
||||
goToChangePage(0);
|
||||
break;
|
||||
|
||||
case R.id.tv_room_rank_in_room_tab:
|
||||
goToChangePage(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private IRoomRankDialogDismissListener dismissListener;
|
||||
private IRoomRankDialogChangePageListener changePageListener;
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
if (dismissListener != null) {
|
||||
dismissListener.onDismiss();
|
||||
}
|
||||
}
|
||||
public void setDismissListener(IRoomRankDialogDismissListener dismissListener) {
|
||||
this.dismissListener = dismissListener;
|
||||
}
|
||||
/**
|
||||
* 修改最外层Dialog的显示页面
|
||||
*/
|
||||
private void goToChangePage(int pos) {
|
||||
if (changePageListener != null) {
|
||||
changePageListener.onChangePage(pos);
|
||||
}
|
||||
}
|
||||
|
||||
public void setChangePageListener(IRoomRankDialogChangePageListener changePageListener) {
|
||||
this.changePageListener = changePageListener;
|
||||
}
|
||||
}
|
@@ -1,338 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.isGone
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.viewModels
|
||||
import com.mango.core.UriProvider
|
||||
import com.mango.core.auth.AuthModel
|
||||
import com.mango.core.fansteam.FansTeamInitInfo
|
||||
import com.mango.core.home.bean.BannerInfo
|
||||
import com.mango.core.im.custom.bean.FansTeamMsgAttachment
|
||||
import com.mango.core.im.custom.bean.RequestUpmicAttachment
|
||||
import com.mango.core.im.custom.bean.RoomPKAttachment
|
||||
import com.mango.core.manager.AvRoomDataManager
|
||||
import com.mango.core.manager.RoomEvent
|
||||
import com.mango.core.pay.event.FirstChargeEvent
|
||||
import com.mango.core.room.anotherroompk.ShowPkMatchEvent
|
||||
import com.mango.core.room.anotherroompk.SingleRoomPKModel
|
||||
import com.mango.core.statistic.StatisticManager
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||
import com.mango.core.user.UserModel
|
||||
import com.mango.core.user.bean.UserInfo
|
||||
import com.mango.core.utils.CurrentTimeUtils
|
||||
import com.mango.core.utils.toast
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.avroom.adapter.OnMicroItemClickListener
|
||||
import com.mango.moshen.avroom.adapter.SingleAnchorMicroViewAdapter
|
||||
import com.mango.moshen.avroom.adapter.SingleRoomPKMicroViewAdapter
|
||||
import com.mango.moshen.avroom.dialog.RequestUpMicDialog
|
||||
import com.mango.moshen.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.mango.moshen.avroom.presenter.SingleRoomPresenter
|
||||
import com.mango.moshen.avroom.singleroompk.SingleRoomPkFinishDialog
|
||||
import com.mango.moshen.avroom.singleroompk.SingleRoomPkForceFinishDialog
|
||||
import com.mango.moshen.avroom.singleroompk.SingleRoomPkReceivedDialog
|
||||
import com.mango.moshen.avroom.view.ISingleRoomView
|
||||
import com.mango.moshen.databinding.FragmentSingleRoomBinding
|
||||
import com.mango.moshen.fansteam.FansTeamJoinActivity
|
||||
import com.mango.moshen.fansteam.FansTeamJoinedActivity
|
||||
import com.mango.moshen.fansteam.FansTeamViewModel
|
||||
import com.mango.moshen.ui.webview.CommonWebViewActivity
|
||||
import com.mango.moshen.ui.webview.DialogWebViewActivity
|
||||
import com.mango.xchat_android_library.base.factory.CreatePresenter
|
||||
import com.mango.xchat_android_library.utils.TimeUtils
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.math.max
|
||||
|
||||
/**
|
||||
* 个播房间
|
||||
*
|
||||
* @author chenran
|
||||
* @date 2017/7/26
|
||||
*/
|
||||
@CreatePresenter(SingleRoomPresenter::class)
|
||||
class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresenter?>(),
|
||||
ISingleRoomView, OnMicroItemClickListener {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun newInstance(): SingleRoomFragment {
|
||||
val roomFragment = SingleRoomFragment()
|
||||
val bundle = Bundle()
|
||||
roomFragment.arguments = bundle
|
||||
return roomFragment
|
||||
}
|
||||
}
|
||||
|
||||
private lateinit var gameBinding: FragmentSingleRoomBinding
|
||||
private lateinit var upMicDialog: RequestUpMicDialog
|
||||
private var pkMatchDisposable: Disposable? = null
|
||||
|
||||
private val fansTeamViewModel: FansTeamViewModel by viewModels()
|
||||
override fun getRootLayoutId(): Int {
|
||||
return R.layout.fragment_single_room
|
||||
}
|
||||
|
||||
override fun onFindViews() {
|
||||
super.onFindViews()
|
||||
gameBinding = DataBindingUtil.bind(mView)!!
|
||||
gameBinding.lifecycleOwner = this
|
||||
gameBinding.click = this
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun initiate() {
|
||||
super.initiate()
|
||||
mvpPresenter?.getBannerList()
|
||||
initSpeedyMessage(gameBinding.flSpeedyMessage)
|
||||
UserModel.get().currentUserInfo
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe { userInfo ->
|
||||
gameBinding.ivFirstChargeEnter.isVisible = userInfo.isFirstCharge
|
||||
if (userInfo.isFirstCharge) {
|
||||
StatisticManager.Instance()
|
||||
.onEvent(
|
||||
StatisticsProtocol.EVENT_ROOM_POP_SHOW,
|
||||
"房间pop曝光",
|
||||
mapOf("name" to "新人充值")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
|
||||
fansTeamViewModel.fansTeamInitInfoLiveData.observe(viewLifecycleOwner) {
|
||||
it?.let {
|
||||
updateFansTeamInfo(it)
|
||||
}
|
||||
}
|
||||
|
||||
initRoomPkOrder(AvRoomDataManager.get().pkMatchStartTime)
|
||||
gameBinding.llRoomPkOrder.setOnClickListener {
|
||||
dialogManager.showOkCancelDialog("是否取消PK匹配?") {
|
||||
SingleRoomPKModel.cancelSingleRoomPkMatch()
|
||||
.doOnSuccess {
|
||||
initRoomPkOrder(0L)
|
||||
AvRoomDataManager.get().pkMatchStartTime = 0
|
||||
"取消PK匹配成功!".toast()
|
||||
}
|
||||
.doOnError { it.message.toast() }
|
||||
.subscribe()
|
||||
}
|
||||
}
|
||||
|
||||
gameBinding.tvHourRank.setOnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
UriProvider.getSingleRoomHourRankUrl(AvRoomDataManager.get().roomUid)
|
||||
)
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_RANKLIST_CLICK, "房间小时榜点击")
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateFansTeamInfo(initInfo: FansTeamInitInfo) {
|
||||
var clickListener: View.OnClickListener? = null
|
||||
gameBinding.flFansTeam.isGone =
|
||||
!AvRoomDataManager.get().isRoomOwner && !initInfo.hasFansTeamCurrentRoom
|
||||
if (initInfo.hasFansTeamCurrentRoom) {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.tvFansTeamOpt.text = "粉丝团(${initInfo.anchorFansNum})"
|
||||
clickListener = View.OnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
requireContext(),
|
||||
UriProvider.getFansTeamMyFansUrl(AvRoomDataManager.get().roomUid)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (initInfo.isAnchorFans) {
|
||||
gameBinding.tvFansTeamOpt.text =
|
||||
"粉丝LV.${if (initInfo.fansLevelSeq == 0) 1 else initInfo.fansLevelSeq}"
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinedActivity.start(requireContext())
|
||||
}
|
||||
} else {
|
||||
gameBinding.tvFansTeamOpt.text = "加入粉丝团"
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinActivity.start(requireContext())
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.tvFansTeamOpt.text = "开通粉丝团"
|
||||
clickListener = View.OnClickListener {
|
||||
CommonWebViewActivity.start(
|
||||
requireContext(),
|
||||
UriProvider.getFansTeamOpenUrl(AvRoomDataManager.get().roomUid)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
gameBinding.tvFansTeamOpt.text = "该主播暂未开通粉丝团"
|
||||
}
|
||||
}
|
||||
gameBinding.flFansTeam.setOnClickListener(clickListener)
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun onReceiveRoomEvent(roomEvent: RoomEvent?) {
|
||||
super.onReceiveRoomEvent(roomEvent)
|
||||
if (roomEvent == null) return
|
||||
when (roomEvent.event) {
|
||||
RoomEvent.ENTER_ROOM -> {
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
initRoomPkOrder(AvRoomDataManager.get().pkMatchStartTime)
|
||||
}
|
||||
RoomEvent.REQUEST_UP_MIC -> {
|
||||
(roomEvent.chatRoomMessage?.attachment as? RequestUpmicAttachment)?.userInfo?.let {
|
||||
showInviteDialog(it)
|
||||
}
|
||||
}
|
||||
RoomEvent.FANS_TEAM_OPEN_SUCCESS,
|
||||
RoomEvent.FANS_TEAM_OPEN_FAILED,
|
||||
RoomEvent.FANS_TEAM_JOIN,
|
||||
RoomEvent.FANS_TEAM_EXIT -> {
|
||||
(roomEvent.chatRoomMessage?.attachment as? FansTeamMsgAttachment)?.fansTeamMsgInfo?.let {
|
||||
val currFansTeamInitInfo = fansTeamViewModel.fansTeamInitInfoLiveData.value
|
||||
updateFansTeamInfo(
|
||||
FansTeamInitInfo(
|
||||
it.count,
|
||||
currFansTeamInitInfo?.fansLevelSeq ?: 1,
|
||||
roomEvent.event != RoomEvent.FANS_TEAM_OPEN_FAILED,
|
||||
if (AuthModel.get().currentUid == it.uid) {
|
||||
roomEvent.event == RoomEvent.FANS_TEAM_JOIN
|
||||
} else {
|
||||
currFansTeamInitInfo?.isAnchorFans ?: false
|
||||
},
|
||||
AvRoomDataManager.get().isRoomOwner,
|
||||
roomEvent.event == RoomEvent.FANS_TEAM_OPEN_FAILED
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
RoomEvent.ROOM_PK_INVITE ->
|
||||
SingleRoomPkReceivedDialog.newInstance((roomEvent.chatRoomMessage.attachment as RoomPKAttachment).roomPkBean)
|
||||
.show(mContext)
|
||||
RoomEvent.ROOM_PK_FINISH -> {
|
||||
val roomPkBean =
|
||||
(roomEvent.chatRoomMessage.attachment as RoomPKAttachment).roomPkBean
|
||||
if (roomPkBean.isForce) {
|
||||
SingleRoomPkForceFinishDialog.newInstance(roomPkBean).show(mContext)
|
||||
} else {
|
||||
SingleRoomPkFinishDialog.newInstance(roomPkBean).show(mContext)
|
||||
}
|
||||
gameBinding.microView.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
RoomEvent.ROOM_PK_TIMEOUT -> {
|
||||
dialogManager.showOkCancelDialog("暂未匹配到合适的PK对象是否继续?") {
|
||||
SingleRoomPKModel.initSingleRoomPkMatch()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
AvRoomDataManager.get().pkMatchStartTime = it.toLong()
|
||||
initRoomPkOrder(it.toLong())
|
||||
}, {
|
||||
it.message.toast()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//显示请求上麦弹窗
|
||||
private fun showInviteDialog(userInfo: UserInfo) {
|
||||
if (!this::upMicDialog.isInitialized) {
|
||||
upMicDialog = RequestUpMicDialog(requireContext())
|
||||
}
|
||||
if (!upMicDialog.isShowing) {
|
||||
upMicDialog.openDialog()
|
||||
upMicDialog.setUser(userInfo)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSetListener() {
|
||||
super.onSetListener()
|
||||
bottomView.setBottomViewListener(BaseRoomBottomViewWrapper())
|
||||
}
|
||||
|
||||
override fun updateView() {
|
||||
super.updateView()
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode && gameBinding.microView.adapter !is SingleRoomPKMicroViewAdapter) {
|
||||
gameBinding.microView.bindAdapter(SingleRoomPKMicroViewAdapter(context))
|
||||
gameBinding.viewPkBoard.isVisible = true
|
||||
gameBinding.microView.updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||
topMargin = ScreenUtil.dip2px(140f)
|
||||
}
|
||||
} else if (!AvRoomDataManager.get().isOpenAnotherPKMode && gameBinding.microView.adapter !is SingleAnchorMicroViewAdapter) {
|
||||
gameBinding.microView.bindAdapter(SingleAnchorMicroViewAdapter(context))
|
||||
gameBinding.viewPkBoard.isVisible = false
|
||||
gameBinding.microView.updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||
topMargin = ScreenUtil.dip2px(110f)
|
||||
}
|
||||
} else {
|
||||
gameBinding.microView.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initRoomPkOrder(pkMatchStartTime: Long) {
|
||||
if (!AvRoomDataManager.get().isRoomOwner) return
|
||||
pkMatchDisposable?.dispose()
|
||||
if (pkMatchStartTime > 0L) {
|
||||
val residueSeconds = max((CurrentTimeUtils.getCurrentTime() - pkMatchStartTime) / 1000,0)
|
||||
gameBinding.llRoomPkOrder.visibility = View.VISIBLE
|
||||
pkMatchDisposable =
|
||||
Observable.intervalRange(
|
||||
residueSeconds,
|
||||
Int.MAX_VALUE.toLong(),
|
||||
0,
|
||||
1,
|
||||
TimeUnit.SECONDS
|
||||
)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe { aLong: Long ->
|
||||
gameBinding.tvRoomPkOrderTime.text = TimeUtils.ms2MS(
|
||||
aLong * 1000,
|
||||
true
|
||||
)
|
||||
}
|
||||
} else {
|
||||
gameBinding.llRoomPkOrder.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onShowBanner(dialogInfos: List<BannerInfo>) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfos, 10f)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFirstRechargeEvent(event: FirstChargeEvent) {
|
||||
gameBinding.ivFirstChargeEnter.visibility = View.GONE
|
||||
FirstChargePrizeDialog(
|
||||
requireContext(),
|
||||
event.chargeProdTitle,
|
||||
event.firstChargeRewardList
|
||||
).openDialog()
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onShowPkMatchEvent(event: ShowPkMatchEvent) {
|
||||
initRoomPkOrder(event.pkMatchStartTime)
|
||||
}
|
||||
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
Copyright © Sud.Tech
|
||||
https://sud.tech
|
||||
*/
|
||||
package com.mango.moshen.avroom.game;
|
||||
|
||||
import com.mango.moshen.BuildConfig;
|
||||
|
||||
public class AppConfig {
|
||||
|
||||
protected static final String APP_ID = "1467745235064848385";
|
||||
protected static final String APP_KEY = "BvjLDpWol7OihaYeFebuepx1bZu6cxU5";
|
||||
protected static boolean isTestEnv = BuildConfig.DEBUG;
|
||||
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
package com.mango.moshen.avroom.helper;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 房间数据的一些管理
|
||||
* Created by lvzebiao on 2018/11/16.
|
||||
*/
|
||||
|
||||
public class RoomViewModel extends ViewModel {
|
||||
|
||||
@Getter
|
||||
private final MutableLiveData<Boolean> isKtvModel = new MutableLiveData<>();
|
||||
|
||||
@Getter
|
||||
private final MutableLiveData<Boolean> isGameModel = new MutableLiveData<>();
|
||||
|
||||
public void init() {
|
||||
isKtvModel.setValue(false);
|
||||
isGameModel.postValue(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCleared() {
|
||||
super.onCleared();
|
||||
}
|
||||
}
|
@@ -1,241 +0,0 @@
|
||||
package com.mango.moshen.avroom.newuserchargegift
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.netease.nim.uikit.common.util.sys.TimeUtil
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.avroom.firstcharge.SelectPayTypeDialog
|
||||
import com.mango.moshen.bank_card.activity.AddBankCardAgreementActivity
|
||||
import com.mango.moshen.base.BaseViewBindingActivity
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager.AbsOkDialogListener
|
||||
import com.mango.moshen.databinding.DialogNewUserChargeGiftBinding
|
||||
import com.mango.moshen.ui.setting.ModifyPwdActivity
|
||||
import com.mango.moshen.ui.utils.RVDelegate
|
||||
import com.mango.moshen.ui.webview.CommonWebViewActivity
|
||||
import com.mango.core.UriProvider
|
||||
import com.mango.core.auth.AuthModel
|
||||
import com.mango.core.pay.PayModel
|
||||
import com.mango.core.pay.PaymentActivity
|
||||
import com.mango.core.pay.bean.FirstChargeGoods
|
||||
import com.mango.core.pay.bean.FirstChargeReward
|
||||
import com.mango.core.pay.bean.PaymentResult
|
||||
import com.mango.core.pay.event.NewUserChargeEvent
|
||||
import com.mango.core.pay.model.unionpay.UnionPayModel
|
||||
import com.mango.core.statistic.StatisticManager
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||
import com.mango.core.user.UserModel
|
||||
import com.mango.core.utils.CurrentTimeUtils
|
||||
import com.mango.core.utils.toast
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.mango.xchat_android_library.utils.JavaUtil
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_new_user_charge_gift)
|
||||
class NewUserChargeGiftDialog : BaseViewBindingActivity<DialogNewUserChargeGiftBinding>() {
|
||||
|
||||
private var goodsList: List<FirstChargeGoods>? = null
|
||||
private var currGoods: FirstChargeGoods? = null
|
||||
private lateinit var rewardAdapter: RewardAdapter
|
||||
private lateinit var rvDelegate: RVDelegate<FirstChargeReward>
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, NewUserChargeGiftDialog::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
|
||||
private const val BIND_CODE_GOLD = 200
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
//这里的height用MATCH_PARENT状态栏会被顶上去,不知道什么鬼
|
||||
val height = ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(context)
|
||||
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, height)
|
||||
window.setGravity(Gravity.CENTER)
|
||||
EventBus.getDefault().register(this)
|
||||
binding.rgPlan.setOnCheckedChangeListener { group, checkedId ->
|
||||
updateCurrGoods(goodsList?.getOrNull(group.indexOfChild(group.findViewById(checkedId))))
|
||||
}
|
||||
|
||||
binding.tvCharge.setOnClickListener {
|
||||
currGoods?.let {
|
||||
SelectPayTypeDialog.newInstance(it.chargeProdId, "¥${it.chargeMoney}")
|
||||
.show(this)
|
||||
StatisticManager.Instance()
|
||||
.onEvent(
|
||||
StatisticsProtocol.EVENT_NUGIFT_POP_CLICK,
|
||||
"新人专享礼物弹窗充值点击",
|
||||
mapOf("charge_money" to "${it.chargeMoney}元")
|
||||
)
|
||||
} ?: run {
|
||||
"请选择充值产品!".toast()
|
||||
}
|
||||
}
|
||||
|
||||
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||
.setAdapter(RewardAdapter().also { rewardAdapter = it })
|
||||
.setLayoutManager(LinearLayoutManager(this, RecyclerView.HORIZONTAL, false))
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.build()
|
||||
|
||||
dialogManager.showProgressDialog(this)
|
||||
PayModel.get().newUserChargeInfo
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
initData(it.limitFirstChargeTaskList)
|
||||
initNewUserCharge(it.limitEndTime)
|
||||
dialogManager.dismissDialog()
|
||||
}, {
|
||||
it.printStackTrace()
|
||||
dialogManager.dismissDialog()
|
||||
SingleToastUtil.showToast(it.message)
|
||||
finish()
|
||||
})
|
||||
|
||||
binding.viewBg.setOnClickListener {
|
||||
//do nothing
|
||||
}
|
||||
val closeClick = View.OnClickListener {
|
||||
finish()
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_NUGIFT_POP_CLOSE_CLICK, "新人专享礼物弹窗关闭点击")
|
||||
}
|
||||
binding.root.setOnClickListener(closeClick)
|
||||
binding.ivClose.setOnClickListener(closeClick)
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initData(goodsList: List<FirstChargeGoods>) {
|
||||
this.goodsList = goodsList
|
||||
updateCurrGoods(goodsList.getOrNull(0))
|
||||
val planViews = arrayListOf(
|
||||
binding.rbPlanA,
|
||||
binding.rbPlanB,
|
||||
binding.rbPlanC,
|
||||
binding.rbPlanD
|
||||
)
|
||||
var initChecked = false
|
||||
planViews.forEachIndexed { index, button ->
|
||||
goodsList.getOrNull(index)?.let {
|
||||
if (!it.isFinishCharge && !initChecked) {
|
||||
initChecked = true
|
||||
button.isChecked = true
|
||||
}
|
||||
button.isVisible = true
|
||||
button.text = "${it.chargeMoney}元"
|
||||
} ?: run {
|
||||
button.isVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult", "SetTextI18n")
|
||||
private fun initNewUserCharge(limitChargeEndTime: Long) {
|
||||
val count = (limitChargeEndTime - CurrentTimeUtils.getCurrentTime()) / 1000 / 60 + 1
|
||||
if (count <= 0) return
|
||||
Observable.intervalRange(0, count, 0, 1, TimeUnit.MINUTES)
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnComplete {
|
||||
finish()
|
||||
}
|
||||
.subscribe({
|
||||
val residueTime =
|
||||
limitChargeEndTime - CurrentTimeUtils.getCurrentTime()
|
||||
if (residueTime <= 0) {
|
||||
UserModel.get().cacheLoginUserInfo?.isShowLimitCharge = false
|
||||
finish()
|
||||
} else {
|
||||
binding.tvTime.text =
|
||||
"限时${TimeUtil.getElapseTimeForNewUserCharge(residueTime)}"
|
||||
}
|
||||
}, {
|
||||
it.printStackTrace()
|
||||
})
|
||||
}
|
||||
|
||||
private fun updateCurrGoods(firstChargeGoods: FirstChargeGoods?) {
|
||||
firstChargeGoods?.let {
|
||||
currGoods = it
|
||||
binding.tvTitle.text = it.chargeProdTitle
|
||||
binding.tvCharge.isEnabled = !it.isFinishCharge
|
||||
rewardAdapter.setNewData(it.firstChargeRewardList)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
dialogManager.dismissDialog()
|
||||
if (resultCode != RESULT_OK) {
|
||||
return
|
||||
}
|
||||
//支付页面返回处理
|
||||
if (requestCode == PaymentActivity.REQUEST_CODE_PAY) {
|
||||
if (data != null && data.extras != null) {
|
||||
val paymentResult: PaymentResult? =
|
||||
data.getParcelableExtra(PaymentActivity.KEY_PAY_RESULT)
|
||||
if (paymentResult != null) {
|
||||
// 充值金额超过限定时,就必须先实名认证
|
||||
when (JavaUtil.str2int(paymentResult.code)) {
|
||||
PayModel.NOT_REAL_NAME_BEFORE_CHARGING -> dialogManager.showTipsDialog(
|
||||
getString(R.string.tips_need_to_certification),
|
||||
getString(R.string.go_to_certification),
|
||||
object : AbsOkDialogListener() {
|
||||
override fun onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(
|
||||
this@NewUserChargeGiftDialog,
|
||||
UriProvider.getTutuRealNamePage()
|
||||
)
|
||||
}
|
||||
})
|
||||
UnionPayModel.CODE_NEED_BIND_BANK_CARD_FIRST -> dialogManager.showTipsDialog(
|
||||
getString(R.string.tips_need_bind_bank_card_first),
|
||||
object : AbsOkDialogListener() {
|
||||
override fun onOk() {
|
||||
// 跳去添加银行卡页面
|
||||
AddBankCardAgreementActivity.start(this@NewUserChargeGiftDialog)
|
||||
}
|
||||
})
|
||||
else -> {
|
||||
toast(paymentResult.msg)
|
||||
//重新获取钱包信息
|
||||
PayModel.get().getWalletInfo(AuthModel.get().currentUid).subscribe()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (requestCode == BIND_CODE_GOLD) {
|
||||
ModifyPwdActivity.start(this, ModifyPwdActivity.FOGERT_PAY_PWD)
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onNewUserChargeEvent(event: NewUserChargeEvent?) {
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
package com.mango.moshen.avroom.newuserchargegift
|
||||
|
||||
import android.content.Context
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.databinding.DialogNewUserChargePrizeBinding
|
||||
import com.mango.moshen.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.mango.moshen.ui.utils.RVDelegate
|
||||
import com.mango.core.pay.bean.FirstChargeReward
|
||||
import com.mango.core.statistic.StatisticManager
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_new_user_charge_prize)
|
||||
class NewUserChargePrizeDialog(
|
||||
context: Context,
|
||||
val title: String?,
|
||||
private val firstChargeRewardList: List<FirstChargeReward>?
|
||||
) : BaseBindingDialog<DialogNewUserChargePrizeBinding>(context) {
|
||||
|
||||
private lateinit var rvDelegate: RVDelegate<FirstChargeReward>
|
||||
|
||||
override fun init() {
|
||||
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||
.setAdapter(RewardAdapter())
|
||||
.setLayoutManager(LinearLayoutManager(context, RecyclerView.HORIZONTAL, false))
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.build()
|
||||
binding.ivKnow.setOnClickListener {
|
||||
closeDialog()
|
||||
}
|
||||
rvDelegate.setNewData(firstChargeRewardList)
|
||||
StatisticManager.Instance()
|
||||
.onEvent(
|
||||
StatisticsProtocol.EVENT_NUGIFT_POP_FINISH_CLICK,
|
||||
"新人专享礼物弹窗充值完成后弹窗",
|
||||
mapOf("charge_money" to title)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
package com.mango.moshen.avroom.newuserchargegift
|
||||
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.ui.utils.load
|
||||
import com.mango.core.pay.bean.FirstChargeReward
|
||||
import com.mango.core.utils.TextUtils
|
||||
|
||||
class RewardAdapter :
|
||||
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_new_user_charge_reward) {
|
||||
override fun convert(helper: BaseViewHolder, item: FirstChargeReward) {
|
||||
|
||||
helper.getView<ImageView>(R.id.iv_pic).load(item.showPir)
|
||||
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, "(${item.showTime})")
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
}
|
@@ -1,60 +0,0 @@
|
||||
package com.mango.moshen.avroom.presenter;
|
||||
|
||||
import com.mango.moshen.avroom.view.IRecordForPKView;
|
||||
import com.mango.moshen.base.BaseMvpPresenter;
|
||||
import com.mango.moshen.home.helper.LoadPageDataHelper;
|
||||
import com.mango.core.Constants;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.room.bean.RoomInfo;
|
||||
import com.mango.core.room.pk.bean.PKRecordInfo;
|
||||
import com.mango.core.room.pk.bean.PKRecordListInfo;
|
||||
import com.mango.core.room.pk.model.PkModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleSource;
|
||||
import io.reactivex.functions.Function;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
* @Description
|
||||
* @Date 2018/12/29
|
||||
*/
|
||||
public class RecordForPKPresenter extends BaseMvpPresenter<IRecordForPKView>
|
||||
implements LoadPageDataHelper.LoadData<List<PKRecordInfo>> {
|
||||
|
||||
LoadPageDataHelper<List<PKRecordInfo>> loadPageDataHelper;
|
||||
|
||||
public RecordForPKPresenter() {
|
||||
loadPageDataHelper = new LoadPageDataHelper<List<PKRecordInfo>>(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<List<PKRecordInfo>> loadData(int curPage) {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoomInfo == null) {
|
||||
return Single.error(new Throwable("没有当前房间信息"));
|
||||
}
|
||||
return PkModel.get().loadPKRecordList(
|
||||
currentRoomInfo.getUid(),
|
||||
curPage,
|
||||
Constants.PAGE_SIZE
|
||||
)
|
||||
.flatMap(new Function<PKRecordListInfo, SingleSource<? extends List<PKRecordInfo>>>() {
|
||||
@Override
|
||||
public SingleSource<? extends List<PKRecordInfo>> apply(PKRecordListInfo pkRecordListInfo) throws Exception {
|
||||
return Single.just(pkRecordListInfo.getRecords());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public Single<List<PKRecordInfo>> refreshData() {
|
||||
return loadPageDataHelper.refreshData();
|
||||
}
|
||||
|
||||
public Single<List<PKRecordInfo>> loadMoreData() {
|
||||
return loadPageDataHelper.loadMoreData();
|
||||
}
|
||||
}
|
@@ -1,103 +0,0 @@
|
||||
package com.mango.moshen.avroom.presenter;
|
||||
|
||||
import com.mango.moshen.avroom.fragment.IRoomRankHalfHourView;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.room.bean.RoomInfo;
|
||||
import com.mango.core.room.bean.RoomRankHalfHourDataInfo;
|
||||
import com.mango.core.room.bean.RoomRankHalfHourRankInfo;
|
||||
import com.mango.core.room.bean.RoomRankMultiItem;
|
||||
import com.mango.core.room.model.RoomRankModel;
|
||||
import com.mango.xchat_android_library.base.factory.AbstractMvpPresenter;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class RoomRankHalfHourPresenter extends AbstractMvpPresenter<IRoomRankHalfHourView> {
|
||||
|
||||
public void getRankListInfo() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null) {
|
||||
RoomRankModel.get()
|
||||
.getRoomRankHalfHourList(roomInfo.getUid())
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(new SingleObserver<RoomRankHalfHourDataInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(RoomRankHalfHourDataInfo roomRankHalfHourDataInfo) {
|
||||
if (roomRankHalfHourDataInfo != null) {
|
||||
|
||||
if (mMvpView != null) {
|
||||
if (roomRankHalfHourDataInfo.getMe() != null) {
|
||||
mMvpView.showMeInfo(roomRankHalfHourDataInfo.getMe());
|
||||
} else
|
||||
mMvpView.showMeInfo(null);
|
||||
|
||||
transformData(roomRankHalfHourDataInfo.getRankVoList());
|
||||
}
|
||||
|
||||
} else {
|
||||
if (mMvpView != null)
|
||||
mMvpView.loadDataFailure();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (mMvpView != null)
|
||||
mMvpView.loadDataFailure();
|
||||
SingleToastUtil.showToast(e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void transformData(List<RoomRankHalfHourRankInfo> dataInfoList) {
|
||||
|
||||
if (dataInfoList != null) {
|
||||
List<RoomRankHalfHourRankInfo> top3rankInfo;
|
||||
if (dataInfoList.size() >= 3) {
|
||||
top3rankInfo = dataInfoList.subList(0, 3);
|
||||
} else {
|
||||
top3rankInfo = dataInfoList;
|
||||
}
|
||||
mMvpView.showTop3Info(top3rankInfo);
|
||||
// 第四名开始以后的信息
|
||||
List<RoomRankMultiItem> otherRankInfo = new ArrayList<>();
|
||||
if (dataInfoList.size() > 3) {
|
||||
|
||||
for (int i = 3; i < dataInfoList.size(); i++) {
|
||||
RoomRankHalfHourRankInfo info = dataInfoList.get(i);
|
||||
RoomRankMultiItem item = new RoomRankMultiItem();
|
||||
item.setItemType(RoomRankMultiItem.TYPE_LINEAR);
|
||||
item.setData(info);
|
||||
otherRankInfo.add(item);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// RoomRankMultiItem item = new RoomRankMultiItem();
|
||||
// item.setItemType(RoomRankHalfHourListAdapter.TYPE_TIPS);
|
||||
// otherRankInfo.add(item);
|
||||
mMvpView.showRankListInfo(otherRankInfo);
|
||||
|
||||
} else {
|
||||
mMvpView.showTop3Info(null);
|
||||
|
||||
List<RoomRankMultiItem> otherRankInfo = new ArrayList<>();
|
||||
RoomRankMultiItem item = new RoomRankMultiItem();
|
||||
item.setItemType(RoomRankMultiItem.TYPE_EMPTY);
|
||||
otherRankInfo.add(item);
|
||||
mMvpView.showRankListInfo(otherRankInfo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +0,0 @@
|
||||
package com.mango.moshen.avroom.redpackage;
|
||||
|
||||
public class RedPackageEvent {
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
package com.mango.moshen.avroom.singleroompk
|
||||
|
||||
import com.mango.core.room.anotherroompk.SingleRoomPKModel
|
||||
import com.mango.core.utils.toast
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.DialogSingleRoomPkRuleBinding
|
||||
|
||||
class SingleRoomPkRuleDialog : BaseDialog<DialogSingleRoomPkRuleBinding>() {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(): SingleRoomPkRuleDialog {
|
||||
return SingleRoomPkRuleDialog()
|
||||
}
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
SingleRoomPKModel.getSingleRoomPkRule()
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
binding.tvContent.text = it.replace("\\n", "\n").replace("\\r", "\r")
|
||||
}
|
||||
.doOnError { it?.message.toast() }
|
||||
.subscribe()
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
* @Description
|
||||
* @Date 2018/12/28
|
||||
*/
|
||||
public interface ICreatePKView extends IMvpBaseView {
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.core.home.bean.BannerInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public interface IGameRoomView extends IBaseRoomView {
|
||||
|
||||
void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
|
||||
|
||||
import com.mango.core.room.bean.OnlineChatMember;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public interface IHomePartyUserListView extends IMvpBaseView {
|
||||
void onRequestChatMemberByPageSuccess(List<OnlineChatMember> memberList, int page);
|
||||
|
||||
void onRequestChatMemberByPageFail(String errorStr, int page);
|
||||
|
||||
void onMemberInRefresh();
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.core.home.bean.BannerInfo;
|
||||
import com.mango.core.room.bean.RoomInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public interface IHomePartyView extends IBaseRoomView {
|
||||
|
||||
//玩龙珠时换坑
|
||||
void onDragonBarChangeMic(int micPosition, String uId, boolean isInviteUpMic, RoomInfo roomInfo);
|
||||
|
||||
/**
|
||||
* 礼物值模式下换麦
|
||||
*/
|
||||
void onGiftValueChangeMic(int micPosition, String uId, boolean isInviteUpMic, RoomInfo roomInfo);
|
||||
|
||||
void onShowBanner(List<BannerInfo> bannerInfos);
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
|
||||
|
||||
import com.mango.core.room.queue.bean.RoomConsumeInfo;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/24
|
||||
*/
|
||||
public interface ILightChatConsumeView extends IMvpBaseView {
|
||||
|
||||
void onGetRoomConsumeListSuccess(List<RoomConsumeInfo> roomConsumeInfos);
|
||||
|
||||
void onGetRoomConsumeListFail(String error);
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
* @Description
|
||||
* @Date 2018/12/29
|
||||
*/
|
||||
public interface IRecordForPKView extends IMvpBaseView {
|
||||
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.core.room.bean.RoomRankMultiItem;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IRoomCharmRankingListView extends IMvpBaseView {
|
||||
|
||||
void roomCharmListSuccess(List<RoomRankMultiItem> list);
|
||||
void roomCharListFail(String message);
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
|
||||
import com.mango.core.room.bean.RoomContributeDataInfo;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
/**
|
||||
* Created by MadisonRong on 25/04/2018.
|
||||
*/
|
||||
|
||||
public interface IRoomContributeListView extends IMvpBaseView {
|
||||
|
||||
void getSingleRankingSuccess(RoomContributeDataInfo roomContributeDataInfo);
|
||||
|
||||
void getSingleRakingFail(int errorCode, String errorMsg);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.core.home.bean.BannerInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public interface ISingleRoomView extends IBaseRoomView {
|
||||
|
||||
void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
|
||||
}
|
@@ -1,119 +0,0 @@
|
||||
package com.mango.moshen.avroom.widget;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
|
||||
/**
|
||||
* 从library拿到client
|
||||
* Created by lvzebiao on 2018/11/9.
|
||||
*/
|
||||
|
||||
public class ViewItem {
|
||||
public static final int BUTTON_TYPE_NORMAL = 0;
|
||||
public static final int BUTTON_TYPE_CANCEL = 1;
|
||||
/**放置在资料卡片的底部位置的button*/
|
||||
public static final int BUTTON_TYPE_USER_CAR_BOTTOM = 2;
|
||||
|
||||
|
||||
/** 发送礼物 */
|
||||
public static final int SEND_GIFT_ITEM = 0;
|
||||
/** 锁坑 */
|
||||
public static final int SEND_LOCK_MIC_ITEM = 1;
|
||||
/** 踢下麦 */
|
||||
public static final int SEND_KICKDOWN_MIC_ITEM = 2;
|
||||
/** 踢出房间 */
|
||||
public static final int SEND_KICKOUT_ROOM_ITEM = 3;
|
||||
/** 查看个人信息 */
|
||||
public static final int SEND_SHOW_USER_INCO_ITEM = 4;
|
||||
/** 下麦 */
|
||||
public static final int SEND_DOWN_MIC_ITEM = 5;
|
||||
/** 释放麦 */
|
||||
public static final int SEND_FREE_MIC_ITEM = 6;
|
||||
/** 设置管理员 */
|
||||
public static final int SEND_MARK_MANAGER_ITEM = 7;
|
||||
/** 取消管理员 */
|
||||
public static final int SEND_NOMARK_MANAGER_ITEM = 11;
|
||||
/** 加入黑名单 */
|
||||
public static final int SEND_MARK_BLACK_ITEM = 8;
|
||||
/** 开麦 */
|
||||
public static final int SEND_OPEN_MUTE_ITEM = 9;
|
||||
/**
|
||||
* 装扮
|
||||
*/
|
||||
public static final int SEND_DECORATION_ITEM = 10;
|
||||
/** 抱上麦 */
|
||||
public static final int SEND_INVITE_MIC_ITEM = 12;
|
||||
/** 发起竞拍 */
|
||||
public static final int START_AUCTION = 13;
|
||||
/**关注or取消*/
|
||||
public static final int ATTENT_ITEM = 15;
|
||||
/**房间外送礼物*/
|
||||
public final static int SEND_GIFT_OUT_ROOM = 16;
|
||||
/**房间内送礼物*/
|
||||
public final static int SEND_MAGIC_OUT_ROOM = 17;
|
||||
|
||||
/**是否是关注按钮*/
|
||||
public boolean isAttent = false;
|
||||
/**ture则的话,则显示在个人资料卡片底部*/
|
||||
public boolean isBottom = false;
|
||||
/**
|
||||
* 找到Ta
|
||||
*/
|
||||
public boolean isFindTa = false;
|
||||
|
||||
/**
|
||||
* @Ta
|
||||
*/
|
||||
public boolean isAt = false;
|
||||
|
||||
public String mText;
|
||||
public int resourceID;
|
||||
public int imgRes;
|
||||
public OnClickListener mClickListener;
|
||||
public int mButtonType;
|
||||
public int mTheme = -1;
|
||||
public boolean noDissmis;
|
||||
public ViewItem(String text, int imgRes, OnClickListener l) {
|
||||
this(text, imgRes,BUTTON_TYPE_NORMAL, l);
|
||||
}
|
||||
public ViewItem(String text, int imgRes, boolean noDissmis, OnClickListener l) {
|
||||
this(text, imgRes,BUTTON_TYPE_NORMAL, l);
|
||||
this.noDissmis = noDissmis;
|
||||
}
|
||||
public ViewItem(String text, int imgRes, int buttonType, OnClickListener l) {
|
||||
mText = text;
|
||||
mClickListener = l;
|
||||
mButtonType = buttonType;
|
||||
this.imgRes = imgRes;
|
||||
resourceID = R.layout.dialog_user_card_item;
|
||||
}
|
||||
|
||||
public ViewItem(String text, int imgRes, int buttonType, int theme, OnClickListener l) {
|
||||
mText = text;
|
||||
this.imgRes = imgRes;
|
||||
mClickListener = l;
|
||||
mButtonType = buttonType;
|
||||
resourceID = R.layout.dialog_user_card_item;
|
||||
mTheme = theme;
|
||||
}
|
||||
|
||||
/**用户卡片的底部item*/
|
||||
public ViewItem(String text, OnClickListener l) {
|
||||
mText = text;
|
||||
mClickListener = l;
|
||||
mButtonType = BUTTON_TYPE_USER_CAR_BOTTOM;
|
||||
resourceID = R.layout.item_room_user_dialog_bottom_button;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.mText = text;
|
||||
}
|
||||
|
||||
public void setClickListener(OnClickListener mClickListener) {
|
||||
this.mClickListener = mClickListener;
|
||||
}
|
||||
|
||||
public interface OnClickListener {
|
||||
void onClick();
|
||||
}
|
||||
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
package com.mango.moshen.avroom.wishlist
|
||||
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.mango.core.gift.bean.SimpleUserInfo
|
||||
import com.mango.core.room.wishlist.WishItemInfo
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.ui.utils.load
|
||||
|
||||
|
||||
class WishListPanelUserAdapter :
|
||||
BaseQuickAdapter<SimpleUserInfo, BaseViewHolder>(R.layout.item_wish_list_panel_user) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: SimpleUserInfo) {
|
||||
helper.getView<ImageView>(R.id.iv_avatar).load(item.avatar)
|
||||
}
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
package com.mango.moshen.avroom.wishlist.history
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.mango.core.bean.response.ListResult
|
||||
import com.mango.core.room.wishlist.WishHistoryInfo
|
||||
import com.mango.core.room.wishlist.WishListModel
|
||||
import com.mango.moshen.base.BaseViewModel
|
||||
|
||||
class WishListHistoryViewModel : BaseViewModel() {
|
||||
|
||||
private val _wishHistoryLiveData = MutableLiveData<ListResult<WishHistoryInfo>>()
|
||||
val wishHistoryLiveData: LiveData<ListResult<WishHistoryInfo>> = _wishHistoryLiveData
|
||||
|
||||
fun getWisHistoryList() {
|
||||
safeLaunch(true, onError = {
|
||||
_wishHistoryLiveData.value = ListResult.failed(1)
|
||||
}, block = {
|
||||
val result = WishListModel.getWisHistoryList()
|
||||
_wishHistoryLiveData.value = ListResult.success(result, 1)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,252 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.common.widget.OriginalDrawStatusClickSpan;
|
||||
import com.mango.moshen.ui.webview.CommonWebViewActivity;
|
||||
import com.mango.xchat_android_constants.XChatConstants;
|
||||
import com.mango.core.UriProvider;
|
||||
import com.mango.core.auth.AuthModel;
|
||||
import com.mango.core.bean.LoginTipsInfo;
|
||||
import com.mango.core.market_verify.MarketVerifyModel;
|
||||
import com.mango.core.statistic.StatisticManager;
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.BiConsumer;
|
||||
|
||||
public abstract class BaseLoginAct extends BaseActivity {
|
||||
|
||||
protected CheckBox tvProtocol;
|
||||
protected TextView wxLogin;
|
||||
protected TextView qqLogin;
|
||||
protected TextView tvLoginQuickPass;
|
||||
protected TextView tvLoginTip;
|
||||
protected TextView tvDesc;
|
||||
|
||||
protected boolean canClick = true;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
protected void setProtocol() {
|
||||
|
||||
if (tvProtocol == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String privacyAgreementTip = context.getString(R.string.tip_privacy_agreement);
|
||||
String userAgreementTip = context.getString(R.string.tip_user_agreement);
|
||||
String privacyAgreementDescTip = context.getString(R.string.text_login_protocol, privacyAgreementTip, userAgreementTip);
|
||||
SpannableString ss = new SpannableString(privacyAgreementDescTip);
|
||||
int privacyAgreementTipIndex = privacyAgreementDescTip.indexOf(privacyAgreementTip);
|
||||
int userAgreementTipIndex = privacyAgreementDescTip.indexOf(userAgreementTip);
|
||||
|
||||
|
||||
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_2D93FF)), privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.color_2D93FF)) {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (!canClick) {
|
||||
return;
|
||||
}
|
||||
if (widget instanceof TextView)
|
||||
((TextView) widget).setHighlightColor(getResources().getColor(android.R.color.transparent));
|
||||
|
||||
CommonWebViewActivity.start(context, UriProvider.getPrivacyAgreement());
|
||||
}
|
||||
}, privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_2D93FF)), userAgreementTipIndex, userAgreementTipIndex + userAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.color_2D93FF)) {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (!canClick) {
|
||||
return;
|
||||
}
|
||||
if (widget instanceof TextView)
|
||||
((TextView) widget).setHighlightColor(getResources().getColor(android.R.color.transparent));
|
||||
|
||||
CommonWebViewActivity.start(context, UriProvider.getUserProtocolUrl());
|
||||
}
|
||||
}, userAgreementTipIndex, userAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
|
||||
tvProtocol.setText(ss);
|
||||
tvProtocol.setHighlightColor(Color.TRANSPARENT);
|
||||
tvProtocol.setMovementMethod(new LinkMovementMethod());
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
protected void showLoginTip() {
|
||||
MarketVerifyModel.get().loadLoginTip()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(new BiConsumer<LoginTipsInfo, Throwable>() {
|
||||
@Override
|
||||
public void accept(LoginTipsInfo loginTipsInfo, Throwable throwable) throws Exception {
|
||||
if (throwable == null) {
|
||||
showTvDesc(loginTipsInfo.getTips());
|
||||
showTvLoginTip(loginTipsInfo.isShowWechat() || loginTipsInfo.isShowQq());
|
||||
showThirdPartLogin(loginTipsInfo.isShowWechat(), loginTipsInfo.isShowQq(), loginTipsInfo.isShowOneClick());
|
||||
} else {
|
||||
showTvLoginTip(false);
|
||||
showThirdPartLogin(false, false, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void showThirdPartLogin(boolean isShowWechat, boolean isShowQq, boolean isShowOneClick) {
|
||||
showwxLogin(isShowWechat);
|
||||
showqqLogin(isShowQq);
|
||||
showOneClickLogin(isShowOneClick);
|
||||
}
|
||||
|
||||
private void showTvLoginTip(boolean visible) {
|
||||
if (tvLoginTip != null) {
|
||||
tvLoginTip.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void showwxLogin(boolean visible) {
|
||||
if (wxLogin != null) {
|
||||
wxLogin.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void showqqLogin(boolean visible) {
|
||||
if (qqLogin != null) {
|
||||
qqLogin.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void showOneClickLogin(boolean visible) {
|
||||
if (tvLoginQuickPass != null) {
|
||||
tvLoginQuickPass.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void showTvDesc(String tips) {
|
||||
if (tvDesc != null && !TextUtils.isEmpty(tips)) {
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(tips);
|
||||
int start = tips.indexOf("如何登录");
|
||||
|
||||
if (start > -1) {
|
||||
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_FE4C62)), start, start + 5, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new OriginalDrawStatusClickSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (!canClick) {
|
||||
return;
|
||||
}
|
||||
CommonWebViewActivity.start(BaseLoginAct.this, UriProvider.JAVA_WEB_URL + XChatConstants.LOGIN_ERBAN_ACCOUNT_URL);
|
||||
}
|
||||
}, start, start + 5, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
tvDesc.setText(builder);
|
||||
tvDesc.setHighlightColor(Color.TRANSPARENT);
|
||||
tvDesc.setMovementMethod(new LinkMovementMethod());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void wxLogin() {
|
||||
// 易盾保护 token
|
||||
// String yiDunToken = watchman.getToken(XChatConstants.YI_DUN_BUSINESS_ID);
|
||||
// 数美天网 deviceId
|
||||
// String shuMeiDeviceId = SmAntiFraud.getDeviceId();
|
||||
getDialogManager().showProgressDialog(this, "请稍后");
|
||||
AuthModel.get()
|
||||
.wxLogin("", "")
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mCompositeDisposable.add(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
getDialogManager().dismissDialog();
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
getDialogManager().dismissDialog();
|
||||
dealWithLoginError(e);
|
||||
}
|
||||
});
|
||||
StatisticManager.Instance().onEvent(this,
|
||||
StatisticsProtocol.EVENT_LOGIN_WX_CLICK, "点击微信登录", null);
|
||||
|
||||
}
|
||||
|
||||
protected void qqLogin() {
|
||||
// 易盾保护 token
|
||||
// String yiDunToken = watchman.getToken(XChatConstants.YI_DUN_BUSINESS_ID);
|
||||
// 数美天网 deviceId
|
||||
// String shuMeiDeviceId = SmAntiFraud.getDeviceId();
|
||||
String yiDunToken = "";
|
||||
String shuMeiDeviceId = "";
|
||||
|
||||
getDialogManager().showProgressDialog(this, "请稍后");
|
||||
AuthModel.get()
|
||||
.qqLogin(yiDunToken, shuMeiDeviceId)
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mCompositeDisposable.add(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
getDialogManager().dismissDialog();
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
getDialogManager().dismissDialog();
|
||||
dealWithLoginError(e);
|
||||
}
|
||||
});
|
||||
StatisticManager.Instance().onEvent(this,
|
||||
StatisticsProtocol.EVENT_LOGIN_QQ_CLICK, "点击qq登录", null);
|
||||
|
||||
}
|
||||
|
||||
public abstract void dealWithLoginError(Throwable e);
|
||||
|
||||
@Override
|
||||
protected boolean needSteepStateBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setStatusBar() {
|
||||
StatusBarUtil.transparencyBar(this);
|
||||
StatusBarUtil.StatusBarLightMode(this);
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
import com.mango.xchat_android_library.base.factory.AbstractMvpPresenter;
|
||||
|
||||
/**
|
||||
* @author alvin hwang
|
||||
*/
|
||||
public abstract class BaseMvpActivity<V extends IMvpBaseView, P extends AbstractMvpPresenter<V>> extends AbstractMvpActivity<V, P>
|
||||
implements IDataStatus, DialogManagerInterface {
|
||||
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
import com.mango.xchat_android_library.base.factory.AbstractMvpPresenter;
|
||||
|
||||
/**
|
||||
* @author alvin hwang
|
||||
*/
|
||||
public abstract class BaseMvpFragment<V extends IMvpBaseView, P extends AbstractMvpPresenter<V>> extends AbstractMvpFragment<V, P>
|
||||
implements KeyEvent.Callback, IDataStatus, FragmentManager.OnBackStackChangedListener, IAcitivityBase {
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
import com.mango.xchat_android_library.base.factory.AbstractMvpPresenter;
|
||||
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
* @Description
|
||||
* @Date 2018/5/9
|
||||
*/
|
||||
|
||||
public class BaseMvpPresenter<V extends IMvpBaseView> extends AbstractMvpPresenter<V> {
|
||||
|
||||
@Override
|
||||
public void onCreatePresenter(@Nullable Bundle saveState) {
|
||||
super.onCreatePresenter(saveState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyPresenter() {
|
||||
super.onDestroyPresenter();
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/5/7.
|
||||
*/
|
||||
|
||||
public class BaseVM {
|
||||
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||
|
||||
/**
|
||||
* 返回通用的dialogmanager
|
||||
*/
|
||||
public interface DialogManagerInterface {
|
||||
DialogManager getDialogManager();
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
/**
|
||||
* Created by zhouxiangfeng on 17/3/5.
|
||||
*/
|
||||
public interface IBase {
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user