Compare commits
392 Commits
master
...
peko_relea
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f4f7361184 | ||
![]() |
7bd8b4c653 | ||
![]() |
beb083c896 | ||
![]() |
56942bf545 | ||
![]() |
a1891718f5 | ||
![]() |
68723cd47f | ||
![]() |
6f49eca7b9 | ||
![]() |
1478973d42 | ||
![]() |
688dc3bc3d | ||
![]() |
8096ce0ff5 | ||
![]() |
f2b083d7a7 | ||
![]() |
e326dabc13 | ||
![]() |
794a24f332 | ||
![]() |
3a6ccd0e97 | ||
![]() |
87da2a9f18 | ||
![]() |
9d8118e331 | ||
![]() |
ed6e247de7 | ||
![]() |
3864efcc4c | ||
![]() |
cae5ccce7a | ||
![]() |
6bd857b97d | ||
![]() |
502a2f20b9 | ||
![]() |
74a7ccecfc | ||
![]() |
d4f65da89e | ||
![]() |
bbb6a21cb9 | ||
![]() |
098bf777d7 | ||
![]() |
6f1165dc37 | ||
![]() |
5c4c4cc284 | ||
![]() |
6b7adc5950 | ||
![]() |
87b81b7761 | ||
![]() |
842bf98958 | ||
![]() |
f110a47c0e | ||
![]() |
160e5025b8 | ||
![]() |
9ec8385544 | ||
![]() |
13106a62e4 | ||
![]() |
7a677c96cd | ||
![]() |
7093cfa7f3 | ||
![]() |
3747c10dc1 | ||
![]() |
d9e3c32f1b | ||
![]() |
9891c6f9d0 | ||
![]() |
f721e34139 | ||
![]() |
069eb3e89c | ||
![]() |
8ae154cf09 | ||
![]() |
6b90fedb8b | ||
![]() |
cee6060d62 | ||
![]() |
0acd6f9c88 | ||
![]() |
9a075db5d5 | ||
![]() |
592dbc78f3 | ||
![]() |
c3bf0b9451 | ||
![]() |
82ad02f2a7 | ||
![]() |
fb6d784c1d | ||
![]() |
3e4d9654c9 | ||
![]() |
923e598344 | ||
![]() |
5de48352c5 | ||
![]() |
5140a70569 | ||
![]() |
0e405f5bda | ||
![]() |
d5be4ace02 | ||
![]() |
4475d622fd | ||
![]() |
03faea9138 | ||
![]() |
37afa710fe | ||
![]() |
6a71670b84 | ||
![]() |
615089d1e1 | ||
![]() |
47b38458df | ||
![]() |
91be03ea07 | ||
![]() |
f7a500770a | ||
![]() |
d82bb55c4e | ||
![]() |
dc1383be70 | ||
![]() |
368ed2bf70 | ||
![]() |
d595ed469e | ||
![]() |
792ad5141c | ||
![]() |
de6a4fe524 | ||
![]() |
d0cb9e43b1 | ||
![]() |
ef8d9b0b6f | ||
![]() |
e781369be1 | ||
![]() |
3bd13e732a | ||
![]() |
67babbaebd | ||
![]() |
c392b20f21 | ||
![]() |
0a1ae82d42 | ||
![]() |
6dc63e1d26 | ||
![]() |
2dcbcf7179 | ||
![]() |
bcd6faf213 | ||
![]() |
072c837c99 | ||
![]() |
067f97d6be | ||
![]() |
15b317d5d0 | ||
![]() |
16712197e3 | ||
![]() |
24ccadc593 | ||
![]() |
88767208bd | ||
![]() |
91bb8f7871 | ||
![]() |
dedb075c56 | ||
![]() |
1b1f477494 | ||
![]() |
9a015aff0b | ||
![]() |
9500554550 | ||
![]() |
23e05ccab1 | ||
![]() |
0417e53b85 | ||
![]() |
df96cfe5d4 | ||
![]() |
213efcba31 | ||
![]() |
9e36225b77 | ||
![]() |
da3d72ebff | ||
![]() |
fd3dc7cb3c | ||
![]() |
eebe231a45 | ||
![]() |
276f2002f9 | ||
![]() |
2942e2f0bb | ||
![]() |
406077b43b | ||
![]() |
55a8d037e0 | ||
![]() |
ba58b0bd40 | ||
![]() |
151b1c37d0 | ||
![]() |
4a7af141aa | ||
![]() |
cec6e00e09 | ||
![]() |
bf6ef26eca | ||
![]() |
07845b5e60 | ||
![]() |
097ead1327 | ||
![]() |
2b45d35d40 | ||
![]() |
e6f4b40e66 | ||
![]() |
c46f19f03f | ||
![]() |
37196025cc | ||
![]() |
9096a9b57f | ||
![]() |
c46c49715c | ||
![]() |
31b785c511 | ||
![]() |
6f01c5ddad | ||
![]() |
306f15f7f9 | ||
![]() |
0babbedeb9 | ||
![]() |
d09e60d206 | ||
![]() |
e37796286b | ||
![]() |
bdcfb21e6e | ||
![]() |
5c7d2e9645 | ||
![]() |
d2f24c4457 | ||
![]() |
7ec11e0aba | ||
![]() |
f4a9690c1b | ||
![]() |
0742894540 | ||
![]() |
d0fe8e892e | ||
![]() |
b9120dca54 | ||
![]() |
8ebaddad07 | ||
![]() |
b63b4ba07a | ||
![]() |
a211267517 | ||
![]() |
d0e88440e3 | ||
![]() |
260ed56c99 | ||
![]() |
505917b70f | ||
![]() |
03d013fcba | ||
![]() |
19301bbd84 | ||
![]() |
694a73931b | ||
![]() |
d34929d7c7 | ||
![]() |
73eccecfc9 | ||
![]() |
eb1546570a | ||
![]() |
7ba43a51d4 | ||
![]() |
bae4660840 | ||
![]() |
b9fd24e0ff | ||
![]() |
4bef25e1e3 | ||
![]() |
72480daa98 | ||
![]() |
1defcb0d28 | ||
![]() |
4885a0bdbd | ||
![]() |
5900702ca6 | ||
![]() |
9e6928580f | ||
![]() |
e644ced1ed | ||
![]() |
1667dd3863 | ||
![]() |
c04d3e283b | ||
![]() |
2b6d66c31e | ||
![]() |
e56bbb5f8f | ||
![]() |
7bf7e232d0 | ||
![]() |
d63a441296 | ||
![]() |
e81ec19168 | ||
![]() |
588b96ec7b | ||
![]() |
514abbc314 | ||
![]() |
94d9183952 | ||
![]() |
6eedd5cc46 | ||
![]() |
087091275f | ||
![]() |
f54a8ec175 | ||
![]() |
fee8f2ceb9 | ||
![]() |
a18a66b496 | ||
![]() |
80e21bee74 | ||
![]() |
e031dd9d02 | ||
![]() |
19a3b64a32 | ||
![]() |
34a5571338 | ||
![]() |
5b4eeb80e8 | ||
![]() |
f7889ace18 | ||
![]() |
cfc909df42 | ||
![]() |
ebc989cccf | ||
![]() |
5ad1c017c3 | ||
![]() |
15a80f5537 | ||
![]() |
38fde6109b | ||
![]() |
3199114ff6 | ||
![]() |
57139f1f97 | ||
![]() |
c7d7d98873 | ||
![]() |
d7da6d4be4 | ||
![]() |
b9a2f03184 | ||
![]() |
5ef9be75d2 | ||
![]() |
cf3ab9ce84 | ||
![]() |
3ba31c46d8 | ||
![]() |
e8f7eca1af | ||
![]() |
d93b6fbf60 | ||
![]() |
6ec57834fd | ||
![]() |
c3dab80e71 | ||
![]() |
60e56beb43 | ||
![]() |
a0667bdd8d | ||
![]() |
ba65ad680f | ||
![]() |
5163c2dc9d | ||
![]() |
ad5a769f25 | ||
![]() |
be291fa7e1 | ||
![]() |
27713e5300 | ||
![]() |
80e180f2b8 | ||
![]() |
ba93c9c0fe | ||
![]() |
6f9d1d81ad | ||
![]() |
81d0cd819d | ||
![]() |
36897df28b | ||
![]() |
6bdfe0426e | ||
![]() |
997b7ee9a3 | ||
![]() |
b885a24b8e | ||
![]() |
5d2551e04f | ||
![]() |
309e696a07 | ||
![]() |
68c9c6a8cb | ||
![]() |
448e6800ab | ||
![]() |
068ffcbed4 | ||
![]() |
cf7b49b69d | ||
![]() |
09fd7c586a | ||
![]() |
03b77fae08 | ||
![]() |
b75ba89d75 | ||
![]() |
2074039de2 | ||
![]() |
6b580ad2a6 | ||
![]() |
6134962297 | ||
![]() |
ce5cc20ac4 | ||
![]() |
bc718f26c6 | ||
![]() |
8f9a5bd565 | ||
![]() |
623a721e58 | ||
![]() |
a9be418fc3 | ||
![]() |
5b781b890c | ||
![]() |
4a6892d0c6 | ||
![]() |
a6e6992b1a | ||
![]() |
248e306e85 | ||
![]() |
bce08e82ca | ||
![]() |
32814780c2 | ||
![]() |
d0dc4cab49 | ||
![]() |
80d571d1d1 | ||
![]() |
b92c97dfb9 | ||
![]() |
e585899c44 | ||
![]() |
03f28b7be0 | ||
![]() |
c7225892f0 | ||
![]() |
f8d4601c38 | ||
![]() |
ce4fce319e | ||
![]() |
ce4293ec35 | ||
![]() |
1c9de5f03a | ||
![]() |
2734ff1ff2 | ||
![]() |
c7a28c5ac9 | ||
![]() |
ae4d327baf | ||
![]() |
9e9eb5d5b7 | ||
![]() |
96b1ad9e4c | ||
![]() |
48c527e789 | ||
![]() |
4e0a55ae46 | ||
![]() |
c85065d86c | ||
![]() |
c1371fab10 | ||
![]() |
6717f9aa69 | ||
![]() |
61cafd8c8c | ||
![]() |
e4f0853d3e | ||
![]() |
46a2985a49 | ||
![]() |
b2f9f07ded | ||
![]() |
5023d9a250 | ||
![]() |
29957775e0 | ||
![]() |
5f73c46868 | ||
![]() |
656eea5ebc | ||
![]() |
f9b8c20d85 | ||
![]() |
2d7b55ad0d | ||
![]() |
91350218d6 | ||
![]() |
ca56ee0877 | ||
![]() |
23214de384 | ||
![]() |
da45a64af9 | ||
![]() |
e236ef2aff | ||
![]() |
7de533bf3f | ||
![]() |
e23363c736 | ||
![]() |
4395951973 | ||
![]() |
e02020577d | ||
![]() |
61306e833a | ||
![]() |
49ba0a2701 | ||
![]() |
2e32184248 | ||
![]() |
bab64db25c | ||
![]() |
612502153c | ||
![]() |
9cdb0eef53 | ||
![]() |
6528ac407a | ||
![]() |
94d18e6035 | ||
![]() |
08abf47890 | ||
![]() |
cb89eccf23 | ||
![]() |
b57622ad42 | ||
![]() |
fd71af897f | ||
![]() |
1998258bda | ||
![]() |
5cce2cb68c | ||
![]() |
08230c55a3 | ||
![]() |
f51dec1101 | ||
![]() |
1dd5d64a09 | ||
![]() |
30d793d794 | ||
![]() |
d2fb38f094 | ||
![]() |
01958edd06 | ||
![]() |
5a2903d14d | ||
![]() |
1bade9dd00 | ||
![]() |
8d7ab335e2 | ||
![]() |
8bf25ad378 | ||
![]() |
6e11cfb30d | ||
![]() |
0c2fd28f15 | ||
![]() |
a2e0e9df53 | ||
![]() |
9e3ebfa541 | ||
![]() |
94a0575909 | ||
![]() |
3d161b94e4 | ||
![]() |
08d9534095 | ||
![]() |
ff1cd57d98 | ||
![]() |
2a57ad3145 | ||
![]() |
92f2db36ae | ||
![]() |
362c75f93c | ||
![]() |
b9c3bbdbec | ||
![]() |
0a24dc66e6 | ||
![]() |
ca62822bfb | ||
![]() |
5db5afa5ed | ||
![]() |
edad692309 | ||
![]() |
23a34434a0 | ||
![]() |
8ad38583ff | ||
![]() |
391fae9006 | ||
![]() |
9854e91fe8 | ||
![]() |
d587f1b43d | ||
![]() |
595d3a767a | ||
![]() |
4d13cf5e9c | ||
![]() |
62ce160dfa | ||
![]() |
c631c1d3a8 | ||
![]() |
27420aa51a | ||
![]() |
12c5344d72 | ||
![]() |
a716136090 | ||
![]() |
f860c96887 | ||
![]() |
873ecf1d2b | ||
![]() |
957b64476f | ||
![]() |
306e0a99a0 | ||
![]() |
bfd619e8b5 | ||
![]() |
4c0184c80b | ||
![]() |
aeb47da0ee | ||
![]() |
d99ef80d2e | ||
![]() |
77dcc9d117 | ||
![]() |
a7f17276c5 | ||
![]() |
63f1e02c6f | ||
![]() |
5c6657c538 | ||
![]() |
7548b4174a | ||
![]() |
068172bbd2 | ||
![]() |
0dda893e1f | ||
![]() |
928857f97d | ||
![]() |
46a2dab191 | ||
![]() |
877c3d9361 | ||
![]() |
ef8ca0b939 | ||
![]() |
50a20f7822 | ||
![]() |
9cc59dd275 | ||
![]() |
1ac47c055d | ||
![]() |
24f1437418 | ||
![]() |
f794fe960f | ||
![]() |
282036bb20 | ||
![]() |
ffab260d6a | ||
![]() |
8c47c3e717 | ||
![]() |
c36f127bce | ||
![]() |
d46ec289ea | ||
![]() |
a9405eb8f8 | ||
![]() |
f5d3f45001 | ||
![]() |
49f2764344 | ||
![]() |
e2a477bd0d | ||
![]() |
0cc24f4adf | ||
![]() |
44e918bd68 | ||
![]() |
cc21e2969a | ||
![]() |
cbe2234c83 | ||
![]() |
68e091131d | ||
![]() |
346b535757 | ||
![]() |
a16a918d06 | ||
![]() |
d3b6a16db9 | ||
![]() |
c34e8b034d | ||
![]() |
d2b0e904c8 | ||
![]() |
b57e7afb6d | ||
![]() |
edcabd157d | ||
![]() |
384831effa | ||
![]() |
f8f0c2c59b | ||
![]() |
96e3c65f2f | ||
![]() |
d8c1a89005 | ||
![]() |
e014e6a6b2 | ||
![]() |
144fa832f1 | ||
![]() |
9b7c0cae6b | ||
![]() |
f6f79f83dc | ||
![]() |
09f0eac2b3 | ||
![]() |
951c42592e | ||
![]() |
fdfec8610d | ||
![]() |
fcf9f65984 | ||
![]() |
2ef89535d5 | ||
![]() |
f742102a60 | ||
![]() |
eb73898872 | ||
![]() |
122f2d374f | ||
![]() |
7adefe8375 | ||
![]() |
34b9233825 | ||
![]() |
cd5b1728f8 | ||
![]() |
ac53bbd484 | ||
![]() |
48a096a64a | ||
![]() |
0dd0e131f2 | ||
![]() |
4999c6e955 | ||
![]() |
259c3e408a | ||
![]() |
58b66848d9 | ||
![]() |
bf805afdb5 | ||
![]() |
a1221fa5a5 | ||
![]() |
7515f50095 |
@@ -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 {
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
outputFileName = "peko_${buildType.name}_v${defaultConfig.versionName}-${date}.apk"
|
||||
android.applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach { output ->
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
|
||||
def outputFile = output.outputFile
|
||||
if (outputFile == null || !outputFile.name.endsWith('.apk')) {
|
||||
return
|
||||
}
|
||||
|
||||
def abi = output.getFilter(com.android.build.OutputFile.ABI)
|
||||
if (abi == null) {
|
||||
abi = "universal"
|
||||
}
|
||||
outputFileName = "piko_${buildType.name}_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${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" />
|
||||
@@ -320,9 +355,42 @@
|
||||
android:name=".ui.webview.CommonWebViewActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".ui.wallet.PaymentResultActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/transparent_activity"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
<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:host="payment"
|
||||
android:path="/result"
|
||||
android:scheme="pekoapp" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<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 +433,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 +513,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,9 +525,21 @@
|
||||
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" />
|
||||
android:theme="@style/transparent_activity" />
|
||||
<activity
|
||||
android:name=".treasure_box.activity.BoxRankingActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
@@ -452,6 +572,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 +698,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 +767,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 +809,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"
|
||||
@@ -695,10 +843,18 @@
|
||||
<activity
|
||||
android:name=".ui.webview.DialogWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" /> <!-- 隐私政策 -->
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".ui.webview.room_banner.RoomWebDialogActivity"
|
||||
android:theme="@style/room_dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" /><!-- 隐私政策 -->
|
||||
<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 +1010,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 +1041,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 +1087,33 @@
|
||||
<service
|
||||
android:name=".service.DaemonService"
|
||||
android:enabled="true" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ApplicationId"
|
||||
android:value="@string/facebook_app_id" />
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ClientToken"
|
||||
android:value="@string/facebook_client_token" />
|
||||
|
||||
<activity
|
||||
android:name="com.facebook.FacebookActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="com.facebook.CustomTabActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="@string/fb_login_protocol_scheme" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".avroom.room_album.RoomAlbumActivity" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
1
app/src/main/assets/hot_region.json
Normal file
@@ -0,0 +1 @@
|
||||
[{"name":"Taiwan","abbr":"TW","mcc":"466","code":"886"},{"name":"Hong Kong","abbr":"HK","mcc":"454","code":"852"},{"name":"Singapore","abbr":"SG","mcc":"525","code":"65"},{"name":"Malaysia","abbr":"MY","mcc":"502","code":"60"},{"name":"China","abbr":"CN","mcc":"460","code":"86"}]
|
1
app/src/main/assets/region.json
Normal file
BIN
app/src/main/assets/svga/home_living.svga
Normal file
BIN
app/src/main/assets/svga/home_voice_playing.svga
Normal file
BIN
app/src/main/assets/svga/home_white_living.svga
Normal file
BIN
app/src/main/assets/svga/room_bg_single.svga
Normal file
BIN
app/src/main/assets/svga/svga_home_pk.svga
Normal file
BIN
app/src/main/assets/svga/svga_notify_h5.svga
Normal file
BIN
app/src/main/assets/svga/svga_tarot_senior.svga
Normal file
BIN
app/src/main/assets/svga/zoo_notify.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();
|
||||
|
||||
@@ -453,6 +478,7 @@ public class XChatApplication extends BaseApp {
|
||||
ChannelModel.get();
|
||||
MarketVerifyModel.get();
|
||||
GiftModel.get();
|
||||
GiftModel.get().tryLoadGiftList();
|
||||
PublicChatHallModel.get();
|
||||
// 模厅
|
||||
HallDataManager.get().application();
|
||||
@@ -500,10 +526,7 @@ public class XChatApplication extends BaseApp {
|
||||
BasicConfig.INSTANCE.setAppContext(this.getApplicationContext());
|
||||
SharedPreferenceUtils.init(this);
|
||||
ResUtil.init(this);
|
||||
boolean isShowPrivacyAgreement = (boolean) SharedPreferenceUtils.get(SplashActivity.SHOW_PRIVACY_AGREEMENT, true);
|
||||
if (!isShowPrivacyAgreement) {
|
||||
initOtherSDK();
|
||||
}
|
||||
initOtherSDK();
|
||||
initContext(this);
|
||||
//首次启动事件
|
||||
HashMap<String, Object> map = new HashMap<>(2);
|
||||
@@ -539,4 +562,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,25 @@ 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_CRAZY_ZOO;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM;
|
||||
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 static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_TEMPLATE_NOTIFY;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_TEMPLATE_NOTIFY_ALL;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -31,10 +43,12 @@ 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;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.netease.nimlib.sdk.NIMSDK;
|
||||
import com.netease.nimlib.sdk.Observer;
|
||||
@@ -49,6 +63,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 +72,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 +88,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 +99,23 @@ 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.RoomTemplateNotifyAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomTemplateNotifyMsgBean;
|
||||
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 +134,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 +145,10 @@ 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.support.room.RoomWidget;
|
||||
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 +156,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 +167,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 +184,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 +222,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 +229,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);
|
||||
@@ -303,7 +331,8 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
} else if (roomInfo.getType() == RoomInfo.ROOM_TYPE_SINGLE) {
|
||||
bgPicture[0] = "";
|
||||
svgaRoomBg.setImageResource(R.drawable.bg_room_single_pic);
|
||||
// svgaRoomBg.setImageResource(R.drawable.bg_room_single_pic);
|
||||
playSvgaBg(svgaRoomBg, "svga/room_bg_single.svga");
|
||||
} else {
|
||||
bgPicture[0] = "";
|
||||
if (roomInfo.getRoomModeType() == RoomModeType.OPEN_PK_MODE) {
|
||||
@@ -380,7 +409,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 +421,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 +458,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 +485,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 +525,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,8 +628,11 @@ 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);
|
||||
case RoomEvent.FAIRY_DRAW_GIFT_L5:
|
||||
ChatRoomMessage message = roomEvent.getChatRoomMessage();
|
||||
if (message != null) {
|
||||
IMNetEaseManager.get().addMessages(message);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
@@ -646,7 +682,14 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
*/
|
||||
private void showRoomFragment(boolean isRoomMin) {
|
||||
mCurrentFragment = (HomePartyFragment) mAdapter.getItem(1);
|
||||
viewpager.setUserInputEnabled(AvRoomDataManager.get().isSingleRoom());
|
||||
mCurrentFragment.getPlayNotifyState().observe(getLifecycleOwner(), aBoolean -> {
|
||||
if (!aBoolean) {
|
||||
if (isValid()) {
|
||||
showGiftDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
tryEnabledViewPagerInput();
|
||||
viewpager.setCurrentItem(1, false);
|
||||
if (isRoomMin) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
@@ -659,6 +702,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 +749,24 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
AvRoomDataManager.get().release();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void showRedPackage(RoomInfo roomInfo) {
|
||||
if (roomInfo == null) return;
|
||||
RedPackageNotifyInfo inRoomNotifyInfo = (RedPackageNotifyInfo) getIntent().getSerializableExtra("notifyInfo");
|
||||
Map<String, Long> redMap = DemoCache.readRedPackage();
|
||||
RedPackageModel.INSTANCE.getRedPackage(roomInfo.getUid())
|
||||
.compose(bindToLifecycle())
|
||||
.doFinally(() -> {
|
||||
if (inRoomNotifyInfo != null && (redMap == null || !redMap.containsKey(inRoomNotifyInfo.getRedEnvelopeId()))) {
|
||||
showRedPackageOpenDialog(inRoomNotifyInfo);
|
||||
}
|
||||
})
|
||||
.filter(notifyInfo -> inRoomNotifyInfo == null || !notifyInfo.getRedEnvelopeId().equals(inRoomNotifyInfo.getRedEnvelopeId()))
|
||||
.subscribe(this::showRedPackageOpenDialog);
|
||||
}
|
||||
|
||||
private void showRedPackageOpenDialog(RedPackageNotifyInfo notifyInfo) {
|
||||
if (!isResume) return;
|
||||
if (openDialogs == null) {
|
||||
openDialogs = new ArrayList<>();
|
||||
}
|
||||
RedPackageOpenDialog openDialog = RedPackageOpenDialog.Companion.newInstance(notifyInfo);
|
||||
openDialog.show(this);
|
||||
if (openDialog.getDialog() != null) {
|
||||
openDialog.getDialog().setOnDismissListener(dialog -> openDialogs.remove(openDialog));
|
||||
}
|
||||
openDialogs.add(openDialog);
|
||||
if (openDialogs.size() >= SHOW_RED_DIALOG_MAX) {
|
||||
openDialogs.get(SHOW_RED_DIALOG_MAX - 1).dismissAllowingStateLoss();
|
||||
/**
|
||||
* 尝试展示来源红包(在房间外点击红包入口进入房间时)
|
||||
*/
|
||||
private void tryShowSourceRedPackage() {
|
||||
try {
|
||||
if (redPackageNotifyInfo != null) {
|
||||
RedPackageHandler handler = getRoomContext().findAbility(RedPackageHandler.class.getSimpleName());
|
||||
if (handler != null) {
|
||||
long id = Long.parseLong(redPackageNotifyInfo.getRedEnvelopeId());
|
||||
handler.tryShowRedPackage(id);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void dismissRedPackageDialog() {
|
||||
if (openDialogs != null) {
|
||||
openDialogs.clear();
|
||||
}
|
||||
if (mCurrentFragment != null) {
|
||||
mCurrentFragment.dismissSendRedPackageDialog();
|
||||
}
|
||||
@@ -1044,6 +1080,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
//获取管理员
|
||||
getMvpPresenter().getNormalChatMember();
|
||||
getMvpPresenter().getSuperAdminList();
|
||||
getMvpPresenter().checkNewUserGift();
|
||||
if (UserUtils.getUserInfo().isFirstCharge()) {
|
||||
getMvpPresenter().checkFirstCharge();
|
||||
}
|
||||
@@ -1054,7 +1091,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
DemoCache.readNewUserChargeGift() == 0) {
|
||||
DemoCache.saveNewUserChargeGift(1);
|
||||
}
|
||||
showRedPackage(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
|
||||
@@ -1174,10 +1210,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<>();
|
||||
}
|
||||
@@ -1187,21 +1222,94 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
return;
|
||||
giftList.add(data);
|
||||
if (second2 == CUSTOM_MSG_ALL_SERVICE_GIFT) {
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
// 如果当前以及有礼物弹窗在展示,则需要等到他 dismiss 后再显示下一个
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
return;
|
||||
} else {
|
||||
giftDialog.dismiss();
|
||||
if (mCurrentFragment != null && mCurrentFragment.isShowingPlayNotify()) {
|
||||
return;
|
||||
}
|
||||
showGiftDialog();
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_BOX://寻爱之旅
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA) {
|
||||
RoomBoxPrizeAttachment roomBoxPrizeAttachment = new RoomBoxPrizeAttachment(CUSTOM_MSG_BOX, CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA);
|
||||
RoomBoxPrizeInfo roomBoxPrizeBean = JSON.parseObject(String.valueOf(baseProtocol.getData()), RoomBoxPrizeInfo.class);
|
||||
roomBoxPrizeAttachment.setUid(roomBoxPrizeBean.getUid());
|
||||
roomBoxPrizeAttachment.setPrizeName(roomBoxPrizeBean.getPrizeName());
|
||||
roomBoxPrizeAttachment.setNick(roomBoxPrizeBean.getNick());
|
||||
roomBoxPrizeAttachment.setBoxTypeStr(roomBoxPrizeBean.getBoxTypeStr());
|
||||
roomBoxPrizeAttachment.setRoomUid(roomBoxPrizeBean.getRoomUid());
|
||||
roomBoxPrizeAttachment.setPrizeNum(roomBoxPrizeBean.getPrizeNum());
|
||||
roomBoxPrizeAttachment.setUserLevelLimit(roomBoxPrizeBean.getUserLevelLimit());
|
||||
if (AvRoomDataManager.get().isOpenPureMode()) {
|
||||
// 純凈模式打開後,僅能看跟自己相關的砸蛋消息
|
||||
if (Objects.equals(roomBoxPrizeAttachment.getUid(), AuthModel.get().getCurrentUid())) {
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), roomBoxPrizeAttachment);
|
||||
IMNetEaseManager.get().addMessages(message);
|
||||
}
|
||||
} else {
|
||||
showGiftDialog();
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), roomBoxPrizeAttachment);
|
||||
IMNetEaseManager.get().addMessages(message);
|
||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.onNext(new RoomEvent()
|
||||
.setEvent(RoomEvent.BOX_NOTIFY_SVGA)
|
||||
.setChatRoomMessage(message));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_GIFT:
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY) {
|
||||
case CustomAttachment.CUSTOM_MESS_TAROT:
|
||||
if (baseProtocol.getSecond() == CustomAttachment.CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING) {
|
||||
TarotMsgBean tarotMsgBean = JSON.parseObject(String.valueOf(baseProtocol.getData()), TarotMsgBean.class);
|
||||
TarotAttachment tarotAttachment = new TarotAttachment(CustomAttachment.CUSTOM_MESS_TAROT,
|
||||
CustomAttachment.CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING);
|
||||
tarotAttachment.setTarotMsgBean(tarotMsgBean);
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomId()), tarotAttachment);
|
||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.onNext(new RoomEvent()
|
||||
.setEvent(RoomEvent.TAROT_NOTIFY_SVGA)
|
||||
.setChatRoomMessage(message));
|
||||
AvRoomDataManager.get().addChatRoomMessage(message);
|
||||
}
|
||||
break;
|
||||
case CustomAttachment.CUSTOM_MSG_NOTIFY_H5:
|
||||
if (baseProtocol.getSecond() == CustomAttachment.CUSTOM_MSG_NOTIFY_H5_SUB_WHOLE_SERVICE) {
|
||||
NotifyH5Info bean = JSON.parseObject(String.valueOf(baseProtocol.getData()), NotifyH5Info.class);
|
||||
NotifyH5Attachment notifyH5Attachment = new NotifyH5Attachment(baseProtocol.getSecond());
|
||||
notifyH5Attachment.setBean(bean);
|
||||
ChatRoomMessage notifyH5Msg = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomId()), notifyH5Attachment);
|
||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.onNext(new RoomEvent()
|
||||
.setEvent(RoomEvent.NOTIFY_H5)
|
||||
.setChatRoomMessage(notifyH5Msg));
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_SEA://星级厨房
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL) {
|
||||
RoomLuckySeaAttachment attachment = new RoomLuckySeaAttachment(CUSTOM_MSG_LUCKY_SEA, CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL);
|
||||
attachment.setRoomLuckySeaMsgBean(JSON.parseObject(String.valueOf(baseProtocol.getData()), RoomLuckySeaMsgBean.class));
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
IMNetEaseManager.get().addMessages(message);
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_CRAZY_ZOO://疯狂动物园
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM) {
|
||||
RoomLuckySeaAttachment attachment = new RoomLuckySeaAttachment(CUSTOM_MSG_CRAZY_ZOO, CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM);
|
||||
attachment.setRoomLuckySeaMsgBean(JSON.parseObject(String.valueOf(baseProtocol.getData()), RoomLuckySeaMsgBean.class));
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.CRAZY_ZOO_ALL_ROOM_NOTIFY);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_TEMPLATE_NOTIFY://通用飘屏
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_TEMPLATE_NOTIFY_ALL) {
|
||||
RoomTemplateNotifyAttachment attachment = new RoomTemplateNotifyAttachment(CUSTOM_MSG_TEMPLATE_NOTIFY, CUSTOM_MSG_TEMPLATE_NOTIFY_ALL);
|
||||
attachment.setMsgBean(new Gson().fromJson(String.valueOf(baseProtocol.getData()), RoomTemplateNotifyMsgBean.class));
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.TEMPLATE_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 +1317,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);
|
||||
@@ -1222,9 +1338,24 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isShowingGiftNotify() {
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void showGiftDialog() {
|
||||
if (!isValid()) return;
|
||||
if (giftList == null) return;
|
||||
if (giftList.size() == 0) return;
|
||||
giftDialog = generateAllServiceGiftDialog(this, giftList.peekFirst());
|
||||
AllServiceGiftProtocol.DataBean data = giftList.peekFirst();
|
||||
if (data == null) return;
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
return;
|
||||
}
|
||||
giftDialog = generateAllServiceGiftDialog(this, data);
|
||||
giftDialog.setOnDismissListener(dialog -> {
|
||||
giftList.pollFirst();
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
@@ -1239,30 +1370,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 +1398,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 +1425,30 @@ 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;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public RoomWidget findWidget(@NonNull String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class GiftBroadcastObserver implements Observer<BroadcastMessage> {
|
||||
private WeakReference<AVRoomActivity> mReference;
|
||||
|
||||
@@ -1316,24 +1462,64 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
String contentStr = broadcastMessage.getContent();
|
||||
Logger.i(ResUtil.getString(R.string.avroom_activity_avroomactivity_014) + contentStr);
|
||||
if (TextUtils.isEmpty(contentStr)) return;
|
||||
AVRoomActivity activity = mReference.get();
|
||||
if (activity == null) return;
|
||||
if (activity.isValid()) {
|
||||
JSONObject jsonObject;
|
||||
try {
|
||||
jsonObject = JSON.parseObject(contentStr);
|
||||
} catch (Exception e) {
|
||||
jsonObject = null;
|
||||
}
|
||||
if (jsonObject == null) return;
|
||||
if (jsonObject.containsKey("body")) {
|
||||
String body = jsonObject.getString("body");
|
||||
if (TextUtils.isEmpty(body)) return;
|
||||
activity.onReceivedGiftBroadcastMessage(body);
|
||||
try {
|
||||
AVRoomActivity activity = mReference.get();
|
||||
if (activity == null) return;
|
||||
if (activity.isValid()) {
|
||||
JSONObject jsonObject;
|
||||
try {
|
||||
jsonObject = JSON.parseObject(contentStr);
|
||||
} catch (Exception e) {
|
||||
jsonObject = null;
|
||||
}
|
||||
if (jsonObject == null) return;
|
||||
if (jsonObject.containsKey("body")) {
|
||||
String body = jsonObject.getString("body");
|
||||
if (TextUtils.isEmpty(body)) return;
|
||||
activity.onReceivedGiftBroadcastMessage(body);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -21,6 +21,7 @@ import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleResourceType;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomOnlineUserBean;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
@@ -107,10 +108,11 @@ public class RoomInviteActivity extends BaseMvpActivity<IRoomInviteView, RoomInv
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageSuccess(List<OnlineChatMember> memberList, int page) {
|
||||
public void onRequestRoomOnlineListSuccess(List<RoomOnlineUserBean> list) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageFail(String errorStr, int page) {
|
||||
mPage = page;
|
||||
|
@@ -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) {
|
||||
@@ -527,7 +527,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
/**
|
||||
* 主席位特有
|
||||
*/
|
||||
FrameLayout frTitle;
|
||||
View frTitle;
|
||||
TextView tvRoomDesc;
|
||||
ImageView ivTag;
|
||||
TextView tvLabelLeaveMode;
|
||||
|
@@ -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) {
|
||||
|
@@ -12,27 +12,20 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.netease.nim.uikit.impl.cache.NimUserInfoCache;
|
||||
import com.netease.nimlib.sdk.RequestCallbackWrapper;
|
||||
import com.netease.nimlib.sdk.uinfo.constant.GenderEnum;
|
||||
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.NobleAvatarView;
|
||||
import com.yizhuan.erban.utils.NamePlateHelper;
|
||||
import com.yizhuan.erban.utils.RegexUtil;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelResourceType;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleResourceType;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomOnlineUserBean;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/**
|
||||
@@ -41,19 +34,17 @@ import io.reactivex.disposables.Disposable;
|
||||
* @author Administrator
|
||||
* @date 2017/12/4
|
||||
*/
|
||||
public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMember, BaseViewHolder> {
|
||||
public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<RoomOnlineUserBean, BaseViewHolder> {
|
||||
|
||||
private boolean mIsHomeParty;
|
||||
private Disposable mDisposable;
|
||||
private Context context;
|
||||
private OnRoomOnlineNumberChangeListener mListener;
|
||||
|
||||
public OnlineUserAdapter(Context context, boolean isHomeParty) {
|
||||
super(null);
|
||||
addItemType(OnlineChatMember.NORMAL, R.layout.list_item_online_user);
|
||||
addItemType(OnlineChatMember.NOBLE, R.layout.list_item_online_user_mystery);
|
||||
addItemType(RoomOnlineUserBean.NORMAL, R.layout.list_item_online_user);
|
||||
addItemType(RoomOnlineUserBean.NOBLE, R.layout.list_item_online_user_mystery);
|
||||
mIsHomeParty = isHomeParty;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,147 +54,76 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(@NonNull BaseViewHolder baseViewHolder, OnlineChatMember onlineChatMember) {
|
||||
if (onlineChatMember != null && onlineChatMember.chatRoomMember != null) {
|
||||
if (onlineChatMember.getItemType() == OnlineChatMember.NORMAL) {
|
||||
setNormalData(baseViewHolder, onlineChatMember);
|
||||
} else {
|
||||
setMysteryData();
|
||||
}
|
||||
protected void convert(@NonNull BaseViewHolder helper, RoomOnlineUserBean item) {
|
||||
if (item.getItemType() == OnlineChatMember.NOBLE) {
|
||||
return;
|
||||
}
|
||||
// 性别
|
||||
final ImageView sexImage = helper.getView(R.id.sex);
|
||||
if (item.getGender() == 1) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (item.getGender() == 2) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
sexImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setMysteryData() {
|
||||
//do nothing
|
||||
}
|
||||
// 昵称
|
||||
helper.setText(R.id.nick, RegexUtil.getPrintableString(item.getNick()));
|
||||
|
||||
private void setNormalData(BaseViewHolder baseViewHolder, OnlineChatMember onlineChatMember) {
|
||||
setSexData(baseViewHolder, onlineChatMember);
|
||||
|
||||
ImageView roomOnlineTag = baseViewHolder.getView(R.id.room_online_tag);
|
||||
ImageView managerLogo = baseViewHolder.getView(R.id.manager_logo);
|
||||
roomOnlineTag.setVisibility(onlineChatMember.isOnMic ? View.VISIBLE : View.GONE);
|
||||
managerLogo.setVisibility((onlineChatMember.isAdmin || onlineChatMember.isRoomOwer)
|
||||
? View.VISIBLE : View.GONE);
|
||||
managerLogo.setImageResource(onlineChatMember.isAdmin ? R.drawable.icon_admin_logo
|
||||
: R.drawable.icon_user_list_room_ownner);
|
||||
|
||||
baseViewHolder.setText(R.id.nick, RegexUtil.getPrintableString(onlineChatMember.chatRoomMember.getNick()));
|
||||
|
||||
NobleAvatarView nobleAvatarView = baseViewHolder.getView(R.id.noble_avatar_view);
|
||||
// 头像
|
||||
NobleAvatarView nobleAvatarView = helper.getView(R.id.noble_avatar_view);
|
||||
nobleAvatarView.setSize(37, 54, 0);
|
||||
nobleAvatarView.setData(onlineChatMember.chatRoomMember);
|
||||
nobleAvatarView.setData(item);
|
||||
|
||||
// 官字
|
||||
baseViewHolder.getView(R.id.iv_user_official).setVisibility(onlineChatMember.isOfficial() ? View.VISIBLE : View.GONE);
|
||||
helper.getView(R.id.iv_user_official).setVisibility(item.isOfficial() ? View.VISIBLE : View.GONE);
|
||||
|
||||
// 管理
|
||||
ImageView ivManager = helper.getView(R.id.manager_logo);
|
||||
if (item.getMemberType() != null && item.getMemberType().equals("MANAGER")) {
|
||||
ivManager.setVisibility(View.VISIBLE);
|
||||
ivManager.setImageResource(R.drawable.icon_admin_logo);
|
||||
} else if (item.getMemberType() != null && item.getMemberType().equals("CREATOR")) {
|
||||
ivManager.setVisibility(View.VISIBLE);
|
||||
ivManager.setImageResource(R.drawable.icon_user_list_room_ownner);
|
||||
} else {
|
||||
ivManager.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 在麦
|
||||
ImageView ivMic = helper.getView(R.id.room_online_tag);
|
||||
ivMic.setVisibility(item.isInMic() ? View.VISIBLE : View.GONE);
|
||||
|
||||
|
||||
//等级
|
||||
UserLevelVo levelVo = item.getUserLevelVo();
|
||||
String experLevelUrl = null;
|
||||
String charmLevelUrl = null;
|
||||
if (levelVo != null) {
|
||||
experLevelUrl = levelVo.getExperUrl();
|
||||
charmLevelUrl = levelVo.getCharmUrl();
|
||||
}
|
||||
//经验等级
|
||||
AppCompatImageView ivUserExper = baseViewHolder.getView(R.id.iv_user_exper);
|
||||
String experLevelUrl = NobleUtil.getLevel(UserLevelResourceType.EXPER_URL, onlineChatMember.chatRoomMember);
|
||||
AppCompatImageView ivUserExper = helper.getView(R.id.iv_user_exper);
|
||||
boolean isExperLevelUrlEmpty = TextUtils.isEmpty(experLevelUrl);
|
||||
ivUserExper.setVisibility(!isExperLevelUrlEmpty ? View.VISIBLE : View.GONE);
|
||||
if (!isExperLevelUrlEmpty) {
|
||||
ImageLoadUtils.loadImage(mContext, experLevelUrl, ivUserExper);
|
||||
}
|
||||
//魅力等级
|
||||
AppCompatImageView ivUserCharm = baseViewHolder.getView(R.id.iv_user_charm);
|
||||
String charmLevelUrl = NobleUtil.getLevel(UserLevelResourceType.CHARM_URL, onlineChatMember.chatRoomMember);
|
||||
AppCompatImageView ivUserCharm = helper.getView(R.id.iv_user_charm);
|
||||
boolean isCharmLevelUrlEmpty = TextUtils.isEmpty(charmLevelUrl);
|
||||
ivUserCharm.setVisibility(!isCharmLevelUrlEmpty ? View.VISIBLE : View.GONE);
|
||||
if (!isCharmLevelUrlEmpty) {
|
||||
ImageLoadUtils.loadImage(mContext, charmLevelUrl, ivUserCharm);
|
||||
}
|
||||
|
||||
// 官方主播铭牌标识
|
||||
String fixWord = NobleUtil.getLevel(UserInfo.OAC_NAME, onlineChatMember.chatRoomMember);
|
||||
String iconPic = NobleUtil.getLevel(UserInfo.OAC_ICON, onlineChatMember.chatRoomMember);
|
||||
View inOfficialMask = baseViewHolder.getView(R.id.in_official_mask);
|
||||
if (!TextUtils.isEmpty(fixWord) && !TextUtils.isEmpty(iconPic)) {
|
||||
inOfficialMask.setVisibility(View.VISIBLE);
|
||||
TextView tvOfficialMask = inOfficialMask.findViewById(R.id.tv_official_mask);
|
||||
if (tvOfficialMask != null) {
|
||||
tvOfficialMask.setText(fixWord);
|
||||
}
|
||||
|
||||
ImageView ivOfficialMask = inOfficialMask.findViewById(R.id.iv_official_mask);
|
||||
if (ivOfficialMask != null) {
|
||||
ImageLoadUtils.loadImage(mContext, iconPic, ivOfficialMask);
|
||||
}
|
||||
|
||||
} else {
|
||||
inOfficialMask.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 铭牌
|
||||
String namePlateWord = NobleUtil.getLevel(UserInfo.NAMEPLATE_WORD, onlineChatMember.chatRoomMember);
|
||||
String namePlatePic = NobleUtil.getLevel(UserInfo.NAMEPLATE_PIC, onlineChatMember.chatRoomMember);
|
||||
View inNamePlate = baseViewHolder.getView(R.id.in_nameplate);
|
||||
if (!TextUtils.isEmpty(namePlateWord) && !TextUtils.isEmpty(namePlatePic)) {
|
||||
inNamePlate.setVisibility(View.VISIBLE);
|
||||
TextView tvNamePlate = inNamePlate.findViewById(R.id.tv_official_mask);
|
||||
if (tvNamePlate != null) {
|
||||
tvNamePlate.setText(namePlateWord);
|
||||
}
|
||||
|
||||
ImageView ivNamePlate = inNamePlate.findViewById(R.id.iv_official_mask);
|
||||
if (ivNamePlate != null) {
|
||||
ImageLoadUtils.loadImage(mContext, namePlatePic, ivNamePlate);
|
||||
}
|
||||
|
||||
} else {
|
||||
inNamePlate.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
AppCompatImageView ivUserLevel = baseViewHolder.getView(R.id.iv_noble_level);
|
||||
String resource = (String) NobleUtil.getResource(NobleResourceType.KEY_BADGE, onlineChatMember.chatRoomMember);
|
||||
if (TextUtils.isEmpty(resource)) {
|
||||
ivUserLevel.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
ivUserLevel.setVisibility(View.VISIBLE);
|
||||
NobleUtil.loadResource(resource, ivUserLevel);
|
||||
}
|
||||
|
||||
private void setSexData(BaseViewHolder baseViewHolder, OnlineChatMember onlineChatMember) {
|
||||
final ImageView sexImage = baseViewHolder.getView(R.id.sex);
|
||||
String gender = NobleUtil.getLevel(UserInfo.GENDER, onlineChatMember.chatRoomMember);
|
||||
if ("1".equals(gender)) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if ("2".equals(gender)) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
NimUserInfo nimUserInfo = NimUserInfoCache.getInstance().getUserInfo(onlineChatMember.chatRoomMember.getAccount());
|
||||
if (nimUserInfo == null) {
|
||||
NimUserInfoCache.getInstance().getUserInfoFromRemote(onlineChatMember.chatRoomMember.getAccount(),
|
||||
new RequestCallbackWrapper<NimUserInfo>() {
|
||||
@Override
|
||||
public void onResult(int i, NimUserInfo nimUserInfo, Throwable throwable) {
|
||||
if (nimUserInfo != null) {
|
||||
if (nimUserInfo.getGenderEnum() == GenderEnum.MALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (nimUserInfo.getGenderEnum() == GenderEnum.FEMALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
sexImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (nimUserInfo.getGenderEnum() == GenderEnum.MALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (nimUserInfo.getGenderEnum() == GenderEnum.FEMALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
sexImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
View inNamePlate = helper.getView(R.id.in_nameplate);
|
||||
NamePlateHelper.INSTANCE.load(inNamePlate, inNamePlate.findViewById(R.id.tv_official_mask), inNamePlate.findViewById(R.id.iv_official_mask), item);
|
||||
}
|
||||
|
||||
private void registerRoomEvent() {
|
||||
@@ -240,7 +160,7 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
updateMemberIn(roomEvent);
|
||||
} else if (event == RoomEvent.ROOM_MEMBER_EXIT) {
|
||||
if (mListener != null) {
|
||||
mListener.onMemberExit(roomEvent.getAccount(), mData);
|
||||
mListener.onMemberExit(roomEvent.getAccount());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -248,19 +168,19 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
|
||||
private void updateMemberIn(RoomEvent roomEvent) {
|
||||
if (mListener != null) {
|
||||
mListener.onMemberIn(roomEvent.getAccount(), mData);
|
||||
mListener.onMemberIn(roomEvent.getAccount());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateManager(RoomEvent roomEvent) {
|
||||
if (mListener != null)
|
||||
mListener.onUpdateMemberManager(roomEvent.getAccount(),
|
||||
roomEvent.getEvent() == RoomEvent.ROOM_MANAGER_REMOVE, mData);
|
||||
roomEvent.getEvent() == RoomEvent.ROOM_MANAGER_REMOVE);
|
||||
}
|
||||
|
||||
private void updateDownUpMic(String account, boolean isUpMic) {
|
||||
if (mListener != null) {
|
||||
mListener.onMemberDownUpMic(account, isUpMic, mData);
|
||||
mListener.onMemberDownUpMic(account, isUpMic);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,34 +201,29 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
*
|
||||
* @param account
|
||||
*/
|
||||
void onMemberIn(String account, List<OnlineChatMember> dataList);
|
||||
void onMemberIn(String account);
|
||||
|
||||
/**
|
||||
* 成员出去回调
|
||||
*
|
||||
* @param account
|
||||
* @param dataList
|
||||
*/
|
||||
void onMemberExit(String account, List<OnlineChatMember> dataList);
|
||||
void onMemberExit(String account);
|
||||
|
||||
/**
|
||||
* 成员上下麦更新
|
||||
*
|
||||
* @param account
|
||||
* @param isUpMic
|
||||
* @param dataList
|
||||
*/
|
||||
void onMemberDownUpMic(String account, boolean isUpMic,
|
||||
List<OnlineChatMember> dataList);
|
||||
void onMemberDownUpMic(String account, boolean isUpMic);
|
||||
|
||||
/**
|
||||
* 设置管理员回调
|
||||
*
|
||||
* @param account
|
||||
* @param dataList
|
||||
*/
|
||||
void onUpdateMemberManager(String account, boolean isRemoveManager,
|
||||
List<OnlineChatMember> dataList);
|
||||
void onUpdateMemberManager(String account, boolean isRemoveManager);
|
||||
|
||||
void addMemberBlack();
|
||||
}
|
||||
|
@@ -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,40 @@
|
||||
package com.yizhuan.erban.avroom.banner
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.core.util.Consumer
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapter
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon
|
||||
|
||||
class RoomBannerAdapter(private val mContext: Context, private val data: List<RoomIcon>) :
|
||||
StaticPagerAdapter() {
|
||||
|
||||
var onItemClickListener: Consumer<RoomIcon>? = null
|
||||
|
||||
override fun getView(container: ViewGroup, position: Int): View {
|
||||
val view = LayoutInflater.from(mContext).inflate(R.layout.item_room_act, container, false)
|
||||
val ivCover = view.findViewById<ImageView>(R.id.iv_cover)
|
||||
val bannerInfo = data[position]
|
||||
val actId = bannerInfo.id?.toString()
|
||||
ivCover.scaleType = ImageView.ScaleType.CENTER_CROP
|
||||
ImageLoadUtils.loadImage(
|
||||
mContext,
|
||||
bannerInfo.icon,
|
||||
ivCover,
|
||||
R.drawable.default_cover
|
||||
)
|
||||
ivCover.setOnClickListener { v: View? ->
|
||||
onItemClickListener?.accept(bannerInfo)
|
||||
}
|
||||
return view
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return data.size
|
||||
}
|
||||
}
|
@@ -0,0 +1,194 @@
|
||||
package com.yizhuan.erban.avroom.banner
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog
|
||||
import com.yizhuan.erban.databinding.RoomBannerWidgetBinding
|
||||
import com.yizhuan.erban.shipantics.PullRadishActivity
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.treasurefairy.HomeFairyActivity
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.erban.ui.webview.room_banner.RoomBannerWebDialogActivity
|
||||
import com.yizhuan.erban.ui.webview.room_banner.RoomWebDialogActivity
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.Util
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView
|
||||
import com.yizhuan.erban.utils.CommonJumpHelper
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.support.room.FrameLayoutRoomWidget
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView
|
||||
import okhttp3.internal.filterList
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/20 10:42
|
||||
* Desc:玩法活动
|
||||
**/
|
||||
class RoomBannerWidget : FrameLayoutRoomWidget {
|
||||
private val binding: RoomBannerWidgetBinding =
|
||||
DataBindingUtil.inflate(
|
||||
LayoutInflater.from(
|
||||
context
|
||||
), R.layout.room_banner_widget, this, true
|
||||
)
|
||||
|
||||
|
||||
private var indicatorVisible = false
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
init {
|
||||
setIndicatorEnabled(true)
|
||||
}
|
||||
|
||||
override fun onInitialize(roomView: RoomView, roomContext: RoomContext) {
|
||||
super.onInitialize(roomView, roomContext)
|
||||
refreshData()
|
||||
}
|
||||
|
||||
fun disabledIndicator() {
|
||||
setIndicatorEnabled(false)
|
||||
}
|
||||
|
||||
fun refreshData() {
|
||||
if (RoomContext.get()?.getRoomInfo()?.type == RoomInfo.ROOMTYPE_GAME) {
|
||||
refreshData(true)
|
||||
} else {
|
||||
refreshData(false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun refreshData(isGameRoom: Boolean) {
|
||||
val disposable = if (isGameRoom) {
|
||||
AvRoomModel.get().gameRoomBannerList
|
||||
} else {
|
||||
AvRoomModel.get().roomBannerList
|
||||
}.subscribe { list: List<RoomIcon> ->
|
||||
loadData(list)
|
||||
}
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
private fun loadData(list: List<RoomIcon>?) {
|
||||
if (list.isNullOrEmpty()) {
|
||||
this.isVisible = false
|
||||
return
|
||||
}
|
||||
this.isVisible = true
|
||||
// 只有一個圖標,隱藏底部指示器
|
||||
indicatorVisible = list.size > 1
|
||||
|
||||
val bannerAdapter = RoomBannerAdapter(context, list)
|
||||
bannerAdapter.onItemClickListener = androidx.core.util.Consumer<RoomIcon> {
|
||||
if (it.isSeizeTreasure()) {
|
||||
HomeFairyActivity.start(context)
|
||||
} else if (it.isFirstCharge()) {
|
||||
FirstChargeDialog.start(context)
|
||||
} else if (it.isFindLove()) {
|
||||
GoldBoxHelper.handleBoxClick(context)
|
||||
} else if (it.isNauticalAdventure()) {
|
||||
PullRadishActivity.start(context)
|
||||
} else {
|
||||
AvRoomModel.get().activityClickLog("2", it.id?.toString()).subscribe()
|
||||
|
||||
if (it.skipType == 3) {
|
||||
if (it.tag == RoomIcon.TAG_GAMEPLAY) {
|
||||
if (it.showType == 2) {
|
||||
RoomWebDialogActivity.start(context, it.skipContent ?: "", false)
|
||||
} else {
|
||||
CommonWebViewActivity.start(context, it.skipContent ?: "")
|
||||
}
|
||||
} else {
|
||||
val newList = list.filterList {
|
||||
skipType == 3 && tag != RoomIcon.TAG_GAMEPLAY
|
||||
}
|
||||
val newPosition = newList.indexOfFirst { item ->
|
||||
item == it
|
||||
}
|
||||
RoomBannerWebDialogActivity.start(context, newPosition, newList)
|
||||
}
|
||||
} else {
|
||||
CommonJumpHelper.bannerJump(context, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.pagerView.adapter = bannerAdapter
|
||||
binding.pagerView.setPlayDelay(3000)
|
||||
//設置透明度
|
||||
binding.pagerView.setAnimationDurtion(500)
|
||||
bannerAdapter.notifyDataSetChanged()
|
||||
|
||||
val viewPager = binding.pagerView.viewPager
|
||||
viewPager.offscreenPageLimit = list.size
|
||||
}
|
||||
|
||||
private fun setIndicatorEnabled(isEnabled: Boolean) {
|
||||
// 模擬指示器在viewpager底部效果
|
||||
val viewPager = binding.pagerView.viewPager
|
||||
val layoutParams = viewPager.layoutParams as RelativeLayout.LayoutParams
|
||||
if (isEnabled) {
|
||||
layoutParams.setMargins(0, 0, 0, Util.dip2px(context, 7f))
|
||||
binding.pagerView.setHintView(object : ColorPointHintView(
|
||||
context, Color.WHITE, ContextCompat.getColor(
|
||||
context,
|
||||
R.color.color_66FFFFFF
|
||||
)
|
||||
) {
|
||||
override fun makeFocusDrawable(): Drawable? {
|
||||
val dotFocus = GradientDrawable()
|
||||
dotFocus.setColor(Color.WHITE)
|
||||
dotFocus.cornerRadius = Util.dip2px(
|
||||
context, 2f
|
||||
).toFloat()
|
||||
dotFocus.setSize(
|
||||
Util.dip2px(context, 9f), Util.dip2px(
|
||||
context, 4f
|
||||
)
|
||||
)
|
||||
return if (indicatorVisible) dotFocus else null
|
||||
}
|
||||
|
||||
override fun makeNormalDrawable(): Drawable? {
|
||||
val dotNormal = GradientDrawable()
|
||||
dotNormal.setColor(ContextCompat.getColor(context, R.color.color_66FFFFFF))
|
||||
dotNormal.cornerRadius = Util.dip2px(
|
||||
context, 2f
|
||||
).toFloat()
|
||||
dotNormal.setSize(
|
||||
Util.dip2px(context, 4f), Util.dip2px(
|
||||
context, 4f
|
||||
)
|
||||
)
|
||||
return if (indicatorVisible) dotNormal else null
|
||||
}
|
||||
})
|
||||
} else {
|
||||
layoutParams.setMargins(0, 0, 0, 0)
|
||||
binding.pagerView.setHintView(null)
|
||||
}
|
||||
viewPager.layoutParams = layoutParams
|
||||
}
|
||||
}
|
@@ -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 {
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -419,7 +428,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
superAdminModel.roomOperate(SuperAdminModel.CLOSE_PUBLIC_SCREEN).subscribe();
|
||||
}
|
||||
AvRoomModel.get().closeScreen(roomInfo.getRoomId(),
|
||||
!isCloseScreen)
|
||||
!isCloseScreen)
|
||||
.compose(RxHelper.bindContext(context))
|
||||
.flatMap(data -> IMNetEaseManager.get().closeOpenScreen(
|
||||
data.getRoomId(), data))
|
||||
@@ -639,7 +648,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
}
|
||||
optAdapter.addData(new OptAction(R.drawable.icon_room_shield_report,
|
||||
ResUtil.getString(R.string.me_shield_report),
|
||||
() ->{
|
||||
() -> {
|
||||
DialogManager dialogManager = new DialogManager(context);
|
||||
List<ButtonItem> buttonItems = new ArrayList<>();
|
||||
ButtonItem buttonItem1 = new ButtonItem(ResUtil.getString(R.string.me_shield_room), () -> {
|
||||
|
@@ -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()
|
||||
},
|
||||
|