Compare commits
299 Commits
master
...
peko_relea
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 |
@@ -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()
|
||||
|
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="crop__saving">…جارٍ حفظ الصورة</string>
|
||||
<string name="crop__wait">…انتظر من فضلك</string>
|
||||
<string name="crop__pick_error">لا يوجد مصدر صورة متاح</string>
|
||||
<string name="crop__done">ينهي</string>
|
||||
<string name="crop__cancel">يلغي</string>
|
||||
|
||||
</resources>
|
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="crop__saving">Saving photo…</string>
|
||||
<string name="crop__wait">Please wait…</string>
|
||||
<string name="crop__pick_error">No image source available</string>
|
||||
<string name="crop__done">Finish</string>
|
||||
<string name="crop__cancel">Cancel</string>
|
||||
|
||||
</resources>
|
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="crop__saving">Menyimpan foto…</string>
|
||||
<string name="crop__wait">Harap tunggu…</string>
|
||||
<string name="crop__pick_error">Tidak ada sumber gambar yang tersedia</string>
|
||||
<string name="crop__done">Menyelesaikan</string>
|
||||
<string name="crop__cancel">Membatalkan</string>
|
||||
|
||||
</resources>
|
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="crop__saving">Fotoğraf kaydediliyor…</string>
|
||||
<string name="crop__wait">Lütfen bekleyin…</string>
|
||||
<string name="crop__pick_error">Görüntü kaynağı yok</string>
|
||||
<string name="crop__done">Sona ermek</string>
|
||||
<string name="crop__cancel">İptal etmek</string>
|
||||
|
||||
</resources>
|
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<string name="crop__saving">正在儲存相片…</string>
|
||||
<string name="crop__wait">請稍候…</string>
|
||||
<string name="crop__pick_error">沒有可用的圖片來源</string>
|
||||
<string name="crop__done">完成</string>
|
||||
<string name="crop__cancel" tools:ignore="ButtonCase">取消</string>
|
||||
|
||||
</resources>
|
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<string name="crop__saving">正在儲存相片…</string>
|
||||
<string name="crop__wait">請稍候…</string>
|
||||
<string name="crop__pick_error">沒有可用的圖片來源</string>
|
||||
<string name="crop__done">完成</string>
|
||||
<string name="crop__cancel" tools:ignore="ButtonCase">取消</string>
|
||||
|
||||
</resources>
|
@@ -1,9 +1,10 @@
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<string name="crop__saving">Saving photo…</string>
|
||||
<string name="crop__wait">Please wait…</string>
|
||||
<string name="crop__pick_error">No image source available</string>
|
||||
<string name="crop__done">Finish</string>
|
||||
<string name="crop__cancel">Cancel</string>
|
||||
<string name="crop__saving">正在儲存相片…</string>
|
||||
<string name="crop__wait">請稍候…</string>
|
||||
<string name="crop__pick_error">沒有可用的圖片來源</string>
|
||||
|
||||
<string name="crop__done">完成</string>
|
||||
<string name="crop__cancel" tools:ignore="ButtonCase">取消</string>
|
||||
|
||||
</resources>
|
||||
|
@@ -24,7 +24,7 @@
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:paddingEnd">20dp</item> <!-- Offsets left drawable -->
|
||||
<item name="android:paddingRight">20dp</item> <!-- Offsets left drawable -->
|
||||
<item name="android:drawablePadding">8dp</item>
|
||||
<item name="android:textColor">@color/crop__button_text</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
|
@@ -2,7 +2,6 @@ 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'
|
||||
|
||||
@@ -21,20 +20,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 +47,29 @@ android {
|
||||
}
|
||||
|
||||
//在apk文件后边生成版本号信息
|
||||
android.applicationVariants.all {
|
||||
variant ->
|
||||
variant.outputs.all {
|
||||
android.applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach { output ->
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
outputFileName = "peko_${buildType.name}_v${defaultConfig.versionName}-${date}.apk"
|
||||
|
||||
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 = "piko_${buildType.name}_v${defaultConfig.versionName}_${abi}_${date}.apk"
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
lint {
|
||||
abortOnError false
|
||||
disable 'MissingTranslation'
|
||||
disable 'ExtraTranslation'
|
||||
disable 'MissingTranslation', 'ExtraTranslation', 'ContentDescription', 'SmallSp'
|
||||
}
|
||||
|
||||
|
||||
dataBinding {
|
||||
enabled = true
|
||||
}
|
||||
@@ -139,19 +147,23 @@ android {
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
def server_url_debug = '"http://beta.api.pekolive.com/"'
|
||||
def server_url_release = '"https://api.pekolive.com/"'
|
||||
|
||||
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 +181,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 +215,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 +275,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 +302,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.9.0'
|
||||
}
|
||||
|
||||
channel {
|
||||
@@ -294,7 +311,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 = 'piko-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
|
||||
//快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
|
||||
fastMode = false
|
||||
//buildTime的时间格式,默认格式:yyyyMMdd-HHmmss
|
||||
|
16
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.**
|
||||
@@ -233,6 +235,8 @@
|
||||
-keep class org.json.** {*;}
|
||||
-dontwarn com.yizhuan.xchat_android_core.**
|
||||
-keep class com.yizhuan.xchat_android_core.** {*;}
|
||||
-keep class com.yizhuan.treasure_box.bean.** {*;}
|
||||
-keep class com.yizhuan.erban.avroom.bean.** {*;}
|
||||
|
||||
|
||||
#百度统计
|
||||
|
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 556 B |
Before Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 361 B |
Before Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 648 B |
Before Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 767 B |
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 692 B |
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 709 B |
Before Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 470 B |
Before Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 709 B |
Before Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 470 B |
@@ -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 替换为自己的包名 -->
|
||||
@@ -69,8 +76,12 @@
|
||||
<uses-permission android:name="com.meizu.flyme.push.permission.RECEIVE" /> <!-- 兼容flyme3.0配置权限 -->
|
||||
<uses-permission android:name="${applicationId}.push.permission.MESSAGE" />
|
||||
<uses-permission android:name="com.meizu.c2dm.permission.RECEIVE" />
|
||||
<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="${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"
|
||||
@@ -84,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"
|
||||
@@ -110,7 +122,7 @@
|
||||
|
||||
<data
|
||||
android:host="main"
|
||||
android:scheme="pekoapp" />
|
||||
android:scheme="pikoapp" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -210,7 +222,7 @@
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:label="Peko"
|
||||
android:label="Piko"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> <!-- 配置的service和receiver -->
|
||||
@@ -242,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"
|
||||
@@ -286,6 +302,10 @@
|
||||
android:name=".home.activity.CollectionRoomActivity"
|
||||
android:label="@string/main_androidmanifest_019"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.wallet.ExchangeGoldActivity"
|
||||
android:label="@string/main_androidmanifest_020"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.setting.SettingActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -295,6 +315,9 @@
|
||||
<activity
|
||||
android:name=".ui.relation.FansListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.withdraw.WithdrawActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.withdraw.bankcard.BindWithdrawBankCardActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -310,6 +333,18 @@
|
||||
<activity
|
||||
android:name=".ui.user.activity.ShowPhotoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bills.activities.TotalBillsActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bills.activities.WithdrawBillsActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bills.activities.ChargeBillsActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bills.activities.ChatBillsActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.setting.FeedbackActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -323,6 +358,21 @@
|
||||
<activity
|
||||
android:name=".ui.webview.SimpleWebViewActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bills.activities.RedBagBillsActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bills.activities.BillGiftExpendActivity"
|
||||
android:label="@string/main_androidmanifest_021"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bills.activities.BillGiftInComeActivity"
|
||||
android:label="@string/main_androidmanifest_022"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bills.activities.BillNobleActivity"
|
||||
android:label="@string/bill_noble_open"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".avroom.activity.RoomInviteActivity"
|
||||
android:label="@string/main_androidmanifest_023"
|
||||
@@ -365,6 +415,42 @@
|
||||
android:name=".friend.view.SelectFriendActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyPlazaActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyHomeActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilySearchActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyListActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyManageActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyCurrencyActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyMemberListActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyInfoActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyMemberSearchActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".team.view.NimTeamMessageActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@@ -409,6 +495,10 @@
|
||||
android:name=".luckymoney.view.LuckyMoneyDetailActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" /> <!-- android:launchMode="singleTask" -->
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyMemberCurrencyActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".ErbanTakePhotoActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@@ -417,6 +507,18 @@
|
||||
android:name=".team.view.UpdateTeamNameActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilySelectFriendActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyTextInputActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".family.view.activity.FamilyGameListActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".treasure_box.activity.TreasureBoxActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
@@ -452,6 +554,9 @@
|
||||
android:name=".ui.user.decorationsend.DecorationSendActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".avroom.activity.RoomRankListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".avroom.activity.RoomOnlineUserActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -575,6 +680,18 @@
|
||||
android:name="com.yizhuan.tutu.room_chat.activity.NimHallTeamRoomMessageActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/room_message_activity" />
|
||||
<activity
|
||||
android:name=".bills.activities.BillGiftIncomeGroupActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".radish.activity.RadishRecordActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".radish.signin.SignInActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".radish.task.activity.TaskCenterActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.patriarch.PatriarchModeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -632,9 +749,18 @@
|
||||
android:name=".miniworld.activity.MiniWorldMainActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".ui.im.friend.ActFriendList" />
|
||||
<activity
|
||||
android:name=".bank_card.activity.BankCardListActivity"
|
||||
android:screenOrientation="portrait" /> <!-- 萝卜-签到-任务 -->
|
||||
<activity
|
||||
android:name=".bank_card.activity.BankCardListUnbindActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bank_card.activity.BankCardBindActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".bank_card.activity.AddBankCardAgreementActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.tongdaxing.erban.sadmin.RoomSAdminManagerActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -665,6 +791,10 @@
|
||||
<activity
|
||||
android:name="com.zhihu.matisse.internal.ui.SelectedPreviewActivity"
|
||||
android:screenOrientation="portrait" /> <!-- 房间内私聊 -->
|
||||
<activity
|
||||
android:name=".ui.wallet.sendgold.SendGoldActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".pay.activity.GiveGoldActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@@ -699,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" />
|
||||
@@ -854,19 +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" />
|
||||
<activity
|
||||
android:name=".ui.setting.AreaSelectActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
android:theme="@style/transparent_activity" />
|
||||
|
||||
<meta-data
|
||||
android:name="notch.config"
|
||||
@@ -890,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"
|
||||
@@ -932,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/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
@@ -49,7 +49,7 @@ import com.yizhuan.erban.common.widget.DragLayout;
|
||||
import com.yizhuan.erban.community.dynamic.view.DynamicDetailActivity;
|
||||
import com.yizhuan.erban.community.publish.view.PublishActivity;
|
||||
import com.yizhuan.erban.community.square.SquareFragment;
|
||||
import com.yizhuan.erban.event.AreaChangeEvent;
|
||||
import com.yizhuan.erban.family.view.activity.FamilyHomeActivity;
|
||||
import com.yizhuan.erban.home.HomeViewModel;
|
||||
import com.yizhuan.erban.home.dialog.NewUserHelloDialog;
|
||||
import com.yizhuan.erban.home.dialog.ProtocolUpdateDialog;
|
||||
@@ -89,7 +89,6 @@ import com.yizhuan.xchat_android_core.auth.event.LogoutEvent;
|
||||
import com.yizhuan.xchat_android_core.channel_page.model.ChannelPageModel;
|
||||
import com.yizhuan.xchat_android_core.community.event.SquareTaskEvent;
|
||||
import com.yizhuan.xchat_android_core.community.event.UnReadCountEvent;
|
||||
import com.yizhuan.xchat_android_core.home.bean.MainTabInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.MainTabType;
|
||||
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent;
|
||||
import com.yizhuan.xchat_android_core.home.event.VisitorUnreadCountEvent;
|
||||
@@ -191,21 +190,6 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 让页面重新执行生命周期
|
||||
* @param context
|
||||
* @param extras
|
||||
*/
|
||||
public static void startNewTask(Context context, Intent extras) {
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(context, MainActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (extras != null) {
|
||||
intent.putExtras(extras);
|
||||
}
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true 如果处理了跳转
|
||||
*/
|
||||
@@ -220,6 +204,8 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
// 跳转
|
||||
if (!StringUtil.isEmpty(linkedInfo.getRoomUid()) && linkedInfo.getType().equals("2")) {
|
||||
AVRoomActivity.start(context, Long.parseLong(linkedInfo.getRoomUid()));
|
||||
} else if (!StringUtil.isEmpty(linkedInfo.getFamilyId()) && linkedInfo.getType().equals("4")) {
|
||||
FamilyHomeActivity.start(context, linkedInfo.getFamilyId());
|
||||
} else if (!TextUtils.isEmpty(linkedInfo.getUrl()) && linkedInfo.getType().equals("3")) {
|
||||
CommonWebViewActivity.start(context, UriProvider.getLinkUrl(linkedInfo.getUrl()));
|
||||
} else if (!TextUtils.isEmpty(linkedInfo.getWorldId()) && linkedInfo.getType().equals("5")) {
|
||||
@@ -228,6 +214,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;
|
||||
}
|
||||
@@ -261,15 +249,11 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
.doOnError(throwable -> onNeedLogin())
|
||||
.subscribe();
|
||||
initView();
|
||||
// InitialModel.get().getMainTabInfosLiveData().observeForever(mainTabInfo -> {
|
||||
// if (mainTabInfo != null) {
|
||||
// mMainTabLayout.setMainTabInfoList(mainTabInfo);
|
||||
// }
|
||||
// });
|
||||
List<MainTabInfo> tabInfoList = InitialModel.get().getDefaultMainTab();
|
||||
if (tabInfoList != null) {
|
||||
mMainTabLayout.setMainTabInfoList(tabInfoList);
|
||||
InitialModel.get().getMainTabInfosLiveData().observeForever(mainTabInfo -> {
|
||||
if (mainTabInfo != null) {
|
||||
mMainTabLayout.setMainTabInfoList(mainTabInfo);
|
||||
}
|
||||
});
|
||||
//检测更新
|
||||
AppUpgradeHelper.checkAppUpgrade(this);
|
||||
initMaterialView();
|
||||
@@ -426,6 +410,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
}
|
||||
onParseIntent();
|
||||
handleNimIntent();
|
||||
InitialModel.get().regionCheck();
|
||||
}
|
||||
|
||||
private void onParseIntent() {
|
||||
@@ -535,6 +520,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLoadLoginUserInfoEvent(LoadLoginUserInfoEvent event) {
|
||||
firstLoadedUserInfo();
|
||||
InitialModel.get().regionCheck();
|
||||
}
|
||||
|
||||
public void onLogout() {
|
||||
@@ -597,12 +583,6 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onAreaChangeEvent(AreaChangeEvent event) {
|
||||
toast(getString(R.string.succeeded_in_switching_the_partition));
|
||||
startNewTask(this, null);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onNeedCompleteInfo(NeedCompleteInfoEvent event) {
|
||||
getDialogManager().dismissDialog();
|
||||
|
@@ -12,14 +12,17 @@ import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
|
||||
import com.netease.nimlib.sdk.msg.model.IMMessage;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.radish.signin.SignInActivity;
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.erban.utils.PushMessageHandler;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.OpenRoomNotiAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.OpenSignInAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RedPackageAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomInviteFansAttachment;
|
||||
import com.yizhuan.xchat_android_library.utils.UIUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
@@ -103,6 +106,11 @@ public class NimMiddleActivity extends BaseActivity {
|
||||
if (noticeAttachment.getUid() > 0) {
|
||||
AVRoomActivity.start(this, noticeAttachment.getUid());
|
||||
}
|
||||
} else if (attachment instanceof OpenSignInAttachment) {
|
||||
if (AuthModel.get().isImLogin()
|
||||
&& !UIUtils.isTopActivity(this, SignInActivity.class.getSimpleName())) {
|
||||
SignInActivity.start(this);
|
||||
}
|
||||
} else if (attachment.getFirst() == CustomAttachment.CUSTOM_MSG_RED_PACKAGE) {
|
||||
if (attachment.getSecond() == CustomAttachment.CUSTOM_MSG_SUB_RED_PACKAGE_RECEIVE_ALL_DIAMOND) {
|
||||
RedPackageAttachment redPackageAttachment = (RedPackageAttachment) attachment;
|
||||
|
@@ -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;
|
||||
|
@@ -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,7 @@ 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;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
@@ -64,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;
|
||||
@@ -112,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) {
|
||||
@@ -161,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;
|
||||
//生命周期监听
|
||||
@@ -195,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);
|
||||
@@ -237,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;
|
||||
@@ -247,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);
|
||||
|
||||
//生命周期监听
|
||||
@@ -395,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 初始化
|
||||
@@ -412,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);
|
||||
@@ -441,6 +464,8 @@ public class XChatApplication extends BaseApp {
|
||||
DynamicFaceModel.get().init();
|
||||
PayModel.get();
|
||||
UserModel.get();
|
||||
//ui层的萝卜钱包
|
||||
RadishWalletManager.get();
|
||||
//model层的
|
||||
RadishModel.get();
|
||||
|
||||
@@ -500,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();
|
||||
}
|
||||
initContext(this);
|
||||
//首次启动事件
|
||||
HashMap<String, Object> map = new HashMap<>(2);
|
||||
@@ -539,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()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@ import com.yizhuan.erban.base.TitleBar;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.databinding.ActivityVoiceMatchBinding;
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.yizhuan.erban.ui.widget.higuide.TuTuGuideHelper;
|
||||
import com.yizhuan.xchat_android_core.audio.AudioModel;
|
||||
import com.yizhuan.xchat_android_core.audio.bean.HistoryVoiceInfo;
|
||||
import com.yizhuan.xchat_android_core.audio.bean.VoiceMatchInfo;
|
||||
@@ -37,8 +38,10 @@ import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.music.model.PlayerModel;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.ActivityUtil;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
@@ -157,6 +160,23 @@ public class VoiceMatchActivity extends BaseViewBindingActivity<ActivityVoiceMat
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示引导图的时机
|
||||
* 1. 首次进入页面(isNeedHiGuide)
|
||||
* 2. 请求数据且数据不为空时
|
||||
*/
|
||||
private void showGuide() {
|
||||
/*引导图*/
|
||||
binding.svgaGroupVoiceLike.postDelayed(() -> {
|
||||
if (!ActivityUtil.isValidContext(context)) {
|
||||
return;
|
||||
}
|
||||
TuTuGuideHelper guideHelper = new TuTuGuideHelper(context);
|
||||
guideHelper.createHiGuide(() -> guideHelper.createVoiceMatchGuide(binding.svgaGroupVoiceLike, binding.layoutMyVoiceEntrance));
|
||||
TuTuGuideHelper.setNoNeedHiGuide(TuTuGuideHelper.KEY_GUIDE_VOICE_MATCH);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
private void queryHistoryVoice() {
|
||||
AudioModel.get().queryHistoryVoice(AuthModel.get().getCurrentUid())
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
@@ -357,6 +377,10 @@ public class VoiceMatchActivity extends BaseViewBindingActivity<ActivityVoiceMat
|
||||
if (isFinishing() || isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
if (TuTuGuideHelper.isNeedHiGuide(TuTuGuideHelper.KEY_GUIDE_VOICE_MATCH)
|
||||
&& !ListUtils.isListEmpty(voiceMatchInfos)) {
|
||||
showGuide();// 首次进入页面(isNeedHiGuide)且 请求成功数据不为空时,显示引导图
|
||||
}
|
||||
if (voiceMatchInfos != null) {
|
||||
if (voiceMatchInfos.size() == 0) {
|
||||
binding.groupVoiceLayout.setVisibility(View.INVISIBLE);
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
@@ -161,7 +161,7 @@ public class ButtonItemFactory {
|
||||
|
||||
//关注
|
||||
buttonItems.add(createAttentItem());
|
||||
//@Ta
|
||||
//关注
|
||||
buttonItems.add(createAtItem());
|
||||
|
||||
final RoomInfo currentRoom = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
|
@@ -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;
|
||||
@@ -49,6 +58,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.dialog.NewUserGiftDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.SingleRoomTipDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.avroom.fragment.FakeSingleRoomBackFragment;
|
||||
@@ -57,7 +67,7 @@ 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;
|
||||
@@ -73,10 +83,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;
|
||||
@@ -87,10 +94,21 @@ import com.yizhuan.xchat_android_core.auth.event.LogoutEvent;
|
||||
import com.yizhuan.xchat_android_core.bean.BaseProtocol;
|
||||
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;
|
||||
@@ -109,7 +127,6 @@ 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.room.anotherroompk.ShowGiftDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
@@ -121,6 +138,9 @@ 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.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;
|
||||
@@ -128,7 +148,6 @@ import com.yizhuan.xchat_android_core.utils.LogUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||
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;
|
||||
@@ -140,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;
|
||||
@@ -159,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;
|
||||
@@ -197,7 +214,6 @@ 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;
|
||||
/*********************************显示全服礼物***************************************/
|
||||
@@ -205,9 +221,13 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
private GiftBroadcastObserver giftObserver;
|
||||
private Dialog giftDialog;
|
||||
private LinkedList<AllServiceGiftProtocol.DataBean> giftList;
|
||||
private boolean isResume = true;
|
||||
@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);
|
||||
@@ -380,7 +400,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);
|
||||
}
|
||||
}
|
||||
@@ -392,6 +412,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 {
|
||||
@@ -423,7 +449,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) {
|
||||
@@ -450,11 +476,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();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -490,8 +516,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) {
|
||||
@@ -595,9 +619,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:
|
||||
}
|
||||
}
|
||||
@@ -646,7 +667,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
*/
|
||||
private void showRoomFragment(boolean isRoomMin) {
|
||||
mCurrentFragment = (HomePartyFragment) mAdapter.getItem(1);
|
||||
viewpager.setUserInputEnabled(AvRoomDataManager.get().isSingleRoom());
|
||||
tryEnabledViewPagerInput();
|
||||
viewpager.setCurrentItem(1, false);
|
||||
if (isRoomMin) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
@@ -659,6 +680,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) {
|
||||
@@ -695,42 +727,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);
|
||||
/**
|
||||
* 尝试展示来源红包(在房间外点击红包入口进入房间时)
|
||||
*/
|
||||
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);
|
||||
}
|
||||
})
|
||||
.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();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void dismissRedPackageDialog() {
|
||||
if (openDialogs != null) {
|
||||
openDialogs.clear();
|
||||
}
|
||||
if (mCurrentFragment != null) {
|
||||
mCurrentFragment.dismissSendRedPackageDialog();
|
||||
}
|
||||
@@ -1044,6 +1058,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
//获取管理员
|
||||
getMvpPresenter().getNormalChatMember();
|
||||
getMvpPresenter().getSuperAdminList();
|
||||
getMvpPresenter().checkNewUserGift();
|
||||
if (UserUtils.getUserInfo().isFirstCharge()) {
|
||||
getMvpPresenter().checkFirstCharge();
|
||||
}
|
||||
@@ -1054,7 +1069,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
DemoCache.readNewUserChargeGift() == 0) {
|
||||
DemoCache.saveNewUserChargeGift(1);
|
||||
}
|
||||
showRedPackage(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
|
||||
@@ -1174,10 +1188,9 @@ 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<>();
|
||||
}
|
||||
@@ -1200,8 +1213,72 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_GIFT:
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY) {
|
||||
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 {
|
||||
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 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);
|
||||
@@ -1209,6 +1286,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);
|
||||
@@ -1224,7 +1309,9 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
|
||||
private void showGiftDialog() {
|
||||
if (giftList.size() == 0) return;
|
||||
giftDialog = generateAllServiceGiftDialog(this, giftList.peekFirst());
|
||||
AllServiceGiftProtocol.DataBean data = giftList.peekFirst();
|
||||
if (data == null) return;
|
||||
giftDialog = generateAllServiceGiftDialog(this, data);
|
||||
giftDialog.setOnDismissListener(dialog -> {
|
||||
giftList.pollFirst();
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
@@ -1239,30 +1326,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 AllServiceGiftProtocol.DataBean 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();
|
||||
@@ -1281,6 +1354,11 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
this::handlePmExitRoom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showNewUserDialog(GiftInfo giftInfo) {
|
||||
new NewUserGiftDialog(giftInfo).show(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showFirstChargeDialog(FirstChargeInfo firstChargeInfo) {
|
||||
Single.timer(firstChargeInfo.getShowAfterSecond() * 1000L, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread())
|
||||
@@ -1303,6 +1381,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;
|
||||
|
||||
@@ -1336,4 +1432,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,95 @@
|
||||
package com.yizhuan.erban.avroom.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.fragment.RoomCharmListFragment;
|
||||
import com.yizhuan.erban.avroom.fragment.RoomContributeListFragment;
|
||||
import com.yizhuan.erban.base.BaseBindingActivity;
|
||||
import com.yizhuan.erban.databinding.ActivityRoomRankListBinding;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 房间排行榜,(魅力榜+贡献榜)
|
||||
*/
|
||||
@ActLayoutRes(R.layout.activity_room_rank_list)
|
||||
public class RoomRankListActivity extends BaseBindingActivity<ActivityRoomRankListBinding> {
|
||||
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent intent = new Intent(context, RoomRankListActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
private String [] bgPicture = new String[]{""};
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
mBinding.setClick(this);
|
||||
List<Fragment> list = new ArrayList<>();
|
||||
list.add(RoomCharmListFragment.newInstance());
|
||||
list.add(new RoomContributeListFragment());
|
||||
mBinding.viewPager.setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) {
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return list.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list.size();
|
||||
}
|
||||
});
|
||||
mBinding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
mBinding.setPosition(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
AVRoomActivity.setBackBg(this, AvRoomDataManager.get().mCurrentRoomInfo, mBinding.svgaImageViewBg, bgPicture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
super.onClick(v);
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_back:
|
||||
finish();
|
||||
break;
|
||||
case R.id.tv_charm_tab:
|
||||
mBinding.viewPager.setCurrentItem(0);
|
||||
break;
|
||||
case R.id.tv_contribute_tab:
|
||||
mBinding.viewPager.setCurrentItem(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mBinding.svgaImageViewBg.isAnimating()) {
|
||||
mBinding.svgaImageViewBg.clearAnimation();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package com.yizhuan.erban.avroom.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.xchat_android_library.list.BaseGroupItem;
|
||||
import com.yizhuan.xchat_android_library.list.ViewHolder;
|
||||
|
||||
/**
|
||||
* Created by chenran on 2017/8/9.
|
||||
*/
|
||||
|
||||
public class AuctionListHeaderItem extends BaseGroupItem{
|
||||
public AuctionListHeaderItem(Context context, int viewType) {
|
||||
super(context, viewType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder createViewHolder(ViewGroup group) {
|
||||
View view = LayoutInflater.from(getContext()).inflate(R.layout.list_item_auction_header, null);
|
||||
AuctionListHeaderItem.AuctionListHeaderHolder holder = new AuctionListHeaderItem.AuctionListHeaderHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHolder(ViewHolder holder, int groupPos, int childPos) {
|
||||
AuctionListHeaderItem.AuctionListHeaderHolder auctionListHolder = (AuctionListHeaderItem.AuctionListHeaderHolder) holder;
|
||||
if (auctionListHolder != null) {
|
||||
if (getViewType() == AuctionListAdapter.VIEW_TYPE_WEEK_HEADER) {
|
||||
auctionListHolder.image.setImageResource(R.drawable.icon_week_auction_list);
|
||||
} else {
|
||||
auctionListHolder.image.setImageResource(R.drawable.icon_total_auction_list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class AuctionListHeaderHolder extends ViewHolder {
|
||||
private ImageView image;
|
||||
public AuctionListHeaderHolder(View itemView) {
|
||||
super(itemView);
|
||||
image = (ImageView) itemView.findViewById(R.id.auction_list_header);
|
||||
}
|
||||
}
|
||||
}
|
@@ -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) {
|
||||
|
@@ -100,17 +100,13 @@ class DatingMicroViewAdapter(context: Context?) : BaseMicroViewAdapter(context)
|
||||
) {
|
||||
tvSelectedStatus.text =
|
||||
if (AvRoomDataManager.get().isDatingVipMic(it.selectMicPosition)
|
||||
) ResUtil.getString(R.string.avroom_adapter_datingmicroviewadapter_01) else "${
|
||||
context.getString(
|
||||
R.string.micro_select
|
||||
)
|
||||
}${it.selectMicPosition + 1}${context.getString(R.string.micro_number)}"
|
||||
) ResUtil.getString(R.string.avroom_adapter_datingmicroviewadapter_01) else "選${it.selectMicPosition + 1}號"
|
||||
} else {
|
||||
tvSelectedStatus.text = context.getString(R.string.micro_have_select)
|
||||
tvSelectedStatus.text = "已選擇"
|
||||
}
|
||||
} else {
|
||||
tvSelectedStatus.isSelected = false
|
||||
tvSelectedStatus.text = context.getString(R.string.micro_no_select)
|
||||
tvSelectedStatus.text = "未選擇"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,8 +128,7 @@ class DatingMicroViewAdapter(context: Context?) : BaseMicroViewAdapter(context)
|
||||
if (AvRoomDataManager.POSITION_VIP_MIC == position) {
|
||||
tvNick.text = ""
|
||||
} else if (position != -1) {
|
||||
tvNick.text = "${context.getString(R.string.micro_number)}${if (manMicro) context.getString(
|
||||
R.string.god) else context.getString(R.string.goddess)}${context.getString(R.string.place)}"
|
||||
tvNick.text = "號${if (manMicro) "男神" else "女神"}位"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +145,7 @@ class DatingMicroViewAdapter(context: Context?) : BaseMicroViewAdapter(context)
|
||||
super.bind(info, position)
|
||||
if (info.mChatRoomMember == null) {
|
||||
tvNick.alpha = 1f
|
||||
tvNick.text = context.getString(R.string.micro_compere)
|
||||
tvNick.text = "主持人"
|
||||
ivVipWear.isVisible = false
|
||||
} else {
|
||||
if (info.mChatRoomMember.isVipMic) {
|
||||
|
@@ -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
|
||||
|
@@ -12,7 +12,7 @@ class RoomPKSearchAdapter :
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: SimpleRoomInfo) {
|
||||
helper.setText(R.id.tv_room_title,item.title.subAndReplaceDot(7))
|
||||
.setText(R.id.tv_room_id,"${mContext.getString(R.string.peko_number)}${item.erbanNo}")
|
||||
.setText(R.id.tv_room_id,"Piko号:${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)
|
||||
|
@@ -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 = "${getString(R.string.divine_value)}${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 = "${getString(R.string.charm_value)}${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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
)
|
||||
|
||||
|
@@ -3,7 +3,6 @@ package com.yizhuan.erban.avroom.anotherroompk
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import androidx.core.view.isVisible
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogRoomPkReceivedBinding
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
@@ -37,26 +36,26 @@ class RoomPkReceivedDialog : BaseDialog<DialogRoomPkReceivedBinding>() {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
binding.tvNick.text = pkBean.inviteRoomTitle.subAndReplaceDot(7)
|
||||
binding.tvTime.text = "${pkBean.pkDuration}${getString(R.string.avroom_dialog_pktimepickerdialog_01)}"
|
||||
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()
|
||||
}
|
||||
}
|
@@ -33,10 +33,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 +48,7 @@ class CreateGameRoomDialog : BaseDialog<DialogCreateGameRoomBinding>() {
|
||||
)
|
||||
}
|
||||
|
||||
binding.ivClose.setOnClickListener {
|
||||
binding?.ivClose?.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.yizhuan.erban.avroom.dialog
|
||||
|
||||
import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogNewUserGiftBinding
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.gift.bean.GiftInfo
|
||||
|
||||
class NewUserGiftDialog(val giftInfo: GiftInfo) :
|
||||
BaseDialog<DialogNewUserGiftBinding>() {
|
||||
|
||||
override fun init() {
|
||||
binding?.ivClose?.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
binding?.ivGift?.load(giftInfo.giftUrl)
|
||||
binding?.tvGiftName?.text = "${giftInfo.giftName}*${giftInfo.count}"
|
||||
}
|
||||
|
||||
}
|
@@ -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.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 {
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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), () -> {
|
||||
|
@@ -7,7 +7,6 @@ import android.text.Editable
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.view.WindowManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.adapter.SendBroadcastAdapter
|
||||
import com.yizhuan.erban.base.BaseActivity
|
||||
import com.yizhuan.erban.base.BaseDialog
|
||||
@@ -45,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()
|
||||
}
|
||||
@@ -91,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 = "${getString(R.string.input_content_cannot_be_less_than)}${info.minWords}${getString(R.string.please_speak_civilized_oh)}"
|
||||
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 = "${getString(R.string.after_the_release)}${info.minutes}${getString(R.string.do_not_broadcast_within_minutes)}"
|
||||
binding?.tvSendHint?.text = "发布后,${info.minutes}分钟内不可再发布广播"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,15 +107,15 @@ class SendBroadcastDialog : BaseDialog<DialogSendBroadcastBinding>() {
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(bindToLifecycle())
|
||||
.doOnComplete {
|
||||
binding.tvSendHint.text = "${getString(R.string.after_the_release)}${info.minutes}${getString(R.string.do_not_broadcast_within_minutes)}"
|
||||
binding?.tvSendHint?.text = "发布后,${info.minutes}分钟内不可再发布广播"
|
||||
}
|
||||
.subscribe {
|
||||
binding.tvSendHint.text = SpannableBuilder()
|
||||
binding?.tvSendHint?.text = SpannableBuilder()
|
||||
.append(
|
||||
"${info.seconds - it}",
|
||||
ForegroundColorSpan(Color.parseColor("#FFFDA615"))
|
||||
)
|
||||
.append(getString(R.string.you_can_publish_it_again))
|
||||
.append("后可以再次发布")
|
||||
.build()
|
||||
}
|
||||
}
|
||||
@@ -124,13 +123,13 @@ class SendBroadcastDialog : BaseDialog<DialogSendBroadcastBinding>() {
|
||||
@SuppressLint("CheckResult")
|
||||
private fun sendBroadcast() {
|
||||
if (broadcastInfo == null) {
|
||||
getString(R.string.data_loading_please_wait).toast()
|
||||
"数据加载中,请稍后...".toast()
|
||||
return
|
||||
}
|
||||
broadcastInfo?.let {
|
||||
val msg = binding.editContent.text
|
||||
val msg = binding?.editContent?.text
|
||||
if (msg.isNullOrEmpty() || msg.length < it.minWords) {
|
||||
"${getString(R.string.the_input_content_cannot_be_less_than)}${it.minWords}${getString(R.string.a_world)}".toast()
|
||||
"输入内容不能少于${it.minWords}个字!".toast()
|
||||
return@let
|
||||
}
|
||||
val dialogManager = (requireActivity() as BaseActivity).dialogManager
|
||||
@@ -139,7 +138,7 @@ class SendBroadcastDialog : BaseDialog<DialogSendBroadcastBinding>() {
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(
|
||||
{
|
||||
getString(R.string.send_success).toast()
|
||||
"发送成功".toast()
|
||||
dialogManager.dismissDialog()
|
||||
dismissAllowingStateLoss()
|
||||
},
|
||||
|
@@ -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
|
||||
@@ -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) {
|
||||
|
@@ -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,10 +122,10 @@ 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
|
||||
import java.util.*
|
||||
|
||||
|
||||
/**
|
||||
@@ -129,7 +137,8 @@ import java.util.*
|
||||
*/
|
||||
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
|
||||
@@ -178,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() {
|
||||
@@ -185,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)
|
||||
@@ -229,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
|
||||
@@ -276,6 +296,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
|
||||
@@ -293,18 +323,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之前!!!
|
||||
@@ -314,13 +348,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) {
|
||||
@@ -336,16 +373,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) {
|
||||
@@ -363,6 +404,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()
|
||||
}
|
||||
@@ -472,9 +514,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
|
||||
@@ -545,7 +584,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
|
||||
) {
|
||||
@@ -604,6 +646,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
releaseView()
|
||||
unregisterWidgets()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
@@ -633,13 +676,16 @@ 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)
|
||||
}
|
||||
}
|
||||
@@ -703,17 +749,12 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doOnError {
|
||||
if (it is VipLevelNotEnoughException) {
|
||||
dialogManager.showOkDialog(
|
||||
"${getString(R.string.not_yet_given)}${giftInfo.giftName}${
|
||||
getString(
|
||||
R.string.rank_of_nobility_required
|
||||
)
|
||||
}${giftInfo.giftVipInfo?.vipName}"
|
||||
)
|
||||
dialogManager.showOkDialog("尚未達到贈送${giftInfo.giftName}所需貴族等級,所需貴族等級:${giftInfo.giftVipInfo?.vipName}")
|
||||
}
|
||||
}
|
||||
.subscribe { _, throwable ->
|
||||
if (throwable != null) {
|
||||
toast(throwable.message)
|
||||
callback.onFail()
|
||||
} else {
|
||||
callback.onSuccess()
|
||||
@@ -761,7 +802,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
) {
|
||||
val buttonItems: MutableList<ButtonItem> = ArrayList(4)
|
||||
val presideMic = AvRoomDataManager.get().isDatingMode && micPosition == -1
|
||||
val presideText = if (presideMic) getString(R.string.maria_bartiromo) else ""
|
||||
val presideText = if (presideMic) "當主持人" else ""
|
||||
val buttonItem1 = ButtonItem(
|
||||
getString(R.string.embrace_up_mic) + presideText,
|
||||
object : ButtonItem.OnClickListener {
|
||||
@@ -807,13 +848,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
})
|
||||
val buttonItem4 =
|
||||
ButtonItem(getString(R.string.up_micro)) {
|
||||
toUpMicroPhone(
|
||||
micPosition,
|
||||
currentUid.toString() + "",
|
||||
false
|
||||
)
|
||||
}
|
||||
ButtonItem("上麥") { toUpMicroPhone(micPosition, currentUid.toString() + "", false) }
|
||||
//別問為什麽,ui調整了順序
|
||||
//禁用超管的上麥和抱TA上麥
|
||||
if (!SuperAdminUtil.isSuperAdmin()) {
|
||||
@@ -996,8 +1031,11 @@ 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(getString(R.string.not_change_wheat_in_the_game))
|
||||
SingleToastUtil.showToast("遊戲中不可以換麥!")
|
||||
return
|
||||
}
|
||||
UserModel.get().cacheLoginUserInfo?.gameStatus = GameStatus.STATUS_NOT_JOIN
|
||||
@@ -1006,9 +1044,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
if (result) {
|
||||
mvpPresenter?.upMicroPhone(micPosition, currentUid, b)
|
||||
} else {
|
||||
toast(getString(R.string.please_give_the_microphone_permission))
|
||||
toast("請給予麥克風權限後再試!")
|
||||
}
|
||||
}, { _: Throwable? -> toast(getString(R.string.something_abnormal_happens)) })
|
||||
}, { _: Throwable? -> toast("發生一些異常,請稍後重試!") })
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1072,9 +1110,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
val rvSpeedyMessage =
|
||||
speedyMessageContainer.findViewById<RecyclerView>(R.id.rv_speedy_message)
|
||||
val phrases = AvRoomDataManager.get().phrases
|
||||
if (ListUtils.isListEmpty(phrases) || !TimeUtils.isTomorrow(DemoCache.readSpeedyMessageGoneTime())
|
||||
|| Locale.getDefault().language != "zh"
|
||||
) {
|
||||
if (ListUtils.isListEmpty(phrases) || !TimeUtils.isTomorrow(DemoCache.readSpeedyMessageGoneTime())) {
|
||||
speedyMessageContainer.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
@@ -1099,10 +1135,10 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
val roomInfo =
|
||||
AvRoomDataManager.get().mCurrentRoomInfo ?: return@setOnItemClickListener
|
||||
if (roomInfo.isCloseScreen) {
|
||||
toast(getString(R.string.public_screen_in_the_room_is_closed))
|
||||
toast("房間公屏已關閉")
|
||||
return@setOnItemClickListener
|
||||
}
|
||||
SingleToastUtil.showToast(getString(R.string.send_too_often))
|
||||
SingleToastUtil.showToast("你發送的太頻繁啦,請稍後再試")
|
||||
}
|
||||
}
|
||||
speedyMessageContainer.findViewById<View>(R.id.iv_close_speedy_message).setOnClickListener {
|
||||
@@ -1116,7 +1152,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
|
||||
override fun onFollowFail(msg: String?) {
|
||||
toast(getString(R.string.focus_failure))
|
||||
toast("關註失敗,請稍後重試")
|
||||
}
|
||||
|
||||
override fun updateMicView() {
|
||||
@@ -1215,7 +1251,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_BROADCASTER)
|
||||
updateMicBtn()
|
||||
} else {
|
||||
toast(getString(R.string.only_after_the_permission_is_enabled))
|
||||
toast("開啟權限後才能開麥")
|
||||
}
|
||||
}
|
||||
return
|
||||
@@ -1223,7 +1259,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)
|
||||
}
|
||||
@@ -1242,15 +1278,12 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
dynamicFaceDialog?.show()
|
||||
}
|
||||
} else {
|
||||
toast(getString(R.string.you_have_to_do_it_on_the_mic))
|
||||
toast("上麥才能發表情哦!")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSendMsgBtnClick() {
|
||||
inputLayout.visibility = View.VISIBLE
|
||||
inputEdit.isFocusableInTouchMode = true
|
||||
inputEdit.requestFocus()
|
||||
KeyBoardUtils.showKeyBoard(context, inputEdit)
|
||||
openMessageInput(null)
|
||||
}
|
||||
|
||||
override fun onSendGiftBtnClick() {
|
||||
@@ -1266,7 +1299,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()
|
||||
@@ -1276,4 +1312,59 @@ 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(){
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,201 @@
|
||||
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.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)
|
||||
}
|
||||
|
||||
|
||||
@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)
|
||||
}
|
||||
}
|
@@ -32,6 +32,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;
|
||||
@@ -78,6 +79,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 +100,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[]{""};
|
||||
@@ -178,6 +181,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 +213,13 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
ivRoomShare.setOnClickListener(this);
|
||||
gameMainBinding.llRoomInfo.setOnClickListener(this);
|
||||
gameMainBinding.ivBack.setOnClickListener(this);
|
||||
|
||||
mRoomEffectView.setOnPlayAnimCallback(new Function0<Boolean>() {
|
||||
@Override
|
||||
public Boolean invoke() {
|
||||
return getIsAnim();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -344,6 +355,24 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼物飘屏是否展示
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean getIsAnim() {
|
||||
if (giftView != null) {
|
||||
return giftView.getIsPlayAnim();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩法飘屏是否展示
|
||||
*/
|
||||
private boolean getIsPlayAnim() {
|
||||
return mRoomEffectView.getIsPlayAnim();
|
||||
}
|
||||
|
||||
private void onReceiveLuckyGiftToMultiMsg(LuckyBagGifts giftMultiReceiverInfo) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed()) return;
|
||||
@@ -405,7 +434,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)) {
|
||||
@@ -449,7 +480,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
if (AvRoomDataManager.get().isOpenGame()) {
|
||||
gameMainBinding.tvCurrGame.setText(currentRoomInfo.getMgName());
|
||||
} else {
|
||||
gameMainBinding.tvCurrGame.setText(ResUtil.getString(R.string.avroom_fragment_homepartyfragment_05));
|
||||
gameMainBinding.tvCurrGame.setText(ResUtil.getString(R.string.avroom_fragment_homepartyfragment_08));
|
||||
}
|
||||
GameModel.INSTANCE.getGameList()
|
||||
.compose(bindToLifecycle())
|
||||
@@ -463,7 +494,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
GameInfo gameInfo = new GameInfo();
|
||||
gameInfo.setName(ResUtil.getString(R.string.avroom_fragment_homepartyfragment_05));
|
||||
gameInfo.setName(ResUtil.getString(R.string.avroom_fragment_homepartyfragment_09));
|
||||
gameInfos.add(gameInfo);
|
||||
}
|
||||
gameAdapter.setNewData(gameInfos);
|
||||
|
@@ -26,6 +26,7 @@ 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.redpackage.RedPackageWidget;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyView;
|
||||
import com.yizhuan.erban.avroom.widget.PKBoardView;
|
||||
import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
@@ -60,7 +61,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 +134,12 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
bottomView.setBottomViewListener(new PartyRoomBottomViewWrapper());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initWidget() {
|
||||
super.initWidget();
|
||||
registerWidget(RedPackageWidget.class.getSimpleName(), gameBinding.redPackageWidget);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void initiate() {
|
||||
@@ -527,7 +533,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (mDisposable != null) {
|
||||
@@ -809,7 +814,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 +969,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();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -3,7 +3,6 @@ package com.yizhuan.erban.avroom.fragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.adapter.CommonVPAdapter;
|
||||
import com.yizhuan.erban.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.yizhuan.erban.avroom.widget.RankNavigatorAdapter;
|
||||
import com.yizhuan.erban.base.BaseBindingFragment;
|
||||
@@ -27,7 +26,7 @@ public class RoomCharmListFragment extends BaseBindingFragment<FragmentRoomCharm
|
||||
ArrayList<Fragment> fragments = new ArrayList<>(2);
|
||||
fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING));
|
||||
fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING));
|
||||
mBinding.vpCharmRankings.setAdapter(new CommonVPAdapter(getChildFragmentManager(), getLifecycle(), fragments));
|
||||
mBinding.vpCharmRankings.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), fragments));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(false);
|
||||
|
||||
|
@@ -2,10 +2,8 @@ package com.yizhuan.erban.avroom.fragment;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.adapter.CommonVPAdapter;
|
||||
import com.yizhuan.erban.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.yizhuan.erban.avroom.widget.RankNavigatorAdapter;
|
||||
import com.yizhuan.erban.base.BaseMvpFragment;
|
||||
@@ -23,7 +21,7 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class RoomContributeListFragment extends BaseMvpFragment implements IMvpBaseView {
|
||||
|
||||
private ViewPager2 viewPager;
|
||||
private ViewPager viewPager;
|
||||
private MagicIndicator viewIndicator;
|
||||
|
||||
@Override
|
||||
@@ -45,7 +43,7 @@ public class RoomContributeListFragment extends BaseMvpFragment implements IMvpB
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_MONTH_RANKING));
|
||||
}
|
||||
viewPager.setAdapter(new CommonVPAdapter(getChildFragmentManager(), getLifecycle(), fragments));
|
||||
viewPager.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), fragments));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(false);
|
||||
RankNavigatorAdapter indicator = new RankNavigatorAdapter(AvRoomDataManager.get().isDatingMode());
|
||||
|