Compare commits
359 Commits
master
...
develop_re
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e29884b40e | ||
![]() |
b4e700397f | ||
![]() |
1d7740e593 | ||
![]() |
5540d6c6bc | ||
![]() |
5c1da135aa | ||
![]() |
37bb28af69 | ||
![]() |
acbecf1b51 | ||
![]() |
463d9ec4b4 | ||
![]() |
f4811c9fe5 | ||
![]() |
5ceb15f807 | ||
![]() |
f7edaffd44 | ||
![]() |
8bd9f91892 | ||
![]() |
acfb446eb0 | ||
![]() |
4daf77adb8 | ||
![]() |
426bea9ac5 | ||
![]() |
7cf8865727 | ||
![]() |
c997896a9b | ||
![]() |
043b79553e | ||
![]() |
2d002958cd | ||
![]() |
be75ae855a | ||
![]() |
e30784cfc9 | ||
![]() |
ebe6ee2918 | ||
![]() |
c74873c837 | ||
![]() |
9b88c65f9c | ||
![]() |
7679937945 | ||
![]() |
4fd2afe8e0 | ||
![]() |
7f6e82c7a8 | ||
![]() |
615089d1e1 | ||
![]() |
47b38458df | ||
![]() |
91be03ea07 | ||
![]() |
f7a500770a | ||
![]() |
d82bb55c4e | ||
![]() |
dc1383be70 | ||
![]() |
368ed2bf70 | ||
![]() |
d595ed469e | ||
![]() |
792ad5141c | ||
![]() |
de6a4fe524 | ||
![]() |
d0cb9e43b1 | ||
![]() |
ef8d9b0b6f | ||
![]() |
e781369be1 | ||
![]() |
3bd13e732a | ||
![]() |
67babbaebd | ||
![]() |
c392b20f21 | ||
![]() |
0a1ae82d42 | ||
![]() |
6dc63e1d26 | ||
![]() |
2dcbcf7179 | ||
![]() |
bcd6faf213 | ||
![]() |
072c837c99 | ||
![]() |
067f97d6be | ||
![]() |
15b317d5d0 | ||
![]() |
16712197e3 | ||
![]() |
24ccadc593 | ||
![]() |
88767208bd | ||
![]() |
91bb8f7871 | ||
![]() |
dedb075c56 | ||
![]() |
1b1f477494 | ||
![]() |
9a015aff0b | ||
![]() |
9500554550 | ||
![]() |
23e05ccab1 | ||
![]() |
0417e53b85 | ||
![]() |
df96cfe5d4 | ||
![]() |
213efcba31 | ||
![]() |
9e36225b77 | ||
![]() |
da3d72ebff | ||
![]() |
fd3dc7cb3c | ||
![]() |
eebe231a45 | ||
![]() |
276f2002f9 | ||
![]() |
2942e2f0bb | ||
![]() |
406077b43b | ||
![]() |
55a8d037e0 | ||
![]() |
ba58b0bd40 | ||
![]() |
151b1c37d0 | ||
![]() |
4a7af141aa | ||
![]() |
cec6e00e09 | ||
![]() |
bf6ef26eca | ||
![]() |
07845b5e60 | ||
![]() |
097ead1327 | ||
![]() |
2b45d35d40 | ||
![]() |
e6f4b40e66 | ||
![]() |
c46f19f03f | ||
![]() |
37196025cc | ||
![]() |
9096a9b57f | ||
![]() |
c46c49715c | ||
![]() |
31b785c511 | ||
![]() |
6f01c5ddad | ||
![]() |
306f15f7f9 | ||
![]() |
0babbedeb9 | ||
![]() |
d09e60d206 | ||
![]() |
e37796286b | ||
![]() |
bdcfb21e6e | ||
![]() |
5c7d2e9645 | ||
![]() |
d2f24c4457 | ||
![]() |
7ec11e0aba | ||
![]() |
f4a9690c1b | ||
![]() |
0742894540 | ||
![]() |
d0fe8e892e | ||
![]() |
b9120dca54 | ||
![]() |
8ebaddad07 | ||
![]() |
b63b4ba07a | ||
![]() |
a211267517 | ||
![]() |
d0e88440e3 | ||
![]() |
260ed56c99 | ||
![]() |
505917b70f | ||
![]() |
03d013fcba | ||
![]() |
19301bbd84 | ||
![]() |
694a73931b | ||
![]() |
d34929d7c7 | ||
![]() |
73eccecfc9 | ||
![]() |
eb1546570a | ||
![]() |
7ba43a51d4 | ||
![]() |
bae4660840 | ||
![]() |
b9fd24e0ff | ||
![]() |
4bef25e1e3 | ||
![]() |
72480daa98 | ||
![]() |
1defcb0d28 | ||
![]() |
4885a0bdbd | ||
![]() |
5900702ca6 | ||
![]() |
9e6928580f | ||
![]() |
e644ced1ed | ||
![]() |
1667dd3863 | ||
![]() |
c04d3e283b | ||
![]() |
2b6d66c31e | ||
![]() |
e56bbb5f8f | ||
![]() |
7bf7e232d0 | ||
![]() |
d63a441296 | ||
![]() |
e81ec19168 | ||
![]() |
588b96ec7b | ||
![]() |
514abbc314 | ||
![]() |
94d9183952 | ||
![]() |
6eedd5cc46 | ||
![]() |
087091275f | ||
![]() |
f54a8ec175 | ||
![]() |
fee8f2ceb9 | ||
![]() |
a18a66b496 | ||
![]() |
80e21bee74 | ||
![]() |
e031dd9d02 | ||
![]() |
19a3b64a32 | ||
![]() |
34a5571338 | ||
![]() |
5b4eeb80e8 | ||
![]() |
f7889ace18 | ||
![]() |
cfc909df42 | ||
![]() |
ebc989cccf | ||
![]() |
5ad1c017c3 | ||
![]() |
15a80f5537 | ||
![]() |
38fde6109b | ||
![]() |
3199114ff6 | ||
![]() |
57139f1f97 | ||
![]() |
c7d7d98873 | ||
![]() |
d7da6d4be4 | ||
![]() |
b9a2f03184 | ||
![]() |
5ef9be75d2 | ||
![]() |
cf3ab9ce84 | ||
![]() |
3ba31c46d8 | ||
![]() |
e8f7eca1af | ||
![]() |
d93b6fbf60 | ||
![]() |
6ec57834fd | ||
![]() |
c3dab80e71 | ||
![]() |
60e56beb43 | ||
![]() |
a0667bdd8d | ||
![]() |
ba65ad680f | ||
![]() |
5163c2dc9d | ||
![]() |
ad5a769f25 | ||
![]() |
be291fa7e1 | ||
![]() |
27713e5300 | ||
![]() |
80e180f2b8 | ||
![]() |
ba93c9c0fe | ||
![]() |
6f9d1d81ad | ||
![]() |
81d0cd819d | ||
![]() |
36897df28b | ||
![]() |
6bdfe0426e | ||
![]() |
997b7ee9a3 | ||
![]() |
b885a24b8e | ||
![]() |
5d2551e04f | ||
![]() |
309e696a07 | ||
![]() |
68c9c6a8cb | ||
![]() |
448e6800ab | ||
![]() |
068ffcbed4 | ||
![]() |
cf7b49b69d | ||
![]() |
09fd7c586a | ||
![]() |
03b77fae08 | ||
![]() |
b75ba89d75 | ||
![]() |
2074039de2 | ||
![]() |
6b580ad2a6 | ||
![]() |
6134962297 | ||
![]() |
ce5cc20ac4 | ||
![]() |
bc718f26c6 | ||
![]() |
8f9a5bd565 | ||
![]() |
623a721e58 | ||
![]() |
a9be418fc3 | ||
![]() |
5b781b890c | ||
![]() |
4a6892d0c6 | ||
![]() |
a6e6992b1a | ||
![]() |
248e306e85 | ||
![]() |
bce08e82ca | ||
![]() |
32814780c2 | ||
![]() |
d0dc4cab49 | ||
![]() |
80d571d1d1 | ||
![]() |
b92c97dfb9 | ||
![]() |
e585899c44 | ||
![]() |
03f28b7be0 | ||
![]() |
c7225892f0 | ||
![]() |
f8d4601c38 | ||
![]() |
ce4fce319e | ||
![]() |
ce4293ec35 | ||
![]() |
1c9de5f03a | ||
![]() |
2734ff1ff2 | ||
![]() |
c7a28c5ac9 | ||
![]() |
ae4d327baf | ||
![]() |
9e9eb5d5b7 | ||
![]() |
96b1ad9e4c | ||
![]() |
48c527e789 | ||
![]() |
4e0a55ae46 | ||
![]() |
c85065d86c | ||
![]() |
c1371fab10 | ||
![]() |
6717f9aa69 | ||
![]() |
61cafd8c8c | ||
![]() |
e4f0853d3e | ||
![]() |
46a2985a49 | ||
![]() |
b2f9f07ded | ||
![]() |
5023d9a250 | ||
![]() |
29957775e0 | ||
![]() |
5f73c46868 | ||
![]() |
656eea5ebc | ||
![]() |
f9b8c20d85 | ||
![]() |
2d7b55ad0d | ||
![]() |
91350218d6 | ||
![]() |
ca56ee0877 | ||
![]() |
23214de384 | ||
![]() |
da45a64af9 | ||
![]() |
e236ef2aff | ||
![]() |
7de533bf3f | ||
![]() |
e23363c736 | ||
![]() |
4395951973 | ||
![]() |
e02020577d | ||
![]() |
61306e833a | ||
![]() |
49ba0a2701 | ||
![]() |
2e32184248 | ||
![]() |
bab64db25c | ||
![]() |
612502153c | ||
![]() |
9cdb0eef53 | ||
![]() |
6528ac407a | ||
![]() |
94d18e6035 | ||
![]() |
08abf47890 | ||
![]() |
cb89eccf23 | ||
![]() |
b57622ad42 | ||
![]() |
fd71af897f | ||
![]() |
1998258bda | ||
![]() |
5cce2cb68c | ||
![]() |
08230c55a3 | ||
![]() |
f51dec1101 | ||
![]() |
1dd5d64a09 | ||
![]() |
30d793d794 | ||
![]() |
d2fb38f094 | ||
![]() |
01958edd06 | ||
![]() |
5a2903d14d | ||
![]() |
1bade9dd00 | ||
![]() |
8d7ab335e2 | ||
![]() |
8bf25ad378 | ||
![]() |
6e11cfb30d | ||
![]() |
0c2fd28f15 | ||
![]() |
a2e0e9df53 | ||
![]() |
9e3ebfa541 | ||
![]() |
94a0575909 | ||
![]() |
3d161b94e4 | ||
![]() |
08d9534095 | ||
![]() |
ff1cd57d98 | ||
![]() |
2a57ad3145 | ||
![]() |
92f2db36ae | ||
![]() |
362c75f93c | ||
![]() |
b9c3bbdbec | ||
![]() |
0a24dc66e6 | ||
![]() |
ca62822bfb | ||
![]() |
5db5afa5ed | ||
![]() |
edad692309 | ||
![]() |
23a34434a0 | ||
![]() |
8ad38583ff | ||
![]() |
391fae9006 | ||
![]() |
9854e91fe8 | ||
![]() |
d587f1b43d | ||
![]() |
595d3a767a | ||
![]() |
4d13cf5e9c | ||
![]() |
62ce160dfa | ||
![]() |
c631c1d3a8 | ||
![]() |
27420aa51a | ||
![]() |
12c5344d72 | ||
![]() |
a716136090 | ||
![]() |
f860c96887 | ||
![]() |
873ecf1d2b | ||
![]() |
957b64476f | ||
![]() |
306e0a99a0 | ||
![]() |
bfd619e8b5 | ||
![]() |
4c0184c80b | ||
![]() |
aeb47da0ee | ||
![]() |
d99ef80d2e | ||
![]() |
77dcc9d117 | ||
![]() |
a7f17276c5 | ||
![]() |
63f1e02c6f | ||
![]() |
5c6657c538 | ||
![]() |
7548b4174a | ||
![]() |
068172bbd2 | ||
![]() |
0dda893e1f | ||
![]() |
928857f97d | ||
![]() |
46a2dab191 | ||
![]() |
877c3d9361 | ||
![]() |
ef8ca0b939 | ||
![]() |
50a20f7822 | ||
![]() |
9cc59dd275 | ||
![]() |
1ac47c055d | ||
![]() |
24f1437418 | ||
![]() |
f794fe960f | ||
![]() |
282036bb20 | ||
![]() |
ffab260d6a | ||
![]() |
8c47c3e717 | ||
![]() |
c36f127bce | ||
![]() |
d46ec289ea | ||
![]() |
a9405eb8f8 | ||
![]() |
f5d3f45001 | ||
![]() |
49f2764344 | ||
![]() |
e2a477bd0d | ||
![]() |
0cc24f4adf | ||
![]() |
44e918bd68 | ||
![]() |
cc21e2969a | ||
![]() |
cbe2234c83 | ||
![]() |
68e091131d | ||
![]() |
346b535757 | ||
![]() |
a16a918d06 | ||
![]() |
d3b6a16db9 | ||
![]() |
c34e8b034d | ||
![]() |
d2b0e904c8 | ||
![]() |
b57e7afb6d | ||
![]() |
edcabd157d | ||
![]() |
384831effa | ||
![]() |
f8f0c2c59b | ||
![]() |
96e3c65f2f | ||
![]() |
d8c1a89005 | ||
![]() |
e014e6a6b2 | ||
![]() |
144fa832f1 | ||
![]() |
9b7c0cae6b | ||
![]() |
f6f79f83dc | ||
![]() |
09f0eac2b3 | ||
![]() |
951c42592e | ||
![]() |
fdfec8610d | ||
![]() |
fcf9f65984 | ||
![]() |
2ef89535d5 | ||
![]() |
f742102a60 | ||
![]() |
eb73898872 | ||
![]() |
122f2d374f | ||
![]() |
7adefe8375 | ||
![]() |
34b9233825 | ||
![]() |
cd5b1728f8 | ||
![]() |
ac53bbd484 | ||
![]() |
48a096a64a | ||
![]() |
0dd0e131f2 | ||
![]() |
4999c6e955 | ||
![]() |
259c3e408a | ||
![]() |
58b66848d9 | ||
![]() |
bf805afdb5 | ||
![]() |
a1221fa5a5 | ||
![]() |
7515f50095 |
0
aab-res-guard-mapping.txt
Normal file
@@ -26,7 +26,7 @@ dependencies {
|
||||
api 'androidx.annotation:annotation:1.4.0'
|
||||
api 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation "androidx.core:core-ktx:1.7.0"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
0
app/aab-res-guard-mapping.txt
Normal file
230
app/build.gradle
@@ -2,17 +2,17 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'com.tencent.vasdolly'
|
||||
apply from: '../mob.gradle'
|
||||
|
||||
apply plugin: "com.bytedance.android.aabResGuard"
|
||||
apply plugin: "xml-class-guard"
|
||||
def onlyArm64 = Boolean.parseBoolean(only_arm64)
|
||||
|
||||
android {
|
||||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.vele.pekolive"
|
||||
applicationId "app.repo.cam"
|
||||
minSdkVersion MIN_SDK_VERSION.toInteger()
|
||||
targetSdkVersion TARGET_SDK_VERSION.toInteger()
|
||||
versionCode Integer.valueOf(version_code)
|
||||
@@ -21,20 +21,20 @@ android {
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
|
||||
ndk {
|
||||
//设置支持的SO库架构
|
||||
if (onlyArm64) {
|
||||
abiFilters "arm64-v8a"
|
||||
} else {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions 'default'
|
||||
|
||||
manifestPlaceholders = [CRASHLYTICS_COLLECTION_ENABLED: CRASHLYTICS_COLLECTION_ENABLED.toBoolean()]
|
||||
}
|
||||
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
|
||||
bundle {
|
||||
language {
|
||||
enableSplit = false
|
||||
@@ -48,20 +48,29 @@ android {
|
||||
}
|
||||
|
||||
//在apk文件后边生成版本号信息
|
||||
android.applicationVariants.all {
|
||||
variant ->
|
||||
variant.outputs.all {
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
outputFileName = "peko_${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 = "repo_${buildType.name}_v${defaultConfig.versionName}_${abi}_${date}.apk"
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
lint {
|
||||
abortOnError false
|
||||
disable 'MissingTranslation'
|
||||
disable 'ExtraTranslation'
|
||||
disable 'MissingTranslation', 'ExtraTranslation', 'ContentDescription', 'SmallSp'
|
||||
}
|
||||
|
||||
|
||||
dataBinding {
|
||||
enabled = true
|
||||
}
|
||||
@@ -73,23 +82,13 @@ android {
|
||||
signingConfigs {
|
||||
|
||||
v2 {
|
||||
storeFile file('../pekolive.jks')
|
||||
storePassword "peko2023"
|
||||
keyAlias "pekolive"
|
||||
keyPassword "peko2023"
|
||||
storeFile file('../repo.jks')
|
||||
storePassword "repo2023"
|
||||
keyAlias "repo"
|
||||
keyPassword "repo2023"
|
||||
v2SigningEnabled true
|
||||
v1SigningEnabled true
|
||||
}
|
||||
|
||||
v1 {
|
||||
storeFile file('../pekolive.jks')
|
||||
storePassword "peko2023"
|
||||
keyAlias "pekolive"
|
||||
keyPassword "peko2023"
|
||||
v2SigningEnabled false
|
||||
v1SigningEnabled true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@@ -139,19 +138,23 @@ android {
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
def server_url_debug = '"http://beta.api.pekolive.com/"'
|
||||
def server_url_release = '"https://api.repo.cam/"'
|
||||
|
||||
debug {
|
||||
println("minifyEnabled = " + minify_enabled)
|
||||
|
||||
ext.enableCrashlytics = false
|
||||
ext.alwaysUpdateBuildId = false // Firebase Crashlytics禁用更新构建ID
|
||||
|
||||
buildConfigField "String", "BASE_URL", "\"https://beta.api.pekolive.com/\""
|
||||
buildConfigField "String", "BASE_URL", server_url_debug
|
||||
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_STAGING", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_RELEASE", "BASE_URL"
|
||||
minifyEnabled false // 是否混淆
|
||||
buildConfigField "String", "BASE_URL_RELEASE", server_url_release
|
||||
minifyEnabled minify_enabled.toBoolean() // 是否混淆
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
crunchPngs false // 停用 PNG 压缩
|
||||
signingConfig signingConfigs.v2
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
gradle.taskGraph.whenReady {
|
||||
tasks.each { task ->
|
||||
if (task.name.contains("Test") || task.name.contains("Lint")) {
|
||||
@@ -169,7 +172,7 @@ android {
|
||||
mappingFileUploadEnabled CRASHLYTICS_COLLECTION_ENABLED.toBoolean()
|
||||
}
|
||||
|
||||
buildConfigField "String", "BASE_URL", "\"https://api.pekolive.com/\""
|
||||
buildConfigField "String", "BASE_URL", server_url_release
|
||||
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_STAGING", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_RELEASE", "BASE_URL"
|
||||
@@ -203,6 +206,9 @@ dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.4.2'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
@@ -260,7 +266,7 @@ dependencies {
|
||||
|
||||
implementation 'com.github.fodroid:XRadioGroup:v1.5'
|
||||
|
||||
api 'com.tencent.vasdolly:helper:3.0.3'
|
||||
api 'com.tencent.vasdolly:helper:3.0.6'
|
||||
implementation "io.github.tencent:vap:2.0.24"
|
||||
|
||||
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
|
||||
@@ -287,6 +293,8 @@ dependencies {
|
||||
//wheelView
|
||||
implementation 'com.contrarywind:wheelview:4.1.0'
|
||||
|
||||
implementation 'tech.sud.mgp:SudMGP-static:1.3.3.1158'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
}
|
||||
|
||||
channel {
|
||||
@@ -294,7 +302,7 @@ channel {
|
||||
outputDir = new File(project.buildDir, "channelapk")
|
||||
//多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime}
|
||||
def only64 = onlyArm64 ? "-only64" : ""
|
||||
apkNameFormat = 'peko-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
|
||||
apkNameFormat = 'repo-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
|
||||
//快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
|
||||
fastMode = false
|
||||
//buildTime的时间格式,默认格式:yyyyMMdd-HHmmss
|
||||
@@ -302,3 +310,143 @@ channel {
|
||||
//低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式
|
||||
lowMemory = false
|
||||
}
|
||||
|
||||
aabResGuard {
|
||||
mappingFile = file("aab-res-guard-mapping.txt").toPath() // Mapping file used for incremental obfuscation
|
||||
whiteList = [ // White list rules
|
||||
"*.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 = "duplicated-app.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.yizhuan.erban": "com.c.r"]
|
||||
moveDir = [
|
||||
"com.zhihu.matisse.internal.entity" : "fddbcec",
|
||||
"com.yizhuan.xchat_android_library.easyphoto.models.album.entity" : "dafefbfcbdbe",
|
||||
"com.chuhai.utils" : "cbeccaebfacee",
|
||||
"com.yizhuan.xchat_android_library.utils" : "afeaaebba",
|
||||
"com.yizhuan.erban.base" : "cceceecedec",
|
||||
"com.yizhuan.xchat_android_library.common.base" : "efdbbabccaaf",
|
||||
"com.yizhuan.erban.public_chat_hall.msg" : "cbfce",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.adapter" : "dddeefacdcbfcbd",
|
||||
"com.yizhuan.erban.ui.list" : "ffbbbeedfdddd",
|
||||
"com.yizhuan.xchat_android_library.list" : "efcebcafccfff",
|
||||
"com.yizhuan.erban.ui.im.avtivity" : "fbabadeadfbeab",
|
||||
"com.netease.nim.uikit.business.session.activity" : "fbfacfcef",
|
||||
"com.yizhuan.erban.common.util" : "dfffbcadbaecffd",
|
||||
"com.netease.nim.uikit.common.util.media" : "bdbeeecbddacffef",
|
||||
"com.netease.nim.uikit.common.media.picker.util" : "dcfdaddda",
|
||||
"com.yizhuan.xchat_android_core.utils" : "eebaabdaacfdc",
|
||||
"com.yizhuan.xchat_android_library.easyphoto.utils.bitmap" : "cafbbeeaccf",
|
||||
"com.yizhuan.xchat_android_library.net.rxnet.manager" : "edeaeebedbddd",
|
||||
"com.yizhuan.xchat_android_library.utils.cache" : "fafcafaecadbbab",
|
||||
"com.yizhuan.erban.ui.pay" : "fdafbddcdeceeed",
|
||||
"com.yizhuan.erban.pay.adapter" : "bcaacecbabacecdfb",
|
||||
"com.yizhuan.erban.public_chat_hall.msg.viewholder" : "bedbdbf",
|
||||
"com.netease.nim.uikit.business.chatroom.viewholder" : "aadeeeeda",
|
||||
"com.yizhuan.erban.common.widget" : "aeccddabefcaaad",
|
||||
"com.netease.nim.uikit.common.ui.imageview" : "baaabaffdafcee",
|
||||
"com.soundcloud.android.crop" : "dcdfeaddbddfdbff",
|
||||
"com.netease.nim.uikit.common.media.picker.activity" : "feaccce",
|
||||
"com.yizhuan.erban.common.permission" : "bbbebcbdfbaadba",
|
||||
"com.yizhuan.xchat_android_library.easypermisssion" : "dbcdcbabdfdefd",
|
||||
"com.yizhuan.erban.module" : "ffccffc",
|
||||
"com.netease.nim.uikit.business.session.constant" : "bebcdeebec",
|
||||
"com.netease.nim.uikit.common.util.log.sdk.util" : "beebacccee",
|
||||
"com.yizhuan.erban.ui.utils" : "bceafa",
|
||||
"com.yizhuan.erban.ui.gift.util" : "aaaaffcaec",
|
||||
"com.zhihu.matisse.engine.impl" : "eaedaafed",
|
||||
"com.yizhuan.xchat_android_library.common.glide" : "ddcefebecddfacade",
|
||||
"com.yizhuan.erban.friend" : "bffeaceaaed",
|
||||
"com.yizhuan.erban.share" : "baadcaabfdcfdef",
|
||||
"com.yizhuan.treasure_box.model" : "ffbefbdaaca",
|
||||
"com.yizhuan.xchat_android_core.radish" : "cbaaafeb",
|
||||
"com.yizhuan.xchat_android_library.easyphoto.engine" : "aeeebbccbfde",
|
||||
"com.yizhuan.xchat_android_core.module_hall.income.bean" : "eaeebbdabcce",
|
||||
"com.yizhuan.xchat_android_core.bills.bean" : "fcafacceabd",
|
||||
"com.jph.takephoto.uitl" : "babbcdefdca",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.loadmore" : "fbafabef",
|
||||
"com.yizhuan.erban.ui.widget" : "accfffcddadfeefffafad",
|
||||
"com.yizhuan.xchat_android_library.easyphoto.ui.dialog" : "dcbfaeffceafafade",
|
||||
"com.yizhuan.erban.common.widget.dialog" : "aeedfefafd",
|
||||
"com.yizhuan.erban.ui.im.fragment" : "eeceacedadfffff",
|
||||
"com.netease.nim.uikit.business.session.fragment" : "facbafcfbefdcfccb",
|
||||
"com.netease.nim.uikit.business.session.module.list" : "ffdfafebdbdaea",
|
||||
"com.yizhuan.erban.ui.im.chat" : "aafeeecfaa",
|
||||
"com.netease.nim.uikit.business.session.viewholder" : "dfafaeecf",
|
||||
"com.yizhuan.erban.base.list" : "cecbbffbab",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.entity" : "accaacebcfc",
|
||||
"com.yizhuan.erban.ui.widget.password" : "ddefafca",
|
||||
"com.yizhuan.erban.pay.interfaces" : "fafeddcdbeaa",
|
||||
"com.yizhuan.erban.community.photo" : "daaccefbafac",
|
||||
"com.yizhuan.erban.ui.user.adapter" : "aabafbccfaf",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.holder" : "bbeaabadfdfeee",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.util" : "bddceccecb",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.listener" : "bafbafebdffacbdafe",
|
||||
"com.yizhuan.erban.ui.widget.recyclerview.decoration" : "cddeddddd",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.decoration" : "aefdcc",
|
||||
"com.yizhuan.tutu.room_chat" : "afeefeddae",
|
||||
"com.yizhuan.erban.bank_card" : "cdfcdafdabcccbfab",
|
||||
"com.yizhuan.tutu.music" : "deebbdbefbbc",
|
||||
"com.yizhuan.erban.team.adapter" : "aaefddefe",
|
||||
"com.netease.nim.uikit.business.team.adapter" : "bfbdeedbcbbc",
|
||||
"com.zhihu.matisse.internal.utils" : "fbdeaebfabae",
|
||||
"com.netease.nim.uikit.impl.preference" : "acacff",
|
||||
"com.netease.nim.uikit.business.preference" : "ccdedacaac",
|
||||
"com.yizhuan.erban.avroom.widget" : "fbaebeeefabde",
|
||||
"com.yizhuan.xchat_android_library.widget" : "aefdcddaaee",
|
||||
]
|
||||
|
||||
}
|
@@ -1,36 +1,26 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "656602722869",
|
||||
"project_id": "pekolive-30f9e",
|
||||
"storage_bucket": "pekolive-30f9e.appspot.com"
|
||||
"project_number": "557443720422",
|
||||
"project_id": "repo-32561",
|
||||
"storage_bucket": "repo-32561.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:656602722869:android:dac206f8aae0ba9021f77c",
|
||||
"mobilesdk_app_id": "1:557443720422:android:d5d1480109b8af15b54727",
|
||||
"android_client_info": {
|
||||
"package_name": "com.vele.pekolive"
|
||||
"package_name": "app.repo.cam"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "656602722869-sss2inirem512et0015kdqjp39mqgn96.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDDoTSpY3wxOefVDVKRmE9cDiT1iv8Ra-4"
|
||||
"current_key": "AIzaSyC2L4szjA4Le5D5_dq0a4PUDxJSCf8XuEI"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "656602722869-sss2inirem512et0015kdqjp39mqgn96.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
197
app/proguard-rules.pro
vendored
@@ -99,16 +99,18 @@
|
||||
-keep class android.support.v7.** { *;}
|
||||
|
||||
#----------------EventBus事件巴士-----------------
|
||||
-keepclassmembers class ** {
|
||||
-keepattributes *Annotation*
|
||||
-keepclassmembers class * {
|
||||
@org.greenrobot.eventbus.Subscribe <methods>;
|
||||
}
|
||||
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
|
||||
|
||||
# Only required if you use AsyncExecutor
|
||||
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
|
||||
<init>(Java.lang.Throwable);
|
||||
# If using AsyncExecutord, keep required constructor of default event used.
|
||||
# Adjust the class name if a custom failure event type is used.
|
||||
-keepclassmembers class org.greenrobot.eventbus.util.ThrowableFailureEvent {
|
||||
<init>(java.lang.Throwable);
|
||||
}
|
||||
|
||||
# Accessed via reflection, avoid renaming or removal
|
||||
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl
|
||||
|
||||
#-------------云信相关的混淆配置------------
|
||||
-dontwarn com.netease.**
|
||||
@@ -231,8 +233,9 @@
|
||||
|
||||
# TODO 网络加载 一些业务bean gson 时候混淆问题
|
||||
-keep class org.json.** {*;}
|
||||
-dontwarn com.yizhuan.xchat_android_core.**
|
||||
-keep class com.yizhuan.xchat_android_core.** {*;}
|
||||
-keep class com.yizhuan.**.bean.** {*;}
|
||||
-keep class com.yizhuan.**.result.** {*;}
|
||||
-keep class com.yizhuan.**.entity.** {*;}
|
||||
|
||||
|
||||
#百度统计
|
||||
@@ -475,4 +478,180 @@
|
||||
}
|
||||
-keep public class com.android.installreferrer.**{ *; }
|
||||
|
||||
-keep public class * extends java.lang.Exception
|
||||
-keep public class * extends java.lang.Exception
|
||||
|
||||
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
||||
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
||||
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
||||
|
||||
|
||||
-keep class b.** { *; }
|
||||
-keep class cc.** { *; }
|
||||
-keep public class * extends b.QQ
|
||||
-keep public class * extends com.yizhuan.xchat_android_library.base.factory.AbstractMvpPresenter
|
||||
-dontwarn com.yizhuan.erban.ui.im.recent.holder.**
|
||||
-keep class com.yizhuan.erban.ui.im.recent.holder.** {*;}
|
||||
-keep class aafeeecfaa.** {*;}
|
||||
-keep class com.yizhuan.erban.luckymoney.viewholder.** {*;}
|
||||
-keep class baadcaabfdcfdef.viewholder.** {*;}
|
||||
-keep class cbfce.viewholder.** {*;}
|
||||
-keep class com.yizhuan.erban.module_hall.im.msgholder.** {*;}
|
||||
-keep class com.yizhuan.tutu.mentoring_relationship.viewholder.** {*;}
|
||||
-dontwarn com.yizhuan.erban.bindadapter.**
|
||||
-keep class com.yizhuan.erban.bindadapter.** {*;}
|
||||
-keep class com.yizhuan.**.bean.** {*;}
|
||||
-keep class com.yizhuan.**.result.** {*;}
|
||||
-keep class com.yizhuan.**.entity.** {*;}
|
||||
-keep class g.GL{*;}
|
||||
-keep class bc.BV{*;}
|
||||
-keep class d.BD {*;}
|
||||
-keep class com.yizhuan.xchat_android_library.easyphoto.models.** { *; }
|
||||
-keep class fn.** { *; }
|
||||
-keep class com.jph.takephoto.** { *; }
|
||||
-dontwarn com.jph.takephoto.**
|
||||
-keep class babbcdefdca.** { *; }
|
||||
-dontwarn babbcdefdca.**
|
||||
-keep class dd.** { *; }
|
||||
-dontwarn dd.**
|
||||
-keep public class * extends bbeaabadfdfeee.RecyclerViewHolder {*;}
|
||||
-keep public class * extends dfafaeecf.MsgViewHolderBase {*;}
|
||||
|
||||
-keep class h.** {*;}
|
||||
-keep class k.** {*;}
|
||||
-keep class w.** {*;}
|
||||
-keep class bb.** {*;}
|
||||
-keep class bd.** {*;}
|
||||
-keep class be.** {*;}
|
||||
-keep class bi.** {*;}
|
||||
-keep class bl.** {*;}
|
||||
-keep class ce.** {*;}
|
||||
-keep class cm.** {*;}
|
||||
-keep class h.J {*;}
|
||||
-keep class h.K {*;}
|
||||
-keep class k.N {*;}
|
||||
-keep class w.BJ {*;}
|
||||
-keep class bb.BU {*;}
|
||||
-keep class bd.BX {*;}
|
||||
-keep class be.BY {*;}
|
||||
-keep class bd.CB {*;}
|
||||
-keep class bi.CF {*;}
|
||||
-keep class be.CG {*;}
|
||||
-keep class bl.CK {*;}
|
||||
-keep class bi.CP {*;}
|
||||
-keep class bb.DG {*;}
|
||||
-keep class bb.DX {*;}
|
||||
-keep class ce.EL {*;}
|
||||
-keep class bi.ES {*;}
|
||||
-keep class bd.FH {*;}
|
||||
-keep class bb.FJ {*;}
|
||||
-keep class cm.FW {*;}
|
||||
-keep class h.UD {*;}
|
||||
-keep class h.UE {*;}
|
||||
-keep class h.UF {*;}
|
||||
-keep class h.UG {*;}
|
||||
-keep class h.UH {*;}
|
||||
-keep class h.UI {*;}
|
||||
-keep class w.VA {*;}
|
||||
-keep class w.VB {*;}
|
||||
-keep class w.VC {*;}
|
||||
-keep class w.VD {*;}
|
||||
-keep class w.VE {*;}
|
||||
-keep class w.VF {*;}
|
||||
-keep class w.VG {*;}
|
||||
-keep class w.VH {*;}
|
||||
-keep class w.VI {*;}
|
||||
-keep class w.VJ {*;}
|
||||
-keep class w.VK {*;}
|
||||
-keep class w.VL {*;}
|
||||
-keep class w.VM {*;}
|
||||
-keep class bb.WY {*;}
|
||||
-keep class bb.WZ {*;}
|
||||
-keep class bb.XA {*;}
|
||||
-keep class bb.XB {*;}
|
||||
-keep class bb.XC {*;}
|
||||
-keep class bb.XD {*;}
|
||||
-keep class bb.XE {*;}
|
||||
-keep class bb.XF {*;}
|
||||
-keep class bb.XG {*;}
|
||||
-keep class bb.XH {*;}
|
||||
-keep class bb.XI {*;}
|
||||
-keep class bb.XJ {*;}
|
||||
-keep class bb.XK {*;}
|
||||
-keep class bb.XL {*;}
|
||||
-keep class bb.XM {*;}
|
||||
-keep class bb.XN {*;}
|
||||
-keep class bb.XO {*;}
|
||||
-keep class bb.XP {*;}
|
||||
-keep class bb.XQ {*;}
|
||||
-keep class bb.XR {*;}
|
||||
-keep class bb.XS {*;}
|
||||
-keep class bb.XT {*;}
|
||||
-keep class bb.XU {*;}
|
||||
-keep class bb.XV {*;}
|
||||
-keep class bb.XW {*;}
|
||||
-keep class bb.XX {*;}
|
||||
-keep class bb.XY {*;}
|
||||
-keep class bd.YC {*;}
|
||||
-keep class bd.YD {*;}
|
||||
-keep class bd.YE {*;}
|
||||
-keep class be.YF {*;}
|
||||
-keep class be.YG {*;}
|
||||
-keep class be.YH {*;}
|
||||
-keep class be.YI {*;}
|
||||
-keep class be.YJ {*;}
|
||||
-keep class be.YK {*;}
|
||||
-keep class be.YL {*;}
|
||||
-keep class be.YM {*;}
|
||||
-keep class be.YN {*;}
|
||||
-keep class bl.ZD {*;}
|
||||
-keep class bl.ZE {*;}
|
||||
-keep class bl.ZF {*;}
|
||||
-keep class bl.ZG {*;}
|
||||
-keep class bl.ZH {*;}
|
||||
-keep class bl.ZI {*;}
|
||||
-keep class bl.ZJ {*;}
|
||||
-keep class bl.ZK {*;}
|
||||
-keep class bl.ZL {*;}
|
||||
-keep class bl.ZM {*;}
|
||||
-keep class bl.ZN {*;}
|
||||
-keep class bl.ZO {*;}
|
||||
-keep class bl.ZP {*;}
|
||||
-keep class ce.BDC {*;}
|
||||
-keep class ce.BDD {*;}
|
||||
-keep class ce.BDE {*;}
|
||||
-keep class ce.BDF {*;}
|
||||
-keep class ce.BDG {*;}
|
||||
-keep class ce.BDH {*;}
|
||||
-keep class ce.BDI {*;}
|
||||
-keep class ce.BDJ {*;}
|
||||
-keep class ce.BDK {*;}
|
||||
-keep class ce.BDL {*;}
|
||||
-keep class ce.BDM {*;}
|
||||
-keep class ce.BDN {*;}
|
||||
-keep class ce.BDO {*;}
|
||||
-keep class ce.BDP {*;}
|
||||
-keep class ce.BDQ {*;}
|
||||
-keep class ce.BDR {*;}
|
||||
-keep class ce.BDS {*;}
|
||||
-keep class ce.BDT {*;}
|
||||
-keep class ce.BDU {*;}
|
||||
-keep class ce.BDV {*;}
|
||||
-keep class ce.BDW {*;}
|
||||
-keep class ce.BDX {*;}
|
||||
-keep class ce.BDY {*;}
|
||||
-keep class ce.BDZ {*;}
|
||||
-keep class ce.BEA {*;}
|
||||
-keep class ce.BEB {*;}
|
||||
-keep class ce.BEC {*;}
|
||||
-keep class ce.BED {*;}
|
||||
-keep class ce.BEE {*;}
|
||||
-keep class ce.BEF {*;}
|
||||
-keep class ce.BEG {*;}
|
||||
-keep class ce.BEH {*;}
|
||||
-keep class ce.BEI {*;}
|
||||
-keep class ce.BEJ {*;}
|
||||
-keep class cm.BFD {*;}
|
||||
-keep class cm.BFE {*;}
|
||||
-keep class cm.BFF {*;}
|
||||
-keep class cm.BFG {*;}
|
||||
|
||||
|
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 767 B |
Before Width: | Height: | Size: 709 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 692 B |
Before Width: | Height: | Size: 470 B After Width: | Height: | Size: 1.2 KiB |
@@ -51,8 +51,15 @@
|
||||
tools:node="remove" />
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="32" />
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="32" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" /> <!-- 如果需要实时音视频通话模块,下面的权限也是必须的。否则,可以不加 -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <!-- SDK 权限申明, 第三方 APP 接入时,请将 com.netease.nim.demo 替换为自己的包名 -->
|
||||
@@ -72,6 +79,9 @@
|
||||
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
|
||||
<!-- AppsFlyer需要,参考:https://dev.appsflyer.com/hc/docs/install-android-sdk#setting-required-permissions -->
|
||||
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- 对于 Android 12.0 及以上设备,还需要添加如下权限: -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
|
||||
<application
|
||||
android:name=".application.XChatApplication"
|
||||
@@ -85,6 +95,7 @@
|
||||
android:theme="@style/MyMaterialTheme"
|
||||
tools:replace="android:name,android:allowBackup"
|
||||
tools:targetApi="n">
|
||||
|
||||
<activity
|
||||
android:name=".other.activity.SplashActivity"
|
||||
android:exported="true"
|
||||
@@ -111,7 +122,7 @@
|
||||
|
||||
<data
|
||||
android:host="main"
|
||||
android:scheme="pekoapp" />
|
||||
android:scheme="repoapp" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -150,7 +161,7 @@
|
||||
如果 SDKOptions 中提供了,取 SDKOptions 中的值。
|
||||
-->
|
||||
<activity
|
||||
android:name="com.vele.pekolive.lineapi.LineAuthenticationCallbackActivity"
|
||||
android:name="app.repo.cam.lineapi.LineAuthenticationCallbackActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:noHistory="true">
|
||||
@@ -211,7 +222,7 @@
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:label="Peko"
|
||||
android:label="Repo"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> <!-- 配置的service和receiver -->
|
||||
@@ -243,6 +254,10 @@
|
||||
android:name=".avroom.activity.RoomBlackListActivity"
|
||||
android:label="@string/main_androidmanifest_09"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".module_hall.hall.activity.RoomIncomeActivity"
|
||||
android:label="房间流水"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.yizhuan.tutu.music.activity.AddLocalMusicListActivity"
|
||||
android:label="@string/main_androidmanifest_010"
|
||||
@@ -814,6 +829,10 @@
|
||||
<activity
|
||||
android:name=".ui.webview.DatingRuleWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
<activity
|
||||
android:name=".ui.webview.room_banner.RoomBannerWebDialogActivity"
|
||||
android:theme="@style/dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".ui.webview.TarotPayWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
@@ -969,15 +988,14 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".treasurefairy.HomeFairyActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||
android:exported="false"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
android:theme="@style/transparent_activity" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.webview.FairyDialogWebViewActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||
android:exported="false"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
android:theme="@style/transparent_activity" />
|
||||
|
||||
<meta-data
|
||||
android:name="notch.config"
|
||||
@@ -1001,6 +1019,10 @@
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
|
||||
<meta-data
|
||||
android:name="Mob-Https"
|
||||
android:value="yes" />
|
||||
|
||||
<provider
|
||||
android:name="com.netease.nimlib.ipc.NIMContentProvider"
|
||||
android:authorities="${applicationId}.ipc.provider"
|
||||
@@ -1018,8 +1040,7 @@
|
||||
android:name="com.netease.nimlib.service.NimReceiver"
|
||||
android:exported="false"
|
||||
android:process=":core"
|
||||
tools:node="remove">
|
||||
</receiver>
|
||||
tools:node="remove"></receiver>
|
||||
<receiver android:name="com.netease.nimlib.service.ResponseReceiver" />
|
||||
<receiver
|
||||
android:name=".reciever.IncomingCallReceiver"
|
||||
@@ -1029,6 +1050,7 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name=".reciever.NotificationClickReceiver" />
|
||||
|
||||
<service
|
||||
android:name="com.netease.nimlib.service.NimService"
|
||||
android:process=":core" />
|
||||
@@ -1043,6 +1065,33 @@
|
||||
<service
|
||||
android:name=".service.DaemonService"
|
||||
android:enabled="true" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ApplicationId"
|
||||
android:value="@string/facebook_app_id" />
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ClientToken"
|
||||
android:value="@string/facebook_client_token" />
|
||||
|
||||
<activity
|
||||
android:name="com.facebook.FacebookActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="com.facebook.CustomTabActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="@string/fb_login_protocol_scheme" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".avroom.room_album.RoomAlbumActivity" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
1
app/src/main/assets/hot_region.json
Normal file
@@ -0,0 +1 @@
|
||||
[{"name":"Taiwan","abbr":"TW","mcc":"466","code":"886"},{"name":"Hong Kong","abbr":"HK","mcc":"454","code":"852"},{"name":"Singapore","abbr":"SG","mcc":"525","code":"65"},{"name":"Malaysia","abbr":"MY","mcc":"502","code":"60"},{"name":"China","abbr":"CN","mcc":"460","code":"86"}]
|
1
app/src/main/assets/region.json
Normal file
BIN
app/src/main/assets/svga/home_living.svga
Normal file
BIN
app/src/main/assets/svga/home_voice_playing.svga
Normal file
BIN
app/src/main/assets/svga/home_white_living.svga
Normal file
BIN
app/src/main/assets/svga/room_bg_single.svga
Normal file
BIN
app/src/main/assets/svga/svga_home_pk.svga
Normal file
BIN
app/src/main/assets/svga/svga_notify_h5.svga
Normal file
BIN
app/src/main/assets/svga/svga_tarot_senior.svga
Normal file
@@ -1,4 +1,4 @@
|
||||
package com.vele.pekolive.lineapi;
|
||||
package app.repo.cam.lineapi;
|
||||
|
||||
import cn.sharesdk.line.LineHandlerActivity;
|
||||
|
@@ -15,7 +15,7 @@ import com.yizhuan.erban.other.activity.SplashActivity;
|
||||
import com.yizhuan.xchat_android_core.linked.LinkedModel;
|
||||
import com.yizhuan.xchat_android_core.linked.bean.LinkedInfo;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.CoreTextUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -49,7 +49,7 @@ public class AgentActivity extends AppCompatActivity implements SceneRestorable
|
||||
if (roomuid != null) {
|
||||
linkedInfo.setRoomUid(roomuid);
|
||||
}
|
||||
if (TextUtils.isEmptyText(roomuid) && uid != null) {
|
||||
if (CoreTextUtils.isEmptyText(roomuid) && uid != null) {
|
||||
linkedInfo.setRoomUid(uid);
|
||||
}
|
||||
if (uid != null) {
|
||||
|
@@ -112,9 +112,10 @@ import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedBindPhoneEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedCompleteInfoEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedVerifyBoundAuthCodeEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.CoreLogger;
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.threadmgr.ThreadPoolManager;
|
||||
@@ -214,6 +215,8 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
!TextUtils.isEmpty(linkedInfo.getDynamicId())) {
|
||||
DynamicDetailActivity.start(context, JavaUtil.str2long(linkedInfo.getDynamicId()),
|
||||
JavaUtil.str2long(linkedInfo.getWorldId()), 6);
|
||||
} else if (linkedInfo.getType().equals("7") && !TextUtils.isEmpty(linkedInfo.getUid())) {
|
||||
NimP2PMessageActivity.start(context, linkedInfo.getUid());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -408,6 +411,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
}
|
||||
onParseIntent();
|
||||
handleNimIntent();
|
||||
InitialModel.get().regionCheck();
|
||||
}
|
||||
|
||||
private void onParseIntent() {
|
||||
@@ -517,6 +521,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLoadLoginUserInfoEvent(LoadLoginUserInfoEvent event) {
|
||||
firstLoadedUserInfo();
|
||||
InitialModel.get().regionCheck();
|
||||
}
|
||||
|
||||
public void onLogout() {
|
||||
@@ -564,7 +569,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
.subscribe(new BeanObserver<Boolean>() {
|
||||
@Override
|
||||
public void onErrorMsg(String error) {
|
||||
com.yizhuan.xchat_android_core.utils.Logger.info("isBoundAuthCode", error);
|
||||
CoreLogger.info("isBoundAuthCode", error);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -816,8 +821,8 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
GameHomeModel.get().getRoomShortcut()
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(uid -> {
|
||||
if (StringUtils.toLong(uid) != 0) {
|
||||
AVRoomActivity.start(context, StringUtils.toLong(uid));
|
||||
if (StringFormatUtils.toLong(uid) != 0) {
|
||||
AVRoomActivity.start(context, StringFormatUtils.toLong(uid));
|
||||
}
|
||||
},
|
||||
Throwable::printStackTrace);
|
||||
|
@@ -108,7 +108,7 @@ public class UIHelper {
|
||||
|
||||
public static void showMonsterResult(Context context, String monsterId) {
|
||||
CommonWebViewActivity.start(context, UriProvider.IM_SERVER_URL +
|
||||
"/peko/modules/monster/index.html?monsterId=" + monsterId);
|
||||
"/repo/modules/monster/index.html?monsterId=" + monsterId);
|
||||
}
|
||||
|
||||
public static void showLabelInfoAct(Activity mActivity, int requestCode) {
|
||||
@@ -132,11 +132,11 @@ public class UIHelper {
|
||||
*/
|
||||
public static void showRecommendPosH5(Context context) {
|
||||
String cardUrl = UriProvider.JAVA_WEB_URL +
|
||||
"/peko/modules/recommend-card/index.html";
|
||||
"/repo/modules/recommend-card/index.html";
|
||||
CommonWebViewActivity.start(context, cardUrl);
|
||||
}
|
||||
|
||||
public static void openContactUs(Context context) {
|
||||
CommonWebViewActivity.start(context, UriProvider.IM_SERVER_URL + "/peko/modules/contact/contact.html");
|
||||
CommonWebViewActivity.start(context, UriProvider.IM_SERVER_URL + "/repo/modules/contact/contact.html");
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ import com.yizhuan.erban.relation.cp.dialog.CpGlobalDialog;
|
||||
import com.yizhuan.erban.ui.widget.LevelUpDialog;
|
||||
import com.yizhuan.erban.ui.widget.RecallDialog;
|
||||
import com.yizhuan.erban.ui.widget.lottery_dialog.LotteryDialogManager;
|
||||
import com.yizhuan.erban.vip.VipUpgradeDialog;
|
||||
import com.yizhuan.erban.vip.dialog.VipUpgradeDialog;
|
||||
import com.yizhuan.xchat_android_core.activity.bean.LotteryInfo;
|
||||
import com.yizhuan.xchat_android_core.level.event.CharmLevelUpEvent;
|
||||
import com.yizhuan.xchat_android_core.level.event.LevelUpEvent;
|
||||
@@ -17,7 +17,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.pay.event.NewUserChargeEvent;
|
||||
import com.yizhuan.xchat_android_core.recall.bean.CheckLostUserInfo;
|
||||
import com.yizhuan.xchat_android_core.recall.event.CheckLostUserEvent;
|
||||
import com.yizhuan.xchat_android_core.relation.cp.CpInviteInfo;
|
||||
import com.yizhuan.xchat_android_core.relation.cp.bean.CpInviteInfo;
|
||||
import com.yizhuan.xchat_android_core.upgrade.event.ImPushUpdateAppEvent;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
@@ -27,8 +27,6 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* 全局处理,比如App弹窗
|
||||
* create by lvzebiao @2019/8/14
|
||||
|
@@ -16,7 +16,10 @@ import android.util.Log;
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
import com.bumptech.glide.request.target.ViewTarget;
|
||||
import com.chuhai.utils.LanguageUtils;
|
||||
import com.chuhai.utils.ServiceTime;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.facebook.stetho.Stetho;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.mob.MobSDK;
|
||||
import com.mob.moblink.MobLink;
|
||||
@@ -48,7 +51,6 @@ import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.common.app.ActivityStack;
|
||||
import com.yizhuan.erban.common.util.AppLifeCycleHelper;
|
||||
import com.yizhuan.erban.module_hall.HallDataManager;
|
||||
import com.yizhuan.erban.other.activity.SplashActivity;
|
||||
import com.yizhuan.erban.radish.wallet.RadishWalletManager;
|
||||
import com.yizhuan.erban.utils.PushMessageHandler;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
@@ -65,6 +67,7 @@ import com.yizhuan.xchat_android_core.im.custom.bean.OpenSignInAttachment;
|
||||
import com.yizhuan.xchat_android_core.initial.InitialModel;
|
||||
import com.yizhuan.xchat_android_core.interceptor.NoParamsInterceptor;
|
||||
import com.yizhuan.xchat_android_core.interceptor.ParamsInterceptor;
|
||||
import com.yizhuan.xchat_android_core.interceptor.TimeSyncInterceptor;
|
||||
import com.yizhuan.xchat_android_core.manager.IMMessageManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMSystemMsgManager;
|
||||
import com.yizhuan.xchat_android_core.market_verify.MarketVerifyModel;
|
||||
@@ -113,6 +116,9 @@ import io.realm.RealmConfiguration;
|
||||
public class XChatApplication extends BaseApp {
|
||||
public static final String TAG = "XChatApplication";
|
||||
public static Application gContext;
|
||||
|
||||
// 接收到退出登录事件(跳转到登录页了)
|
||||
private static long logoutEventTime = 0;
|
||||
private static final MessageNotifierCustomization messageNotifierCustomization = new MessageNotifierCustomization() {
|
||||
@Override
|
||||
public String makeNotifyContent(String nick, IMMessage message) {
|
||||
@@ -162,6 +168,11 @@ public class XChatApplication extends BaseApp {
|
||||
public String makeRevokeMsgTip(String s, IMMessage imMessage) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String makeCategory(IMMessage message) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
private static XChatApplication instance;
|
||||
//生命周期监听
|
||||
@@ -196,10 +207,11 @@ public class XChatApplication extends BaseApp {
|
||||
|
||||
String channel = "";
|
||||
channel = ChannelReaderUtil.getChannel(instance);
|
||||
Log.d(TAG, "localChannel:" + channel);
|
||||
if (TextUtils.isEmpty(channel)) {
|
||||
channel = Constants.GOOGLE;
|
||||
}
|
||||
|
||||
Log.d(TAG, "finalChannel:" + channel);
|
||||
BasicConfig.INSTANCE.setOriginalChannel(channel);
|
||||
|
||||
BasicConfig.INSTANCE.setChannel(channel);
|
||||
@@ -238,6 +250,13 @@ public class XChatApplication extends BaseApp {
|
||||
SingleToastUtil.showToast(serviceResult.getMessage());
|
||||
EventBus.getDefault().post(new NeedCompleteInfoEvent());
|
||||
throw new ServerException(serviceResult.getMessage(), serviceResult.getCode());
|
||||
} else if (serviceResult.getCode() == 401) {
|
||||
if ((ServiceTime.INSTANCE.getTime() - logoutEventTime) > 800) {
|
||||
logoutEventTime = ServiceTime.INSTANCE.getTime();
|
||||
SingleToastUtil.showToast(serviceResult.getMessage());
|
||||
AuthModel.get().cleanLogInfo();
|
||||
}
|
||||
throw new ServerException(serviceResult.getMessage(), serviceResult.getCode());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -248,6 +267,7 @@ public class XChatApplication extends BaseApp {
|
||||
//fixed: Glide Exception:"You must not call setTag() on a view Glide is targeting"
|
||||
ViewTarget.setTagId(R.id.tag_glide);
|
||||
|
||||
initStetho(context);
|
||||
init(channel);
|
||||
|
||||
//生命周期监听
|
||||
@@ -396,11 +416,13 @@ public class XChatApplication extends BaseApp {
|
||||
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());
|
||||
httpParams.put("lang", LanguageUtils.INSTANCE.getSystemLanguage().toLanguageTag());
|
||||
RxNet.init(context)
|
||||
.debug(BuildConfig.DEBUG)
|
||||
.setBaseUrl(url)
|
||||
.addInterceptors(new ParamsInterceptor(httpParams))
|
||||
.addInterceptors(new NoParamsInterceptor())//注意:拦截器的添加顺序,请求的拦截顺序
|
||||
.addInterceptors(new TimeSyncInterceptor())
|
||||
.certificates()
|
||||
.build();
|
||||
//单例的model 初始化
|
||||
@@ -413,11 +435,11 @@ public class XChatApplication extends BaseApp {
|
||||
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);
|
||||
String cacheDirPath = FileHelper.getRootCacheDir().getAbsolutePath();
|
||||
File cacheFie = new File(cacheDirPath, "cacheDir");
|
||||
HttpResponseCache.install(cacheFie, 1024 * 1024 * 128);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "testtest", e);
|
||||
Log.e(TAG, "HttpResponseCache install error :" + e.getMessage());
|
||||
}
|
||||
|
||||
initRxNet(BasicConfig.INSTANCE.getAppContext(), UriProvider.JAVA_WEB_URL);
|
||||
@@ -503,10 +525,7 @@ public class XChatApplication extends BaseApp {
|
||||
BasicConfig.INSTANCE.setAppContext(this.getApplicationContext());
|
||||
SharedPreferenceUtils.init(this);
|
||||
ResUtil.init(this);
|
||||
boolean isShowPrivacyAgreement = (boolean) SharedPreferenceUtils.get(SplashActivity.SHOW_PRIVACY_AGREEMENT, true);
|
||||
if (!isShowPrivacyAgreement) {
|
||||
initOtherSDK();
|
||||
}
|
||||
initOtherSDK();
|
||||
initContext(this);
|
||||
//首次启动事件
|
||||
HashMap<String, Object> map = new HashMap<>(2);
|
||||
@@ -542,4 +561,18 @@ public class XChatApplication extends BaseApp {
|
||||
unregisterActivityLifecycleCallbacks(lifeCycleHelper);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化Stetho(网络调试)
|
||||
*/
|
||||
private static void initStetho(Context context) {
|
||||
if (Env.isDebug()) {
|
||||
Stetho.initialize(
|
||||
Stetho.newInitializerBuilder(context)
|
||||
.enableDumpapp(Stetho.defaultDumperPluginsProvider(context))
|
||||
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(context))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.audio.widget.VoiceLine;
|
||||
import com.yizhuan.xchat_android_core.audio.bean.UserVoiceInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
|
||||
import java.util.List;
|
||||
@@ -105,7 +105,7 @@ public class MyVoiceListAdapter extends BaseQuickAdapter<UserVoiceInfo, BaseView
|
||||
});
|
||||
// 点击播放声音/停止声音
|
||||
helper.voiceBarLayout.setOnClickListener(view -> {
|
||||
if (StringUtils.isEmpty(item.getVoiceUrl())) {
|
||||
if (StringFormatUtils.isEmpty(item.getVoiceUrl())) {
|
||||
return;
|
||||
}
|
||||
boolean isChange = helper.getAdapterPosition() != voiceClickPos;
|
||||
@@ -140,7 +140,7 @@ public class MyVoiceListAdapter extends BaseQuickAdapter<UserVoiceInfo, BaseView
|
||||
});
|
||||
// 点击播放声音/停止声音
|
||||
helper.voiceBarLayout.setOnClickListener(view -> {
|
||||
if (StringUtils.isEmpty(item.getVoiceUrl())) {
|
||||
if (StringFormatUtils.isEmpty(item.getVoiceUrl())) {
|
||||
return;
|
||||
}
|
||||
boolean isChange = helper.getAdapterPosition() != voiceClickPos;
|
||||
@@ -177,7 +177,7 @@ public class MyVoiceListAdapter extends BaseQuickAdapter<UserVoiceInfo, BaseView
|
||||
});
|
||||
// 点击播放声音/停止声音
|
||||
helper.voiceBarLayout.setOnClickListener(view -> {
|
||||
if (StringUtils.isEmpty(item.getVoiceUrl())) {
|
||||
if (StringFormatUtils.isEmpty(item.getVoiceUrl())) {
|
||||
return;
|
||||
}
|
||||
boolean isChange = helper.getAdapterPosition() != voiceClickPos;
|
||||
|
@@ -109,6 +109,9 @@ public class AudioPlayerHelper {
|
||||
}
|
||||
|
||||
public void endPlay() {
|
||||
if (listener != null) {
|
||||
listener.onCompletion();
|
||||
}
|
||||
handler.removeMessages(WHAT_STATUS.COUNT_PLAY);
|
||||
if (player != null) {
|
||||
if (preparing) {
|
||||
|
@@ -17,7 +17,7 @@ import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.manager.AudioEngineManager
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.sound.model.SoundModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.common.application.BaseApp
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||
|
@@ -18,7 +18,7 @@ import com.yizhuan.erban.ui.im.avtivity.NimFriendModel;
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem;
|
||||
import com.yizhuan.erban.ui.widget.GiftDialog;
|
||||
import com.yizhuan.erban.vip.VipHelper;
|
||||
import com.yizhuan.erban.vip.util.VipHelper;
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomMsgActivity;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
|
||||
|
@@ -2,13 +2,21 @@ package com.yizhuan.erban.avroom.activity;
|
||||
|
||||
import static android.view.View.VISIBLE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ALL_SERVICE_GIFT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_BOX;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_FAIRY;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_GIFT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_SEA;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ROOM_PK;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_DRAW_GIFT_L5;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_ROOM_PK_NOTIFY;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -31,6 +39,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -58,11 +67,12 @@ import com.yizhuan.erban.avroom.fragment.HomePartyFragment;
|
||||
import com.yizhuan.erban.avroom.fragment.InputPwdDialogFragment;
|
||||
import com.yizhuan.erban.avroom.presenter.AvRoomPresenter;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyPresenter;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageOpenDialog;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageHandler;
|
||||
import com.yizhuan.erban.avroom.view.IAvRoomView;
|
||||
import com.yizhuan.erban.avroom.widget.VerticalViewPagerAdapter;
|
||||
import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.AllServiceGiftProtocolDataBean;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.common.widget.CustomImageSpan;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
@@ -74,10 +84,7 @@ import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
|
||||
import com.yizhuan.erban.ui.widget.NobleOpenNoticeView;
|
||||
import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftDialog;
|
||||
import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftLevelOneDialog;
|
||||
import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftLevelThreeDialog;
|
||||
import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftLevelTwoDialog;
|
||||
import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftLevelDialog;
|
||||
import com.yizhuan.erban.ui.widget.dialog.MonsterDialog;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomMsgActivity;
|
||||
@@ -90,29 +97,37 @@ import com.yizhuan.xchat_android_core.channel_page.bean.HelloMessageInfo;
|
||||
import com.yizhuan.xchat_android_core.gift.GiftModel;
|
||||
import com.yizhuan.xchat_android_core.gift.bean.GiftInfo;
|
||||
import com.yizhuan.xchat_android_core.gift.bean.LuckyBagNoticeInfo;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.FairyMsgAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.NotifyH5Attachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.NotifyH5Info;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeInfo;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomLuckySeaAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomLuckySeaMsgBean;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPKAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomReceivedLuckyGiftAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.TarotAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.TarotMsgBean;
|
||||
import com.yizhuan.xchat_android_core.initial.InitialModel;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel;
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.bean.SuperAdminInfo;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterDataBean;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterHuntingResult;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterInfo;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterProtocol;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.manager.MonsterDataManager;
|
||||
import com.yizhuan.xchat_android_core.noble.AllServiceGiftProtocol;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleResourceType;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.patriarch.event.CloseMinRoomEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.event.ImPushMsgPmLimitTimeEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.event.PmDismissAllLimitDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.exception.PmRoomLimitException;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo;
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageNotifyInfo;
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomModeType;
|
||||
@@ -123,14 +138,16 @@ import com.yizhuan.xchat_android_core.room.event.RoomTaskTipsEvent;
|
||||
import com.yizhuan.xchat_android_core.room.pk.event.PKStateEvent;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SAdminOptUtil;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext;
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView;
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.bean.FairyMsgInfoBean;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.FirstChargeInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.UIUtils;
|
||||
@@ -142,10 +159,8 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Single;
|
||||
@@ -161,7 +176,7 @@ import io.reactivex.disposables.Disposable;
|
||||
*/
|
||||
@CreatePresenter(AvRoomPresenter.class)
|
||||
public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter>
|
||||
implements View.OnClickListener, IAvRoomView {
|
||||
implements View.OnClickListener, IAvRoomView, RoomView {
|
||||
|
||||
public static final int FROM_TYPE_NORMAL = 0;
|
||||
public static final int FROM_TYPE_RECOMMEND = 1;
|
||||
@@ -199,17 +214,20 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
private RoomInfo mRoomInfo;
|
||||
private ImageView ivHeadWear;
|
||||
private MonsterDialog monsterDialog;
|
||||
private List<RedPackageOpenDialog> openDialogs;
|
||||
private ViewPager2 viewpager;
|
||||
private VerticalViewPagerAdapter mAdapter;
|
||||
/*********************************显示全服礼物***************************************/
|
||||
|
||||
private GiftBroadcastObserver giftObserver;
|
||||
private Dialog giftDialog;
|
||||
private LinkedList<AllServiceGiftProtocol.DataBean> giftList;
|
||||
private boolean isResume = true;
|
||||
private LinkedList<AllServiceGiftProtocolDataBean> giftList;
|
||||
@Nullable
|
||||
private SingleRoomTipDialog singleRoomTipDialog;
|
||||
// 通过红包进来时,有该参数
|
||||
private RedPackageNotifyInfo redPackageNotifyInfo;
|
||||
|
||||
// 是否禁用VP滑动(true:不允许滑动;false:某些条件下可以滑动)
|
||||
private boolean viewPagerInputDisable;
|
||||
|
||||
public static void start(Context context, long roomUid) {
|
||||
startForFromType(context, roomUid, FROM_TYPE_NORMAL, null, null);
|
||||
@@ -282,7 +300,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
|
||||
public static void setBackBg(Context context, RoomInfo roomInfo, SVGAImageView svgaRoomBg, String[] bgPicture) {
|
||||
if (roomInfo != null && svgaRoomBg != null) {
|
||||
if (!StringUtils.isBlank(roomInfo.getBackPic())) {
|
||||
if (!StringFormatUtils.isBlank(roomInfo.getBackPic())) {
|
||||
int resourceType = NobleUtil.getResourceType(roomInfo.getBackPic());
|
||||
if (resourceType == NobleResourceType.URLS) {
|
||||
if (!roomInfo.getBackPic().equals(bgPicture[0])) {
|
||||
@@ -305,7 +323,8 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
} else if (roomInfo.getType() == RoomInfo.ROOM_TYPE_SINGLE) {
|
||||
bgPicture[0] = "";
|
||||
svgaRoomBg.setImageResource(R.drawable.bg_room_single_pic);
|
||||
// svgaRoomBg.setImageResource(R.drawable.bg_room_single_pic);
|
||||
playSvgaBg(svgaRoomBg, "svga/room_bg_single.svga");
|
||||
} else {
|
||||
bgPicture[0] = "";
|
||||
if (roomInfo.getRoomModeType() == RoomModeType.OPEN_PK_MODE) {
|
||||
@@ -382,7 +401,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
public void setCurrentItem(int item) {
|
||||
dismissLoadingDialog();
|
||||
if (viewpager != null) {
|
||||
viewpager.setUserInputEnabled(true);
|
||||
tryEnabledViewPagerInput();
|
||||
viewpager.setCurrentItem(item, false);
|
||||
}
|
||||
}
|
||||
@@ -394,6 +413,12 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
fromUid = intent.getStringExtra("fromUid");
|
||||
giftId = intent.getIntExtra("giftId", 0);
|
||||
mRoomInfo = intent.getParcelableExtra(Constants.ROOM_INFO);
|
||||
Object notifyInfo = intent.getSerializableExtra("notifyInfo");
|
||||
if (notifyInfo instanceof RedPackageNotifyInfo) {
|
||||
redPackageNotifyInfo = (RedPackageNotifyInfo) notifyInfo;
|
||||
} else {
|
||||
redPackageNotifyInfo = null;
|
||||
}
|
||||
if (mRoomInfo != null) {
|
||||
roomUid = mRoomInfo.getRoomUid();
|
||||
} else {
|
||||
@@ -425,7 +450,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
viewpager.setOffscreenPageLimit(2);
|
||||
viewpager.setOrientation(ViewPager2.ORIENTATION_VERTICAL);
|
||||
viewpager.getChildAt(0).setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
viewpager.setUserInputEnabled(false);
|
||||
disableViewPagerInput();
|
||||
viewpager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
@@ -452,11 +477,11 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
if (state == 0 && viewpager.getCurrentItem() == 2) {
|
||||
showLoadingDialog();
|
||||
((FakeSingleRoomFragment) mAdapter.getItem(2)).tryJumpRoom();
|
||||
viewpager.setUserInputEnabled(false);
|
||||
disableViewPagerInput();
|
||||
} else if (state == 0 && viewpager.getCurrentItem() == 0) {
|
||||
showLoadingDialog();
|
||||
((FakeSingleRoomBackFragment) mAdapter.getItem(0)).tryJumpRoom();
|
||||
viewpager.setUserInputEnabled(false);
|
||||
disableViewPagerInput();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -492,8 +517,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
if (giftList != null) {
|
||||
giftList.clear();
|
||||
}
|
||||
if (!isResume) showRedPackage(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
isResume = true;
|
||||
}
|
||||
|
||||
private void onRoomEventReceive(RoomEvent roomEvent) {
|
||||
@@ -538,7 +561,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
break;
|
||||
case RoomEvent.MONSTER_STATUS_CHANGED:
|
||||
MonsterProtocol.DataBean dataBean = roomEvent.getMonsterStatusAttachment().getDataBean();
|
||||
MonsterDataBean dataBean = roomEvent.getMonsterStatusAttachment().getDataBean();
|
||||
Log.e(TAG, "onRoomEventReceive: monster status changed: " + dataBean);
|
||||
RoomInfo myRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
// 当前为房间页面并且当前房间为怪兽出现房间时才出现通知
|
||||
@@ -586,7 +609,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
// 当前为房间页面并且当前房间为怪兽出现房间时才出现通知
|
||||
if (UIUtils.isTopActivity(AVRoomActivity.this) && currentRoomInfo != null &&
|
||||
currentRoomInfo.getUid() == monsterHuntingResult.getMonster().getAppearRoomUid()) {
|
||||
MonsterProtocol.DataBean monsterInfo = monsterHuntingResult.getMonster();
|
||||
MonsterDataBean monsterInfo = monsterHuntingResult.getMonster();
|
||||
if (monsterDialog != null && monsterDialog.isShowing()) {
|
||||
monsterDialog.dismiss();
|
||||
}
|
||||
@@ -597,9 +620,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
case RoomEvent.MY_SELF_KICK_OUT_ROOM_BY_S_ADMIN:
|
||||
toBack(true);
|
||||
break;
|
||||
case RoomEvent.RECEIVE_RED_PACKAGE:
|
||||
showRedPackage(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@@ -648,7 +668,14 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
*/
|
||||
private void showRoomFragment(boolean isRoomMin) {
|
||||
mCurrentFragment = (HomePartyFragment) mAdapter.getItem(1);
|
||||
viewpager.setUserInputEnabled(AvRoomDataManager.get().isSingleRoom());
|
||||
mCurrentFragment.getPlayNotifyState().observe(getLifecycleOwner(), aBoolean -> {
|
||||
if (!aBoolean) {
|
||||
if (isValid()) {
|
||||
showGiftDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
tryEnabledViewPagerInput();
|
||||
viewpager.setCurrentItem(1, false);
|
||||
if (isRoomMin) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
@@ -661,6 +688,17 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
RxBus.get().post(new ShowGiftDialogEvent().setGiftId(giftId));
|
||||
giftId = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 临时方案:后续逐步完善整个房间的RoomContext替换计划
|
||||
* PS:目前房间进入的逻辑有些凌乱,没有明确的生命周期,看代码逻辑,无论是第一次还是再次进入都会走这里,所以在这里绑定View
|
||||
*/
|
||||
getRoomContext().onViewAttach(this);
|
||||
|
||||
/**
|
||||
* 每次View重新创建(意味着可能在房间外点了红包),就重新尝试加载红包并展示
|
||||
*/
|
||||
tryShowSourceRedPackage();
|
||||
}
|
||||
|
||||
private void showLiveFinishView(long uid) {
|
||||
@@ -697,42 +735,24 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
AvRoomDataManager.get().release();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void showRedPackage(RoomInfo roomInfo) {
|
||||
if (roomInfo == null) return;
|
||||
RedPackageNotifyInfo inRoomNotifyInfo = (RedPackageNotifyInfo) getIntent().getSerializableExtra("notifyInfo");
|
||||
Map<String, Long> redMap = DemoCache.readRedPackage();
|
||||
RedPackageModel.INSTANCE.getRedPackage(roomInfo.getUid())
|
||||
.compose(bindToLifecycle())
|
||||
.doFinally(() -> {
|
||||
if (inRoomNotifyInfo != null && (redMap == null || !redMap.containsKey(inRoomNotifyInfo.getRedEnvelopeId()))) {
|
||||
showRedPackageOpenDialog(inRoomNotifyInfo);
|
||||
}
|
||||
})
|
||||
.filter(notifyInfo -> inRoomNotifyInfo == null || !notifyInfo.getRedEnvelopeId().equals(inRoomNotifyInfo.getRedEnvelopeId()))
|
||||
.subscribe(this::showRedPackageOpenDialog);
|
||||
}
|
||||
|
||||
private void showRedPackageOpenDialog(RedPackageNotifyInfo notifyInfo) {
|
||||
if (!isResume) return;
|
||||
if (openDialogs == null) {
|
||||
openDialogs = new ArrayList<>();
|
||||
}
|
||||
RedPackageOpenDialog openDialog = RedPackageOpenDialog.Companion.newInstance(notifyInfo);
|
||||
openDialog.show(this);
|
||||
if (openDialog.getDialog() != null) {
|
||||
openDialog.getDialog().setOnDismissListener(dialog -> openDialogs.remove(openDialog));
|
||||
}
|
||||
openDialogs.add(openDialog);
|
||||
if (openDialogs.size() >= SHOW_RED_DIALOG_MAX) {
|
||||
openDialogs.get(SHOW_RED_DIALOG_MAX - 1).dismissAllowingStateLoss();
|
||||
/**
|
||||
* 尝试展示来源红包(在房间外点击红包入口进入房间时)
|
||||
*/
|
||||
private void tryShowSourceRedPackage() {
|
||||
try {
|
||||
if (redPackageNotifyInfo != null) {
|
||||
RedPackageHandler handler = getRoomContext().findAbility(RedPackageHandler.class.getSimpleName());
|
||||
if (handler != null) {
|
||||
long id = Long.parseLong(redPackageNotifyInfo.getRedEnvelopeId());
|
||||
handler.tryShowRedPackage(id);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void dismissRedPackageDialog() {
|
||||
if (openDialogs != null) {
|
||||
openDialogs.clear();
|
||||
}
|
||||
if (mCurrentFragment != null) {
|
||||
mCurrentFragment.dismissSendRedPackageDialog();
|
||||
}
|
||||
@@ -1057,7 +1077,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
DemoCache.readNewUserChargeGift() == 0) {
|
||||
DemoCache.saveNewUserChargeGift(1);
|
||||
}
|
||||
showRedPackage(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
|
||||
@@ -1177,34 +1196,90 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
baseProtocol = null;
|
||||
}
|
||||
if (baseProtocol == null) return;
|
||||
|
||||
if (!isValid()) return;
|
||||
switch (baseProtocol.getFirst()) {
|
||||
case CUSTOM_MSG_HEADER_TYPE_GIFT:
|
||||
if (!isValid()) return;
|
||||
if (giftList == null) {
|
||||
giftList = new LinkedList<>();
|
||||
}
|
||||
int second2 = baseProtocol.getSecond();
|
||||
AllServiceGiftProtocol.DataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocol.DataBean.class);
|
||||
AllServiceGiftProtocolDataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocolDataBean.class);
|
||||
if (data == null || (data.getGiftUrl()) == null)
|
||||
return;
|
||||
giftList.add(data);
|
||||
if (second2 == CUSTOM_MSG_ALL_SERVICE_GIFT) {
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
// 如果当前以及有礼物弹窗在展示,则需要等到他 dismiss 后再显示下一个
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
return;
|
||||
} else {
|
||||
giftDialog.dismiss();
|
||||
if (mCurrentFragment != null && mCurrentFragment.isShowingPlayNotify()) {
|
||||
return;
|
||||
}
|
||||
showGiftDialog();
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_BOX://寻爱之旅
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA) {
|
||||
RoomBoxPrizeAttachment roomBoxPrizeAttachment = new RoomBoxPrizeAttachment(CUSTOM_MSG_BOX, CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA);
|
||||
RoomBoxPrizeInfo roomBoxPrizeBean = JSON.parseObject(String.valueOf(baseProtocol.getData()), RoomBoxPrizeInfo.class);
|
||||
roomBoxPrizeAttachment.setUid(roomBoxPrizeBean.getUid());
|
||||
roomBoxPrizeAttachment.setPrizeName(roomBoxPrizeBean.getPrizeName());
|
||||
roomBoxPrizeAttachment.setNick(roomBoxPrizeBean.getNick());
|
||||
roomBoxPrizeAttachment.setBoxTypeStr(roomBoxPrizeBean.getBoxTypeStr());
|
||||
roomBoxPrizeAttachment.setRoomUid(roomBoxPrizeBean.getRoomUid());
|
||||
roomBoxPrizeAttachment.setPrizeNum(roomBoxPrizeBean.getPrizeNum());
|
||||
roomBoxPrizeAttachment.setUserLevelLimit(roomBoxPrizeBean.getUserLevelLimit());
|
||||
if (AvRoomDataManager.get().isOpenPureMode()) {
|
||||
// 純凈模式打開後,僅能看跟自己相關的砸蛋消息
|
||||
if (Objects.equals(roomBoxPrizeAttachment.getUid(), AuthModel.get().getCurrentUid())) {
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), roomBoxPrizeAttachment);
|
||||
IMNetEaseManager.get().addMessages(message);
|
||||
}
|
||||
} else {
|
||||
showGiftDialog();
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), roomBoxPrizeAttachment);
|
||||
IMNetEaseManager.get().addMessages(message);
|
||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.onNext(new RoomEvent()
|
||||
.setEvent(RoomEvent.BOX_NOTIFY_SVGA)
|
||||
.setChatRoomMessage(message));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_GIFT:
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY) {
|
||||
case CustomAttachment.CUSTOM_MESS_TAROT:
|
||||
if (baseProtocol.getSecond() == CustomAttachment.CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING) {
|
||||
TarotMsgBean tarotMsgBean = JSON.parseObject(String.valueOf(baseProtocol.getData()), TarotMsgBean.class);
|
||||
TarotAttachment tarotAttachment = new TarotAttachment(CustomAttachment.CUSTOM_MESS_TAROT,
|
||||
CustomAttachment.CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING);
|
||||
tarotAttachment.setTarotMsgBean(tarotMsgBean);
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomId()), tarotAttachment);
|
||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.onNext(new RoomEvent()
|
||||
.setEvent(RoomEvent.TAROT_NOTIFY_SVGA)
|
||||
.setChatRoomMessage(message));
|
||||
AvRoomDataManager.get().addChatRoomMessage(message);
|
||||
}
|
||||
break;
|
||||
case CustomAttachment.CUSTOM_MSG_NOTIFY_H5:
|
||||
if (baseProtocol.getSecond() == CustomAttachment.CUSTOM_MSG_NOTIFY_H5_SUB_WHOLE_SERVICE) {
|
||||
NotifyH5Info bean = JSON.parseObject(String.valueOf(baseProtocol.getData()), NotifyH5Info.class);
|
||||
NotifyH5Attachment notifyH5Attachment = new NotifyH5Attachment(baseProtocol.getSecond());
|
||||
notifyH5Attachment.setBean(bean);
|
||||
ChatRoomMessage notifyH5Msg = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomId()), notifyH5Attachment);
|
||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.onNext(new RoomEvent()
|
||||
.setEvent(RoomEvent.NOTIFY_H5)
|
||||
.setChatRoomMessage(notifyH5Msg));
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_SEA://星级厨房
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL) {
|
||||
RoomLuckySeaAttachment attachment = new RoomLuckySeaAttachment(CUSTOM_MSG_LUCKY_SEA, CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL);
|
||||
attachment.setRoomLuckySeaMsgBean(JSON.parseObject(String.valueOf(baseProtocol.getData()), RoomLuckySeaMsgBean.class));
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
IMNetEaseManager.get().addMessages(message);
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_GIFT://福袋
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY || baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL) {
|
||||
RoomReceivedLuckyGiftAttachment attachment = new RoomReceivedLuckyGiftAttachment(CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY);
|
||||
attachment.setLuckyBagNoticeInfo(JSON.parseObject(String.valueOf(baseProtocol.getData()), LuckyBagNoticeInfo.class));
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
@@ -1212,6 +1287,14 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
IMNetEaseManager.get().addMessages(message);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_FAIRY://夺宝精灵
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_SUB_DRAW_GIFT_L5) {
|
||||
FairyMsgAttachment attachment = new FairyMsgAttachment(CUSTOM_MSG_FAIRY, CUSTOM_MSG_SUB_DRAW_GIFT_L5);
|
||||
attachment.setFairyMsgInfo(JSON.parseObject(String.valueOf(baseProtocol.getData()), FairyMsgInfoBean.class));
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.FAIRY_DRAW_GIFT_L5);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_ROOM_PK:
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_SUB_ROOM_PK_NOTIFY) {
|
||||
RoomPKAttachment attachment = new RoomPKAttachment(CUSTOM_MSG_SUB_ROOM_PK_NOTIFY);
|
||||
@@ -1225,12 +1308,27 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isShowingGiftNotify() {
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void showGiftDialog() {
|
||||
if (!isValid()) return;
|
||||
if (giftList == null) return;
|
||||
if (giftList.size() == 0) return;
|
||||
giftDialog = generateAllServiceGiftDialog(this, giftList.peekFirst());
|
||||
AllServiceGiftProtocolDataBean data = giftList.peekFirst();
|
||||
if (data == null) return;
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
return;
|
||||
}
|
||||
giftDialog = generateAllServiceGiftDialog(this, data);
|
||||
giftDialog.setOnDismissListener(dialog -> {
|
||||
giftList.pollFirst();
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
AllServiceGiftProtocolDataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
if (isValid()) {
|
||||
showGiftDialog();
|
||||
@@ -1242,30 +1340,16 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
giftDialog.show();
|
||||
}
|
||||
|
||||
private AllServiceGiftDialog generateAllServiceGiftDialog(Context context, AllServiceGiftProtocol.DataBean dataBean) {
|
||||
switch (JavaUtil.str2int(dataBean.getLevelNum())) {
|
||||
default:
|
||||
case AllServiceGiftDialog.ALL_SERVICE_GIFT_LEVEL_1:
|
||||
return new AllServiceGiftLevelOneDialog(context, dataBean);
|
||||
|
||||
case AllServiceGiftDialog.ALL_SERVICE_GIFT_LEVEL_2:
|
||||
|
||||
return new AllServiceGiftLevelTwoDialog(context, dataBean);
|
||||
|
||||
case AllServiceGiftDialog.ALL_SERVICE_GIFT_LEVEL_3:
|
||||
return new AllServiceGiftLevelThreeDialog(context, dataBean);
|
||||
}
|
||||
private AllServiceGiftLevelDialog generateAllServiceGiftDialog(@NonNull Context context, @NonNull AllServiceGiftProtocolDataBean dataBean) {
|
||||
return new AllServiceGiftLevelDialog(context, dataBean);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
registerGiftBroadcastMessage(false);
|
||||
isResume = false;
|
||||
}
|
||||
|
||||
|
||||
private void handlePmExitRoom() {
|
||||
EventBus.getDefault().post(new PmDismissAllLimitDialogEvent());
|
||||
getMvpPresenter().exitRoom();
|
||||
@@ -1311,6 +1395,24 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
getLimitEnterRoomHelper().handleThisContext(this, event.getData(), true, this::handlePmExitRoom);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public RoomContext getRoomContext() {
|
||||
return RoomContext.Companion.get();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public LifecycleOwner getLifecycleOwner() {
|
||||
return this;
|
||||
}
|
||||
|
||||
private static class GiftBroadcastObserver implements Observer<BroadcastMessage> {
|
||||
private WeakReference<AVRoomActivity> mReference;
|
||||
|
||||
@@ -1344,4 +1446,40 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onReceiveChatRoomEvent(RoomEvent roomEvent) {
|
||||
super.onReceiveChatRoomEvent(roomEvent);
|
||||
switch (roomEvent.getEvent()) {
|
||||
case RoomEvent.UP_MIC:
|
||||
case RoomEvent.DOWN_MIC:
|
||||
resetViewPagerInputEnabled();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用VP滑动
|
||||
*/
|
||||
private void disableViewPagerInput() {
|
||||
this.viewPagerInputDisable = true;
|
||||
resetViewPagerInputEnabled();
|
||||
}
|
||||
|
||||
private void tryEnabledViewPagerInput() {
|
||||
this.viewPagerInputDisable = false;
|
||||
resetViewPagerInputEnabled();
|
||||
}
|
||||
|
||||
private void resetViewPagerInputEnabled() {
|
||||
if (viewPagerInputDisable) {
|
||||
viewpager.setUserInputEnabled(false);
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isSingleRoom() && !AvRoomDataManager.get().isOwnerOnMic()) {
|
||||
// 个播+没在麦位=可以滑动
|
||||
viewpager.setUserInputEnabled(true);
|
||||
} else {
|
||||
viewpager.setUserInputEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@ import com.yizhuan.erban.avroom.adapter.RecordForPKAdapter;
|
||||
import com.yizhuan.erban.avroom.presenter.RecordForPKPresenter;
|
||||
import com.yizhuan.erban.avroom.view.IRecordForPKView;
|
||||
import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.yizhuan.xchat_android_core.room.pk.bean.PKRecordInfo;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
|
@@ -21,6 +21,7 @@ import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleResourceType;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomOnlineUserBean;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
@@ -107,10 +108,11 @@ public class RoomInviteActivity extends BaseMvpActivity<IRoomInviteView, RoomInv
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageSuccess(List<OnlineChatMember> memberList, int page) {
|
||||
public void onRequestRoomOnlineListSuccess(List<RoomOnlineUserBean> list) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageFail(String errorStr, int page) {
|
||||
mPage = page;
|
||||
|
@@ -39,7 +39,7 @@ import com.yizhuan.xchat_android_core.room.pk.bean.PKTeamInfo;
|
||||
import com.yizhuan.xchat_android_core.room.queue.bean.MicMemberInfo;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.ActivityUtil;
|
||||
import com.yizhuan.xchat_android_core.utils.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_core.utils.extension.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
protected static final int TYPE_BOSS = 1;
|
||||
protected static final int TYPE_NORMAL = 0;
|
||||
protected static final int TYPE_INVALID = -2;
|
||||
protected OnMicroItemClickListener onMicroItemClickListener;
|
||||
protected OnMicroItemClickListener onMicroItemClickListener = null;
|
||||
protected Context context;
|
||||
|
||||
public BaseMicroViewAdapter(Context context) {
|
||||
@@ -527,7 +527,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
/**
|
||||
* 主席位特有
|
||||
*/
|
||||
FrameLayout frTitle;
|
||||
View frTitle;
|
||||
TextView tvRoomDesc;
|
||||
ImageView ivTag;
|
||||
TextView tvLabelLeaveMode;
|
||||
|
@@ -5,7 +5,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
|
||||
class CreateRoomGameAdapter :
|
||||
BaseQuickAdapter<GameInfo, BaseViewHolder>(R.layout.item_room_create_game) {
|
||||
|
@@ -4,8 +4,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.xchat_android_library.common.glide.GlideUtils
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
|
||||
class CreateRoomGameGuideAdapter :
|
||||
BaseQuickAdapter<GameInfo, BaseViewHolder>(R.layout.item_room_create_game_guide) {
|
||||
|
@@ -5,7 +5,7 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
|
||||
class ExitRoomAdapter :
|
||||
BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.item_exit_room) {
|
||||
|
@@ -12,27 +12,20 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.netease.nim.uikit.impl.cache.NimUserInfoCache;
|
||||
import com.netease.nimlib.sdk.RequestCallbackWrapper;
|
||||
import com.netease.nimlib.sdk.uinfo.constant.GenderEnum;
|
||||
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.NobleAvatarView;
|
||||
import com.yizhuan.erban.utils.NamePlateHelper;
|
||||
import com.yizhuan.erban.utils.RegexUtil;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelResourceType;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleResourceType;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomOnlineUserBean;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/**
|
||||
@@ -41,19 +34,17 @@ import io.reactivex.disposables.Disposable;
|
||||
* @author Administrator
|
||||
* @date 2017/12/4
|
||||
*/
|
||||
public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMember, BaseViewHolder> {
|
||||
public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<RoomOnlineUserBean, BaseViewHolder> {
|
||||
|
||||
private boolean mIsHomeParty;
|
||||
private Disposable mDisposable;
|
||||
private Context context;
|
||||
private OnRoomOnlineNumberChangeListener mListener;
|
||||
|
||||
public OnlineUserAdapter(Context context, boolean isHomeParty) {
|
||||
super(null);
|
||||
addItemType(OnlineChatMember.NORMAL, R.layout.list_item_online_user);
|
||||
addItemType(OnlineChatMember.NOBLE, R.layout.list_item_online_user_mystery);
|
||||
addItemType(RoomOnlineUserBean.NORMAL, R.layout.list_item_online_user);
|
||||
addItemType(RoomOnlineUserBean.NOBLE, R.layout.list_item_online_user_mystery);
|
||||
mIsHomeParty = isHomeParty;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,147 +54,76 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(@NonNull BaseViewHolder baseViewHolder, OnlineChatMember onlineChatMember) {
|
||||
if (onlineChatMember != null && onlineChatMember.chatRoomMember != null) {
|
||||
if (onlineChatMember.getItemType() == OnlineChatMember.NORMAL) {
|
||||
setNormalData(baseViewHolder, onlineChatMember);
|
||||
} else {
|
||||
setMysteryData();
|
||||
}
|
||||
protected void convert(@NonNull BaseViewHolder helper, RoomOnlineUserBean item) {
|
||||
if (item.getItemType() == OnlineChatMember.NOBLE) {
|
||||
return;
|
||||
}
|
||||
// 性别
|
||||
final ImageView sexImage = helper.getView(R.id.sex);
|
||||
if (item.getGender() == 1) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (item.getGender() == 2) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
sexImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setMysteryData() {
|
||||
//do nothing
|
||||
}
|
||||
// 昵称
|
||||
helper.setText(R.id.nick, RegexUtil.getPrintableString(item.getNick()));
|
||||
|
||||
private void setNormalData(BaseViewHolder baseViewHolder, OnlineChatMember onlineChatMember) {
|
||||
setSexData(baseViewHolder, onlineChatMember);
|
||||
|
||||
ImageView roomOnlineTag = baseViewHolder.getView(R.id.room_online_tag);
|
||||
ImageView managerLogo = baseViewHolder.getView(R.id.manager_logo);
|
||||
roomOnlineTag.setVisibility(onlineChatMember.isOnMic ? View.VISIBLE : View.GONE);
|
||||
managerLogo.setVisibility((onlineChatMember.isAdmin || onlineChatMember.isRoomOwer)
|
||||
? View.VISIBLE : View.GONE);
|
||||
managerLogo.setImageResource(onlineChatMember.isAdmin ? R.drawable.icon_admin_logo
|
||||
: R.drawable.icon_user_list_room_ownner);
|
||||
|
||||
baseViewHolder.setText(R.id.nick, RegexUtil.getPrintableString(onlineChatMember.chatRoomMember.getNick()));
|
||||
|
||||
NobleAvatarView nobleAvatarView = baseViewHolder.getView(R.id.noble_avatar_view);
|
||||
// 头像
|
||||
NobleAvatarView nobleAvatarView = helper.getView(R.id.noble_avatar_view);
|
||||
nobleAvatarView.setSize(37, 54, 0);
|
||||
nobleAvatarView.setData(onlineChatMember.chatRoomMember);
|
||||
nobleAvatarView.setData(item);
|
||||
|
||||
// 官字
|
||||
baseViewHolder.getView(R.id.iv_user_official).setVisibility(onlineChatMember.isOfficial() ? View.VISIBLE : View.GONE);
|
||||
helper.getView(R.id.iv_user_official).setVisibility(item.isOfficial() ? View.VISIBLE : View.GONE);
|
||||
|
||||
// 管理
|
||||
ImageView ivManager = helper.getView(R.id.manager_logo);
|
||||
if (item.getMemberType() != null && item.getMemberType().equals("MANAGER")) {
|
||||
ivManager.setVisibility(View.VISIBLE);
|
||||
ivManager.setImageResource(R.drawable.icon_admin_logo);
|
||||
} else if (item.getMemberType() != null && item.getMemberType().equals("CREATOR")) {
|
||||
ivManager.setVisibility(View.VISIBLE);
|
||||
ivManager.setImageResource(R.drawable.icon_user_list_room_ownner);
|
||||
} else {
|
||||
ivManager.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 在麦
|
||||
ImageView ivMic = helper.getView(R.id.room_online_tag);
|
||||
ivMic.setVisibility(item.isInMic() ? View.VISIBLE : View.GONE);
|
||||
|
||||
|
||||
//等级
|
||||
UserLevelVo levelVo = item.getUserLevelVo();
|
||||
String experLevelUrl = null;
|
||||
String charmLevelUrl = null;
|
||||
if (levelVo != null) {
|
||||
experLevelUrl = levelVo.getExperUrl();
|
||||
charmLevelUrl = levelVo.getCharmUrl();
|
||||
}
|
||||
//经验等级
|
||||
AppCompatImageView ivUserExper = baseViewHolder.getView(R.id.iv_user_exper);
|
||||
String experLevelUrl = NobleUtil.getLevel(UserLevelResourceType.EXPER_URL, onlineChatMember.chatRoomMember);
|
||||
AppCompatImageView ivUserExper = helper.getView(R.id.iv_user_exper);
|
||||
boolean isExperLevelUrlEmpty = TextUtils.isEmpty(experLevelUrl);
|
||||
ivUserExper.setVisibility(!isExperLevelUrlEmpty ? View.VISIBLE : View.GONE);
|
||||
if (!isExperLevelUrlEmpty) {
|
||||
ImageLoadUtils.loadImage(mContext, experLevelUrl, ivUserExper);
|
||||
}
|
||||
//魅力等级
|
||||
AppCompatImageView ivUserCharm = baseViewHolder.getView(R.id.iv_user_charm);
|
||||
String charmLevelUrl = NobleUtil.getLevel(UserLevelResourceType.CHARM_URL, onlineChatMember.chatRoomMember);
|
||||
AppCompatImageView ivUserCharm = helper.getView(R.id.iv_user_charm);
|
||||
boolean isCharmLevelUrlEmpty = TextUtils.isEmpty(charmLevelUrl);
|
||||
ivUserCharm.setVisibility(!isCharmLevelUrlEmpty ? View.VISIBLE : View.GONE);
|
||||
if (!isCharmLevelUrlEmpty) {
|
||||
ImageLoadUtils.loadImage(mContext, charmLevelUrl, ivUserCharm);
|
||||
}
|
||||
|
||||
// 官方主播铭牌标识
|
||||
String fixWord = NobleUtil.getLevel(UserInfo.OAC_NAME, onlineChatMember.chatRoomMember);
|
||||
String iconPic = NobleUtil.getLevel(UserInfo.OAC_ICON, onlineChatMember.chatRoomMember);
|
||||
View inOfficialMask = baseViewHolder.getView(R.id.in_official_mask);
|
||||
if (!TextUtils.isEmpty(fixWord) && !TextUtils.isEmpty(iconPic)) {
|
||||
inOfficialMask.setVisibility(View.VISIBLE);
|
||||
TextView tvOfficialMask = inOfficialMask.findViewById(R.id.tv_official_mask);
|
||||
if (tvOfficialMask != null) {
|
||||
tvOfficialMask.setText(fixWord);
|
||||
}
|
||||
|
||||
ImageView ivOfficialMask = inOfficialMask.findViewById(R.id.iv_official_mask);
|
||||
if (ivOfficialMask != null) {
|
||||
ImageLoadUtils.loadImage(mContext, iconPic, ivOfficialMask);
|
||||
}
|
||||
|
||||
} else {
|
||||
inOfficialMask.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 铭牌
|
||||
String namePlateWord = NobleUtil.getLevel(UserInfo.NAMEPLATE_WORD, onlineChatMember.chatRoomMember);
|
||||
String namePlatePic = NobleUtil.getLevel(UserInfo.NAMEPLATE_PIC, onlineChatMember.chatRoomMember);
|
||||
View inNamePlate = baseViewHolder.getView(R.id.in_nameplate);
|
||||
if (!TextUtils.isEmpty(namePlateWord) && !TextUtils.isEmpty(namePlatePic)) {
|
||||
inNamePlate.setVisibility(View.VISIBLE);
|
||||
TextView tvNamePlate = inNamePlate.findViewById(R.id.tv_official_mask);
|
||||
if (tvNamePlate != null) {
|
||||
tvNamePlate.setText(namePlateWord);
|
||||
}
|
||||
|
||||
ImageView ivNamePlate = inNamePlate.findViewById(R.id.iv_official_mask);
|
||||
if (ivNamePlate != null) {
|
||||
ImageLoadUtils.loadImage(mContext, namePlatePic, ivNamePlate);
|
||||
}
|
||||
|
||||
} else {
|
||||
inNamePlate.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
AppCompatImageView ivUserLevel = baseViewHolder.getView(R.id.iv_noble_level);
|
||||
String resource = (String) NobleUtil.getResource(NobleResourceType.KEY_BADGE, onlineChatMember.chatRoomMember);
|
||||
if (TextUtils.isEmpty(resource)) {
|
||||
ivUserLevel.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
ivUserLevel.setVisibility(View.VISIBLE);
|
||||
NobleUtil.loadResource(resource, ivUserLevel);
|
||||
}
|
||||
|
||||
private void setSexData(BaseViewHolder baseViewHolder, OnlineChatMember onlineChatMember) {
|
||||
final ImageView sexImage = baseViewHolder.getView(R.id.sex);
|
||||
String gender = NobleUtil.getLevel(UserInfo.GENDER, onlineChatMember.chatRoomMember);
|
||||
if ("1".equals(gender)) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if ("2".equals(gender)) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
NimUserInfo nimUserInfo = NimUserInfoCache.getInstance().getUserInfo(onlineChatMember.chatRoomMember.getAccount());
|
||||
if (nimUserInfo == null) {
|
||||
NimUserInfoCache.getInstance().getUserInfoFromRemote(onlineChatMember.chatRoomMember.getAccount(),
|
||||
new RequestCallbackWrapper<NimUserInfo>() {
|
||||
@Override
|
||||
public void onResult(int i, NimUserInfo nimUserInfo, Throwable throwable) {
|
||||
if (nimUserInfo != null) {
|
||||
if (nimUserInfo.getGenderEnum() == GenderEnum.MALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (nimUserInfo.getGenderEnum() == GenderEnum.FEMALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
sexImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (nimUserInfo.getGenderEnum() == GenderEnum.MALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (nimUserInfo.getGenderEnum() == GenderEnum.FEMALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
sexImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
View inNamePlate = helper.getView(R.id.in_nameplate);
|
||||
NamePlateHelper.INSTANCE.load(inNamePlate, inNamePlate.findViewById(R.id.tv_official_mask), inNamePlate.findViewById(R.id.iv_official_mask), item);
|
||||
}
|
||||
|
||||
private void registerRoomEvent() {
|
||||
@@ -240,7 +160,7 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
updateMemberIn(roomEvent);
|
||||
} else if (event == RoomEvent.ROOM_MEMBER_EXIT) {
|
||||
if (mListener != null) {
|
||||
mListener.onMemberExit(roomEvent.getAccount(), mData);
|
||||
mListener.onMemberExit(roomEvent.getAccount());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -248,19 +168,19 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
|
||||
private void updateMemberIn(RoomEvent roomEvent) {
|
||||
if (mListener != null) {
|
||||
mListener.onMemberIn(roomEvent.getAccount(), mData);
|
||||
mListener.onMemberIn(roomEvent.getAccount());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateManager(RoomEvent roomEvent) {
|
||||
if (mListener != null)
|
||||
mListener.onUpdateMemberManager(roomEvent.getAccount(),
|
||||
roomEvent.getEvent() == RoomEvent.ROOM_MANAGER_REMOVE, mData);
|
||||
roomEvent.getEvent() == RoomEvent.ROOM_MANAGER_REMOVE);
|
||||
}
|
||||
|
||||
private void updateDownUpMic(String account, boolean isUpMic) {
|
||||
if (mListener != null) {
|
||||
mListener.onMemberDownUpMic(account, isUpMic, mData);
|
||||
mListener.onMemberDownUpMic(account, isUpMic);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,34 +201,29 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
*
|
||||
* @param account
|
||||
*/
|
||||
void onMemberIn(String account, List<OnlineChatMember> dataList);
|
||||
void onMemberIn(String account);
|
||||
|
||||
/**
|
||||
* 成员出去回调
|
||||
*
|
||||
* @param account
|
||||
* @param dataList
|
||||
*/
|
||||
void onMemberExit(String account, List<OnlineChatMember> dataList);
|
||||
void onMemberExit(String account);
|
||||
|
||||
/**
|
||||
* 成员上下麦更新
|
||||
*
|
||||
* @param account
|
||||
* @param isUpMic
|
||||
* @param dataList
|
||||
*/
|
||||
void onMemberDownUpMic(String account, boolean isUpMic,
|
||||
List<OnlineChatMember> dataList);
|
||||
void onMemberDownUpMic(String account, boolean isUpMic);
|
||||
|
||||
/**
|
||||
* 设置管理员回调
|
||||
*
|
||||
* @param account
|
||||
* @param dataList
|
||||
*/
|
||||
void onUpdateMemberManager(String account, boolean isRemoveManager,
|
||||
List<OnlineChatMember> dataList);
|
||||
void onUpdateMemberManager(String account, boolean isRemoveManager);
|
||||
|
||||
void addMemberBlack();
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.NobleAvatarView;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.utils.RegexUtil;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeUserInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomRankMultiItem;
|
||||
|
@@ -3,7 +3,7 @@ package com.yizhuan.erban.avroom.adapter
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
|
||||
class SelectGameAdapter :
|
||||
BaseQuickAdapter<GameInfo, BaseViewHolder>(R.layout.item_room_select_game) {
|
||||
|
@@ -16,7 +16,7 @@ import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.praise.PraiseModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig
|
||||
|
||||
|
@@ -26,7 +26,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowUserInfoDialogEvent
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus
|
||||
import com.yizhuan.xchat_android_library.utils.CommonUtils
|
||||
import io.reactivex.Observable
|
||||
@@ -39,7 +39,7 @@ class RoomPKBoardView @JvmOverloads constructor(
|
||||
) : DragLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
private val binding = LayoutRoomPkBoardViewBinding.inflate(LayoutInflater.from(context))
|
||||
private val observer = Observer<RoomPkBean> { updateView(it) }
|
||||
private val observer = Observer<RoomPkBean?> { updateView(it) }
|
||||
private var disposable: Disposable? = null
|
||||
private lateinit var helpPopupWindow: PopupWindow
|
||||
private var roomPkBean: RoomPkBean? = null
|
||||
|
@@ -16,10 +16,10 @@ import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.RoomPKModel
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class RoomPKCreateActivity : BaseViewBindingActivity<ActivityRoomPkCreateBinding>() {
|
||||
|
@@ -16,7 +16,7 @@ import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.RoomPKModel
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class RoomPKSearchActivity : BaseViewBindingActivity<ActivityRoomPkSearchBinding>() {
|
||||
|
@@ -5,14 +5,14 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.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,"Peko号:${item.erbanNo}")
|
||||
.setText(R.id.tv_room_id,"Repo号:${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)
|
||||
|
@@ -9,7 +9,7 @@ import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogRoomPkFinishBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
|
||||
class RoomPkFinishDialog : BaseDialog<DialogRoomPkFinishBinding>() {
|
||||
|
||||
@@ -30,71 +30,71 @@ class RoomPkFinishDialog : BaseDialog<DialogRoomPkFinishBinding>() {
|
||||
|
||||
@SuppressLint("CheckResult", "SetTextI18n")
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
binding.tvTitleRed.text = roomPkBean.cTitle.subAndReplaceDot(7)
|
||||
binding.tvValueRed.text = "${roomPkBean.cAmount}"
|
||||
binding.ivRedWin.isVisible = roomPkBean.cUid == roomPkBean.winUid && roomPkBean.winUid != 0L
|
||||
binding?.ivClose?.setOnClickListener { dismissAllowingStateLoss() }
|
||||
binding?.tvTitleRed?.text = roomPkBean.cTitle.subAndReplaceDot(7)
|
||||
binding?.tvValueRed?.text = "${roomPkBean.cAmount}"
|
||||
binding?.ivRedWin?.isVisible = roomPkBean.cUid == roomPkBean.winUid && roomPkBean.winUid != 0L
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
roomPkBean.cAvatar,
|
||||
binding.ivAvatarRed,
|
||||
binding?.ivAvatarRed,
|
||||
R.drawable.default_avatar
|
||||
)
|
||||
|
||||
binding.tvTitleBlue.text = roomPkBean.aTitle.subAndReplaceDot(7)
|
||||
binding.tvValueBlue.text = "${roomPkBean.aAmount}"
|
||||
binding.ivBlueWin.isVisible =
|
||||
binding?.tvTitleBlue?.text = roomPkBean.aTitle.subAndReplaceDot(7)
|
||||
binding?.tvValueBlue?.text = "${roomPkBean.aAmount}"
|
||||
binding?.ivBlueWin?.isVisible =
|
||||
roomPkBean.cUid != roomPkBean.winUid && roomPkBean.winUid != 0L
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
roomPkBean.aAvatar,
|
||||
binding.ivAvatarBlue,
|
||||
binding?.ivAvatarBlue,
|
||||
R.drawable.default_avatar
|
||||
)
|
||||
|
||||
roomPkBean.csRank.getOrNull(0)?.let {
|
||||
binding.tvNickContribute.text = it.nick.subAndReplaceDot(7)
|
||||
binding.tvValueContribute.text = "神豪值:${it.amount}"
|
||||
binding?.tvNickContribute?.text = it.nick.subAndReplaceDot(7)
|
||||
binding?.tvValueContribute?.text = "神豪值:${it.amount}"
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
it.avatar,
|
||||
binding.ivAvatarContribute,
|
||||
binding?.ivAvatarContribute,
|
||||
R.drawable.default_avatar
|
||||
)
|
||||
}
|
||||
|
||||
roomPkBean.crRank.getOrNull(0)?.let {
|
||||
binding.tvNickCharm.text = it.nick.subAndReplaceDot(7)
|
||||
binding.tvValueCharm.text = "魅力值:${it.amount}"
|
||||
binding?.tvNickCharm?.text = it.nick.subAndReplaceDot(7)
|
||||
binding?.tvValueCharm?.text = "魅力值:${it.amount}"
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
it.avatar,
|
||||
binding.ivAvatarCharm,
|
||||
binding?.ivAvatarCharm,
|
||||
R.drawable.default_avatar
|
||||
)
|
||||
}
|
||||
|
||||
when (roomPkBean.winUid) {
|
||||
0L -> {
|
||||
binding.viewBg.setBackgroundResource(R.drawable.bg_719cea_radius_10)
|
||||
binding.clRoot.setBackgroundResource(R.drawable.bg_room_pk_finish_deuce)
|
||||
binding.viewContribute.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_deuce)
|
||||
binding.viewCharm.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_deuce)
|
||||
binding.ivClose.setImageResource(R.drawable.ic_room_pk_finish_close_deuce)
|
||||
binding?.viewBg?.setBackgroundResource(R.drawable.bg_719cea_radius_10)
|
||||
binding?.clRoot?.setBackgroundResource(R.drawable.bg_room_pk_finish_deuce)
|
||||
binding?.viewContribute?.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_deuce)
|
||||
binding?.viewCharm?.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_deuce)
|
||||
binding?.ivClose?.setImageResource(R.drawable.ic_room_pk_finish_close_deuce)
|
||||
}
|
||||
roomPkBean.cUid -> {
|
||||
binding.viewBg.setBackgroundResource(R.drawable.bg_edbf89_radius_10)
|
||||
binding.clRoot.setBackgroundResource(R.drawable.bg_room_pk_finish_win)
|
||||
binding.viewContribute.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_win)
|
||||
binding.viewCharm.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_win)
|
||||
binding.ivClose.setImageResource(R.drawable.ic_room_pk_finish_close_win)
|
||||
binding?.viewBg?.setBackgroundResource(R.drawable.bg_edbf89_radius_10)
|
||||
binding?.clRoot?.setBackgroundResource(R.drawable.bg_room_pk_finish_win)
|
||||
binding?.viewContribute?.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_win)
|
||||
binding?.viewCharm?.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_win)
|
||||
binding?.ivClose?.setImageResource(R.drawable.ic_room_pk_finish_close_win)
|
||||
}
|
||||
else -> {
|
||||
binding.viewBg.setBackgroundResource(R.drawable.bg_bfabf6_radius_10)
|
||||
binding.clRoot.setBackgroundResource(R.drawable.bg_room_pk_finish_failed)
|
||||
binding.viewContribute.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_failed)
|
||||
binding.viewCharm.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_failed)
|
||||
binding.ivClose.setImageResource(R.drawable.ic_room_pk_finish_close_failed)
|
||||
binding?.viewBg?.setBackgroundResource(R.drawable.bg_bfabf6_radius_10)
|
||||
binding?.clRoot?.setBackgroundResource(R.drawable.bg_room_pk_finish_failed)
|
||||
binding?.viewContribute?.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_failed)
|
||||
binding?.viewCharm?.setBackgroundResource(R.drawable.bg_room_pk_finish_rank_failed)
|
||||
binding?.ivClose?.setImageResource(R.drawable.ic_room_pk_finish_close_failed)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -8,7 +8,7 @@ import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogRoomPkForceFinishBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
|
||||
class RoomPkForceFinishDialog : BaseDialog<DialogRoomPkForceFinishBinding>() {
|
||||
|
||||
@@ -29,23 +29,23 @@ class RoomPkForceFinishDialog : BaseDialog<DialogRoomPkForceFinishBinding>() {
|
||||
|
||||
@SuppressLint("CheckResult", "SetTextI18n")
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
binding.tvTitleRed.text = roomPkBean.cTitle.subAndReplaceDot(7)
|
||||
binding.tvValueRed.text = "${roomPkBean.cAmount}"
|
||||
binding?.ivClose?.setOnClickListener { dismissAllowingStateLoss() }
|
||||
binding?.tvTitleRed?.text = roomPkBean.cTitle.subAndReplaceDot(7)
|
||||
binding?.tvValueRed?.text = "${roomPkBean.cAmount}"
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
roomPkBean.cAvatar,
|
||||
binding.ivAvatarRed,
|
||||
binding?.ivAvatarRed,
|
||||
R.drawable.default_avatar
|
||||
)
|
||||
|
||||
binding.tvTitleBlue.text = roomPkBean.aTitle.subAndReplaceDot(7)
|
||||
binding.tvValueBlue.text = "${roomPkBean.aAmount}"
|
||||
binding?.tvTitleBlue?.text = roomPkBean.aTitle.subAndReplaceDot(7)
|
||||
binding?.tvValueBlue?.text = "${roomPkBean.aAmount}"
|
||||
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
roomPkBean.aAvatar,
|
||||
binding.ivAvatarBlue,
|
||||
binding?.ivAvatarBlue,
|
||||
R.drawable.default_avatar
|
||||
)
|
||||
|
||||
|
@@ -8,9 +8,9 @@ import com.yizhuan.erban.databinding.DialogRoomPkReceivedBinding
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.RoomPKModel
|
||||
import com.yizhuan.xchat_android_core.utils.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -36,26 +36,26 @@ class RoomPkReceivedDialog : BaseDialog<DialogRoomPkReceivedBinding>() {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
binding.tvNick.text = pkBean.inviteRoomTitle.subAndReplaceDot(7)
|
||||
binding.tvTime.text = "${pkBean.pkDuration}分鐘"
|
||||
binding?.tvNick?.text = pkBean.inviteRoomTitle.subAndReplaceDot(7)
|
||||
binding?.tvTime?.text = "${pkBean.pkDuration}分鐘"
|
||||
pkBean.pkDesc.ifNotNullOrEmpty {
|
||||
binding.tvDescTitle.isVisible = true
|
||||
binding.tvDesc.isVisible = true
|
||||
binding.tvDesc.text = it
|
||||
binding?.tvDescTitle?.isVisible = true
|
||||
binding?.tvDesc?.isVisible = true
|
||||
binding?.tvDesc?.text = it
|
||||
}
|
||||
disposable = Observable.intervalRange(0, 10, 0, 1, TimeUnit.SECONDS)
|
||||
.compose(bindToLifecycle())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnComplete { dismissAllowingStateLoss() }
|
||||
.subscribe {
|
||||
binding.tvCloseTime.text = "${10 - it}"
|
||||
binding?.tvCloseTime?.text = "${10 - it}"
|
||||
}
|
||||
|
||||
binding.tvReceived.setOnClickListener {
|
||||
binding?.tvReceived?.setOnClickListener {
|
||||
commit(true)
|
||||
}
|
||||
|
||||
binding.tvRefuse.setOnClickListener {
|
||||
binding?.tvRefuse?.setOnClickListener {
|
||||
commit(false)
|
||||
}
|
||||
}
|
||||
|
@@ -14,6 +14,6 @@ class RoomPkRuleDialog : BaseDialog<DialogRoomPkRuleBinding>() {
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
binding?.ivClose?.setOnClickListener { dismissAllowingStateLoss() }
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.yizhuan.erban.avroom.bean
|
||||
|
||||
data class RoomAlbumPhotoInfo(
|
||||
val giftId: Int,
|
||||
val giftNum: Int,
|
||||
val giftUrl: String,
|
||||
val id: Int,
|
||||
val photoUrl: String,
|
||||
val roomUid: Int,
|
||||
val status: Int,
|
||||
val totalGoldPrice: Int,
|
||||
val type: Int,
|
||||
val uid: Int
|
||||
)
|
@@ -0,0 +1,8 @@
|
||||
package com.yizhuan.erban.avroom.bean
|
||||
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage
|
||||
|
||||
data class RoomPlayBean(
|
||||
val event: Int,
|
||||
val chatRoomMessage: ChatRoomMessage
|
||||
)
|
@@ -0,0 +1,19 @@
|
||||
package com.yizhuan.erban.avroom.core
|
||||
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageHandler
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomAbility
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/10/26 15:41
|
||||
* Desc:语音房
|
||||
* @param roomId roomUid
|
||||
**/
|
||||
class AudioRoomContext(roomId: Long) : RoomContext(roomId) {
|
||||
|
||||
override fun loadAbility(list: MutableMap<String, RoomAbility>) {
|
||||
super.loadAbility(list)
|
||||
// 红包处理器
|
||||
list[RedPackageHandler::class.java.simpleName] = RedPackageHandler()
|
||||
}
|
||||
}
|
@@ -3,24 +3,16 @@ package com.yizhuan.erban.avroom.dialog
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.Gravity
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.adapter.CreateRoomGameAdapter
|
||||
import com.yizhuan.erban.avroom.adapter.CreateRoomGameGuideAdapter
|
||||
import com.yizhuan.erban.base.BaseActivity
|
||||
import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogCreateGameRoomBinding
|
||||
import com.yizhuan.erban.databinding.DialogCreateRoomBinding
|
||||
import com.yizhuan.erban.home.helper.OpenRoomHelper
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.GameModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class CreateGameRoomDialog : BaseDialog<DialogCreateGameRoomBinding>() {
|
||||
|
||||
@@ -33,10 +25,10 @@ class CreateGameRoomDialog : BaseDialog<DialogCreateGameRoomBinding>() {
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
|
||||
binding.rvGame.itemAnimator = null
|
||||
binding?.rvGame?.itemAnimator = null
|
||||
rvDelegate = RVDelegate.Builder<GameInfo>()
|
||||
.setAdapter(gameAdapter)
|
||||
.setRecyclerView(binding.rvGame)
|
||||
.setRecyclerView(binding?.rvGame)
|
||||
.setLayoutManager(GridLayoutManager(context, 2))
|
||||
.build()
|
||||
|
||||
@@ -48,7 +40,7 @@ class CreateGameRoomDialog : BaseDialog<DialogCreateGameRoomBinding>() {
|
||||
)
|
||||
}
|
||||
|
||||
binding.ivClose.setOnClickListener {
|
||||
binding?.ivClose?.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
|
||||
|
@@ -14,9 +14,9 @@ import com.yizhuan.erban.databinding.DialogCreateRoomBinding
|
||||
import com.yizhuan.erban.home.helper.OpenRoomHelper
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.GameModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class CreateRoomDialog : BaseDialog<DialogCreateRoomBinding>() {
|
||||
@@ -33,14 +33,14 @@ class CreateRoomDialog : BaseDialog<DialogCreateRoomBinding>() {
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
if(isHomeGame){
|
||||
binding.tvPlayType.isVisible = false
|
||||
binding.rgType.isVisible = false
|
||||
binding.rvGame.isVisible = true
|
||||
binding?.tvPlayType?.isVisible = false
|
||||
binding?.rgType?.isVisible = false
|
||||
binding?.rvGame?.isVisible = true
|
||||
}
|
||||
binding.rvGame.itemAnimator = null
|
||||
binding?.rvGame?.itemAnimator = null
|
||||
rvDelegate = RVDelegate.Builder<GameInfo>()
|
||||
.setAdapter(gameAdapter)
|
||||
.setRecyclerView(binding.rvGame)
|
||||
.setRecyclerView(binding?.rvGame)
|
||||
.setLayoutManager(LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false))
|
||||
.build()
|
||||
|
||||
@@ -55,22 +55,22 @@ class CreateRoomDialog : BaseDialog<DialogCreateRoomBinding>() {
|
||||
checkCreateEnable()
|
||||
}
|
||||
|
||||
binding.rbGameRoom.setOnCheckedChangeListener { _, isChecked ->
|
||||
binding?.rbGameRoom?.setOnCheckedChangeListener { _, isChecked ->
|
||||
checkCreateEnable()
|
||||
if (isChecked) {
|
||||
binding.rvGame.isVisible = true
|
||||
binding?.rvGame?.isVisible = true
|
||||
}
|
||||
}
|
||||
|
||||
binding.rbPartyRoom.setOnCheckedChangeListener { _, isChecked ->
|
||||
binding?.rbPartyRoom?.setOnCheckedChangeListener { _, isChecked ->
|
||||
checkCreateEnable()
|
||||
if (isChecked) {
|
||||
binding.rvGame.isInvisible = true
|
||||
binding?.rvGame?.isInvisible = true
|
||||
}
|
||||
}
|
||||
binding.tvCreate.setOnClickListener {
|
||||
binding?.tvCreate?.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
if (binding.rbPartyRoom.isChecked) {
|
||||
if (binding?.rbPartyRoom?.isChecked == true) {
|
||||
OpenRoomHelper.openHomePartyRoom(requireActivity() as BaseActivity)
|
||||
} else {
|
||||
if (selectIndex != -1) {
|
||||
@@ -84,7 +84,7 @@ class CreateRoomDialog : BaseDialog<DialogCreateRoomBinding>() {
|
||||
}
|
||||
}
|
||||
|
||||
binding.ivClose.setOnClickListener {
|
||||
binding?.ivClose?.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
|
||||
@@ -105,10 +105,10 @@ class CreateRoomDialog : BaseDialog<DialogCreateRoomBinding>() {
|
||||
|
||||
private fun checkCreateEnable() {
|
||||
if(isHomeGame){
|
||||
binding.tvCreate.isEnabled = selectIndex != -1
|
||||
binding?.tvCreate?.isEnabled = selectIndex != -1
|
||||
}else {
|
||||
binding.tvCreate.isEnabled = binding.rbPartyRoom.isChecked ||
|
||||
(binding.rbGameRoom.isChecked && selectIndex != -1)
|
||||
binding?.tvCreate?.isEnabled = binding?.rbPartyRoom?.isChecked == true ||
|
||||
(binding?.rbGameRoom?.isChecked == true && selectIndex != -1)
|
||||
}
|
||||
}
|
||||
}
|
@@ -23,7 +23,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.adapter.MicQueueAdapter;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.home.helper.LoadPageDataHelper;
|
||||
import com.yizhuan.erban.ui.widget.dialog.BaseDialog;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
|
@@ -9,11 +9,11 @@ class NewUserGiftDialog(val giftInfo: GiftInfo) :
|
||||
BaseDialog<DialogNewUserGiftBinding>() {
|
||||
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener {
|
||||
binding?.ivClose?.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
binding.ivGift.load(giftInfo.giftUrl)
|
||||
binding.tvGiftName.text = "${giftInfo.giftName}*${giftInfo.count}"
|
||||
binding?.ivGift?.load(giftInfo.giftUrl)
|
||||
binding?.tvGiftName?.text = "${giftInfo.giftName}*${giftInfo.count}"
|
||||
}
|
||||
|
||||
}
|
@@ -25,7 +25,7 @@ import com.yizhuan.erban.avroom.adapter.PKMicQueueAdapter;
|
||||
import com.yizhuan.erban.home.helper.LoadPageDataHelper;
|
||||
import com.yizhuan.erban.ui.widget.dialog.BaseDialog;
|
||||
import com.yizhuan.erban.ui.widget.dialog.CommonLoadingDialog;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
|
@@ -21,7 +21,7 @@ import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.ui.widget.dialog.BaseDialog;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.room.pk.bean.PKTeamInfo;
|
||||
|
@@ -18,7 +18,7 @@ import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.ui.widget.dialog.BaseDialog;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.pk.bean.PKMemberInfo;
|
||||
|
@@ -19,7 +19,7 @@ import com.yizhuan.erban.avroom.activity.CpRoomInviteActivity;
|
||||
import com.yizhuan.erban.avroom.widget.EditRoomTitleDialog;
|
||||
import com.yizhuan.erban.databinding.DialogRoomImposeBinding;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
|
@@ -24,13 +24,14 @@ import com.yizhuan.erban.avroom.activity.CreatePKActivity;
|
||||
import com.yizhuan.erban.avroom.activity.RoomSettingActivity;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPKCreateActivity;
|
||||
import com.yizhuan.erban.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.yizhuan.erban.avroom.room_album.RoomAlbumActivity;
|
||||
import com.yizhuan.erban.avroom.singleroompk.SingleRoomPKCreateActivity;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.layoutmanager.FullyGridLayoutManager;
|
||||
import com.yizhuan.erban.vip.VipBroadcastDialog;
|
||||
import com.yizhuan.erban.vip.dialog.VipBroadcastDialog;
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomInviteFansActivity;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
@@ -112,10 +113,11 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
true));
|
||||
rvOPtList.setLayoutManager(new FullyGridLayoutManager(getContext(), 5));
|
||||
optAdapter = new OptAdapter(context, null);
|
||||
addRoomAlbum(optAdapter);
|
||||
addDatingAction(optAdapter);
|
||||
// addPKAction(optAdapter);
|
||||
addPKAction(optAdapter);
|
||||
addRoomPKAction(optAdapter);
|
||||
// addSingleRoomPKAction(optAdapter);
|
||||
addSingleRoomPKAction(optAdapter);
|
||||
addSendBroadcastAction(optAdapter);
|
||||
// addInviteFansOptAdapter();
|
||||
addVipSendBroadcastAction(optAdapter);
|
||||
@@ -123,7 +125,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
addRoomSettingAction(optAdapter);
|
||||
addGiftEffectAction(optAdapter);
|
||||
addOpenOrClosePublicScreenAction(optAdapter);
|
||||
addRedPackageSwitch();
|
||||
// addRedPackageSwitch();
|
||||
addCleanScreenAction(optAdapter);
|
||||
addRoomLimit(optAdapter);
|
||||
addGiftValueAction(optAdapter);
|
||||
@@ -267,6 +269,14 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
}
|
||||
}
|
||||
|
||||
private void addRoomAlbum(OptAdapter optAdapter) {
|
||||
if (AvRoomDataManager.get().isHasRoomAlbum()) {
|
||||
optAdapter.addData(new OptAction(R.drawable.ic_room_operation_album, "房间相册", () -> {
|
||||
RoomAlbumActivity.start(getContext());
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 相亲 模式
|
||||
*
|
||||
@@ -331,7 +341,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
* @param optAdapter
|
||||
*/
|
||||
private void addRedPacketAction(OptAdapter optAdapter) {
|
||||
if (AvRoomDataManager.get().isRedEnvelopeOpen()) {
|
||||
if (AvRoomDataManager.get().getRedEnvelopeType() > 0) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
@@ -342,7 +352,6 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -419,7 +428,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
superAdminModel.roomOperate(SuperAdminModel.CLOSE_PUBLIC_SCREEN).subscribe();
|
||||
}
|
||||
AvRoomModel.get().closeScreen(roomInfo.getRoomId(),
|
||||
!isCloseScreen)
|
||||
!isCloseScreen)
|
||||
.compose(RxHelper.bindContext(context))
|
||||
.flatMap(data -> IMNetEaseManager.get().closeOpenScreen(
|
||||
data.getRoomId(), data))
|
||||
@@ -639,7 +648,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
}
|
||||
optAdapter.addData(new OptAction(R.drawable.icon_room_shield_report,
|
||||
ResUtil.getString(R.string.me_shield_report),
|
||||
() ->{
|
||||
() -> {
|
||||
DialogManager dialogManager = new DialogManager(context);
|
||||
List<ButtonItem> buttonItems = new ArrayList<>();
|
||||
ButtonItem buttonItem1 = new ButtonItem(ResUtil.getString(R.string.me_shield_room), () -> {
|
||||
|
@@ -16,7 +16,7 @@ import com.yizhuan.erban.utils.SpannableBuilder
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.bean.BroadcastInfo
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.CommonUtils
|
||||
import com.yizhuan.xchat_android_library.utils.TextWatcherWrapper
|
||||
import io.reactivex.Observable
|
||||
@@ -44,31 +44,31 @@ class SendBroadcastDialog : BaseDialog<DialogSendBroadcastBinding>() {
|
||||
|
||||
@SuppressLint("CheckResult", "SetTextI18n")
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener {
|
||||
binding?.ivClose?.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
|
||||
adapter = SendBroadcastAdapter()
|
||||
rvDelegate = RVDelegate.Builder<String>()
|
||||
.setAdapter(adapter)
|
||||
.setRecyclerView(binding.rvRecommend)
|
||||
.setRecyclerView(binding?.rvRecommend)
|
||||
.setLayoutManager(LinearLayoutManager(context))
|
||||
.build()
|
||||
|
||||
adapter.setOnItemClickListener { _, _, position ->
|
||||
binding.editContent.setText(adapter.getItem(position))
|
||||
binding?.editContent?.setText(adapter.getItem(position))
|
||||
}
|
||||
|
||||
binding.editContent.addTextChangedListener(object : TextWatcherWrapper() {
|
||||
binding?.editContent?.addTextChangedListener(object : TextWatcherWrapper() {
|
||||
override fun afterTextChanged(editable: Editable?) {
|
||||
val contentLength = editable?.length ?: 0
|
||||
binding.tvContentNumLimit.text =
|
||||
binding?.tvContentNumLimit?.text =
|
||||
"${contentLength}/${broadcastInfo?.maxWords ?: 20}"
|
||||
binding.tvSend.isEnabled = contentLength != 0
|
||||
binding?.tvSend?.isEnabled = contentLength != 0
|
||||
}
|
||||
})
|
||||
|
||||
binding.tvSend.setOnClickListener {
|
||||
binding?.tvSend?.setOnClickListener {
|
||||
if (CommonUtils.isFastDoubleClick(1000)) return@setOnClickListener
|
||||
sendBroadcast()
|
||||
}
|
||||
@@ -90,13 +90,13 @@ class SendBroadcastDialog : BaseDialog<DialogSendBroadcastBinding>() {
|
||||
private fun initData(info: BroadcastInfo) {
|
||||
broadcastInfo = info
|
||||
rvDelegate.setNewData(info.recommends)
|
||||
binding.tvAvailableCountNum.text = "${info.availableTimes}/${info.total}"
|
||||
binding.editContent.hint = "输入内容不能少于${info.minWords}个字,请文明发言哦~"
|
||||
binding.tvContentNumLimit.text = "0/${info.maxWords}"
|
||||
binding?.tvAvailableCountNum?.text = "${info.availableTimes}/${info.total}"
|
||||
binding?.editContent?.hint = "输入内容不能少于${info.minWords}个字,请文明发言哦~"
|
||||
binding?.tvContentNumLimit?.text = "0/${info.maxWords}"
|
||||
if (info.seconds > 0) {
|
||||
beginIntervalTime(info)
|
||||
} else {
|
||||
binding.tvSendHint.text = "发布后,${info.minutes}分钟内不可再发布广播"
|
||||
binding?.tvSendHint?.text = "发布后,${info.minutes}分钟内不可再发布广播"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,10 +107,10 @@ class SendBroadcastDialog : BaseDialog<DialogSendBroadcastBinding>() {
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(bindToLifecycle())
|
||||
.doOnComplete {
|
||||
binding.tvSendHint.text = "发布后,${info.minutes}分钟内不可再发布广播"
|
||||
binding?.tvSendHint?.text = "发布后,${info.minutes}分钟内不可再发布广播"
|
||||
}
|
||||
.subscribe {
|
||||
binding.tvSendHint.text = SpannableBuilder()
|
||||
binding?.tvSendHint?.text = SpannableBuilder()
|
||||
.append(
|
||||
"${info.seconds - it}",
|
||||
ForegroundColorSpan(Color.parseColor("#FFFDA615"))
|
||||
@@ -127,7 +127,7 @@ class SendBroadcastDialog : BaseDialog<DialogSendBroadcastBinding>() {
|
||||
return
|
||||
}
|
||||
broadcastInfo?.let {
|
||||
val msg = binding.editContent.text
|
||||
val msg = binding?.editContent?.text
|
||||
if (msg.isNullOrEmpty() || msg.length < it.minWords) {
|
||||
"输入内容不能少于${it.minWords}个字!".toast()
|
||||
return@let
|
||||
|
@@ -9,7 +9,7 @@ class SingleRoomTipDialog :
|
||||
BaseDialog<DialogSingleRoomTipBinding>() {
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun init() {
|
||||
binding.root.setOnClickListener {
|
||||
binding?.root?.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
dialog?.window?.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL)
|
||||
|
@@ -18,8 +18,8 @@ import android.widget.TextView
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.android.billingclient.api.BillingClient
|
||||
import com.android.billingclient.api.BillingResult
|
||||
import com.android.billingclient.api.ProductDetails
|
||||
import com.android.billingclient.api.Purchase
|
||||
import com.android.billingclient.api.SkuDetails
|
||||
import com.appsflyer.AFInAppEventParameterName
|
||||
import com.appsflyer.AFInAppEventType
|
||||
import com.appsflyer.AppsFlyerLib
|
||||
@@ -41,7 +41,7 @@ import com.yizhuan.xchat_android_core.pay.bean.PayRecordId
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.utils.net.IgnoreException
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.common.util.DeviceUtil
|
||||
import com.yizhuan.xchat_android_library.utils.AppMetaDataUtil
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
@@ -123,7 +123,7 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
ResUtil.getString(R.string.avroom_firstcharge_firstchargedialog_01).toast()
|
||||
} else if (channel.equals(Constants.GOOGLE)) {
|
||||
goodsList?.get(position)?.let { charge ->
|
||||
buyProduct(charge.skuDetails)
|
||||
buyProduct(charge.productDetails)
|
||||
}
|
||||
} else {
|
||||
CommonWebViewActivity.start(
|
||||
@@ -142,18 +142,23 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
FirstChargeReward.ONE -> {
|
||||
spanSize = 6
|
||||
}
|
||||
|
||||
FirstChargeReward.TWO_LEFT -> {
|
||||
spanSize = 3
|
||||
}
|
||||
|
||||
FirstChargeReward.TWO_RIGHT -> {
|
||||
spanSize = 3
|
||||
}
|
||||
|
||||
FirstChargeReward.THREE -> {
|
||||
spanSize = 2
|
||||
}
|
||||
|
||||
FirstChargeReward.TWO_LEFT_SMALL -> {
|
||||
spanSize = 3
|
||||
}
|
||||
|
||||
FirstChargeReward.TWO_RIGHT_SMALL -> {
|
||||
spanSize = 3
|
||||
}
|
||||
@@ -196,11 +201,13 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
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}"
|
||||
@@ -227,20 +234,19 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
for (bean in goodsList) {
|
||||
productKeys.add(bean.chargeProdId)
|
||||
}
|
||||
billingManager?.querySkuDetailsAsync(
|
||||
BillingClient.SkuType.INAPP, productKeys
|
||||
) { billingResult: BillingResult, skuDetailsList: List<SkuDetails>? ->
|
||||
billingManager?.querySkuDetailsAsync(productKeys) { billingResult: BillingResult, productDetails: MutableList<ProductDetails> ->
|
||||
if (billingResult.responseCode != BillingClient.BillingResponseCode.OK) {
|
||||
Log.w(
|
||||
TAG,
|
||||
"Unsuccessful query for type: " + BillingClient.SkuType.INAPP
|
||||
+ ". Error code: " + billingResult.responseCode
|
||||
"Unsuccessful query for type: " + BillingClient.ProductType.INAPP + ". Error code: " + billingResult.responseCode
|
||||
)
|
||||
} else if (skuDetailsList != null && skuDetailsList.isNotEmpty()) {
|
||||
return@querySkuDetailsAsync
|
||||
}
|
||||
if (productDetails.isNotEmpty()) {
|
||||
for (chargeBean in goodsList) {
|
||||
for (skuDetails in skuDetailsList) {
|
||||
if (skuDetails.sku == chargeBean.chargeProdId) {
|
||||
chargeBean.skuDetails = skuDetails
|
||||
for (skuDetails in productDetails) {
|
||||
if (skuDetails.productId == chargeBean.chargeProdId) {
|
||||
chargeBean.productDetails = skuDetails
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -258,7 +264,7 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
) {
|
||||
PayModel.get().verifyOrder(
|
||||
purchase.accountIdentifiers!!.obfuscatedAccountId,
|
||||
purchase.skus[0],
|
||||
purchase.products[0],
|
||||
purchase.packageName,
|
||||
purchase.purchaseToken
|
||||
)
|
||||
@@ -267,12 +273,12 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
{ token: String? ->
|
||||
//L.i("token=" + token);
|
||||
billingManager?.consumeAsync(token)
|
||||
var skuDetails: SkuDetails? = null
|
||||
var skuDetails: ProductDetails? = null
|
||||
val goodList = goodsList
|
||||
if (goodList != null && goodList.isNotEmpty()) {
|
||||
if (!goodList.isNullOrEmpty()) {
|
||||
for (datum in goodList) {
|
||||
if (datum.chargeProdId == purchase.skus[0]) {
|
||||
skuDetails = datum.skuDetails
|
||||
if (datum.chargeProdId == purchase.products[0]) {
|
||||
skuDetails = datum.productDetails
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -282,12 +288,12 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
HashMap()
|
||||
eventValue[AFInAppEventParameterName.CONTENT_TYPE] = "Gold"
|
||||
eventValue[AFInAppEventParameterName.QUANTITY] = 1
|
||||
eventValue[AFInAppEventParameterName.CONTENT_ID] = purchase.orderId
|
||||
eventValue[AFInAppEventParameterName.CONTENT_ID] = purchase.orderId!!
|
||||
eventValue[AFInAppEventParameterName.REVENUE] =
|
||||
skuDetails.priceAmountMicros / 1000000f
|
||||
eventValue["Price"] = skuDetails.price
|
||||
skuDetails.oneTimePurchaseOfferDetails?.priceAmountMicros!! / 1000000f
|
||||
eventValue["Price"] = skuDetails.oneTimePurchaseOfferDetails?.formattedPrice!!
|
||||
eventValue[AFInAppEventParameterName.CURRENCY] =
|
||||
skuDetails.priceCurrencyCode
|
||||
skuDetails.oneTimePurchaseOfferDetails?.priceCurrencyCode!!
|
||||
AppsFlyerLib.getInstance().logEvent(
|
||||
applicationContext,
|
||||
AFInAppEventType.PURCHASE,
|
||||
@@ -315,10 +321,10 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
|
||||
/*购买商品*/
|
||||
@SuppressLint("CheckResult")
|
||||
fun buyProduct(skuDetails: SkuDetails?) {
|
||||
fun buyProduct(skuDetails: ProductDetails?) {
|
||||
if (skuDetails != null) {
|
||||
Log.d(TAG, "BuyProduct:" + skuDetails.sku)
|
||||
PayModel.get().placeOrder(skuDetails.sku)
|
||||
Log.d(TAG, "BuyProduct:" + skuDetails.productId)
|
||||
PayModel.get().placeOrder(skuDetails.productId)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(
|
||||
{ recordId: PayRecordId ->
|
||||
@@ -372,6 +378,7 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
bean.itemType = FirstChargeReward.ONE
|
||||
}
|
||||
}
|
||||
|
||||
2 -> {
|
||||
for (i in firstChargeRewardList.indices) {
|
||||
if (i == 0) {
|
||||
@@ -381,11 +388,13 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
3 -> {
|
||||
for (bean in firstChargeRewardList) {
|
||||
bean.itemType = FirstChargeReward.THREE
|
||||
}
|
||||
}
|
||||
|
||||
4 -> {
|
||||
for (i in firstChargeRewardList.indices) {
|
||||
if ((i + 1) % 2 != 0) {
|
||||
@@ -395,6 +404,7 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
if (firstChargeRewardList.size % 3 == 0) {
|
||||
for (bean in firstChargeRewardList) {
|
||||
|
@@ -5,7 +5,7 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
import com.yizhuan.xchat_android_core.utils.CoreTextUtils
|
||||
|
||||
class Reward2Adapter : BaseMultiItemQuickAdapter<FirstChargeReward, BaseViewHolder>(null) {
|
||||
|
||||
@@ -33,7 +33,7 @@ class Reward2Adapter : BaseMultiItemQuickAdapter<FirstChargeReward, BaseViewHold
|
||||
)
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, item.showTime)
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
.setGone(R.id.tv_time, !CoreTextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
|
||||
}
|
@@ -4,11 +4,10 @@ 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.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
import com.yizhuan.xchat_android_core.utils.CoreTextUtils
|
||||
|
||||
class RewardAdapter(private val itemWidth: Int) :
|
||||
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_first_charge_reward) {
|
||||
@@ -24,6 +23,6 @@ class RewardAdapter(private val itemWidth: Int) :
|
||||
)
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, item.showTime)
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
.setGone(R.id.tv_time, !CoreTextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
}
|
@@ -11,6 +11,7 @@ import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.KeyEvent
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewStub
|
||||
@@ -20,6 +21,9 @@ import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.CallSuper
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.withResumed
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
@@ -45,7 +49,8 @@ import com.yizhuan.erban.avroom.dialog.RoomFreeGiftDialog
|
||||
import com.yizhuan.erban.avroom.dialog.RoomOperationDialog
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog
|
||||
import com.yizhuan.erban.avroom.presenter.BaseRoomPresenter
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageSendDialog
|
||||
import com.yizhuan.erban.avroom.redpackage.send.RedPackageSendDialog
|
||||
import com.yizhuan.erban.avroom.room_album.RoomAlbumModel
|
||||
import com.yizhuan.erban.avroom.view.IBaseRoomView
|
||||
import com.yizhuan.erban.avroom.widget.BottomView
|
||||
import com.yizhuan.erban.avroom.widget.MessageView
|
||||
@@ -82,6 +87,7 @@ import com.yizhuan.xchat_android_core.gift.bean.GiftInfo
|
||||
import com.yizhuan.xchat_android_core.gift.event.RoomFreeGiftEvent
|
||||
import com.yizhuan.xchat_android_core.helper.AtProxy
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.home.event.OpenRoomMessageInputEvent
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment2
|
||||
import com.yizhuan.xchat_android_core.manager.AudioEngineManager
|
||||
@@ -102,6 +108,8 @@ import com.yizhuan.xchat_android_core.share.bean.SessionType
|
||||
import com.yizhuan.xchat_android_core.super_admin.SaConstant
|
||||
import com.yizhuan.xchat_android_core.super_admin.model.SuperAdminModel
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomWidget
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.BaseInfo
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
@@ -114,6 +122,7 @@ import com.yizhuan.xchat_android_library.rxbus.RxBus
|
||||
import com.yizhuan.xchat_android_library.utils.*
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.coroutines.launch
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
@@ -128,7 +137,8 @@ import org.greenrobot.eventbus.ThreadMode
|
||||
*/
|
||||
open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
BaseMvpFragment<V?, P?>(),
|
||||
View.OnClickListener, OnGiftDialogBtnClickListener, IBaseRoomView, OnMicroItemClickListener {
|
||||
View.OnClickListener, OnGiftDialogBtnClickListener, IBaseRoomView, OnMicroItemClickListener,
|
||||
RoomView {
|
||||
private var myUid: Long = 0
|
||||
protected lateinit var messageView: MessageView
|
||||
protected lateinit var bottomView: BottomView
|
||||
@@ -177,6 +187,8 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
|
||||
private var atProxy: AtProxy? = null
|
||||
|
||||
// 房间小组件
|
||||
private var widgets: HashMap<String, RoomWidget> = HashMap()
|
||||
|
||||
@CallSuper
|
||||
override fun onFindViews() {
|
||||
@@ -184,6 +196,14 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
bottomView = mView.findViewById(R.id.bottom_view)
|
||||
inputLayout = mView.findViewById(R.id.input_layout)
|
||||
inputEdit = mView.findViewById(R.id.input_edit)
|
||||
inputEdit.setOnKeyListener { _, keyCode, event ->
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) {
|
||||
sendMsg()
|
||||
return@setOnKeyListener true
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
inputSend = mView.findViewById(R.id.input_send)
|
||||
microView = mView.findViewById(R.id.micro_view)
|
||||
mVsMusicPlayer = mView.findViewById(R.id.vs_music_player)
|
||||
@@ -228,6 +248,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
@SuppressLint("CheckResult")
|
||||
@CallSuper
|
||||
override fun initiate() {
|
||||
initWidget()
|
||||
//如果不需要開麥,並且還沒有權限的情況下,重置狀態為需要去打開麥克風
|
||||
myUid = AuthModel.get().currentUid
|
||||
isCloseScreen = AvRoomDataManager.get().isCloseScreen
|
||||
@@ -266,7 +287,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
// 刷新禮物列表,獲取房間專屬禮物列表
|
||||
GiftModel.get().refreshGiftList(AvRoomDataManager.get().roomUid.toString()).subscribe()
|
||||
checkFollowOwner()
|
||||
mvpPresenter?.loadRoomRank()
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
|
||||
//先隐藏航海冒险
|
||||
@@ -275,6 +295,16 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
|
||||
//获取免费礼物详情
|
||||
mvpPresenter?.queryFreeFlower()
|
||||
initRoomAlbum()
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private fun initRoomAlbum() {
|
||||
RoomAlbumModel.listUnlockRoomPhoto(AvRoomDataManager.get().roomUid)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
AvRoomDataManager.get().unlockedRoomAlbumPhotos = it
|
||||
}, { toast(it.message) })
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
@@ -292,18 +322,22 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
GiftValueMrg.get().handleReconnect(false)
|
||||
}
|
||||
}
|
||||
|
||||
RoomEvent.ROOM_EXIT -> {
|
||||
// 退出房間,把標誌置為 false
|
||||
AvRoomDataManager.get().isFromMentoring = false
|
||||
// 退出房間的時候,要停止倒計時
|
||||
EventBus.getDefault().post(MentoringStopCountingEvent())
|
||||
}
|
||||
|
||||
RoomEvent.DOWN_CROWDED_MIC -> if (AvRoomDataManager.get().isOwner(roomEvent.account)) {
|
||||
toast(R.string.crowded_down)
|
||||
}
|
||||
|
||||
RoomEvent.ROOM_MANAGER_ADD, RoomEvent.ROOM_MANAGER_REMOVE -> {
|
||||
updateView()
|
||||
}
|
||||
|
||||
RoomEvent.ROOM_INFO_UPDATE -> {
|
||||
Logger.i(ResUtil.getString(R.string.avroom_fragment_baseroomfragment_01))
|
||||
addOpenDatingTips() //一定要放在updateView之前!!!
|
||||
@@ -313,13 +347,16 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
updateRemoteMuteBtn()
|
||||
openOrCloseGiftValue(false)
|
||||
}
|
||||
|
||||
RoomEvent.ENTER_ROOM -> {
|
||||
Logger.i(ResUtil.getString(R.string.avroom_fragment_baseroomfragment_02))
|
||||
updateView()
|
||||
updateRemoteMuteBtn()
|
||||
openOrCloseGiftValue(true)
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
onEnterRoom()
|
||||
}
|
||||
|
||||
RoomEvent.ADD_BLACK_LIST -> onChatRoomMemberBlackAdd(roomEvent.account)
|
||||
RoomEvent.MIC_QUEUE_STATE_CHANGE -> onQueueMicStateChange()
|
||||
RoomEvent.KICK_DOWN_MIC_BY_S_ADMIN, RoomEvent.KICK_DOWN_MIC -> if (event == RoomEvent.KICK_DOWN_MIC) {
|
||||
@@ -335,16 +372,20 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
RoomEvent.DOWN_MIC -> {
|
||||
onDownMicro()
|
||||
}
|
||||
|
||||
RoomEvent.UP_MIC -> {
|
||||
onUpMicro()
|
||||
}
|
||||
|
||||
RoomEvent.INVITE_UP_MIC -> if (AvRoomDataManager.get().isOwner(roomEvent.account)) {
|
||||
//自己的消息
|
||||
onInviteUpMic(roomEvent.micPosition)
|
||||
}
|
||||
|
||||
RoomEvent.KICK_OUT_ROOM -> {
|
||||
val reason = roomEvent.reason
|
||||
if (reason != null && reason.reason == ChatRoomKickOutEvent.ChatRoomKickOutReason.CHAT_ROOM_INVALID) {
|
||||
@@ -362,6 +403,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
AvRoomDataManager.get().removeChatRoomMember(targetUid)
|
||||
}
|
||||
}
|
||||
|
||||
RoomEvent.LEAVE_MODE -> microView.adapter.notifyDataSetChanged()
|
||||
RoomEvent.ROOM_CLEAN_SCREEN -> messageView.clear()
|
||||
}
|
||||
@@ -471,9 +513,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
//設置透明度
|
||||
rollPagerView.setAnimationDurtion(500)
|
||||
bannerAdapter.notifyDataSetChanged()
|
||||
bannerAdapter.setRoomActClickListener { url ->
|
||||
DialogWebViewActivity.start(mContext, url)
|
||||
}
|
||||
|
||||
// 模擬指示器在viewpager底部效果
|
||||
val viewPager = rollPagerView.viewPager
|
||||
@@ -515,6 +554,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
if (isOnMic) {
|
||||
if (musicPlayerView == null) {
|
||||
musicPlayerView = mVsMusicPlayer?.inflate() as? MusicPlayerView
|
||||
musicPlayerView?.let {
|
||||
onInitMusicPlayerView(it)
|
||||
}
|
||||
}
|
||||
musicPlayerView?.visibility = View.VISIBLE
|
||||
} else {
|
||||
@@ -544,7 +586,10 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
} else {
|
||||
val roomQueueInfo = AvRoomDataManager.get()
|
||||
.getRoomQueueMemberInfoByAccount(myUid.toString())
|
||||
if (roomQueueInfo?.mChatRoomMember != null
|
||||
if (roomQueueInfo?.mChatRoomMember?.isNoProhibitMic == true && roomQueueInfo.mRoomMicInfo?.isMicMute == false) {
|
||||
bottomView.setMicBtnEnable(true)
|
||||
bottomView.setMicBtnOpen(true)
|
||||
} else if (roomQueueInfo?.mChatRoomMember != null
|
||||
&& myUid.toString() == roomQueueInfo.mChatRoomMember.account
|
||||
&& roomQueueInfo.mRoomMicInfo?.isMicMute == true
|
||||
) {
|
||||
@@ -603,6 +648,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
releaseView()
|
||||
unregisterWidgets()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
@@ -632,13 +678,11 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
R.id.input_send -> {
|
||||
sendMsg()
|
||||
}
|
||||
R.id.contribute_list -> {
|
||||
DialogWebViewActivity.start(mContext, UriProvider.getRoomRanking())
|
||||
mvpPresenter?.loadRoomRank()
|
||||
}
|
||||
|
||||
R.id.iv_first_charge_enter -> FirstChargeDialog.start(mContext)
|
||||
R.id.iv_treasure_box,
|
||||
R.id.iv_treasure_box_cp -> GoldBoxHelper.handleBoxClick(mContext)
|
||||
|
||||
R.id.iv_radish_entrance -> PullRadishActivity.start(mContext)
|
||||
}
|
||||
}
|
||||
@@ -707,6 +751,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
.subscribe { _, throwable ->
|
||||
if (throwable != null) {
|
||||
toast(throwable.message)
|
||||
callback.onFail()
|
||||
} else {
|
||||
callback.onSuccess()
|
||||
@@ -983,6 +1028,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun toUpMicroPhone(micPosition: Int, currentUid: String, b: Boolean) {
|
||||
if (!lifecycle.currentState.isAtLeast(androidx.lifecycle.Lifecycle.State.CREATED)) {
|
||||
return
|
||||
}
|
||||
if (AvRoomDataManager.get().isSelfGamePlaying) {
|
||||
SingleToastUtil.showToast("遊戲中不可以換麥!")
|
||||
return
|
||||
@@ -1108,18 +1156,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
microView.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun updateRoomRanks(data: List<RoomContributeUserInfo>) {
|
||||
// val avatarList = arrayListOf<ImageView?>(
|
||||
// mView.findViewById(R.id.iv_rank_0),
|
||||
// mView.findViewById(R.id.iv_rank_1),
|
||||
// mView.findViewById(R.id.iv_rank_2)
|
||||
// )
|
||||
//
|
||||
// for (i in 0 until avatarList.size) {
|
||||
// avatarList[i]?.loadAvatar(data.getOrNull(i)?.avatar)
|
||||
// }
|
||||
}
|
||||
|
||||
private fun onSendGiftBtnClick(giftId: Int = 0) {
|
||||
if (giftDialog == null) {
|
||||
GiftDialog.GIFT_DIALOG_FROM = getString(R.string.room)
|
||||
@@ -1208,7 +1244,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
AudioEngineManager.get().isMute = !AudioEngineManager.get().isMute
|
||||
updateMicBtn()
|
||||
if (AudioEngineManager.get().isMute) {
|
||||
|
||||
AudioEngineManager.get().stopLocalAudio()
|
||||
} else if (AvRoomDataManager.get().isOnMic(myUid)) {
|
||||
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_BROADCASTER)
|
||||
}
|
||||
@@ -1232,10 +1268,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
|
||||
override fun onSendMsgBtnClick() {
|
||||
inputLayout.visibility = View.VISIBLE
|
||||
inputEdit.isFocusableInTouchMode = true
|
||||
inputEdit.requestFocus()
|
||||
KeyBoardUtils.showKeyBoard(context, inputEdit)
|
||||
openMessageInput(null)
|
||||
}
|
||||
|
||||
override fun onSendGiftBtnClick() {
|
||||
@@ -1251,7 +1284,10 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
override fun onMoreBtnClick() {
|
||||
val dialog = RoomOperationDialog(mContext)
|
||||
dialog.setOnActionListener {
|
||||
redPackageSendDialog = RedPackageSendDialog()
|
||||
redPackageSendDialog = RedPackageSendDialog.newInstance(AvRoomDataManager.get().redEnvelopeType)
|
||||
redPackageSendDialog?.setOnDismissListener {
|
||||
redPackageSendDialog = null
|
||||
}
|
||||
redPackageSendDialog?.show(activity)
|
||||
}
|
||||
dialog.show()
|
||||
@@ -1261,4 +1297,63 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
RoomMsgActivity.start(mContext)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册组件
|
||||
*/
|
||||
protected fun registerWidget(name: String, widget: RoomWidget) {
|
||||
widgets.put(name, widget)
|
||||
widget.onStart(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消注册组件
|
||||
*/
|
||||
protected fun unregisterWidgets() {
|
||||
widgets.values.forEach {
|
||||
it.onStop()
|
||||
}
|
||||
widgets.clear()
|
||||
}
|
||||
|
||||
override fun getLifecycleOwner(): LifecycleOwner {
|
||||
return this
|
||||
}
|
||||
|
||||
open fun initWidget() {
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
open fun onOpenRoomMessageInputEvent(event: OpenRoomMessageInputEvent) {
|
||||
lifecycleScope.launch {
|
||||
lifecycle.withResumed {
|
||||
view?.postDelayed({
|
||||
openMessageInput(event.text)
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开公屏输入
|
||||
*/
|
||||
fun openMessageInput(text: String?) {
|
||||
inputLayout.visibility = View.VISIBLE
|
||||
if (text != null) {
|
||||
inputEdit.setText(text)
|
||||
inputEdit.setSelection(inputEdit.length())
|
||||
}
|
||||
inputEdit.isFocusableInTouchMode = true
|
||||
inputEdit.requestFocus()
|
||||
KeyBoardUtils.showKeyBoard(context, inputEdit)
|
||||
}
|
||||
|
||||
protected open fun onEnterRoom(){
|
||||
|
||||
}
|
||||
|
||||
protected open fun onInitMusicPlayerView(view: MusicPlayerView) {
|
||||
|
||||
}
|
||||
}
|
@@ -9,7 +9,7 @@ import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.event.SwitchRoomEvent
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import io.reactivex.Single
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@@ -66,7 +66,7 @@ class FakeSingleRoomBackFragment : BaseViewBindingFragment<FragmentFakeSingleRoo
|
||||
jumpRoom(it)
|
||||
} else {
|
||||
preRoomInfo = it
|
||||
if (!StringUtils.isBlank(it.backPic)) {
|
||||
if (!StringFormatUtils.isBlank(it.backPic)) {
|
||||
AVRoomActivity.setBackBg(mContext, it, binding.svgaImageViewBg, bgPicture)
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.event.SwitchRoomEvent
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils
|
||||
import io.reactivex.Single
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -56,7 +56,7 @@ class FakeSingleRoomFragment : BaseViewBindingFragment<FragmentFakeSingleRoomBin
|
||||
jumpRoom(it)
|
||||
} else {
|
||||
preRoomInfo = it
|
||||
if (!StringUtils.isBlank(it.backPic)) {
|
||||
if (!StringFormatUtils.isBlank(it.backPic)) {
|
||||
AVRoomActivity.setBackBg(mContext, it, binding.svgaImageViewBg, bgPicture)
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,203 @@
|
||||
package com.yizhuan.erban.avroom.fragment
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.adapter.GameMicroViewAdapter
|
||||
import com.yizhuan.erban.avroom.adapter.GameMiniMicroViewAdapter
|
||||
import com.yizhuan.erban.avroom.adapter.OnMicroItemClickListener
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.yizhuan.erban.avroom.game.GameDelegate
|
||||
import com.yizhuan.erban.avroom.game.OnGameStatusChangeListener
|
||||
import com.yizhuan.erban.avroom.presenter.GameRoomPresenter
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
import com.yizhuan.erban.avroom.view.IGameRoomView
|
||||
import com.yizhuan.erban.databinding.FragmentGameRoomBinding
|
||||
import com.yizhuan.erban.ui.widget.GiftDialog.OnGiftDialogBtnClickListener
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.music.model.PlayerModel
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
|
||||
import com.yizhuan.xchat_android_core.room.event.FinishAvRoomEvent
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 轰趴房间
|
||||
*
|
||||
* @author chenran
|
||||
* @date 2017/7/26
|
||||
*/
|
||||
@CreatePresenter(GameRoomPresenter::class)
|
||||
class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
View.OnClickListener, OnGiftDialogBtnClickListener, IGameRoomView, OnMicroItemClickListener,
|
||||
OnGameStatusChangeListener {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun newInstance(): GameRoomFragment {
|
||||
val roomFragment = GameRoomFragment()
|
||||
val bundle = Bundle()
|
||||
roomFragment.arguments = bundle
|
||||
return roomFragment
|
||||
}
|
||||
}
|
||||
|
||||
private lateinit var gameBinding: FragmentGameRoomBinding
|
||||
private lateinit var gameDelegate: GameDelegate
|
||||
private var isShowMiniMic = false
|
||||
|
||||
override fun getRootLayoutId(): Int {
|
||||
return R.layout.fragment_game_room
|
||||
}
|
||||
|
||||
override fun onFindViews() {
|
||||
super.onFindViews()
|
||||
gameBinding = DataBindingUtil.bind(mView)!!
|
||||
gameBinding.lifecycleOwner = this
|
||||
gameBinding.click = this
|
||||
gameBinding.ktvModel = false
|
||||
gameDelegate = GameDelegate(
|
||||
requireActivity(),
|
||||
gameBinding.flGameContainer,
|
||||
AvRoomDataManager.get().mCurrentRoomInfo?.mgId
|
||||
)
|
||||
gameDelegate.setOnGameStatusChangeListener(this)
|
||||
gameBinding.rankWidget.setContentBackgroundResource(R.drawable.room_rank_widget_bg_game)
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun initiate() {
|
||||
gameBinding.microView.bindAdapter(GameMicroViewAdapter(context))
|
||||
super.initiate()
|
||||
//游戏模式暂时不需要这个
|
||||
PlayerModel.get().stop()
|
||||
gameBinding.roomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
mvpPresenter?.getBannerList()
|
||||
gameBinding.tvShowMiniMic.setOnClickListener { showMiniMic() }
|
||||
gameBinding.ivShowMic.setOnClickListener { showMic() }
|
||||
}
|
||||
|
||||
private fun showMiniMic() {
|
||||
if (isShowMiniMic) return
|
||||
isShowMiniMic = true
|
||||
gameBinding.microView.bindAdapter(GameMiniMicroViewAdapter(context).apply {
|
||||
setOnClick { showMic() }
|
||||
})
|
||||
gameBinding.tvShowMiniMic.isVisible = false
|
||||
gameBinding.microView.postDelayed({
|
||||
gameBinding.ivShowMic.isVisible = true
|
||||
gameBinding.llMicView.setBackgroundResource(R.drawable.bg_mini_mic_entrance)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
private fun showMic() {
|
||||
if (!isShowMiniMic) return
|
||||
isShowMiniMic = false
|
||||
gameBinding.microView.bindAdapter(GameMicroViewAdapter(context))
|
||||
gameBinding.tvShowMiniMic.isVisible = true
|
||||
gameBinding.llMicView.background = null
|
||||
gameBinding.ivShowMic.isVisible = false
|
||||
}
|
||||
|
||||
override fun onSetListener() {
|
||||
super.onSetListener()
|
||||
bottomView.setBottomViewListener(BaseRoomBottomViewWrapper())
|
||||
}
|
||||
|
||||
override fun updateView() {
|
||||
super.updateView()
|
||||
gameDelegate.updateGame(AvRoomDataManager.get().mCurrentRoomInfo?.mgId)
|
||||
gameBinding.roomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
if (isSixMic()) {
|
||||
gameBinding.tvShowMiniMic.isVisible = !isShowMiniMic
|
||||
gameBinding.ivShowMic.isVisible = isShowMiniMic
|
||||
} else {
|
||||
showMic()
|
||||
gameBinding.tvShowMiniMic.isInvisible = true
|
||||
gameBinding.ivShowMic.isVisible = false
|
||||
}
|
||||
gameBinding.microView.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onGameStart() {
|
||||
if (isSixMic()) {
|
||||
showMiniMic()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onGameEnd() {
|
||||
if (isSixMic()) {
|
||||
showMic()
|
||||
}
|
||||
}
|
||||
|
||||
private fun isSixMic(): Boolean {
|
||||
return AvRoomDataManager.get().mgMicNum == AvRoomDataManager.GAME_DEF_MIC_COUNT
|
||||
}
|
||||
|
||||
override fun onSendMsgSuccess(msg: String?) {
|
||||
super.onSendMsgSuccess(msg)
|
||||
msg?.let {
|
||||
if (AvRoomDataManager.get().isSelfGamePlaying) {
|
||||
gameDelegate.hitTheMark(msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onShowBanner(dialogInfos: List<BannerInfo>) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfos)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFinishAvRoomEvent(event: FinishAvRoomEvent) {
|
||||
gameDelegate.exitGame()
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFirstRechargeEvent(event: FirstChargeEvent) {
|
||||
FirstChargePrizeDialog(
|
||||
requireContext(),
|
||||
event.chargeProdTitle,
|
||||
event.firstChargeRewardList
|
||||
).openDialog()
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
gameDelegate.onStart()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
gameDelegate.onResume()
|
||||
}
|
||||
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
gameDelegate.onPause()
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
gameDelegate.onStop()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
gameDelegate.onDestroy()
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun initWidget() {
|
||||
super.initWidget()
|
||||
registerWidget(RedPackageWidget::class.java.simpleName, gameBinding.redPackageWidget)
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
}
|
||||
}
|
@@ -18,6 +18,8 @@ import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
@@ -32,6 +34,7 @@ import com.yizhuan.erban.avroom.activity.RoomOnlineUserActivity;
|
||||
import com.yizhuan.erban.avroom.adapter.SelectGameAdapter;
|
||||
import com.yizhuan.erban.avroom.dialog.ExitRoomPopupWindow;
|
||||
import com.yizhuan.erban.avroom.widget.GiftV2View;
|
||||
import com.yizhuan.erban.avroom.widget.RoomEffectView;
|
||||
import com.yizhuan.erban.base.BaseFragment;
|
||||
import com.yizhuan.erban.databinding.FragmentChatroomGameMainBinding;
|
||||
import com.yizhuan.erban.friend.view.SelectFriendActivity;
|
||||
@@ -55,14 +58,14 @@ import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.praise.PraiseModel;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomModeType;
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo;
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo;
|
||||
import com.yizhuan.xchat_android_core.room.game.GameModel;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.event.HasAnimationEffect;
|
||||
import com.yizhuan.xchat_android_core.share.ShareModel;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.Logger;
|
||||
import com.yizhuan.xchat_android_core.utils.CoreLogger;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
@@ -78,6 +81,7 @@ import cn.sharesdk.framework.Platform;
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Action;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
|
||||
/**
|
||||
* 轰趴房
|
||||
@@ -98,6 +102,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
private ImageView ivRoomShare;
|
||||
private GiftV2View giftView;
|
||||
private ViewStub mVsGift2View;
|
||||
private RoomEffectView mRoomEffectView;
|
||||
|
||||
private SVGAImageView svgaRoomBg;
|
||||
private String[] bgPicture = new String[]{""};
|
||||
@@ -111,6 +116,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
private String FOLLOW_ROOM_TYPE = "";
|
||||
private SelectGameAdapter gameAdapter;
|
||||
|
||||
public final MutableLiveData<Boolean> playNotifyStateLiveData = new MutableLiveData<Boolean>(false);
|
||||
|
||||
public static HomePartyFragment newInstance() {
|
||||
HomePartyFragment homePartyFragment = new HomePartyFragment();
|
||||
@@ -149,7 +155,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
toast(getString(R.string.have_copy));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.info("copyText", e.toString());
|
||||
CoreLogger.info("copyText", e.toString());
|
||||
toast(e.toString());
|
||||
}
|
||||
return true;
|
||||
@@ -178,6 +184,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
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);
|
||||
mRoomEffectView = mView.findViewById(R.id.room_effect_view);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,6 +216,14 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
ivRoomShare.setOnClickListener(this);
|
||||
gameMainBinding.llRoomInfo.setOnClickListener(this);
|
||||
gameMainBinding.ivBack.setOnClickListener(this);
|
||||
|
||||
mRoomEffectView.setPlayNotifyStateListener(playNotifyStateLiveData);
|
||||
mRoomEffectView.setOnPlayAnimCallback(new Function0<Boolean>() {
|
||||
@Override
|
||||
public Boolean invoke() {
|
||||
return isShowingGiftNotify();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -344,6 +359,28 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼物飘屏是否展示
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isShowingGiftNotify() {
|
||||
if ((getActivity() instanceof AVRoomActivity)) {
|
||||
return ((AVRoomActivity) getActivity()).isShowingGiftNotify();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public LiveData<Boolean> getPlayNotifyState(){
|
||||
return playNotifyStateLiveData;
|
||||
}
|
||||
|
||||
public boolean isShowingPlayNotify(){
|
||||
if(playNotifyStateLiveData.getValue()==null) {
|
||||
return false;
|
||||
}
|
||||
return playNotifyStateLiveData.getValue();
|
||||
}
|
||||
|
||||
private void onReceiveLuckyGiftToMultiMsg(LuckyBagGifts giftMultiReceiverInfo) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed()) return;
|
||||
@@ -405,7 +442,9 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
Fragment tempFragment = roomFragment;
|
||||
switch (currentRoomInfo.getType()) {
|
||||
case RoomInfo.ROOMTYPE_GAME:
|
||||
toast(getString(R.string.room_game_is_not_open_yet));
|
||||
if (!(tempFragment instanceof GameRoomFragment)) {
|
||||
tempFragment = GameRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
case RoomInfo.ROOM_TYPE_SINGLE:
|
||||
if (!(tempFragment instanceof SingleRoomFragment)) {
|
||||
|
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
@@ -26,6 +27,8 @@ import com.yizhuan.erban.avroom.dialog.PKScoreBoardDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog;
|
||||
import com.yizhuan.erban.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyPresenter;
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyView;
|
||||
import com.yizhuan.erban.avroom.widget.PKBoardView;
|
||||
import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
@@ -35,6 +38,7 @@ import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.ui.webview.DatingRuleWebViewActivity;
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
@@ -60,7 +64,6 @@ import com.yizhuan.xchat_android_core.room.queuing_mic.bean.RespQueuingMicListIn
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.event.QueuingMicEmptyEvent;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.event.QueuingMicNotEmptyEvent;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
@@ -134,6 +137,13 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
bottomView.setBottomViewListener(new PartyRoomBottomViewWrapper());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initWidget() {
|
||||
super.initWidget();
|
||||
registerWidget(RedPackageWidget.class.getSimpleName(), gameBinding.redPackageWidget);
|
||||
registerWidget(RoomRankWidget.class.getSimpleName(), gameBinding.rankWidget);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void initiate() {
|
||||
@@ -453,7 +463,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
if (!microType.equals(BaseMicroViewAdapter.MICRO_TYPE_CP)) {
|
||||
microView.bindAdapter(new CpMicroViewAdapter(mContext));
|
||||
}
|
||||
} else if (AvRoomDataManager.get().isDatingMode()) {
|
||||
} else if (AvRoomDataManager.get().isDatingMode()) {
|
||||
if (!microType.equals(BaseMicroViewAdapter.MICRO_TYPE_DATING)) {
|
||||
microView.bindAdapter(new DatingMicroViewAdapter(mContext));
|
||||
}
|
||||
@@ -527,7 +537,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (mDisposable != null) {
|
||||
@@ -598,7 +607,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
getMvpPresenter().cancelDragon();
|
||||
});
|
||||
break;
|
||||
case R.id.tv_hour_rank:
|
||||
case R.id.layout_hour_rank:
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
UriProvider.getRoomHourRankUrl(AvRoomDataManager.get().getRoomUid())
|
||||
@@ -782,7 +791,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
|
||||
private void hideKtvRelaView() {
|
||||
gameBinding.setKtvModel(false);
|
||||
gameBinding.contributeList.setVisibility(View.VISIBLE);
|
||||
changeModelShowView();
|
||||
gameBinding.bottomView.showKtvBottom(false);
|
||||
}
|
||||
@@ -794,9 +802,9 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo.getIsPermitRoom() == 1) {
|
||||
gameBinding.tvHourRank.setVisibility(View.VISIBLE);
|
||||
gameBinding.layoutHourRank.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
gameBinding.tvHourRank.setVisibility(View.GONE);
|
||||
gameBinding.layoutHourRank.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
@@ -809,7 +817,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
} else {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.VISIBLE);
|
||||
|
||||
GlideApp.with(BasicConfig.INSTANCE.getAppContext())
|
||||
.load(GoldBoxHelper.getBoxIcon())
|
||||
.error(R.drawable.icon_room_treasure_box)
|
||||
@@ -965,9 +972,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
@Override
|
||||
public void onShowBanner(List<BannerInfo> bannerInfos) {
|
||||
initRoomAct(gameBinding.activityImg, bannerInfos, 11f);
|
||||
AvRoomModel.get().getRoomActTimer(AvRoomDataManager.get().getRoomUid())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
|
||||
@@ -1069,4 +1073,10 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInitMusicPlayerView(@NonNull MusicPlayerView view) {
|
||||
super.onInitMusicPlayerView(view);
|
||||
view.linkIconView(gameBinding.ivMusic, gameBinding.ivMusic);
|
||||
}
|
||||
}
|
||||
|
@@ -7,28 +7,23 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.netease.nim.uikit.common.util.sys.NetworkUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadmoreListener;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.adapter.OnlineUserAdapter;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyUserListPresenter;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyUserListView;
|
||||
import com.yizhuan.erban.base.BaseMvpFragment;
|
||||
import com.yizhuan.erban.ui.widget.UserInfoDialog;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomOnlineUserBean;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -44,7 +39,6 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
private SmartRefreshLayout mRefreshLayout;
|
||||
|
||||
private OnlineUserAdapter mOnlineUserAdapter;
|
||||
private int mPage = Constants.PAGE_START;
|
||||
private boolean isShowToUser = false;
|
||||
|
||||
@Override
|
||||
@@ -58,24 +52,12 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
public void onFindViews() {
|
||||
mRecyclerView = mView.findViewById(R.id.recycler_view);
|
||||
mRefreshLayout = mView.findViewById(R.id.refresh_layout);
|
||||
mRefreshLayout.setEnableLoadmore(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
mRefreshLayout.setOnRefreshLoadmoreListener(new OnRefreshLoadmoreListener() {
|
||||
@Override
|
||||
public void onLoadmore(RefreshLayout refreshLayout) {
|
||||
if (!NetworkUtil.isNetAvailable(mContext)) {
|
||||
mRefreshLayout.finishLoadmore();
|
||||
return;
|
||||
}
|
||||
List<OnlineChatMember> data = mOnlineUserAdapter.getData();
|
||||
if (ListUtils.isListEmpty(data)) {
|
||||
mRefreshLayout.finishLoadmore();
|
||||
return;
|
||||
}
|
||||
loadData(data.get(data.size() - 1).chatRoomMember.getEnterTime());
|
||||
}
|
||||
mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
||||
|
||||
@Override
|
||||
public void onRefresh(RefreshLayout refreshLayout) {
|
||||
@@ -106,53 +88,24 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
|
||||
|
||||
public void firstLoad() {
|
||||
mPage = Constants.PAGE_START;
|
||||
loadData(0);
|
||||
loadData();
|
||||
}
|
||||
|
||||
private void loadData(long time) {
|
||||
getMvpPresenter().requestChatMemberByPage(mPage, time,
|
||||
mOnlineUserAdapter == null ? null : mOnlineUserAdapter.getData());
|
||||
private void loadData() {
|
||||
getMvpPresenter().requestRoomOnlineList(AvRoomDataManager.get().getRoomUid());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageSuccess(List<OnlineChatMember> chatRoomMemberList, int page) {
|
||||
mPage = page;
|
||||
if (!ListUtils.isListEmpty(chatRoomMemberList)) {
|
||||
//超管不显示
|
||||
Iterator<OnlineChatMember> iterator = chatRoomMemberList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
OnlineChatMember member = iterator.next();
|
||||
if (member != null && SuperAdminUtil.isSuperAdmin(member.chatRoomMember)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
mOnlineUserAdapter.setNewData(chatRoomMemberList);
|
||||
if (mPage == Constants.PAGE_START) {
|
||||
mRefreshLayout.finishRefresh();
|
||||
} else {
|
||||
mRefreshLayout.finishLoadmore(0);
|
||||
}
|
||||
mPage++;
|
||||
} else {
|
||||
if (mPage == Constants.PAGE_START) {
|
||||
mRefreshLayout.finishRefresh();
|
||||
} else {
|
||||
mRefreshLayout.finishLoadmore(0);
|
||||
}
|
||||
}
|
||||
public void onRequestRoomOnlineListSuccess(List<RoomOnlineUserBean> list) {
|
||||
mOnlineUserAdapter.setNewData(list);
|
||||
mRefreshLayout.finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageFail(String errorStr, int page) {
|
||||
Logger.i(ResUtil.getString(R.string.avroom_fragment_onlineuserfragment_01) + page);
|
||||
mPage = page;
|
||||
if (mPage == Constants.PAGE_START) {
|
||||
mRefreshLayout.finishRefresh();
|
||||
} else {
|
||||
mRefreshLayout.finishLoadmore(0);
|
||||
}
|
||||
mRefreshLayout.finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -166,16 +119,12 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int position) {
|
||||
RoomInfo currentRoom = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoom != null) {
|
||||
List<OnlineChatMember> chatRoomMembers = mOnlineUserAdapter.getData();
|
||||
List<RoomOnlineUserBean> chatRoomMembers = mOnlineUserAdapter.getData();
|
||||
if (ListUtils.isListEmpty(chatRoomMembers)) return;
|
||||
OnlineChatMember onlineChatMember = chatRoomMembers.get(position);
|
||||
ChatRoomMember chatRoomMember = onlineChatMember.chatRoomMember;
|
||||
if (chatRoomMember != null) {
|
||||
if (onlineChatMember.getItemType() == OnlineChatMember.NOBLE) {
|
||||
return;
|
||||
}
|
||||
RoomOnlineUserBean onlineChatMember = chatRoomMembers.get(position);
|
||||
if (onlineChatMember != null) {
|
||||
UserInfoDialog.showNewUserInfoDialog(mContext,
|
||||
JavaUtil.str2long(chatRoomMember.getAccount()),
|
||||
onlineChatMember.getUid(),
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
@@ -185,28 +134,25 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberIn(String account, List<OnlineChatMember> dataList) {
|
||||
// if (!isResumed()) return;
|
||||
// getMvpPresenter().onMemberInRefreshData(account, dataList, mPage);
|
||||
public void onMemberIn(String account) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberExit(String account, List<OnlineChatMember> dataList) {
|
||||
public void onMemberExit(String account) {
|
||||
// if (!isResumed()) return;
|
||||
// if (!isShowToUser()) return;
|
||||
// firstLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberDownUpMic(String account, boolean isUpMic, List<OnlineChatMember> dataList) {
|
||||
if (!isResumed()) return;
|
||||
getMvpPresenter().onMemberDownUpMic(account, isUpMic, dataList, mPage);
|
||||
public void onMemberDownUpMic(String account, boolean isUpMic) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateMemberManager(String account, boolean isRemoveManager, List<OnlineChatMember> dataList) {
|
||||
if (!isResumed()) return;
|
||||
getMvpPresenter().onUpdateMemberManager(account, dataList, isRemoveManager, mPage);
|
||||
public void onUpdateMemberManager(String account, boolean isRemoveManager) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -16,6 +16,8 @@ import com.yizhuan.erban.avroom.adapter.SingleRoomPKMicroViewAdapter
|
||||
import com.yizhuan.erban.avroom.dialog.RequestUpMicDialog
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.yizhuan.erban.avroom.presenter.SingleRoomPresenter
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
import com.yizhuan.erban.avroom.singleroompk.SingleRoomPkFinishDialog
|
||||
import com.yizhuan.erban.avroom.singleroompk.SingleRoomPkForceFinishDialog
|
||||
import com.yizhuan.erban.avroom.singleroompk.SingleRoomPkReceivedDialog
|
||||
@@ -28,9 +30,10 @@ import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.fansteam.FansTeamInitInfo
|
||||
import com.yizhuan.xchat_android_core.fansteam.bean.FansTeamInitInfo
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.FansTeamMsgAttachment
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RequestUpmicAttachment
|
||||
@@ -108,7 +111,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
}
|
||||
|
||||
gameBinding.tvHourRank.setOnClickListener {
|
||||
gameBinding.layoutHourRank.setOnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
UriProvider.getSingleRoomHourRankUrl(AvRoomDataManager.get().roomUid)
|
||||
@@ -119,16 +122,10 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateFansTeamInfo(initInfo: FansTeamInitInfo) {
|
||||
var clickListener: View.OnClickListener? = null
|
||||
if (!AvRoomDataManager.get().isRoomOwner && !initInfo.isAnchorFans && initInfo.hasFansTeamCurrentRoom) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.isVisible = false
|
||||
} else {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
}
|
||||
|
||||
if (initInfo.hasFansTeamCurrentRoom) {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text = "粉絲團(${initInfo.anchorFansNum})"
|
||||
clickListener = View.OnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
@@ -138,12 +135,16 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
} else {
|
||||
if (initInfo.isAnchorFans) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text =
|
||||
"粉絲LV.${if (initInfo.fansLevelSeq == 0) 1 else initInfo.fansLevelSeq}"
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinedActivity.start(requireContext())
|
||||
}
|
||||
} else {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.isVisible = false
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinActivity.start(requireContext())
|
||||
}
|
||||
@@ -151,6 +152,8 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text = "開通粉絲團"
|
||||
clickListener = View.OnClickListener {
|
||||
CommonWebViewActivity.start(
|
||||
@@ -159,7 +162,9 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
)
|
||||
}
|
||||
} else {
|
||||
gameBinding.tvFansTeamOpt.text = "該主播暫未開通粉絲團"
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text = "TA暫未開通粉絲團"
|
||||
}
|
||||
}
|
||||
gameBinding.flFansTeam.setOnClickListener(clickListener)
|
||||
@@ -229,6 +234,11 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
bottomView.setBottomViewListener(BaseRoomBottomViewWrapper())
|
||||
}
|
||||
|
||||
override fun onEnterRoom() {
|
||||
super.onEnterRoom()
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
}
|
||||
|
||||
override fun updateView() {
|
||||
super.updateView()
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode && gameBinding.microView.adapter !is SingleRoomPKMicroViewAdapter) {
|
||||
@@ -262,4 +272,14 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
).openDialog()
|
||||
}
|
||||
|
||||
override fun initWidget() {
|
||||
super.initWidget()
|
||||
registerWidget(RedPackageWidget::class.java.simpleName, gameBinding.redPackageWidget)
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
}
|
||||
|
||||
override fun onInitMusicPlayerView(view: MusicPlayerView) {
|
||||
super.onInitMusicPlayerView(view)
|
||||
view.linkIconView(gameBinding.ivMusic, gameBinding.ivMusic)
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
Copyright © Sud.Tech
|
||||
https://sud.tech
|
||||
*/
|
||||
package com.yizhuan.erban.avroom.game;
|
||||
|
||||
import com.yizhuan.xchat_android_library.BuildConfig;
|
||||
|
||||
public class AppConfig {
|
||||
|
||||
protected static final String APP_ID = "1578948593831571457";
|
||||
protected static final String APP_KEY = "J9lHOXvFWkAZiTfl4SK7IGt0wDnW3fWd";
|
||||
protected static boolean isTestEnv = BuildConfig.DEBUG;
|
||||
|
||||
}
|
676
app/src/main/java/com/yizhuan/erban/avroom/game/GameDelegate.kt
Normal file
@@ -0,0 +1,676 @@
|
||||
package com.yizhuan.erban.avroom.game
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewTreeObserver.OnGlobalLayoutListener
|
||||
import android.widget.FrameLayout
|
||||
import com.google.gson.Gson
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameCfg
|
||||
import com.yizhuan.xchat_android_core.room.game.GameModel
|
||||
import com.yizhuan.xchat_android_core.room.game.GameStatus
|
||||
import com.yizhuan.xchat_android_core.room.model.HomePartyModel
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.utils.LogUtils
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||
import okhttp3.*
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
import tech.sud.mgp.core.*
|
||||
import java.util.*
|
||||
|
||||
class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId: Long?) {
|
||||
|
||||
private val TAG = "GameDelegate"
|
||||
private var APP_CODE = ""
|
||||
|
||||
private val mRoomID :String get() = AvRoomDataManager.get().roomUid.toString()
|
||||
private val mLanguage = "zh-TW" //語言
|
||||
|
||||
//調用遊戲SDK的接口,成功加載遊戲後可用:
|
||||
private var iSudFSTAPP: ISudFSTAPP? = null
|
||||
|
||||
private val gson = Gson()
|
||||
|
||||
//小遊戲ID
|
||||
private var mMGID = 0L
|
||||
|
||||
//通用狀態-遊戲,關鍵詞
|
||||
private var mKeyWord: String? = null
|
||||
private val mUid = AuthModel.get().currentUid.toString()
|
||||
|
||||
private val homePartyModel = HomePartyModel()
|
||||
|
||||
private var onGameStatusChangeListener: OnGameStatusChangeListener? = null
|
||||
|
||||
fun setOnGameStatusChangeListener(onGameStatusChangeListener: OnGameStatusChangeListener) {
|
||||
this.onGameStatusChangeListener = onGameStatusChangeListener
|
||||
}
|
||||
|
||||
private val loginCallback: AppLoginListener =
|
||||
object : AppLoginListener {
|
||||
override fun onLoginFailure(err: String?) {
|
||||
SingleToastUtil.showToast(err)
|
||||
}
|
||||
|
||||
override fun onLoginSuccess(new_code: String, expire_Date: Long) {
|
||||
APP_CODE = new_code
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
//初始化遊戲SDK
|
||||
initGameSDK(
|
||||
activity,
|
||||
AppConfig.APP_ID,
|
||||
AppConfig.APP_KEY,
|
||||
AppConfig.isTestEnv
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
init {
|
||||
mMGID = mgId ?: 0L
|
||||
login(loginCallback)
|
||||
}
|
||||
|
||||
fun updateGame(mgId: Long?) {
|
||||
if (mgId == null || mgId == 0L) return
|
||||
if (mgId == mMGID && iSudFSTAPP != null) {
|
||||
return
|
||||
}
|
||||
mMGID = mgId
|
||||
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
|
||||
loadMG(activity, mUid, mRoomID, APP_CODE, mMGID, mLanguage)
|
||||
}
|
||||
|
||||
fun exitGame() {
|
||||
UserModel.get().cacheLoginUserInfo?.gameStatus = GameStatus.STATUS_NOT_JOIN
|
||||
notifySelfPlayingState(false)
|
||||
notifySelfInState(false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 例如"你畫我猜"遊戲的文字命中
|
||||
*/
|
||||
fun hitTheMark(msg: String) {
|
||||
mKeyWord?.let {
|
||||
if (msg.contains(it)) {
|
||||
notifySelfTextHit(it, msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* "接入方客戶端"登陸接口, 從"接入方服務端"獲得Code
|
||||
* "接入方服務端"是通過"服務端接入SDK"獲得Code來返回給"接入方客戶端"的
|
||||
* @param listener
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private fun login(listener: AppLoginListener) {
|
||||
GameModel.getGameCode()
|
||||
.compose(RxHelper.bindContext(activity))
|
||||
.subscribe({
|
||||
listener.onLoginSuccess(it.code, it.expireDate)
|
||||
}, {
|
||||
listener.onLoginFailure(it.message)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 1,初始化遊戲SDK
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param appID appID
|
||||
* @param appKey appKey
|
||||
* @param isTestEnv 是否是測試環境,true:測試環境,false:正式環境
|
||||
*/
|
||||
private fun initGameSDK(context: Context, appID: String, appKey: String, isTestEnv: Boolean) {
|
||||
SudMGP.initSDK(context, appID, appKey, isTestEnv, object : ISudListenerInitSDK {
|
||||
override fun onSuccess() {
|
||||
loadMG(activity, mUid, mRoomID, APP_CODE, mMGID, mLanguage)
|
||||
}
|
||||
|
||||
override fun onFailure(code: Int, errInfo: String) {
|
||||
showToast("初始化遊戲SDK失敗:$code--errInfo:$errInfo")
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 2,加載遊戲
|
||||
*
|
||||
* @param activity 上下文Activity
|
||||
* @param userID 用戶ID,業務系統保證每個用戶擁有唯一ID
|
||||
* @param roomID 房間ID,進入同一房間內的
|
||||
* @param code 令牌
|
||||
* @param mgID 小遊戲ID
|
||||
* @param language 遊戲語言 現支持,簡體:zh-CN 繁體:zh-TW 英語:en-US 馬來語:ms-MY
|
||||
*/
|
||||
private fun loadMG(
|
||||
activity: Activity,
|
||||
userID: String,
|
||||
roomID: String,
|
||||
code: String,
|
||||
mgID: Long,
|
||||
language: String
|
||||
) {
|
||||
iSudFSTAPP?.destroyMG()
|
||||
iSudFSTAPP = SudMGP.loadMG(activity, userID, roomID, code, mgID, language, mISudFSMMG)
|
||||
iSudFSTAPP?.apply {
|
||||
addGameView(gameView)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 3,將遊戲view添加到我們的布局當中
|
||||
*
|
||||
* @param gameView
|
||||
*/
|
||||
private fun addGameView(gameView: View) {
|
||||
container.removeAllViews()
|
||||
container.addView(gameView)
|
||||
}
|
||||
|
||||
private fun showToast(content: String?) {
|
||||
SingleToastUtil.showToast(content)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通知"文字命中狀態"到遊戲端
|
||||
*
|
||||
* @param iSudFSTAPP
|
||||
* @param keyWord
|
||||
*/
|
||||
private fun notifySelfTextHit(keyWord: String?, msg: String) {
|
||||
LogUtils.d("notifySelfTextHit")
|
||||
try {
|
||||
//狀態名稱
|
||||
val state: String = SudMGPAPPState.APP_COMMON_SELF_TEXT_HIT
|
||||
|
||||
//狀態數據
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject.put("isHit", true) // true 命中,false 未命中
|
||||
jsonObject.put("keyWord", keyWord) // true 命中,false 未命中
|
||||
jsonObject.put("text", msg) // 聊天原始內容,這裏的值只是一個示例,意指內容當中包含關鍵詞則命中,具體按業務規則定。
|
||||
val dataJson = jsonObject.toString()
|
||||
//調用接口
|
||||
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 設置當前關鍵詞
|
||||
*
|
||||
* @param keyWord
|
||||
*/
|
||||
private fun setKeyWord(keyWord: String?) {
|
||||
mKeyWord = keyWord
|
||||
}
|
||||
|
||||
/**
|
||||
* 遊戲SDK調用app的接口
|
||||
*/
|
||||
private val mISudFSMMG: ISudFSMMG = object : ISudFSMMG {
|
||||
|
||||
override fun onGameLog(p0: String?) {
|
||||
LogUtils.d(p0)
|
||||
}
|
||||
|
||||
override fun onGameLoadingProgress(p0: Int, p1: Int, p2: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onGameStarted() {
|
||||
}
|
||||
|
||||
override fun onGameDestroyed() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 回調此方法,表示令牌過期,此時需要刷新令牌並使用ISudFSMStateHandle回調
|
||||
* @param handle
|
||||
* @param dataJson
|
||||
*/
|
||||
override fun onExpireCode(handle: ISudFSMStateHandle, dataJson: String) {
|
||||
login(object : AppLoginListener {
|
||||
override fun onLoginFailure(err: String?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onLoginSuccess(new_code: String, expire_Date: Long) {
|
||||
APP_CODE = new_code
|
||||
try {
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject.put("ret_code", 0)
|
||||
jsonObject.put("ret_msg", "success")
|
||||
handle.success(jsonObject.toString())
|
||||
} catch (e: JSONException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
iSudFSTAPP?.updateCode(APP_CODE, null)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 處理獲取遊戲視圖信息
|
||||
* @param handle
|
||||
* @param dataJson
|
||||
*/
|
||||
override fun onGetGameViewInfo(handle: ISudFSMStateHandle, dataJson: String) {
|
||||
//拿到遊戲View的寬高
|
||||
val gameViewWidth = container.measuredWidth
|
||||
val gameViewHeight = container.measuredHeight
|
||||
if (gameViewWidth > 0 && gameViewHeight > 0) {
|
||||
notifyGameViewInfo(handle, gameViewWidth, gameViewHeight)
|
||||
return
|
||||
}
|
||||
|
||||
//如果遊戲View未加載完成,則監聽加載完成時回調
|
||||
container.viewTreeObserver.addOnGlobalLayoutListener(object : OnGlobalLayoutListener {
|
||||
override fun onGlobalLayout() {
|
||||
container.viewTreeObserver.removeOnGlobalLayoutListener(this)
|
||||
val width = container.measuredWidth
|
||||
val height = container.measuredHeight
|
||||
notifyGameViewInfo(handle, width, height)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onGetGameCfg(handle: ISudFSMStateHandle?, p1: String?) {
|
||||
handle?.success(gson.toJson(GameCfg()))
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知遊戲,遊戲視圖信息
|
||||
* @param handle
|
||||
* @param gameViewWidth
|
||||
* @param gameViewHeight
|
||||
*/
|
||||
private fun notifyGameViewInfo(
|
||||
handle: ISudFSMStateHandle,
|
||||
gameViewWidth: Int,
|
||||
gameViewHeight: Int
|
||||
) {
|
||||
try {
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject.put("ret_code", 0)
|
||||
jsonObject.put("ret_msg", "success")
|
||||
|
||||
//遊戲View大小
|
||||
val viewSize = JSONObject()
|
||||
viewSize.put("width", gameViewWidth)
|
||||
viewSize.put("height", gameViewHeight)
|
||||
jsonObject.put("view_size", viewSize)
|
||||
|
||||
//遊戲安全操作區域
|
||||
val viewGameRect = JSONObject()
|
||||
viewGameRect.put("left", 0)
|
||||
viewGameRect.put("top", container.context.resources.getDimensionPixelOffset(R.dimen.dp_180))
|
||||
viewGameRect.put("right", 0)
|
||||
viewGameRect.put("bottom", container.context.resources.getDimensionPixelOffset(R.dimen.dp_150))
|
||||
jsonObject.put("view_game_rect", viewGameRect)
|
||||
|
||||
//通知遊戲
|
||||
val json = jsonObject.toString()
|
||||
Log.d(TAG, "notifyGameViewInfo:$json")
|
||||
handle.success(json)
|
||||
} catch (e: JSONException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 遊戲狀態變化
|
||||
* @param handle
|
||||
* @param state 狀態名
|
||||
* @param dataJson 狀態數據,json字符串
|
||||
*/
|
||||
override fun onGameStateChange(
|
||||
handle: ISudFSMStateHandle,
|
||||
state: String,
|
||||
dataJson: String
|
||||
) {
|
||||
Log.d(TAG, "onGameStateChange state:$state--dataJson:$dataJson")
|
||||
when (state) {
|
||||
//SudMGPMGState.MG_COMMON_PUBLIC_MESSAGE -> showToast("遊戲:公屏消息")
|
||||
SudMGPMGState.MG_COMMON_KEY_WORD_TO_HIT -> {
|
||||
if (TextUtils.isEmpty(dataJson)) {
|
||||
setKeyWord(null)
|
||||
} else {
|
||||
try {
|
||||
val jsonObject = JSONObject(dataJson)
|
||||
if (jsonObject.isNull("word")) {
|
||||
setKeyWord(null)
|
||||
} else {
|
||||
val keyWord = jsonObject.getString("word")
|
||||
setKeyWord(keyWord)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
SudMGPMGState.APP_COMMON_SELF_CLICK_JOIN_BTN -> {
|
||||
|
||||
try {
|
||||
val jsonObject = JSONObject(dataJson)
|
||||
val seatIndex = jsonObject.optInt("seatIndex", -1)
|
||||
updateMyMicQueue(GameStatus.STATUS_NOT_READY, true, seatIndex)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
}
|
||||
SudMGPMGState.APP_COMMON_SELF_CLICK_START_BTN -> {
|
||||
notifySelfPlayingState(true)
|
||||
}
|
||||
SudMGPMGState.MG_COMMON_GAME_STATE -> handleGameState(dataJson)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家狀態變化
|
||||
* @param handle
|
||||
* @param userId 玩家用戶ID
|
||||
* @param state 狀態名
|
||||
* @param dataJson 狀態數據,json字符串。參考文檔
|
||||
*/
|
||||
override fun onPlayerStateChange(
|
||||
handle: ISudFSMStateHandle,
|
||||
userId: String,
|
||||
state: String,
|
||||
dataJson: String
|
||||
) {
|
||||
Log.d(TAG, "onPlayerStateChange userId:$userId--state:$state--dataJson:$dataJson")
|
||||
when (state) {
|
||||
SudMGPMGState.MG_COMMON_PLAYER_IN -> handlePlayerIn(userId, dataJson)
|
||||
SudMGPMGState.MG_COMMON_PLAYER_READY -> handlePlayerReady(userId, dataJson)
|
||||
SudMGPMGState.MG_COMMON_PLAYER_CAPTAIN -> handlePlayerCaptain(dataJson)
|
||||
SudMGPMGState.MG_COMMON_PLAYER_PLAYING -> handlePlayerPlaying(userId, dataJson)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handlePlayerIn(userId: String, dataJson: String) {
|
||||
if (userId != mUid) return
|
||||
try {
|
||||
val jsonObject = JSONObject(dataJson)
|
||||
val retCode = jsonObject.getInt("retCode")
|
||||
val isIn = jsonObject.getBoolean("isIn")
|
||||
if (retCode != 0) {
|
||||
return
|
||||
}
|
||||
if (isIn) { // 已加入
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
notifySelfCaptainState(mUid)
|
||||
}
|
||||
} else { // 未加入
|
||||
var reason = 0
|
||||
if (jsonObject.has("reason")) {
|
||||
reason = jsonObject.getInt("reason")
|
||||
}
|
||||
if (reason == 0) {
|
||||
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
|
||||
} else if (reason == 1) {
|
||||
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateMyMicQueue(gameStatus: Int, isJoin: Boolean = false, seatIndex: Int = -1) {
|
||||
UserModel.get().cacheLoginUserInfo?.gameStatus = gameStatus
|
||||
val position = AvRoomDataManager.get().getMicPosition(mUid)
|
||||
if (position != AvRoomDataManager.POSITON_NOT_ON_MIC) {
|
||||
if (isJoin) notifySelfInState(true, seatIndex)
|
||||
homePartyModel.updateMyMicQueue(
|
||||
position,
|
||||
AvRoomDataManager.get().roomId.toString(),
|
||||
UserModel.get().cacheLoginUserInfo
|
||||
).subscribe()
|
||||
} else if (isJoin) {
|
||||
val upPosition = AvRoomDataManager.get().findGamePosition()
|
||||
if (upPosition == Int.MIN_VALUE) {
|
||||
showToast("當前遊戲人數已滿!")
|
||||
} else {
|
||||
UserModel.get().cacheLoginUserInfo?.gameStatus = 1
|
||||
homePartyModel.upMicroPhone(upPosition,
|
||||
mUid,
|
||||
AvRoomDataManager.get().roomId.toString(),
|
||||
false, object : CallBack<String> {
|
||||
override fun onSuccess(data: String?) {
|
||||
notifySelfInState(true, seatIndex)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, error: String?) {
|
||||
showToast(error)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handlePlayerReady(userId: String, dataJson: String) {
|
||||
if (userId != mUid) return
|
||||
try {
|
||||
val jsonObject = JSONObject(dataJson)
|
||||
val retCode = jsonObject.getInt("retCode")
|
||||
val isReady = jsonObject.getBoolean("isReady")
|
||||
if (retCode != 0) {
|
||||
return
|
||||
}
|
||||
updateMyMicQueue(if (isReady) GameStatus.STATUS_READY else GameStatus.STATUS_NOT_READY)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun handlePlayerCaptain(dataJson: String) {
|
||||
try {
|
||||
val jsonObject = JSONObject(dataJson)
|
||||
val retCode = jsonObject.getInt("retCode")
|
||||
if (retCode != 0) {
|
||||
return
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleGameState(dataJson: String) {
|
||||
try {
|
||||
val jsonObject = JSONObject(dataJson)
|
||||
val gameState = jsonObject.getInt("gameState")
|
||||
if (gameState == 0) {
|
||||
onGameStatusChangeListener?.onGameEnd()
|
||||
} else if (gameState == 2) {
|
||||
onGameStatusChangeListener?.onGameStart()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun handlePlayerPlaying(userId: String, dataJson: String) {
|
||||
if (userId != mUid) return
|
||||
try {
|
||||
val jsonObject = JSONObject(dataJson)
|
||||
val retCode = jsonObject.getInt("retCode")
|
||||
if (retCode != 0) {
|
||||
return
|
||||
}
|
||||
val isPlaying = jsonObject.getBoolean("isPlaying")
|
||||
if (isPlaying) {
|
||||
updateMyMicQueue(GameStatus.STATUS_PLAYING)
|
||||
} else {
|
||||
updateMyMicQueue(GameStatus.STATUS_NOT_READY)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun notifySelfInState(isIn: Boolean, seatIndex: Int = -1) {
|
||||
try {
|
||||
if (!isIn) {
|
||||
notifySelfReadyState(false)
|
||||
}
|
||||
//狀態名稱
|
||||
val state = SudMGPAPPState.APP_COMMON_SELF_IN
|
||||
//狀態數據
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject.put("isIn", isIn) // true 加入遊戲,false 退出遊戲
|
||||
if (seatIndex != -1) {
|
||||
jsonObject.put("seatIndex", seatIndex)
|
||||
}
|
||||
jsonObject.put("teamId", 1) //哪一隊伍(2v2,4v4)
|
||||
val dataJson = jsonObject.toString()
|
||||
|
||||
//調用接口
|
||||
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun notifySelfReadyState(isReady: Boolean) {
|
||||
try {
|
||||
//狀態名稱
|
||||
val state = SudMGPAPPState.APP_COMMON_SELF_READY
|
||||
|
||||
//狀態數據
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject.put("isReady", isReady) // true 準備,false 取消準備
|
||||
val dataJson = jsonObject.toString()
|
||||
|
||||
//調用接口
|
||||
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun notifySelfPlayingState(isPlaying: Boolean) {
|
||||
try {
|
||||
//狀態名稱
|
||||
val state = SudMGPAPPState.APP_COMMON_SELF_PLAYING
|
||||
|
||||
//狀態數據
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject.put("isPlaying", isPlaying) // true 開始遊戲,false 結束遊戲
|
||||
val dataJson = jsonObject.toString()
|
||||
|
||||
//調用接口
|
||||
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun notifySelfCaptainState(uid: String) {
|
||||
try {
|
||||
//狀態名稱
|
||||
val state = SudMGPAPPState.APP_COMMON_SELF_CAPTAIN
|
||||
|
||||
//狀態數據
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject.put("curCaptainUID", uid) // 必填,指定隊長uid
|
||||
val dataJson = jsonObject.toString()
|
||||
|
||||
//調用接口
|
||||
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun notifySelfKickState(uid: String) {
|
||||
try {
|
||||
//狀態名稱
|
||||
val state = SudMGPAPPState.APP_COMMON_SELF_KICK
|
||||
|
||||
//狀態數據
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject.put("kickedUID", uid) // 被踢用戶uid
|
||||
val dataJson = jsonObject.toString()
|
||||
|
||||
//調用接口
|
||||
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun notifySelfEndState() {
|
||||
try {
|
||||
//狀態名稱
|
||||
val state = SudMGPAPPState.APP_COMMON_SELF_END
|
||||
|
||||
//狀態數據
|
||||
val jsonObject = JSONObject()
|
||||
val dataJson = jsonObject.toString()
|
||||
|
||||
//調用接口
|
||||
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
fun onStart() {
|
||||
iSudFSTAPP?.startMG() //啟動遊戲
|
||||
}
|
||||
|
||||
fun onResume() {
|
||||
iSudFSTAPP?.playMG() //開始遊戲
|
||||
}
|
||||
|
||||
fun onPause() {
|
||||
iSudFSTAPP?.pauseMG() //暫停遊戲
|
||||
}
|
||||
|
||||
fun onStop() {
|
||||
iSudFSTAPP?.stopMG() //停止遊戲
|
||||
}
|
||||
|
||||
fun onDestroy() {
|
||||
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
|
||||
iSudFSTAPP?.destroyMG()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal interface AppLoginListener {
|
||||
/**
|
||||
* App Server 登陸失敗, App Server 不能返回CODE
|
||||
*/
|
||||
fun onLoginFailure(err: String?)
|
||||
|
||||
/**
|
||||
* App Server 登陸成功, App Server調用服務端接入SDK的API獲取Code 返回給 App
|
||||
* App 就要用CODE和自己生成的UserID去調用SDK的初始化函數,登陸小遊戲
|
||||
* 小遊戲登陸成功後,其UserID,就是App傳的UserID
|
||||
*/
|
||||
fun onLoginSuccess(new_code: String, expire_Date: Long)
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
package com.yizhuan.erban.avroom.game
|
||||
|
||||
interface OnGameStatusChangeListener {
|
||||
/**
|
||||
* 游戏开始
|
||||
*/
|
||||
fun onGameStart()
|
||||
|
||||
/**
|
||||
* 游戏结束
|
||||
*/
|
||||
fun onGameEnd()
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
Copyright © Sud.Tech
|
||||
https://sud.tech
|
||||
*/
|
||||
package com.yizhuan.erban.avroom.game;
|
||||
|
||||
/**
|
||||
* Time:2021/10/19
|
||||
* Description: APP to MG 的状态定义
|
||||
*/
|
||||
public class SudMGPAPPState {
|
||||
|
||||
// region 通用状态
|
||||
|
||||
/**
|
||||
* 加入状态
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_IN = "app_common_self_in";
|
||||
|
||||
/**
|
||||
* 准备状态
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_READY = "app_common_self_ready";
|
||||
|
||||
/**
|
||||
* 游戏状态
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_PLAYING = "app_common_self_playing";
|
||||
|
||||
/**
|
||||
* 队长状态
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_CAPTAIN = "app_common_self_captain";
|
||||
|
||||
/**
|
||||
* 踢人
|
||||
* v1.1.30.xx
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_KICK = "app_common_self_kick";
|
||||
|
||||
/**
|
||||
* 结束游戏
|
||||
* v1.1.30.xx
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_END = "app_common_self_end";
|
||||
|
||||
/**
|
||||
* 麦克风状态
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_MICROPHONE = "app_common_self_microphone";
|
||||
|
||||
/**
|
||||
* 文字命中状态
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_TEXT_HIT = "app_common_self_text_hit";
|
||||
|
||||
}
|
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
Copyright © Sud.Tech
|
||||
https://sud.tech
|
||||
*/
|
||||
package com.yizhuan.erban.avroom.game;
|
||||
|
||||
/**
|
||||
* Time:2021/10/19
|
||||
* Description: MG to APP 的状态定义
|
||||
*/
|
||||
public class SudMGPMGState {
|
||||
|
||||
// region 通用状态-游戏
|
||||
|
||||
/**
|
||||
* 公屏消息 (已修改)
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String MG_COMMON_PUBLIC_MESSAGE = "mg_common_public_message";
|
||||
|
||||
/**
|
||||
* 关键词状态
|
||||
*/
|
||||
public static final String MG_COMMON_KEY_WORD_TO_HIT = "mg_common_key_word_to_hit";
|
||||
|
||||
// endregion 通用状态-游戏
|
||||
|
||||
|
||||
// region 通用状态-玩家
|
||||
|
||||
/**
|
||||
* 加入状态 (已修改)
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String MG_COMMON_PLAYER_IN = "mg_common_player_in";
|
||||
|
||||
/**
|
||||
* 准备状态 (已修改)
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String MG_COMMON_PLAYER_READY = "mg_common_player_ready";
|
||||
|
||||
/**
|
||||
* 队长状态 (已修改)
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String MG_COMMON_PLAYER_CAPTAIN = "mg_common_player_captain";
|
||||
|
||||
/**
|
||||
* 游戏状态 (已修改)
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String MG_COMMON_PLAYER_PLAYING = "mg_common_player_playing";
|
||||
|
||||
/**
|
||||
* 游戏状态(已修改)
|
||||
* 最低版本: v1.1.30.xx
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_STATE = "mg_common_game_state";
|
||||
|
||||
// endregion 通用状态-玩家
|
||||
|
||||
|
||||
// region 碰碰我最强
|
||||
// endregion 碰碰我最强
|
||||
|
||||
// region 飞刀达人
|
||||
// endregion 飞刀达人
|
||||
|
||||
// region 你画我猜
|
||||
|
||||
/**
|
||||
* 选词中
|
||||
*/
|
||||
public static final String MG_DG_SELECTING = "mg_dg_selecting";
|
||||
|
||||
/**
|
||||
* 作画中
|
||||
*/
|
||||
public static final String MG_DG_PAINTING = "mg_dg_painting";
|
||||
|
||||
/**
|
||||
* 错误答案
|
||||
*/
|
||||
public static final String MG_DG_ERRORANSWER = "mg_dg_erroranswer";
|
||||
|
||||
/**
|
||||
* 总积分
|
||||
*/
|
||||
public static final String MG_DG_TOTALSCORE = "mg_dg_totalscore";
|
||||
|
||||
/**
|
||||
* 本次积分
|
||||
*/
|
||||
public static final String MG_DG_SCORE = "mg_dg_score";
|
||||
|
||||
// endregion 你画我猜
|
||||
|
||||
|
||||
/**
|
||||
* 加入游戏按钮点击状态
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_CLICK_JOIN_BTN = "mg_common_self_click_join_btn";
|
||||
/**
|
||||
* 取消加入游戏按钮点击状态
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_CLICK_CANCEL_JOIN_BTN = "mg_common_self_click_cancel_join_btn";
|
||||
/**
|
||||
* 准备按钮点击状态
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_CLICK_READY_BTN = "mg_common_self_click_ready_btn";
|
||||
/**
|
||||
* 取消准备按钮点击状态
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_CLICK_CANCEL_READY_BTN = "mg_common_self_click_cancel_ready_btn";
|
||||
/**
|
||||
* 开始游戏按钮点击状态
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_CLICK_START_BTN = "mg_common_self_click_start_btn";
|
||||
/**
|
||||
* 分享按钮点击状态
|
||||
*/
|
||||
public static final String APP_COMMON_SELF_CLICK_SHARE_BTN = "mg_common_self_click_share_btn";
|
||||
|
||||
}
|
@@ -6,7 +6,7 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
import com.yizhuan.xchat_android_core.utils.CoreTextUtils
|
||||
|
||||
class RewardAdapter :
|
||||
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_new_user_charge_reward) {
|
||||
@@ -16,6 +16,6 @@ class RewardAdapter :
|
||||
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, "(${item.showTime})")
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
.setGone(R.id.tv_time, !CoreTextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
}
|
@@ -20,6 +20,9 @@ import com.netease.nimlib.sdk.chatroom.model.EnterChatRoomResultData;
|
||||
import com.netease.nimlib.sdk.util.Entry;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.avroom.core.AudioRoomContext;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean;
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext;
|
||||
import com.yizhuan.erban.avroom.view.IAvRoomView;
|
||||
import com.yizhuan.erban.base.BaseMvpPresenter;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
@@ -118,7 +121,6 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
exitRoom();
|
||||
}
|
||||
AvRoomDataManager.get().updateServiceRoomInfo(roomInfo);
|
||||
initAnotherPKData();
|
||||
mAvRoomModel.enterRoom(roomInfo.getRoomId(), 3, fromType, fromNick, fromUid)
|
||||
.flatMap(this::dealServerMicInfo)
|
||||
.map(this::dealMicMemberFromIMNet)
|
||||
@@ -128,6 +130,8 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
.subscribe(roomQueueInfoSparseArray -> {
|
||||
long uid = AuthModel.get().getCurrentUid();
|
||||
AudioEngineManager.get().startRtcEngine(uid, roomInfo.getAudioSdkType());
|
||||
// TODO 临时方案:后续逐步完善整个房间的RoomContext替换计划
|
||||
new AudioRoomContext(roomInfo.getUid()).run();
|
||||
if (getMvpView() != null) {
|
||||
getMvpView().enterRoomSuccess();
|
||||
}
|
||||
@@ -139,6 +143,7 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
.subscribe((stringServiceResult) -> EventBus.getDefault().post(new AudioPartyOpenEvent()));
|
||||
mAvRoomModel.loadMessageHistory(AvRoomDataManager.get().clearScreenTime);
|
||||
IMNetEaseManager.get().joinAvRoom();
|
||||
initAnotherPKData();
|
||||
}, this::dealEnterRoomError);
|
||||
}
|
||||
|
||||
@@ -147,7 +152,15 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
RoomPKModel.INSTANCE.getRoomPKData(AvRoomDataManager.get().getRoomUid())
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(roomPkBean -> AvRoomDataManager.get().roomPkLiveData.setValue(roomPkBean));
|
||||
.subscribe(roomPkBean -> {
|
||||
AvRoomDataManager.get().roomPkLiveData.setValue(roomPkBean);
|
||||
if (AvRoomDataManager.get().isSingleRoom()){
|
||||
AudioEngineManager.get().setRemoteMute(roomPkBean.getAUid(), roomPkBean.getAMicStatus() == 0);
|
||||
if (AvRoomDataManager.get().isRoomOwner()) {
|
||||
AudioEngineManager.get().connectOtherRoom(String.valueOf(roomPkBean.getARoomId()), roomPkBean.getAUid());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,7 +495,6 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
public void onNext(Long aLong) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
Log.d(TAG, "onNext: roomInfo in startGetOnlineMemberNumberJob: " + roomInfo);
|
||||
Log.d(TAG, "onNext: has login in IM: " + AuthModel.get().isImLogin());
|
||||
Disposable subscribe = mAvRoomModel.startGetOnlineMemberNumberJob(roomInfo.getRoomId())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
@@ -525,20 +525,6 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void loadRoomRank() {
|
||||
String type = AvRoomDataManager.get().isSingleRoom() ? RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING : RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING;
|
||||
RoomContributeListModel.get().getSingleRoomRanking(1, type)
|
||||
.compose(bindToLifecycle())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.subscribe(roomContributeDataInfo -> {
|
||||
if (getMvpView() == null) {
|
||||
return;
|
||||
}
|
||||
getMvpView().updateRoomRanks(roomContributeDataInfo.getRankings());
|
||||
});
|
||||
}
|
||||
|
||||
/***
|
||||
* 發送房間消息
|
||||
* @param message
|
||||
|
@@ -2,15 +2,9 @@ package com.yizhuan.erban.avroom.presenter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyUserListView;
|
||||
import com.yizhuan.erban.base.BaseMvpPresenter;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.room.model.HomePartyUserListModel;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
@@ -26,49 +20,17 @@ public class HomePartyUserListPresenter extends BaseMvpPresenter<IHomePartyUserL
|
||||
mHomePartyUserListMode = new HomePartyUserListModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取房间成员:第一页包含队列成员,固定成员,游客50人,之后每一页获取游客50人
|
||||
*
|
||||
* @param page 页数
|
||||
* @param time 固定成员列表用updateTime,
|
||||
* 游客列表用进入enterTime,
|
||||
* 填0会使用当前服务器最新时间开始查询,即第一页,单位毫秒
|
||||
*/
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void requestChatMemberByPage(final int page, long time, List<OnlineChatMember> oldList) {
|
||||
mHomePartyUserListMode.getOnLinePageMembers(page, time, oldList)
|
||||
.subscribe(onlineChatMembers -> {
|
||||
Logger.i(ResUtil.getString(R.string.avroom_presenter_homepartyuserlistpresenter_01), page, onlineChatMembers.size());
|
||||
if (getMvpView() != null) {
|
||||
getMvpView().onRequestChatMemberByPageSuccess(onlineChatMembers, page);
|
||||
}
|
||||
}, throwable -> {
|
||||
throwable.printStackTrace();
|
||||
Logger.i(ResUtil.getString(R.string.avroom_presenter_homepartyuserlistpresenter_02), page, throwable.getMessage());
|
||||
if (getMvpView() != null) {
|
||||
getMvpView().onRequestChatMemberByPageFail(throwable.getMessage(), page);
|
||||
}
|
||||
});
|
||||
public void requestRoomOnlineList(long roomUid){
|
||||
mHomePartyUserListMode.getRoomOnlineList(roomUid).compose(bindToLifecycle()).subscribe((data, throwable) -> {
|
||||
if (getMvpView() != null) {
|
||||
if (data != null) {
|
||||
getMvpView().onRequestRoomOnlineListSuccess(data);
|
||||
} else {
|
||||
getMvpView().onRequestChatMemberByPageFail(throwable.getMessage(), 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onMemberDownUpMic(String account, boolean isUpMic, List<OnlineChatMember> dataList,
|
||||
final int page) {
|
||||
mHomePartyUserListMode.onMemberDownUpMic(account, isUpMic, dataList)
|
||||
.subscribe(onlineChatMembers -> {
|
||||
if (getMvpView() != null)
|
||||
getMvpView().onRequestChatMemberByPageSuccess(onlineChatMembers, page);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void onUpdateMemberManager(String account, List<OnlineChatMember> dataList,
|
||||
boolean isRemoveManager, final int page) {
|
||||
mHomePartyUserListMode.onUpdateMemberManager(account, isRemoveManager, dataList)
|
||||
.subscribe(onlineChatMembers -> {
|
||||
if (getMvpView() != null)
|
||||
getMvpView().onRequestChatMemberByPageSuccess(onlineChatMembers, page);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -70,10 +70,20 @@ public class RoomManagerPresenter extends BaseMvpPresenter<IRoomManagerView> {
|
||||
Iterator<ChatRoomMember> iterator = paramList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ChatRoomMember member = iterator.next();
|
||||
if (member != null
|
||||
&& !TextUtils.isEmpty(member.getAccount())
|
||||
&& map.containsKey(member.getAccount())) {
|
||||
iterator.remove();
|
||||
if (member != null && !TextUtils.isEmpty(member.getAccount())) {
|
||||
if (map.containsKey(member.getAccount())) {
|
||||
iterator.remove();
|
||||
} else {
|
||||
if (member.getNick() == null || member.getAvatar() == null) {
|
||||
for (UserInfo info : userInfos) {
|
||||
if (String.valueOf(info.getUid()).equals(member.getAccount())) {
|
||||
member.setNick(info.getNick());
|
||||
member.setAvatar(info.getAvatar());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return paramList;
|
||||
|
@@ -0,0 +1,94 @@
|
||||
package com.yizhuan.erban.avroom.rank
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.chuhai.utils.ktx.singleClick
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.RoomRankWidgetBinding
|
||||
import com.yizhuan.erban.ui.utils.loadAvatar
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.xchat_android_core.support.room.FrameLayoutRoomWidget
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomWidget
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeDataInfo
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeUserInfo
|
||||
import com.yizhuan.xchat_android_core.room.model.RoomContributeListModel
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||
|
||||
/**
|
||||
* 房间榜单入口
|
||||
*/
|
||||
class RoomRankWidget : FrameLayoutRoomWidget, RoomWidget {
|
||||
|
||||
private val binding: RoomRankWidgetBinding =
|
||||
DataBindingUtil.inflate(
|
||||
LayoutInflater.from(
|
||||
context
|
||||
), R.layout.room_rank_widget, this, true
|
||||
)
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
init {
|
||||
this.singleClick {
|
||||
DialogWebViewActivity.start(context, UriProvider.getRoomRanking())
|
||||
refreshData()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onInitialize(roomView: RoomView, roomContext: RoomContext) {
|
||||
super.onInitialize(roomView, roomContext)
|
||||
refreshData()
|
||||
}
|
||||
|
||||
override fun onUnbindContext() {
|
||||
super.onUnbindContext()
|
||||
updateView(null)
|
||||
}
|
||||
|
||||
private fun refreshData() {
|
||||
val disposable = RoomContributeListModel.get()
|
||||
.getSingleRoomRanking(1, RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.subscribe { roomContributeDataInfo: RoomContributeDataInfo ->
|
||||
updateView(roomContributeDataInfo.rankings)
|
||||
}
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
private fun updateView(list: List<RoomContributeUserInfo>?) {
|
||||
arrayListOf(
|
||||
binding.ivRank0, binding.ivRank1, binding.ivRank2
|
||||
).forEachIndexed { index, imageView ->
|
||||
val url = list?.getOrNull(index)?.avatar
|
||||
if (url.isNullOrEmpty()) {
|
||||
imageView.isVisible = false
|
||||
} else {
|
||||
imageView.loadAvatar(url)
|
||||
imageView.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setContentBackgroundResource(resId: Int) {
|
||||
binding.layoutRoot.setBackgroundResource(resId)
|
||||
}
|
||||
}
|
@@ -60,7 +60,7 @@ public class MyRecommendCardActivity extends BaseViewBindingActivity<ActivityMyR
|
||||
@Override
|
||||
public void performAction(View view) {
|
||||
CommonWebViewActivity.start(context, UriProvider.JAVA_WEB_URL +
|
||||
"/peko/modules/recommend-card/help.html");
|
||||
"/repo/modules/recommend-card/help.html");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,20 +0,0 @@
|
||||
package com.yizhuan.erban.avroom.redpackage
|
||||
|
||||
import android.widget.TextView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedEnvelopeGiftItemVO
|
||||
|
||||
class RedPackageGiftAdapter(layoutId: Int = R.layout.item_red_package_gift) :
|
||||
BaseQuickAdapter<RedEnvelopeGiftItemVO, BaseViewHolder>(layoutId) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: RedEnvelopeGiftItemVO) {
|
||||
ImageLoadUtils.loadAvatar(mContext, item.giftVo?.giftUrl, helper.getView(R.id.iv_gift))
|
||||
helper.setText(R.id.tv_gift_num, "x${item.giftNum}")
|
||||
helper.getView<TextView>(R.id.tv_gift_name)?.let {
|
||||
it.text = item.giftVo?.giftName
|
||||
}
|
||||
}
|
||||
}
|
@@ -10,8 +10,8 @@ import com.yizhuan.erban.common.widget.dialog.DialogManager
|
||||
import com.yizhuan.erban.databinding.DialogRedPackageGoRoomBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
@@ -42,15 +42,15 @@ class RedPackageGoRoomDialog : BaseDialog<DialogRedPackageGoRoomBinding>() {
|
||||
|
||||
override fun init() {
|
||||
AnimationUtils.loadAnimation(context, R.anim.anim_all_red_package).apply {
|
||||
binding.clRed.animation = this
|
||||
binding?.clRed?.animation = this
|
||||
start()
|
||||
}
|
||||
AnimationUtils.loadAnimation(context, R.anim.anim_all_red_package_in_btn).let {
|
||||
binding.ivGoRoom.animation = it
|
||||
binding?.ivGoRoom?.animation = it
|
||||
it.start()
|
||||
}
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
binding.ivGoRoom.setOnClickListener {
|
||||
binding?.ivClose?.setOnClickListener { dismissAllowingStateLoss() }
|
||||
binding?.ivGoRoom?.setOnClickListener {
|
||||
val jump = {
|
||||
AVRoomActivity.start(context, redPackageNotifyInfo.roomUid,
|
||||
AVRoomActivity.FROM_TYPE_ALL_RED, redPackageNotifyInfo.sendUserNick, redPackageNotifyInfo)
|
||||
@@ -69,10 +69,10 @@ class RedPackageGoRoomDialog : BaseDialog<DialogRedPackageGoRoomBinding>() {
|
||||
|
||||
}
|
||||
redPackageNotifyInfo.let {
|
||||
ImageLoadUtils.loadAvatar(context, it.sendUserAvatar, binding.ivAvatar)
|
||||
binding.tvContent.text = it.redEnvelopeMessage
|
||||
binding.tvNickname.text = it.sendUserNick.subAndReplaceDot()
|
||||
binding.tvRoomName.text = it.roomTitle.subAndReplaceDot()
|
||||
ImageLoadUtils.loadAvatar(context, it.sendUserAvatar, binding?.ivAvatar)
|
||||
binding?.tvContent?.text = it.redEnvelopeMessage
|
||||
binding?.tvNickname?.text = it.sendUserNick.subAndReplaceDot()
|
||||
binding?.tvRoomName?.text = it.roomTitle.subAndReplaceDot()
|
||||
}
|
||||
// StatUtil.onEvent("gethongbao", ResUtil.getString(R.string.avroom_redpackage_redpackagegoroomdialog_03))
|
||||
}
|
||||
|