Compare commits
81 Commits
peko_relea
...
develop_re
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e29884b40e | ||
![]() |
b4e700397f | ||
![]() |
1d7740e593 | ||
![]() |
5540d6c6bc | ||
![]() |
5c1da135aa | ||
![]() |
37bb28af69 | ||
![]() |
acbecf1b51 | ||
![]() |
463d9ec4b4 | ||
![]() |
f4811c9fe5 | ||
![]() |
5ceb15f807 | ||
![]() |
f7edaffd44 | ||
![]() |
8bd9f91892 | ||
![]() |
acfb446eb0 | ||
![]() |
4daf77adb8 | ||
![]() |
426bea9ac5 | ||
![]() |
7cf8865727 | ||
![]() |
c997896a9b | ||
![]() |
043b79553e | ||
![]() |
2d002958cd | ||
![]() |
be75ae855a | ||
![]() |
e30784cfc9 | ||
![]() |
ebe6ee2918 | ||
![]() |
c74873c837 | ||
![]() |
9b88c65f9c | ||
![]() |
7679937945 | ||
![]() |
4fd2afe8e0 | ||
![]() |
7f6e82c7a8 | ||
![]() |
615089d1e1 | ||
![]() |
47b38458df | ||
![]() |
91be03ea07 | ||
![]() |
f7a500770a | ||
![]() |
d82bb55c4e | ||
![]() |
dc1383be70 | ||
![]() |
368ed2bf70 | ||
![]() |
d595ed469e | ||
![]() |
792ad5141c | ||
![]() |
de6a4fe524 | ||
![]() |
d0cb9e43b1 | ||
![]() |
ef8d9b0b6f | ||
![]() |
e781369be1 | ||
![]() |
3bd13e732a | ||
![]() |
67babbaebd | ||
![]() |
c392b20f21 | ||
![]() |
0a1ae82d42 | ||
![]() |
6dc63e1d26 | ||
![]() |
2dcbcf7179 | ||
![]() |
bcd6faf213 | ||
![]() |
072c837c99 | ||
![]() |
067f97d6be | ||
![]() |
15b317d5d0 | ||
![]() |
16712197e3 | ||
![]() |
24ccadc593 | ||
![]() |
88767208bd | ||
![]() |
91bb8f7871 | ||
![]() |
dedb075c56 | ||
![]() |
1b1f477494 | ||
![]() |
9a015aff0b | ||
![]() |
9500554550 | ||
![]() |
23e05ccab1 | ||
![]() |
0417e53b85 | ||
![]() |
df96cfe5d4 | ||
![]() |
213efcba31 | ||
![]() |
9e36225b77 | ||
![]() |
da3d72ebff | ||
![]() |
fd3dc7cb3c | ||
![]() |
eebe231a45 | ||
![]() |
276f2002f9 | ||
![]() |
2942e2f0bb | ||
![]() |
406077b43b | ||
![]() |
55a8d037e0 | ||
![]() |
ba58b0bd40 | ||
![]() |
151b1c37d0 | ||
![]() |
4a7af141aa | ||
![]() |
cec6e00e09 | ||
![]() |
bf6ef26eca | ||
![]() |
07845b5e60 | ||
![]() |
097ead1327 | ||
![]() |
2b45d35d40 | ||
![]() |
e6f4b40e66 | ||
![]() |
c46f19f03f | ||
![]() |
37196025cc |
0
aab-res-guard-mapping.txt
Normal file
0
aab-res-guard-mapping.txt
Normal file
0
app/aab-res-guard-mapping.txt
Normal file
0
app/aab-res-guard-mapping.txt
Normal file
172
app/build.gradle
172
app/build.gradle
@@ -4,14 +4,15 @@ apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'com.tencent.vasdolly'
|
||||
apply from: '../mob.gradle'
|
||||
|
||||
apply plugin: "com.bytedance.android.aabResGuard"
|
||||
apply plugin: "xml-class-guard"
|
||||
def onlyArm64 = Boolean.parseBoolean(only_arm64)
|
||||
|
||||
android {
|
||||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.vele.pekolive"
|
||||
applicationId "app.repo.cam"
|
||||
minSdkVersion MIN_SDK_VERSION.toInteger()
|
||||
targetSdkVersion TARGET_SDK_VERSION.toInteger()
|
||||
versionCode Integer.valueOf(version_code)
|
||||
@@ -60,7 +61,7 @@ android {
|
||||
if (abi == null) {
|
||||
abi = "universal"
|
||||
}
|
||||
outputFileName = "piko_${buildType.name}_v${defaultConfig.versionName}_${abi}_${date}.apk"
|
||||
outputFileName = "repo_${buildType.name}_v${defaultConfig.versionName}_${abi}_${date}.apk"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,23 +82,13 @@ android {
|
||||
signingConfigs {
|
||||
|
||||
v2 {
|
||||
storeFile file('../pekolive.jks')
|
||||
storePassword "peko2023"
|
||||
keyAlias "pekolive"
|
||||
keyPassword "peko2023"
|
||||
storeFile file('../repo.jks')
|
||||
storePassword "repo2023"
|
||||
keyAlias "repo"
|
||||
keyPassword "repo2023"
|
||||
v2SigningEnabled true
|
||||
v1SigningEnabled true
|
||||
}
|
||||
|
||||
v1 {
|
||||
storeFile file('../pekolive.jks')
|
||||
storePassword "peko2023"
|
||||
keyAlias "pekolive"
|
||||
keyPassword "peko2023"
|
||||
v2SigningEnabled false
|
||||
v1SigningEnabled true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@@ -148,7 +139,7 @@ android {
|
||||
|
||||
buildTypes {
|
||||
def server_url_debug = '"http://beta.api.pekolive.com/"'
|
||||
def server_url_release = '"https://api.pekolive.com/"'
|
||||
def server_url_release = '"https://api.repo.cam/"'
|
||||
|
||||
debug {
|
||||
println("minifyEnabled = " + minify_enabled)
|
||||
@@ -275,7 +266,7 @@ dependencies {
|
||||
|
||||
implementation 'com.github.fodroid:XRadioGroup:v1.5'
|
||||
|
||||
api 'com.tencent.vasdolly:helper:3.0.3'
|
||||
api 'com.tencent.vasdolly:helper:3.0.6'
|
||||
implementation "io.github.tencent:vap:2.0.24"
|
||||
|
||||
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
|
||||
@@ -303,6 +294,7 @@ dependencies {
|
||||
implementation 'com.contrarywind:wheelview:4.1.0'
|
||||
|
||||
implementation 'tech.sud.mgp:SudMGP-static:1.3.3.1158'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
}
|
||||
|
||||
channel {
|
||||
@@ -310,7 +302,7 @@ channel {
|
||||
outputDir = new File(project.buildDir, "channelapk")
|
||||
//多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime}
|
||||
def only64 = onlyArm64 ? "-only64" : ""
|
||||
apkNameFormat = 'piko-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
|
||||
apkNameFormat = 'repo-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
|
||||
//快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
|
||||
fastMode = false
|
||||
//buildTime的时间格式,默认格式:yyyyMMdd-HHmmss
|
||||
@@ -318,3 +310,143 @@ channel {
|
||||
//低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式
|
||||
lowMemory = false
|
||||
}
|
||||
|
||||
aabResGuard {
|
||||
mappingFile = file("aab-res-guard-mapping.txt").toPath() // Mapping file used for incremental obfuscation
|
||||
whiteList = [ // White list rules
|
||||
"*.R.raw.*",
|
||||
"*.R.drawable.icon",
|
||||
//谷歌服务
|
||||
"*.R.string.default_web_client_id",
|
||||
"*.R.string.firebase_database_url",
|
||||
"*.R.string.gcm_defaultSenderId",
|
||||
"*.R.string.google_api_key",
|
||||
"*.R.string.google_app_id",
|
||||
"*.R.string.google_crash_reporting_api_key",
|
||||
"*.R.string.google_storage_bucket",
|
||||
"*.R.string.project_id",
|
||||
//所有涉及到 getResources().getIdentifier 对应的资源ID
|
||||
"*.R.array.a1",
|
||||
"*.R.string.s1",
|
||||
"*.R.mipmap.m1",
|
||||
"*.R.dimen.d1",
|
||||
"*.R.integer.int1",
|
||||
//Firebase Crashlytics
|
||||
"*.R.string.com.crashlytics.*",
|
||||
"*.R.bool.com.crashlytics.useFirebaseAppId",
|
||||
"*.R.string.com.crashlytics.useFirebaseAppId",
|
||||
"*.R.bool.com.crashlytics.CollectDeviceIdentifiers",
|
||||
"*.R.string.com.crashlytics.CollectDeviceIdentifiers",
|
||||
"*.R.bool.com.crashlytics.CollectUserIdentifiers",
|
||||
"*.R.string.com.crashlytics.CollectUserIdentifiers",
|
||||
"*.R.string.com.crashlytics.ApiEndpoint",
|
||||
"*.R.string.io.fabric.android.build_id",
|
||||
"*.R.string.com.crashlytics.android.build_id",
|
||||
"*.R.bool.com.crashlytics.RequireBuildId",
|
||||
"*.R.string.com.crashlytics.RequireBuildId",
|
||||
"*.R.bool.com.crashlytics.CollectCustomLogs",
|
||||
"*.R.string.com.crashlytics.CollectCustomLogs",
|
||||
"*.R.bool.com.crashlytics.Trace",
|
||||
"*.R.string.com.crashlytics.Trace",
|
||||
"*.R.string.com.crashlytics.CollectCustomKeys",
|
||||
"*.R.string.com.google.firebase.crashlytics.mapping_file_id",
|
||||
"*.R.string.com.google.firebase.crashlytics.unity_version"
|
||||
]
|
||||
obfuscatedBundleFileName = "duplicated-app.aab" // Obfuscated file name, must end with '.aab'
|
||||
mergeDuplicatedRes = true // Whether to allow the merge of duplicate resources
|
||||
enableFilterFiles = false // Whether to allow filter files
|
||||
filterList = [ // file filter rules
|
||||
// "*/arm64-v8a/*",
|
||||
// "META-INF/*"
|
||||
]
|
||||
|
||||
enableFilterStrings = false // switch of filter strings
|
||||
unusedStringPath = file("unused.txt").toPath() // strings will be filtered in this file
|
||||
languageWhiteList = ["en", "zh"] // keep en,en-xx,zh,zh-xx etc. remove others.
|
||||
}
|
||||
|
||||
//以下均为非必须
|
||||
xmlClassGuard {
|
||||
findAabConstraintReferencedIds = true
|
||||
//用于增量混淆的 mapping 文件
|
||||
mappingFile = file("xml-class-mapping.txt")
|
||||
//更改manifest文件的package属性,即包名
|
||||
packageChange = ["com.yizhuan.erban": "com.c.r"]
|
||||
moveDir = [
|
||||
"com.zhihu.matisse.internal.entity" : "fddbcec",
|
||||
"com.yizhuan.xchat_android_library.easyphoto.models.album.entity" : "dafefbfcbdbe",
|
||||
"com.chuhai.utils" : "cbeccaebfacee",
|
||||
"com.yizhuan.xchat_android_library.utils" : "afeaaebba",
|
||||
"com.yizhuan.erban.base" : "cceceecedec",
|
||||
"com.yizhuan.xchat_android_library.common.base" : "efdbbabccaaf",
|
||||
"com.yizhuan.erban.public_chat_hall.msg" : "cbfce",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.adapter" : "dddeefacdcbfcbd",
|
||||
"com.yizhuan.erban.ui.list" : "ffbbbeedfdddd",
|
||||
"com.yizhuan.xchat_android_library.list" : "efcebcafccfff",
|
||||
"com.yizhuan.erban.ui.im.avtivity" : "fbabadeadfbeab",
|
||||
"com.netease.nim.uikit.business.session.activity" : "fbfacfcef",
|
||||
"com.yizhuan.erban.common.util" : "dfffbcadbaecffd",
|
||||
"com.netease.nim.uikit.common.util.media" : "bdbeeecbddacffef",
|
||||
"com.netease.nim.uikit.common.media.picker.util" : "dcfdaddda",
|
||||
"com.yizhuan.xchat_android_core.utils" : "eebaabdaacfdc",
|
||||
"com.yizhuan.xchat_android_library.easyphoto.utils.bitmap" : "cafbbeeaccf",
|
||||
"com.yizhuan.xchat_android_library.net.rxnet.manager" : "edeaeebedbddd",
|
||||
"com.yizhuan.xchat_android_library.utils.cache" : "fafcafaecadbbab",
|
||||
"com.yizhuan.erban.ui.pay" : "fdafbddcdeceeed",
|
||||
"com.yizhuan.erban.pay.adapter" : "bcaacecbabacecdfb",
|
||||
"com.yizhuan.erban.public_chat_hall.msg.viewholder" : "bedbdbf",
|
||||
"com.netease.nim.uikit.business.chatroom.viewholder" : "aadeeeeda",
|
||||
"com.yizhuan.erban.common.widget" : "aeccddabefcaaad",
|
||||
"com.netease.nim.uikit.common.ui.imageview" : "baaabaffdafcee",
|
||||
"com.soundcloud.android.crop" : "dcdfeaddbddfdbff",
|
||||
"com.netease.nim.uikit.common.media.picker.activity" : "feaccce",
|
||||
"com.yizhuan.erban.common.permission" : "bbbebcbdfbaadba",
|
||||
"com.yizhuan.xchat_android_library.easypermisssion" : "dbcdcbabdfdefd",
|
||||
"com.yizhuan.erban.module" : "ffccffc",
|
||||
"com.netease.nim.uikit.business.session.constant" : "bebcdeebec",
|
||||
"com.netease.nim.uikit.common.util.log.sdk.util" : "beebacccee",
|
||||
"com.yizhuan.erban.ui.utils" : "bceafa",
|
||||
"com.yizhuan.erban.ui.gift.util" : "aaaaffcaec",
|
||||
"com.zhihu.matisse.engine.impl" : "eaedaafed",
|
||||
"com.yizhuan.xchat_android_library.common.glide" : "ddcefebecddfacade",
|
||||
"com.yizhuan.erban.friend" : "bffeaceaaed",
|
||||
"com.yizhuan.erban.share" : "baadcaabfdcfdef",
|
||||
"com.yizhuan.treasure_box.model" : "ffbefbdaaca",
|
||||
"com.yizhuan.xchat_android_core.radish" : "cbaaafeb",
|
||||
"com.yizhuan.xchat_android_library.easyphoto.engine" : "aeeebbccbfde",
|
||||
"com.yizhuan.xchat_android_core.module_hall.income.bean" : "eaeebbdabcce",
|
||||
"com.yizhuan.xchat_android_core.bills.bean" : "fcafacceabd",
|
||||
"com.jph.takephoto.uitl" : "babbcdefdca",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.loadmore" : "fbafabef",
|
||||
"com.yizhuan.erban.ui.widget" : "accfffcddadfeefffafad",
|
||||
"com.yizhuan.xchat_android_library.easyphoto.ui.dialog" : "dcbfaeffceafafade",
|
||||
"com.yizhuan.erban.common.widget.dialog" : "aeedfefafd",
|
||||
"com.yizhuan.erban.ui.im.fragment" : "eeceacedadfffff",
|
||||
"com.netease.nim.uikit.business.session.fragment" : "facbafcfbefdcfccb",
|
||||
"com.netease.nim.uikit.business.session.module.list" : "ffdfafebdbdaea",
|
||||
"com.yizhuan.erban.ui.im.chat" : "aafeeecfaa",
|
||||
"com.netease.nim.uikit.business.session.viewholder" : "dfafaeecf",
|
||||
"com.yizhuan.erban.base.list" : "cecbbffbab",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.entity" : "accaacebcfc",
|
||||
"com.yizhuan.erban.ui.widget.password" : "ddefafca",
|
||||
"com.yizhuan.erban.pay.interfaces" : "fafeddcdbeaa",
|
||||
"com.yizhuan.erban.community.photo" : "daaccefbafac",
|
||||
"com.yizhuan.erban.ui.user.adapter" : "aabafbccfaf",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.holder" : "bbeaabadfdfeee",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.util" : "bddceccecb",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.listener" : "bafbafebdffacbdafe",
|
||||
"com.yizhuan.erban.ui.widget.recyclerview.decoration" : "cddeddddd",
|
||||
"com.netease.nim.uikit.common.ui.recyclerview.decoration" : "aefdcc",
|
||||
"com.yizhuan.tutu.room_chat" : "afeefeddae",
|
||||
"com.yizhuan.erban.bank_card" : "cdfcdafdabcccbfab",
|
||||
"com.yizhuan.tutu.music" : "deebbdbefbbc",
|
||||
"com.yizhuan.erban.team.adapter" : "aaefddefe",
|
||||
"com.netease.nim.uikit.business.team.adapter" : "bfbdeedbcbbc",
|
||||
"com.zhihu.matisse.internal.utils" : "fbdeaebfabae",
|
||||
"com.netease.nim.uikit.impl.preference" : "acacff",
|
||||
"com.netease.nim.uikit.business.preference" : "ccdedacaac",
|
||||
"com.yizhuan.erban.avroom.widget" : "fbaebeeefabde",
|
||||
"com.yizhuan.xchat_android_library.widget" : "aefdcddaaee",
|
||||
]
|
||||
|
||||
}
|
@@ -1,36 +1,26 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "656602722869",
|
||||
"project_id": "pekolive-30f9e",
|
||||
"storage_bucket": "pekolive-30f9e.appspot.com"
|
||||
"project_number": "557443720422",
|
||||
"project_id": "repo-32561",
|
||||
"storage_bucket": "repo-32561.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:656602722869:android:dac206f8aae0ba9021f77c",
|
||||
"mobilesdk_app_id": "1:557443720422:android:d5d1480109b8af15b54727",
|
||||
"android_client_info": {
|
||||
"package_name": "com.vele.pekolive"
|
||||
"package_name": "app.repo.cam"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "656602722869-sss2inirem512et0015kdqjp39mqgn96.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDDoTSpY3wxOefVDVKRmE9cDiT1iv8Ra-4"
|
||||
"current_key": "AIzaSyC2L4szjA4Le5D5_dq0a4PUDxJSCf8XuEI"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "656602722869-sss2inirem512et0015kdqjp39mqgn96.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
185
app/proguard-rules.pro
vendored
185
app/proguard-rules.pro
vendored
@@ -233,10 +233,9 @@
|
||||
|
||||
# TODO 网络加载 一些业务bean gson 时候混淆问题
|
||||
-keep class org.json.** {*;}
|
||||
-dontwarn com.yizhuan.xchat_android_core.**
|
||||
-keep class com.yizhuan.xchat_android_core.** {*;}
|
||||
-keep class com.yizhuan.treasure_box.bean.** {*;}
|
||||
-keep class com.yizhuan.erban.avroom.bean.** {*;}
|
||||
-keep class com.yizhuan.**.bean.** {*;}
|
||||
-keep class com.yizhuan.**.result.** {*;}
|
||||
-keep class com.yizhuan.**.entity.** {*;}
|
||||
|
||||
|
||||
#百度统计
|
||||
@@ -479,4 +478,180 @@
|
||||
}
|
||||
-keep public class com.android.installreferrer.**{ *; }
|
||||
|
||||
-keep public class * extends java.lang.Exception
|
||||
-keep public class * extends java.lang.Exception
|
||||
|
||||
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
||||
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
||||
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
||||
|
||||
|
||||
-keep class b.** { *; }
|
||||
-keep class cc.** { *; }
|
||||
-keep public class * extends b.QQ
|
||||
-keep public class * extends com.yizhuan.xchat_android_library.base.factory.AbstractMvpPresenter
|
||||
-dontwarn com.yizhuan.erban.ui.im.recent.holder.**
|
||||
-keep class com.yizhuan.erban.ui.im.recent.holder.** {*;}
|
||||
-keep class aafeeecfaa.** {*;}
|
||||
-keep class com.yizhuan.erban.luckymoney.viewholder.** {*;}
|
||||
-keep class baadcaabfdcfdef.viewholder.** {*;}
|
||||
-keep class cbfce.viewholder.** {*;}
|
||||
-keep class com.yizhuan.erban.module_hall.im.msgholder.** {*;}
|
||||
-keep class com.yizhuan.tutu.mentoring_relationship.viewholder.** {*;}
|
||||
-dontwarn com.yizhuan.erban.bindadapter.**
|
||||
-keep class com.yizhuan.erban.bindadapter.** {*;}
|
||||
-keep class com.yizhuan.**.bean.** {*;}
|
||||
-keep class com.yizhuan.**.result.** {*;}
|
||||
-keep class com.yizhuan.**.entity.** {*;}
|
||||
-keep class g.GL{*;}
|
||||
-keep class bc.BV{*;}
|
||||
-keep class d.BD {*;}
|
||||
-keep class com.yizhuan.xchat_android_library.easyphoto.models.** { *; }
|
||||
-keep class fn.** { *; }
|
||||
-keep class com.jph.takephoto.** { *; }
|
||||
-dontwarn com.jph.takephoto.**
|
||||
-keep class babbcdefdca.** { *; }
|
||||
-dontwarn babbcdefdca.**
|
||||
-keep class dd.** { *; }
|
||||
-dontwarn dd.**
|
||||
-keep public class * extends bbeaabadfdfeee.RecyclerViewHolder {*;}
|
||||
-keep public class * extends dfafaeecf.MsgViewHolderBase {*;}
|
||||
|
||||
-keep class h.** {*;}
|
||||
-keep class k.** {*;}
|
||||
-keep class w.** {*;}
|
||||
-keep class bb.** {*;}
|
||||
-keep class bd.** {*;}
|
||||
-keep class be.** {*;}
|
||||
-keep class bi.** {*;}
|
||||
-keep class bl.** {*;}
|
||||
-keep class ce.** {*;}
|
||||
-keep class cm.** {*;}
|
||||
-keep class h.J {*;}
|
||||
-keep class h.K {*;}
|
||||
-keep class k.N {*;}
|
||||
-keep class w.BJ {*;}
|
||||
-keep class bb.BU {*;}
|
||||
-keep class bd.BX {*;}
|
||||
-keep class be.BY {*;}
|
||||
-keep class bd.CB {*;}
|
||||
-keep class bi.CF {*;}
|
||||
-keep class be.CG {*;}
|
||||
-keep class bl.CK {*;}
|
||||
-keep class bi.CP {*;}
|
||||
-keep class bb.DG {*;}
|
||||
-keep class bb.DX {*;}
|
||||
-keep class ce.EL {*;}
|
||||
-keep class bi.ES {*;}
|
||||
-keep class bd.FH {*;}
|
||||
-keep class bb.FJ {*;}
|
||||
-keep class cm.FW {*;}
|
||||
-keep class h.UD {*;}
|
||||
-keep class h.UE {*;}
|
||||
-keep class h.UF {*;}
|
||||
-keep class h.UG {*;}
|
||||
-keep class h.UH {*;}
|
||||
-keep class h.UI {*;}
|
||||
-keep class w.VA {*;}
|
||||
-keep class w.VB {*;}
|
||||
-keep class w.VC {*;}
|
||||
-keep class w.VD {*;}
|
||||
-keep class w.VE {*;}
|
||||
-keep class w.VF {*;}
|
||||
-keep class w.VG {*;}
|
||||
-keep class w.VH {*;}
|
||||
-keep class w.VI {*;}
|
||||
-keep class w.VJ {*;}
|
||||
-keep class w.VK {*;}
|
||||
-keep class w.VL {*;}
|
||||
-keep class w.VM {*;}
|
||||
-keep class bb.WY {*;}
|
||||
-keep class bb.WZ {*;}
|
||||
-keep class bb.XA {*;}
|
||||
-keep class bb.XB {*;}
|
||||
-keep class bb.XC {*;}
|
||||
-keep class bb.XD {*;}
|
||||
-keep class bb.XE {*;}
|
||||
-keep class bb.XF {*;}
|
||||
-keep class bb.XG {*;}
|
||||
-keep class bb.XH {*;}
|
||||
-keep class bb.XI {*;}
|
||||
-keep class bb.XJ {*;}
|
||||
-keep class bb.XK {*;}
|
||||
-keep class bb.XL {*;}
|
||||
-keep class bb.XM {*;}
|
||||
-keep class bb.XN {*;}
|
||||
-keep class bb.XO {*;}
|
||||
-keep class bb.XP {*;}
|
||||
-keep class bb.XQ {*;}
|
||||
-keep class bb.XR {*;}
|
||||
-keep class bb.XS {*;}
|
||||
-keep class bb.XT {*;}
|
||||
-keep class bb.XU {*;}
|
||||
-keep class bb.XV {*;}
|
||||
-keep class bb.XW {*;}
|
||||
-keep class bb.XX {*;}
|
||||
-keep class bb.XY {*;}
|
||||
-keep class bd.YC {*;}
|
||||
-keep class bd.YD {*;}
|
||||
-keep class bd.YE {*;}
|
||||
-keep class be.YF {*;}
|
||||
-keep class be.YG {*;}
|
||||
-keep class be.YH {*;}
|
||||
-keep class be.YI {*;}
|
||||
-keep class be.YJ {*;}
|
||||
-keep class be.YK {*;}
|
||||
-keep class be.YL {*;}
|
||||
-keep class be.YM {*;}
|
||||
-keep class be.YN {*;}
|
||||
-keep class bl.ZD {*;}
|
||||
-keep class bl.ZE {*;}
|
||||
-keep class bl.ZF {*;}
|
||||
-keep class bl.ZG {*;}
|
||||
-keep class bl.ZH {*;}
|
||||
-keep class bl.ZI {*;}
|
||||
-keep class bl.ZJ {*;}
|
||||
-keep class bl.ZK {*;}
|
||||
-keep class bl.ZL {*;}
|
||||
-keep class bl.ZM {*;}
|
||||
-keep class bl.ZN {*;}
|
||||
-keep class bl.ZO {*;}
|
||||
-keep class bl.ZP {*;}
|
||||
-keep class ce.BDC {*;}
|
||||
-keep class ce.BDD {*;}
|
||||
-keep class ce.BDE {*;}
|
||||
-keep class ce.BDF {*;}
|
||||
-keep class ce.BDG {*;}
|
||||
-keep class ce.BDH {*;}
|
||||
-keep class ce.BDI {*;}
|
||||
-keep class ce.BDJ {*;}
|
||||
-keep class ce.BDK {*;}
|
||||
-keep class ce.BDL {*;}
|
||||
-keep class ce.BDM {*;}
|
||||
-keep class ce.BDN {*;}
|
||||
-keep class ce.BDO {*;}
|
||||
-keep class ce.BDP {*;}
|
||||
-keep class ce.BDQ {*;}
|
||||
-keep class ce.BDR {*;}
|
||||
-keep class ce.BDS {*;}
|
||||
-keep class ce.BDT {*;}
|
||||
-keep class ce.BDU {*;}
|
||||
-keep class ce.BDV {*;}
|
||||
-keep class ce.BDW {*;}
|
||||
-keep class ce.BDX {*;}
|
||||
-keep class ce.BDY {*;}
|
||||
-keep class ce.BDZ {*;}
|
||||
-keep class ce.BEA {*;}
|
||||
-keep class ce.BEB {*;}
|
||||
-keep class ce.BEC {*;}
|
||||
-keep class ce.BED {*;}
|
||||
-keep class ce.BEE {*;}
|
||||
-keep class ce.BEF {*;}
|
||||
-keep class ce.BEG {*;}
|
||||
-keep class ce.BEH {*;}
|
||||
-keep class ce.BEI {*;}
|
||||
-keep class ce.BEJ {*;}
|
||||
-keep class cm.BFD {*;}
|
||||
-keep class cm.BFE {*;}
|
||||
-keep class cm.BFF {*;}
|
||||
-keep class cm.BFG {*;}
|
||||
|
||||
|
@@ -122,7 +122,7 @@
|
||||
|
||||
<data
|
||||
android:host="main"
|
||||
android:scheme="pikoapp" />
|
||||
android:scheme="repoapp" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
如果 SDKOptions 中提供了,取 SDKOptions 中的值。
|
||||
-->
|
||||
<activity
|
||||
android:name="com.vele.pekolive.lineapi.LineAuthenticationCallbackActivity"
|
||||
android:name="app.repo.cam.lineapi.LineAuthenticationCallbackActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:noHistory="true">
|
||||
@@ -222,7 +222,7 @@
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:label="Piko"
|
||||
android:label="Repo"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> <!-- 配置的service和receiver -->
|
||||
|
1
app/src/main/assets/hot_region.json
Normal file
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
1
app/src/main/assets/region.json
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
BIN
app/src/main/assets/svga/room_bg_single.svga
Normal file
BIN
app/src/main/assets/svga/room_bg_single.svga
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
package com.vele.pekolive.lineapi;
|
||||
package app.repo.cam.lineapi;
|
||||
|
||||
import cn.sharesdk.line.LineHandlerActivity;
|
||||
|
@@ -15,7 +15,7 @@ import com.yizhuan.erban.other.activity.SplashActivity;
|
||||
import com.yizhuan.xchat_android_core.linked.LinkedModel;
|
||||
import com.yizhuan.xchat_android_core.linked.bean.LinkedInfo;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.CoreTextUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -49,7 +49,7 @@ public class AgentActivity extends AppCompatActivity implements SceneRestorable
|
||||
if (roomuid != null) {
|
||||
linkedInfo.setRoomUid(roomuid);
|
||||
}
|
||||
if (TextUtils.isEmptyText(roomuid) && uid != null) {
|
||||
if (CoreTextUtils.isEmptyText(roomuid) && uid != null) {
|
||||
linkedInfo.setRoomUid(uid);
|
||||
}
|
||||
if (uid != null) {
|
||||
|
@@ -112,9 +112,10 @@ import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedBindPhoneEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedCompleteInfoEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedVerifyBoundAuthCodeEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.CoreLogger;
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.threadmgr.ThreadPoolManager;
|
||||
@@ -568,7 +569,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
.subscribe(new BeanObserver<Boolean>() {
|
||||
@Override
|
||||
public void onErrorMsg(String error) {
|
||||
com.yizhuan.xchat_android_core.utils.Logger.info("isBoundAuthCode", error);
|
||||
CoreLogger.info("isBoundAuthCode", error);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -820,8 +821,8 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
GameHomeModel.get().getRoomShortcut()
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(uid -> {
|
||||
if (StringUtils.toLong(uid) != 0) {
|
||||
AVRoomActivity.start(context, StringUtils.toLong(uid));
|
||||
if (StringFormatUtils.toLong(uid) != 0) {
|
||||
AVRoomActivity.start(context, StringFormatUtils.toLong(uid));
|
||||
}
|
||||
},
|
||||
Throwable::printStackTrace);
|
||||
|
@@ -108,7 +108,7 @@ public class UIHelper {
|
||||
|
||||
public static void showMonsterResult(Context context, String monsterId) {
|
||||
CommonWebViewActivity.start(context, UriProvider.IM_SERVER_URL +
|
||||
"/peko/modules/monster/index.html?monsterId=" + monsterId);
|
||||
"/repo/modules/monster/index.html?monsterId=" + monsterId);
|
||||
}
|
||||
|
||||
public static void showLabelInfoAct(Activity mActivity, int requestCode) {
|
||||
@@ -132,11 +132,11 @@ public class UIHelper {
|
||||
*/
|
||||
public static void showRecommendPosH5(Context context) {
|
||||
String cardUrl = UriProvider.JAVA_WEB_URL +
|
||||
"/peko/modules/recommend-card/index.html";
|
||||
"/repo/modules/recommend-card/index.html";
|
||||
CommonWebViewActivity.start(context, cardUrl);
|
||||
}
|
||||
|
||||
public static void openContactUs(Context context) {
|
||||
CommonWebViewActivity.start(context, UriProvider.IM_SERVER_URL + "/peko/modules/contact/contact.html");
|
||||
CommonWebViewActivity.start(context, UriProvider.IM_SERVER_URL + "/repo/modules/contact/contact.html");
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.pay.event.NewUserChargeEvent;
|
||||
import com.yizhuan.xchat_android_core.recall.bean.CheckLostUserInfo;
|
||||
import com.yizhuan.xchat_android_core.recall.event.CheckLostUserEvent;
|
||||
import com.yizhuan.xchat_android_core.relation.cp.CpInviteInfo;
|
||||
import com.yizhuan.xchat_android_core.relation.cp.bean.CpInviteInfo;
|
||||
import com.yizhuan.xchat_android_core.upgrade.event.ImPushUpdateAppEvent;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
|
@@ -13,7 +13,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.audio.widget.VoiceLine;
|
||||
import com.yizhuan.xchat_android_core.audio.bean.UserVoiceInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
|
||||
import java.util.List;
|
||||
@@ -105,7 +105,7 @@ public class MyVoiceListAdapter extends BaseQuickAdapter<UserVoiceInfo, BaseView
|
||||
});
|
||||
// 点击播放声音/停止声音
|
||||
helper.voiceBarLayout.setOnClickListener(view -> {
|
||||
if (StringUtils.isEmpty(item.getVoiceUrl())) {
|
||||
if (StringFormatUtils.isEmpty(item.getVoiceUrl())) {
|
||||
return;
|
||||
}
|
||||
boolean isChange = helper.getAdapterPosition() != voiceClickPos;
|
||||
@@ -140,7 +140,7 @@ public class MyVoiceListAdapter extends BaseQuickAdapter<UserVoiceInfo, BaseView
|
||||
});
|
||||
// 点击播放声音/停止声音
|
||||
helper.voiceBarLayout.setOnClickListener(view -> {
|
||||
if (StringUtils.isEmpty(item.getVoiceUrl())) {
|
||||
if (StringFormatUtils.isEmpty(item.getVoiceUrl())) {
|
||||
return;
|
||||
}
|
||||
boolean isChange = helper.getAdapterPosition() != voiceClickPos;
|
||||
@@ -177,7 +177,7 @@ public class MyVoiceListAdapter extends BaseQuickAdapter<UserVoiceInfo, BaseView
|
||||
});
|
||||
// 点击播放声音/停止声音
|
||||
helper.voiceBarLayout.setOnClickListener(view -> {
|
||||
if (StringUtils.isEmpty(item.getVoiceUrl())) {
|
||||
if (StringFormatUtils.isEmpty(item.getVoiceUrl())) {
|
||||
return;
|
||||
}
|
||||
boolean isChange = helper.getAdapterPosition() != voiceClickPos;
|
||||
|
@@ -17,7 +17,7 @@ import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.manager.AudioEngineManager
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.sound.model.SoundModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.common.application.BaseApp
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||
|
@@ -71,7 +71,8 @@ import com.yizhuan.erban.avroom.redpackage.RedPackageHandler;
|
||||
import com.yizhuan.erban.avroom.view.IAvRoomView;
|
||||
import com.yizhuan.erban.avroom.widget.VerticalViewPagerAdapter;
|
||||
import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.AllServiceGiftProtocolDataBean;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.common.widget.CustomImageSpan;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
@@ -115,19 +116,18 @@ import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel;
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.bean.SuperAdminInfo;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterDataBean;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterHuntingResult;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterInfo;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterProtocol;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.manager.MonsterDataManager;
|
||||
import com.yizhuan.xchat_android_core.noble.AllServiceGiftProtocol;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleResourceType;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.patriarch.event.CloseMinRoomEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.event.ImPushMsgPmLimitTimeEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.event.PmDismissAllLimitDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.exception.PmRoomLimitException;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo;
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageNotifyInfo;
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomModeType;
|
||||
@@ -140,12 +140,12 @@ import com.yizhuan.xchat_android_core.super_admin.util.SAdminOptUtil;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext;
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView;
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.FairyMsgInfoBean;
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.bean.FairyMsgInfoBean;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.FirstChargeInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
@@ -220,11 +220,15 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
|
||||
private GiftBroadcastObserver giftObserver;
|
||||
private Dialog giftDialog;
|
||||
private LinkedList<AllServiceGiftProtocol.DataBean> giftList;
|
||||
private LinkedList<AllServiceGiftProtocolDataBean> giftList;
|
||||
@Nullable
|
||||
private SingleRoomTipDialog singleRoomTipDialog;
|
||||
// 通过红包进来时,有该参数
|
||||
private RedPackageNotifyInfo redPackageNotifyInfo;
|
||||
|
||||
// 是否禁用VP滑动(true:不允许滑动;false:某些条件下可以滑动)
|
||||
private boolean viewPagerInputDisable;
|
||||
|
||||
public static void start(Context context, long roomUid) {
|
||||
startForFromType(context, roomUid, FROM_TYPE_NORMAL, null, null);
|
||||
}
|
||||
@@ -296,7 +300,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
|
||||
public static void setBackBg(Context context, RoomInfo roomInfo, SVGAImageView svgaRoomBg, String[] bgPicture) {
|
||||
if (roomInfo != null && svgaRoomBg != null) {
|
||||
if (!StringUtils.isBlank(roomInfo.getBackPic())) {
|
||||
if (!StringFormatUtils.isBlank(roomInfo.getBackPic())) {
|
||||
int resourceType = NobleUtil.getResourceType(roomInfo.getBackPic());
|
||||
if (resourceType == NobleResourceType.URLS) {
|
||||
if (!roomInfo.getBackPic().equals(bgPicture[0])) {
|
||||
@@ -319,7 +323,8 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
} else if (roomInfo.getType() == RoomInfo.ROOM_TYPE_SINGLE) {
|
||||
bgPicture[0] = "";
|
||||
svgaRoomBg.setImageResource(R.drawable.bg_room_single_pic);
|
||||
// svgaRoomBg.setImageResource(R.drawable.bg_room_single_pic);
|
||||
playSvgaBg(svgaRoomBg, "svga/room_bg_single.svga");
|
||||
} else {
|
||||
bgPicture[0] = "";
|
||||
if (roomInfo.getRoomModeType() == RoomModeType.OPEN_PK_MODE) {
|
||||
@@ -396,7 +401,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
public void setCurrentItem(int item) {
|
||||
dismissLoadingDialog();
|
||||
if (viewpager != null) {
|
||||
viewpager.setUserInputEnabled(true);
|
||||
tryEnabledViewPagerInput();
|
||||
viewpager.setCurrentItem(item, false);
|
||||
}
|
||||
}
|
||||
@@ -411,7 +416,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
Object notifyInfo = intent.getSerializableExtra("notifyInfo");
|
||||
if (notifyInfo instanceof RedPackageNotifyInfo) {
|
||||
redPackageNotifyInfo = (RedPackageNotifyInfo) notifyInfo;
|
||||
}else{
|
||||
} else {
|
||||
redPackageNotifyInfo = null;
|
||||
}
|
||||
if (mRoomInfo != null) {
|
||||
@@ -445,7 +450,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
viewpager.setOffscreenPageLimit(2);
|
||||
viewpager.setOrientation(ViewPager2.ORIENTATION_VERTICAL);
|
||||
viewpager.getChildAt(0).setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
viewpager.setUserInputEnabled(false);
|
||||
disableViewPagerInput();
|
||||
viewpager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
@@ -472,11 +477,11 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
if (state == 0 && viewpager.getCurrentItem() == 2) {
|
||||
showLoadingDialog();
|
||||
((FakeSingleRoomFragment) mAdapter.getItem(2)).tryJumpRoom();
|
||||
viewpager.setUserInputEnabled(false);
|
||||
disableViewPagerInput();
|
||||
} else if (state == 0 && viewpager.getCurrentItem() == 0) {
|
||||
showLoadingDialog();
|
||||
((FakeSingleRoomBackFragment) mAdapter.getItem(0)).tryJumpRoom();
|
||||
viewpager.setUserInputEnabled(false);
|
||||
disableViewPagerInput();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -556,7 +561,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
break;
|
||||
case RoomEvent.MONSTER_STATUS_CHANGED:
|
||||
MonsterProtocol.DataBean dataBean = roomEvent.getMonsterStatusAttachment().getDataBean();
|
||||
MonsterDataBean dataBean = roomEvent.getMonsterStatusAttachment().getDataBean();
|
||||
Log.e(TAG, "onRoomEventReceive: monster status changed: " + dataBean);
|
||||
RoomInfo myRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
// 当前为房间页面并且当前房间为怪兽出现房间时才出现通知
|
||||
@@ -604,7 +609,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
// 当前为房间页面并且当前房间为怪兽出现房间时才出现通知
|
||||
if (UIUtils.isTopActivity(AVRoomActivity.this) && currentRoomInfo != null &&
|
||||
currentRoomInfo.getUid() == monsterHuntingResult.getMonster().getAppearRoomUid()) {
|
||||
MonsterProtocol.DataBean monsterInfo = monsterHuntingResult.getMonster();
|
||||
MonsterDataBean monsterInfo = monsterHuntingResult.getMonster();
|
||||
if (monsterDialog != null && monsterDialog.isShowing()) {
|
||||
monsterDialog.dismiss();
|
||||
}
|
||||
@@ -663,7 +668,14 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
*/
|
||||
private void showRoomFragment(boolean isRoomMin) {
|
||||
mCurrentFragment = (HomePartyFragment) mAdapter.getItem(1);
|
||||
viewpager.setUserInputEnabled(AvRoomDataManager.get().isSingleRoom());
|
||||
mCurrentFragment.getPlayNotifyState().observe(getLifecycleOwner(), aBoolean -> {
|
||||
if (!aBoolean) {
|
||||
if (isValid()) {
|
||||
showGiftDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
tryEnabledViewPagerInput();
|
||||
viewpager.setCurrentItem(1, false);
|
||||
if (isRoomMin) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
@@ -1191,22 +1203,15 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
giftList = new LinkedList<>();
|
||||
}
|
||||
int second2 = baseProtocol.getSecond();
|
||||
AllServiceGiftProtocol.DataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocol.DataBean.class);
|
||||
AllServiceGiftProtocolDataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocolDataBean.class);
|
||||
if (data == null || (data.getGiftUrl()) == null)
|
||||
return;
|
||||
giftList.add(data);
|
||||
if (second2 == CUSTOM_MSG_ALL_SERVICE_GIFT) {
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
// 如果当前以及有礼物弹窗在展示,则需要等到他 dismiss 后再显示下一个
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
return;
|
||||
} else {
|
||||
giftDialog.dismiss();
|
||||
}
|
||||
} else {
|
||||
showGiftDialog();
|
||||
if (mCurrentFragment != null && mCurrentFragment.isShowingPlayNotify()) {
|
||||
return;
|
||||
}
|
||||
showGiftDialog();
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_BOX://寻爱之旅
|
||||
@@ -1303,14 +1308,27 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isShowingGiftNotify() {
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void showGiftDialog() {
|
||||
if (!isValid()) return;
|
||||
if (giftList == null) return;
|
||||
if (giftList.size() == 0) return;
|
||||
AllServiceGiftProtocol.DataBean data = giftList.peekFirst();
|
||||
AllServiceGiftProtocolDataBean data = giftList.peekFirst();
|
||||
if (data == null) return;
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
return;
|
||||
}
|
||||
giftDialog = generateAllServiceGiftDialog(this, data);
|
||||
giftDialog.setOnDismissListener(dialog -> {
|
||||
giftList.pollFirst();
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
AllServiceGiftProtocolDataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
if (isValid()) {
|
||||
showGiftDialog();
|
||||
@@ -1322,7 +1340,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
giftDialog.show();
|
||||
}
|
||||
|
||||
private AllServiceGiftLevelDialog generateAllServiceGiftDialog(@NonNull Context context, @NonNull AllServiceGiftProtocol.DataBean dataBean) {
|
||||
private AllServiceGiftLevelDialog generateAllServiceGiftDialog(@NonNull Context context, @NonNull AllServiceGiftProtocolDataBean dataBean) {
|
||||
return new AllServiceGiftLevelDialog(context, dataBean);
|
||||
}
|
||||
|
||||
@@ -1427,4 +1445,41 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onReceiveChatRoomEvent(RoomEvent roomEvent) {
|
||||
super.onReceiveChatRoomEvent(roomEvent);
|
||||
switch (roomEvent.getEvent()) {
|
||||
case RoomEvent.UP_MIC:
|
||||
case RoomEvent.DOWN_MIC:
|
||||
resetViewPagerInputEnabled();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用VP滑动
|
||||
*/
|
||||
private void disableViewPagerInput() {
|
||||
this.viewPagerInputDisable = true;
|
||||
resetViewPagerInputEnabled();
|
||||
}
|
||||
|
||||
private void tryEnabledViewPagerInput() {
|
||||
this.viewPagerInputDisable = false;
|
||||
resetViewPagerInputEnabled();
|
||||
}
|
||||
|
||||
private void resetViewPagerInputEnabled() {
|
||||
if (viewPagerInputDisable) {
|
||||
viewpager.setUserInputEnabled(false);
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isSingleRoom() && !AvRoomDataManager.get().isOwnerOnMic()) {
|
||||
// 个播+没在麦位=可以滑动
|
||||
viewpager.setUserInputEnabled(true);
|
||||
} else {
|
||||
viewpager.setUserInputEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@ import com.yizhuan.erban.avroom.adapter.RecordForPKAdapter;
|
||||
import com.yizhuan.erban.avroom.presenter.RecordForPKPresenter;
|
||||
import com.yizhuan.erban.avroom.view.IRecordForPKView;
|
||||
import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.yizhuan.xchat_android_core.room.pk.bean.PKRecordInfo;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
|
@@ -21,6 +21,7 @@ import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleResourceType;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomOnlineUserBean;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
@@ -107,10 +108,11 @@ public class RoomInviteActivity extends BaseMvpActivity<IRoomInviteView, RoomInv
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageSuccess(List<OnlineChatMember> memberList, int page) {
|
||||
public void onRequestRoomOnlineListSuccess(List<RoomOnlineUserBean> list) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageFail(String errorStr, int page) {
|
||||
mPage = page;
|
||||
|
@@ -39,7 +39,7 @@ import com.yizhuan.xchat_android_core.room.pk.bean.PKTeamInfo;
|
||||
import com.yizhuan.xchat_android_core.room.queue.bean.MicMemberInfo;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.ActivityUtil;
|
||||
import com.yizhuan.xchat_android_core.utils.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_core.utils.extension.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
|
||||
@@ -527,7 +527,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
/**
|
||||
* 主席位特有
|
||||
*/
|
||||
FrameLayout frTitle;
|
||||
View frTitle;
|
||||
TextView tvRoomDesc;
|
||||
ImageView ivTag;
|
||||
TextView tvLabelLeaveMode;
|
||||
|
@@ -5,7 +5,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
|
||||
class CreateRoomGameAdapter :
|
||||
BaseQuickAdapter<GameInfo, BaseViewHolder>(R.layout.item_room_create_game) {
|
||||
|
@@ -4,8 +4,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.xchat_android_library.common.glide.GlideUtils
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
|
||||
class CreateRoomGameGuideAdapter :
|
||||
BaseQuickAdapter<GameInfo, BaseViewHolder>(R.layout.item_room_create_game_guide) {
|
||||
|
@@ -5,7 +5,7 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
|
||||
class ExitRoomAdapter :
|
||||
BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.item_exit_room) {
|
||||
|
@@ -12,27 +12,20 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.netease.nim.uikit.impl.cache.NimUserInfoCache;
|
||||
import com.netease.nimlib.sdk.RequestCallbackWrapper;
|
||||
import com.netease.nimlib.sdk.uinfo.constant.GenderEnum;
|
||||
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.NobleAvatarView;
|
||||
import com.yizhuan.erban.utils.NamePlateHelper;
|
||||
import com.yizhuan.erban.utils.RegexUtil;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelResourceType;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleResourceType;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomOnlineUserBean;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/**
|
||||
@@ -41,19 +34,17 @@ import io.reactivex.disposables.Disposable;
|
||||
* @author Administrator
|
||||
* @date 2017/12/4
|
||||
*/
|
||||
public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMember, BaseViewHolder> {
|
||||
public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<RoomOnlineUserBean, BaseViewHolder> {
|
||||
|
||||
private boolean mIsHomeParty;
|
||||
private Disposable mDisposable;
|
||||
private Context context;
|
||||
private OnRoomOnlineNumberChangeListener mListener;
|
||||
|
||||
public OnlineUserAdapter(Context context, boolean isHomeParty) {
|
||||
super(null);
|
||||
addItemType(OnlineChatMember.NORMAL, R.layout.list_item_online_user);
|
||||
addItemType(OnlineChatMember.NOBLE, R.layout.list_item_online_user_mystery);
|
||||
addItemType(RoomOnlineUserBean.NORMAL, R.layout.list_item_online_user);
|
||||
addItemType(RoomOnlineUserBean.NOBLE, R.layout.list_item_online_user_mystery);
|
||||
mIsHomeParty = isHomeParty;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,147 +54,76 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(@NonNull BaseViewHolder baseViewHolder, OnlineChatMember onlineChatMember) {
|
||||
if (onlineChatMember != null && onlineChatMember.chatRoomMember != null) {
|
||||
if (onlineChatMember.getItemType() == OnlineChatMember.NORMAL) {
|
||||
setNormalData(baseViewHolder, onlineChatMember);
|
||||
} else {
|
||||
setMysteryData();
|
||||
}
|
||||
protected void convert(@NonNull BaseViewHolder helper, RoomOnlineUserBean item) {
|
||||
if (item.getItemType() == OnlineChatMember.NOBLE) {
|
||||
return;
|
||||
}
|
||||
// 性别
|
||||
final ImageView sexImage = helper.getView(R.id.sex);
|
||||
if (item.getGender() == 1) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (item.getGender() == 2) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
sexImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setMysteryData() {
|
||||
//do nothing
|
||||
}
|
||||
// 昵称
|
||||
helper.setText(R.id.nick, RegexUtil.getPrintableString(item.getNick()));
|
||||
|
||||
private void setNormalData(BaseViewHolder baseViewHolder, OnlineChatMember onlineChatMember) {
|
||||
setSexData(baseViewHolder, onlineChatMember);
|
||||
|
||||
ImageView roomOnlineTag = baseViewHolder.getView(R.id.room_online_tag);
|
||||
ImageView managerLogo = baseViewHolder.getView(R.id.manager_logo);
|
||||
roomOnlineTag.setVisibility(onlineChatMember.isOnMic ? View.VISIBLE : View.GONE);
|
||||
managerLogo.setVisibility((onlineChatMember.isAdmin || onlineChatMember.isRoomOwer)
|
||||
? View.VISIBLE : View.GONE);
|
||||
managerLogo.setImageResource(onlineChatMember.isAdmin ? R.drawable.icon_admin_logo
|
||||
: R.drawable.icon_user_list_room_ownner);
|
||||
|
||||
baseViewHolder.setText(R.id.nick, RegexUtil.getPrintableString(onlineChatMember.chatRoomMember.getNick()));
|
||||
|
||||
NobleAvatarView nobleAvatarView = baseViewHolder.getView(R.id.noble_avatar_view);
|
||||
// 头像
|
||||
NobleAvatarView nobleAvatarView = helper.getView(R.id.noble_avatar_view);
|
||||
nobleAvatarView.setSize(37, 54, 0);
|
||||
nobleAvatarView.setData(onlineChatMember.chatRoomMember);
|
||||
nobleAvatarView.setData(item);
|
||||
|
||||
// 官字
|
||||
baseViewHolder.getView(R.id.iv_user_official).setVisibility(onlineChatMember.isOfficial() ? View.VISIBLE : View.GONE);
|
||||
helper.getView(R.id.iv_user_official).setVisibility(item.isOfficial() ? View.VISIBLE : View.GONE);
|
||||
|
||||
// 管理
|
||||
ImageView ivManager = helper.getView(R.id.manager_logo);
|
||||
if (item.getMemberType() != null && item.getMemberType().equals("MANAGER")) {
|
||||
ivManager.setVisibility(View.VISIBLE);
|
||||
ivManager.setImageResource(R.drawable.icon_admin_logo);
|
||||
} else if (item.getMemberType() != null && item.getMemberType().equals("CREATOR")) {
|
||||
ivManager.setVisibility(View.VISIBLE);
|
||||
ivManager.setImageResource(R.drawable.icon_user_list_room_ownner);
|
||||
} else {
|
||||
ivManager.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 在麦
|
||||
ImageView ivMic = helper.getView(R.id.room_online_tag);
|
||||
ivMic.setVisibility(item.isInMic() ? View.VISIBLE : View.GONE);
|
||||
|
||||
|
||||
//等级
|
||||
UserLevelVo levelVo = item.getUserLevelVo();
|
||||
String experLevelUrl = null;
|
||||
String charmLevelUrl = null;
|
||||
if (levelVo != null) {
|
||||
experLevelUrl = levelVo.getExperUrl();
|
||||
charmLevelUrl = levelVo.getCharmUrl();
|
||||
}
|
||||
//经验等级
|
||||
AppCompatImageView ivUserExper = baseViewHolder.getView(R.id.iv_user_exper);
|
||||
String experLevelUrl = NobleUtil.getLevel(UserLevelResourceType.EXPER_URL, onlineChatMember.chatRoomMember);
|
||||
AppCompatImageView ivUserExper = helper.getView(R.id.iv_user_exper);
|
||||
boolean isExperLevelUrlEmpty = TextUtils.isEmpty(experLevelUrl);
|
||||
ivUserExper.setVisibility(!isExperLevelUrlEmpty ? View.VISIBLE : View.GONE);
|
||||
if (!isExperLevelUrlEmpty) {
|
||||
ImageLoadUtils.loadImage(mContext, experLevelUrl, ivUserExper);
|
||||
}
|
||||
//魅力等级
|
||||
AppCompatImageView ivUserCharm = baseViewHolder.getView(R.id.iv_user_charm);
|
||||
String charmLevelUrl = NobleUtil.getLevel(UserLevelResourceType.CHARM_URL, onlineChatMember.chatRoomMember);
|
||||
AppCompatImageView ivUserCharm = helper.getView(R.id.iv_user_charm);
|
||||
boolean isCharmLevelUrlEmpty = TextUtils.isEmpty(charmLevelUrl);
|
||||
ivUserCharm.setVisibility(!isCharmLevelUrlEmpty ? View.VISIBLE : View.GONE);
|
||||
if (!isCharmLevelUrlEmpty) {
|
||||
ImageLoadUtils.loadImage(mContext, charmLevelUrl, ivUserCharm);
|
||||
}
|
||||
|
||||
// 官方主播铭牌标识
|
||||
String fixWord = NobleUtil.getLevel(UserInfo.OAC_NAME, onlineChatMember.chatRoomMember);
|
||||
String iconPic = NobleUtil.getLevel(UserInfo.OAC_ICON, onlineChatMember.chatRoomMember);
|
||||
View inOfficialMask = baseViewHolder.getView(R.id.in_official_mask);
|
||||
if (!TextUtils.isEmpty(fixWord) && !TextUtils.isEmpty(iconPic)) {
|
||||
inOfficialMask.setVisibility(View.VISIBLE);
|
||||
TextView tvOfficialMask = inOfficialMask.findViewById(R.id.tv_official_mask);
|
||||
if (tvOfficialMask != null) {
|
||||
tvOfficialMask.setText(fixWord);
|
||||
}
|
||||
|
||||
ImageView ivOfficialMask = inOfficialMask.findViewById(R.id.iv_official_mask);
|
||||
if (ivOfficialMask != null) {
|
||||
ImageLoadUtils.loadImage(mContext, iconPic, ivOfficialMask);
|
||||
}
|
||||
|
||||
} else {
|
||||
inOfficialMask.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 铭牌
|
||||
String namePlateWord = NobleUtil.getLevel(UserInfo.NAMEPLATE_WORD, onlineChatMember.chatRoomMember);
|
||||
String namePlatePic = NobleUtil.getLevel(UserInfo.NAMEPLATE_PIC, onlineChatMember.chatRoomMember);
|
||||
View inNamePlate = baseViewHolder.getView(R.id.in_nameplate);
|
||||
if (!TextUtils.isEmpty(namePlateWord) && !TextUtils.isEmpty(namePlatePic)) {
|
||||
inNamePlate.setVisibility(View.VISIBLE);
|
||||
TextView tvNamePlate = inNamePlate.findViewById(R.id.tv_official_mask);
|
||||
if (tvNamePlate != null) {
|
||||
tvNamePlate.setText(namePlateWord);
|
||||
}
|
||||
|
||||
ImageView ivNamePlate = inNamePlate.findViewById(R.id.iv_official_mask);
|
||||
if (ivNamePlate != null) {
|
||||
ImageLoadUtils.loadImage(mContext, namePlatePic, ivNamePlate);
|
||||
}
|
||||
|
||||
} else {
|
||||
inNamePlate.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
AppCompatImageView ivUserLevel = baseViewHolder.getView(R.id.iv_noble_level);
|
||||
String resource = (String) NobleUtil.getResource(NobleResourceType.KEY_BADGE, onlineChatMember.chatRoomMember);
|
||||
if (TextUtils.isEmpty(resource)) {
|
||||
ivUserLevel.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
ivUserLevel.setVisibility(View.VISIBLE);
|
||||
NobleUtil.loadResource(resource, ivUserLevel);
|
||||
}
|
||||
|
||||
private void setSexData(BaseViewHolder baseViewHolder, OnlineChatMember onlineChatMember) {
|
||||
final ImageView sexImage = baseViewHolder.getView(R.id.sex);
|
||||
String gender = NobleUtil.getLevel(UserInfo.GENDER, onlineChatMember.chatRoomMember);
|
||||
if ("1".equals(gender)) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if ("2".equals(gender)) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
NimUserInfo nimUserInfo = NimUserInfoCache.getInstance().getUserInfo(onlineChatMember.chatRoomMember.getAccount());
|
||||
if (nimUserInfo == null) {
|
||||
NimUserInfoCache.getInstance().getUserInfoFromRemote(onlineChatMember.chatRoomMember.getAccount(),
|
||||
new RequestCallbackWrapper<NimUserInfo>() {
|
||||
@Override
|
||||
public void onResult(int i, NimUserInfo nimUserInfo, Throwable throwable) {
|
||||
if (nimUserInfo != null) {
|
||||
if (nimUserInfo.getGenderEnum() == GenderEnum.MALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (nimUserInfo.getGenderEnum() == GenderEnum.FEMALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
sexImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (nimUserInfo.getGenderEnum() == GenderEnum.MALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (nimUserInfo.getGenderEnum() == GenderEnum.FEMALE) {
|
||||
sexImage.setVisibility(View.VISIBLE);
|
||||
sexImage.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
sexImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
View inNamePlate = helper.getView(R.id.in_nameplate);
|
||||
NamePlateHelper.INSTANCE.load(inNamePlate, inNamePlate.findViewById(R.id.tv_official_mask), inNamePlate.findViewById(R.id.iv_official_mask), item);
|
||||
}
|
||||
|
||||
private void registerRoomEvent() {
|
||||
@@ -240,7 +160,7 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
updateMemberIn(roomEvent);
|
||||
} else if (event == RoomEvent.ROOM_MEMBER_EXIT) {
|
||||
if (mListener != null) {
|
||||
mListener.onMemberExit(roomEvent.getAccount(), mData);
|
||||
mListener.onMemberExit(roomEvent.getAccount());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -248,19 +168,19 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
|
||||
private void updateMemberIn(RoomEvent roomEvent) {
|
||||
if (mListener != null) {
|
||||
mListener.onMemberIn(roomEvent.getAccount(), mData);
|
||||
mListener.onMemberIn(roomEvent.getAccount());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateManager(RoomEvent roomEvent) {
|
||||
if (mListener != null)
|
||||
mListener.onUpdateMemberManager(roomEvent.getAccount(),
|
||||
roomEvent.getEvent() == RoomEvent.ROOM_MANAGER_REMOVE, mData);
|
||||
roomEvent.getEvent() == RoomEvent.ROOM_MANAGER_REMOVE);
|
||||
}
|
||||
|
||||
private void updateDownUpMic(String account, boolean isUpMic) {
|
||||
if (mListener != null) {
|
||||
mListener.onMemberDownUpMic(account, isUpMic, mData);
|
||||
mListener.onMemberDownUpMic(account, isUpMic);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,34 +201,29 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
||||
*
|
||||
* @param account
|
||||
*/
|
||||
void onMemberIn(String account, List<OnlineChatMember> dataList);
|
||||
void onMemberIn(String account);
|
||||
|
||||
/**
|
||||
* 成员出去回调
|
||||
*
|
||||
* @param account
|
||||
* @param dataList
|
||||
*/
|
||||
void onMemberExit(String account, List<OnlineChatMember> dataList);
|
||||
void onMemberExit(String account);
|
||||
|
||||
/**
|
||||
* 成员上下麦更新
|
||||
*
|
||||
* @param account
|
||||
* @param isUpMic
|
||||
* @param dataList
|
||||
*/
|
||||
void onMemberDownUpMic(String account, boolean isUpMic,
|
||||
List<OnlineChatMember> dataList);
|
||||
void onMemberDownUpMic(String account, boolean isUpMic);
|
||||
|
||||
/**
|
||||
* 设置管理员回调
|
||||
*
|
||||
* @param account
|
||||
* @param dataList
|
||||
*/
|
||||
void onUpdateMemberManager(String account, boolean isRemoveManager,
|
||||
List<OnlineChatMember> dataList);
|
||||
void onUpdateMemberManager(String account, boolean isRemoveManager);
|
||||
|
||||
void addMemberBlack();
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.NobleAvatarView;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.utils.RegexUtil;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeUserInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomRankMultiItem;
|
||||
|
@@ -3,7 +3,7 @@ package com.yizhuan.erban.avroom.adapter
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
|
||||
class SelectGameAdapter :
|
||||
BaseQuickAdapter<GameInfo, BaseViewHolder>(R.layout.item_room_select_game) {
|
||||
|
@@ -16,7 +16,7 @@ import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.praise.PraiseModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig
|
||||
|
||||
|
@@ -26,7 +26,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowUserInfoDialogEvent
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus
|
||||
import com.yizhuan.xchat_android_library.utils.CommonUtils
|
||||
import io.reactivex.Observable
|
||||
|
@@ -16,10 +16,10 @@ import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.RoomPKModel
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class RoomPKCreateActivity : BaseViewBindingActivity<ActivityRoomPkCreateBinding>() {
|
||||
|
@@ -16,7 +16,7 @@ import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.RoomPKModel
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class RoomPKSearchActivity : BaseViewBindingActivity<ActivityRoomPkSearchBinding>() {
|
||||
|
@@ -5,14 +5,14 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
|
||||
class RoomPKSearchAdapter :
|
||||
BaseQuickAdapter<SimpleRoomInfo, BaseViewHolder>(R.layout.item_room_pk_search) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: SimpleRoomInfo) {
|
||||
helper.setText(R.id.tv_room_title,item.title.subAndReplaceDot(7))
|
||||
.setText(R.id.tv_room_id,"Piko号:${item.erbanNo}")
|
||||
.setText(R.id.tv_room_id,"Repo号:${item.erbanNo}")
|
||||
.setChecked(R.id.check_box,item.checked)
|
||||
ImageLoadUtils.loadImage(mContext,item.avatar,helper.getView(R.id.iv_avatar))
|
||||
helper.addOnClickListener(R.id.iv_avatar,R.id.check_box)
|
||||
|
@@ -9,7 +9,7 @@ import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogRoomPkFinishBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
|
||||
class RoomPkFinishDialog : BaseDialog<DialogRoomPkFinishBinding>() {
|
||||
|
||||
|
@@ -8,7 +8,7 @@ import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogRoomPkForceFinishBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
|
||||
class RoomPkForceFinishDialog : BaseDialog<DialogRoomPkForceFinishBinding>() {
|
||||
|
||||
|
@@ -8,9 +8,9 @@ import com.yizhuan.erban.databinding.DialogRoomPkReceivedBinding
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.RoomPKModel
|
||||
import com.yizhuan.xchat_android_core.utils.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
@@ -3,24 +3,16 @@ package com.yizhuan.erban.avroom.dialog
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.Gravity
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.adapter.CreateRoomGameAdapter
|
||||
import com.yizhuan.erban.avroom.adapter.CreateRoomGameGuideAdapter
|
||||
import com.yizhuan.erban.base.BaseActivity
|
||||
import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogCreateGameRoomBinding
|
||||
import com.yizhuan.erban.databinding.DialogCreateRoomBinding
|
||||
import com.yizhuan.erban.home.helper.OpenRoomHelper
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.GameModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class CreateGameRoomDialog : BaseDialog<DialogCreateGameRoomBinding>() {
|
||||
|
||||
|
@@ -14,9 +14,9 @@ import com.yizhuan.erban.databinding.DialogCreateRoomBinding
|
||||
import com.yizhuan.erban.home.helper.OpenRoomHelper
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo
|
||||
import com.yizhuan.xchat_android_core.room.game.GameModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class CreateRoomDialog : BaseDialog<DialogCreateRoomBinding>() {
|
||||
|
@@ -23,7 +23,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.adapter.MicQueueAdapter;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.home.helper.LoadPageDataHelper;
|
||||
import com.yizhuan.erban.ui.widget.dialog.BaseDialog;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
|
@@ -25,7 +25,7 @@ import com.yizhuan.erban.avroom.adapter.PKMicQueueAdapter;
|
||||
import com.yizhuan.erban.home.helper.LoadPageDataHelper;
|
||||
import com.yizhuan.erban.ui.widget.dialog.BaseDialog;
|
||||
import com.yizhuan.erban.ui.widget.dialog.CommonLoadingDialog;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
|
@@ -21,7 +21,7 @@ import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.ui.widget.dialog.BaseDialog;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.room.pk.bean.PKTeamInfo;
|
||||
|
@@ -18,7 +18,7 @@ import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.ui.widget.dialog.BaseDialog;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.pk.bean.PKMemberInfo;
|
||||
|
@@ -19,7 +19,7 @@ import com.yizhuan.erban.avroom.activity.CpRoomInviteActivity;
|
||||
import com.yizhuan.erban.avroom.widget.EditRoomTitleDialog;
|
||||
import com.yizhuan.erban.databinding.DialogRoomImposeBinding;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
|
@@ -26,7 +26,7 @@ import com.yizhuan.erban.avroom.anotherroompk.RoomPKCreateActivity;
|
||||
import com.yizhuan.erban.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.yizhuan.erban.avroom.room_album.RoomAlbumActivity;
|
||||
import com.yizhuan.erban.avroom.singleroompk.SingleRoomPKCreateActivity;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
|
@@ -16,7 +16,7 @@ import com.yizhuan.erban.utils.SpannableBuilder
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.bean.BroadcastInfo
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.CommonUtils
|
||||
import com.yizhuan.xchat_android_library.utils.TextWatcherWrapper
|
||||
import io.reactivex.Observable
|
||||
|
@@ -41,7 +41,7 @@ import com.yizhuan.xchat_android_core.pay.bean.PayRecordId
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.utils.net.IgnoreException
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.common.util.DeviceUtil
|
||||
import com.yizhuan.xchat_android_library.utils.AppMetaDataUtil
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
@@ -5,7 +5,7 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
import com.yizhuan.xchat_android_core.utils.CoreTextUtils
|
||||
|
||||
class Reward2Adapter : BaseMultiItemQuickAdapter<FirstChargeReward, BaseViewHolder>(null) {
|
||||
|
||||
@@ -33,7 +33,7 @@ class Reward2Adapter : BaseMultiItemQuickAdapter<FirstChargeReward, BaseViewHold
|
||||
)
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, item.showTime)
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
.setGone(R.id.tv_time, !CoreTextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
|
||||
}
|
@@ -4,11 +4,10 @@ import androidx.core.view.updateLayoutParams
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
import com.yizhuan.xchat_android_core.utils.CoreTextUtils
|
||||
|
||||
class RewardAdapter(private val itemWidth: Int) :
|
||||
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_first_charge_reward) {
|
||||
@@ -24,6 +23,6 @@ class RewardAdapter(private val itemWidth: Int) :
|
||||
)
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, item.showTime)
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
.setGone(R.id.tv_time, !CoreTextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
}
|
@@ -287,7 +287,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
// 刷新禮物列表,獲取房間專屬禮物列表
|
||||
GiftModel.get().refreshGiftList(AvRoomDataManager.get().roomUid.toString()).subscribe()
|
||||
checkFollowOwner()
|
||||
mvpPresenter?.loadRoomRank()
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
|
||||
//先隐藏航海冒险
|
||||
@@ -355,6 +354,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
updateRemoteMuteBtn()
|
||||
openOrCloseGiftValue(true)
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
onEnterRoom()
|
||||
}
|
||||
|
||||
RoomEvent.ADD_BLACK_LIST -> onChatRoomMemberBlackAdd(roomEvent.account)
|
||||
@@ -554,6 +554,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
if (isOnMic) {
|
||||
if (musicPlayerView == null) {
|
||||
musicPlayerView = mVsMusicPlayer?.inflate() as? MusicPlayerView
|
||||
musicPlayerView?.let {
|
||||
onInitMusicPlayerView(it)
|
||||
}
|
||||
}
|
||||
musicPlayerView?.visibility = View.VISIBLE
|
||||
} else {
|
||||
@@ -676,11 +679,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
sendMsg()
|
||||
}
|
||||
|
||||
R.id.contribute_list -> {
|
||||
DialogWebViewActivity.start(mContext, UriProvider.getRoomRanking())
|
||||
mvpPresenter?.loadRoomRank()
|
||||
}
|
||||
|
||||
R.id.iv_first_charge_enter -> FirstChargeDialog.start(mContext)
|
||||
R.id.iv_treasure_box,
|
||||
R.id.iv_treasure_box_cp -> GoldBoxHelper.handleBoxClick(mContext)
|
||||
@@ -1158,18 +1156,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
microView.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun updateRoomRanks(data: List<RoomContributeUserInfo>) {
|
||||
// val avatarList = arrayListOf<ImageView?>(
|
||||
// mView.findViewById(R.id.iv_rank_0),
|
||||
// mView.findViewById(R.id.iv_rank_1),
|
||||
// mView.findViewById(R.id.iv_rank_2)
|
||||
// )
|
||||
//
|
||||
// for (i in 0 until avatarList.size) {
|
||||
// avatarList[i]?.loadAvatar(data.getOrNull(i)?.avatar)
|
||||
// }
|
||||
}
|
||||
|
||||
private fun onSendGiftBtnClick(giftId: Int = 0) {
|
||||
if (giftDialog == null) {
|
||||
GiftDialog.GIFT_DIALOG_FROM = getString(R.string.room)
|
||||
@@ -1362,4 +1348,12 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
inputEdit.requestFocus()
|
||||
KeyBoardUtils.showKeyBoard(context, inputEdit)
|
||||
}
|
||||
|
||||
protected open fun onEnterRoom(){
|
||||
|
||||
}
|
||||
|
||||
protected open fun onInitMusicPlayerView(view: MusicPlayerView) {
|
||||
|
||||
}
|
||||
}
|
@@ -9,7 +9,7 @@ import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.event.SwitchRoomEvent
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import io.reactivex.Single
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@@ -66,7 +66,7 @@ class FakeSingleRoomBackFragment : BaseViewBindingFragment<FragmentFakeSingleRoo
|
||||
jumpRoom(it)
|
||||
} else {
|
||||
preRoomInfo = it
|
||||
if (!StringUtils.isBlank(it.backPic)) {
|
||||
if (!StringFormatUtils.isBlank(it.backPic)) {
|
||||
AVRoomActivity.setBackBg(mContext, it, binding.svgaImageViewBg, bgPicture)
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.event.SwitchRoomEvent
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils
|
||||
import com.yizhuan.xchat_android_core.utils.StringFormatUtils
|
||||
import io.reactivex.Single
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -56,7 +56,7 @@ class FakeSingleRoomFragment : BaseViewBindingFragment<FragmentFakeSingleRoomBin
|
||||
jumpRoom(it)
|
||||
} else {
|
||||
preRoomInfo = it
|
||||
if (!StringUtils.isBlank(it.backPic)) {
|
||||
if (!StringFormatUtils.isBlank(it.backPic)) {
|
||||
AVRoomActivity.setBackBg(mContext, it, binding.svgaImageViewBg, bgPicture)
|
||||
}
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.yizhuan.erban.avroom.game.GameDelegate
|
||||
import com.yizhuan.erban.avroom.game.OnGameStatusChangeListener
|
||||
import com.yizhuan.erban.avroom.presenter.GameRoomPresenter
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
import com.yizhuan.erban.avroom.view.IGameRoomView
|
||||
import com.yizhuan.erban.databinding.FragmentGameRoomBinding
|
||||
@@ -68,9 +69,9 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
AvRoomDataManager.get().mCurrentRoomInfo?.mgId
|
||||
)
|
||||
gameDelegate.setOnGameStatusChangeListener(this)
|
||||
gameBinding.rankWidget.setContentBackgroundResource(R.drawable.room_rank_widget_bg_game)
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun initiate() {
|
||||
gameBinding.microView.bindAdapter(GameMicroViewAdapter(context))
|
||||
@@ -197,5 +198,6 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
override fun initWidget() {
|
||||
super.initWidget()
|
||||
registerWidget(RedPackageWidget::class.java.simpleName, gameBinding.redPackageWidget)
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
}
|
||||
}
|
@@ -18,6 +18,8 @@ import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
@@ -56,14 +58,14 @@ import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.praise.PraiseModel;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomModeType;
|
||||
import com.yizhuan.xchat_android_core.room.game.GameInfo;
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameInfo;
|
||||
import com.yizhuan.xchat_android_core.room.game.GameModel;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.event.HasAnimationEffect;
|
||||
import com.yizhuan.xchat_android_core.share.ShareModel;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.Logger;
|
||||
import com.yizhuan.xchat_android_core.utils.CoreLogger;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
@@ -114,6 +116,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
private String FOLLOW_ROOM_TYPE = "";
|
||||
private SelectGameAdapter gameAdapter;
|
||||
|
||||
public final MutableLiveData<Boolean> playNotifyStateLiveData = new MutableLiveData<Boolean>(false);
|
||||
|
||||
public static HomePartyFragment newInstance() {
|
||||
HomePartyFragment homePartyFragment = new HomePartyFragment();
|
||||
@@ -152,7 +155,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
toast(getString(R.string.have_copy));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.info("copyText", e.toString());
|
||||
CoreLogger.info("copyText", e.toString());
|
||||
toast(e.toString());
|
||||
}
|
||||
return true;
|
||||
@@ -214,10 +217,11 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
gameMainBinding.llRoomInfo.setOnClickListener(this);
|
||||
gameMainBinding.ivBack.setOnClickListener(this);
|
||||
|
||||
mRoomEffectView.setPlayNotifyStateListener(playNotifyStateLiveData);
|
||||
mRoomEffectView.setOnPlayAnimCallback(new Function0<Boolean>() {
|
||||
@Override
|
||||
public Boolean invoke() {
|
||||
return getIsAnim();
|
||||
return isShowingGiftNotify();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -360,18 +364,22 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean getIsAnim() {
|
||||
if (giftView != null) {
|
||||
return giftView.getIsPlayAnim();
|
||||
private boolean isShowingGiftNotify() {
|
||||
if ((getActivity() instanceof AVRoomActivity)) {
|
||||
return ((AVRoomActivity) getActivity()).isShowingGiftNotify();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩法飘屏是否展示
|
||||
*/
|
||||
private boolean getIsPlayAnim() {
|
||||
return mRoomEffectView.getIsPlayAnim();
|
||||
public LiveData<Boolean> getPlayNotifyState(){
|
||||
return playNotifyStateLiveData;
|
||||
}
|
||||
|
||||
public boolean isShowingPlayNotify(){
|
||||
if(playNotifyStateLiveData.getValue()==null) {
|
||||
return false;
|
||||
}
|
||||
return playNotifyStateLiveData.getValue();
|
||||
}
|
||||
|
||||
private void onReceiveLuckyGiftToMultiMsg(LuckyBagGifts giftMultiReceiverInfo) {
|
||||
|
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
@@ -26,6 +27,7 @@ import com.yizhuan.erban.avroom.dialog.PKScoreBoardDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog;
|
||||
import com.yizhuan.erban.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyPresenter;
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyView;
|
||||
import com.yizhuan.erban.avroom.widget.PKBoardView;
|
||||
@@ -36,6 +38,7 @@ import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.ui.webview.DatingRuleWebViewActivity;
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
@@ -138,6 +141,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
public void initWidget() {
|
||||
super.initWidget();
|
||||
registerWidget(RedPackageWidget.class.getSimpleName(), gameBinding.redPackageWidget);
|
||||
registerWidget(RoomRankWidget.class.getSimpleName(), gameBinding.rankWidget);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -603,7 +607,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
getMvpPresenter().cancelDragon();
|
||||
});
|
||||
break;
|
||||
case R.id.tv_hour_rank:
|
||||
case R.id.layout_hour_rank:
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
UriProvider.getRoomHourRankUrl(AvRoomDataManager.get().getRoomUid())
|
||||
@@ -787,7 +791,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
|
||||
private void hideKtvRelaView() {
|
||||
gameBinding.setKtvModel(false);
|
||||
gameBinding.contributeList.setVisibility(View.VISIBLE);
|
||||
changeModelShowView();
|
||||
gameBinding.bottomView.showKtvBottom(false);
|
||||
}
|
||||
@@ -799,9 +802,9 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo.getIsPermitRoom() == 1) {
|
||||
gameBinding.tvHourRank.setVisibility(View.VISIBLE);
|
||||
gameBinding.layoutHourRank.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
gameBinding.tvHourRank.setVisibility(View.GONE);
|
||||
gameBinding.layoutHourRank.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
@@ -1070,4 +1073,10 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInitMusicPlayerView(@NonNull MusicPlayerView view) {
|
||||
super.onInitMusicPlayerView(view);
|
||||
view.linkIconView(gameBinding.ivMusic, gameBinding.ivMusic);
|
||||
}
|
||||
}
|
||||
|
@@ -7,28 +7,23 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.netease.nim.uikit.common.util.sys.NetworkUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadmoreListener;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.adapter.OnlineUserAdapter;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyUserListPresenter;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyUserListView;
|
||||
import com.yizhuan.erban.base.BaseMvpFragment;
|
||||
import com.yizhuan.erban.ui.widget.UserInfoDialog;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomOnlineUserBean;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -44,7 +39,6 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
private SmartRefreshLayout mRefreshLayout;
|
||||
|
||||
private OnlineUserAdapter mOnlineUserAdapter;
|
||||
private int mPage = Constants.PAGE_START;
|
||||
private boolean isShowToUser = false;
|
||||
|
||||
@Override
|
||||
@@ -58,24 +52,12 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
public void onFindViews() {
|
||||
mRecyclerView = mView.findViewById(R.id.recycler_view);
|
||||
mRefreshLayout = mView.findViewById(R.id.refresh_layout);
|
||||
mRefreshLayout.setEnableLoadmore(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
mRefreshLayout.setOnRefreshLoadmoreListener(new OnRefreshLoadmoreListener() {
|
||||
@Override
|
||||
public void onLoadmore(RefreshLayout refreshLayout) {
|
||||
if (!NetworkUtil.isNetAvailable(mContext)) {
|
||||
mRefreshLayout.finishLoadmore();
|
||||
return;
|
||||
}
|
||||
List<OnlineChatMember> data = mOnlineUserAdapter.getData();
|
||||
if (ListUtils.isListEmpty(data)) {
|
||||
mRefreshLayout.finishLoadmore();
|
||||
return;
|
||||
}
|
||||
loadData(data.get(data.size() - 1).chatRoomMember.getEnterTime());
|
||||
}
|
||||
mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
||||
|
||||
@Override
|
||||
public void onRefresh(RefreshLayout refreshLayout) {
|
||||
@@ -106,53 +88,24 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
|
||||
|
||||
public void firstLoad() {
|
||||
mPage = Constants.PAGE_START;
|
||||
loadData(0);
|
||||
loadData();
|
||||
}
|
||||
|
||||
private void loadData(long time) {
|
||||
getMvpPresenter().requestChatMemberByPage(mPage, time,
|
||||
mOnlineUserAdapter == null ? null : mOnlineUserAdapter.getData());
|
||||
private void loadData() {
|
||||
getMvpPresenter().requestRoomOnlineList(AvRoomDataManager.get().getRoomUid());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageSuccess(List<OnlineChatMember> chatRoomMemberList, int page) {
|
||||
mPage = page;
|
||||
if (!ListUtils.isListEmpty(chatRoomMemberList)) {
|
||||
//超管不显示
|
||||
Iterator<OnlineChatMember> iterator = chatRoomMemberList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
OnlineChatMember member = iterator.next();
|
||||
if (member != null && SuperAdminUtil.isSuperAdmin(member.chatRoomMember)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
mOnlineUserAdapter.setNewData(chatRoomMemberList);
|
||||
if (mPage == Constants.PAGE_START) {
|
||||
mRefreshLayout.finishRefresh();
|
||||
} else {
|
||||
mRefreshLayout.finishLoadmore(0);
|
||||
}
|
||||
mPage++;
|
||||
} else {
|
||||
if (mPage == Constants.PAGE_START) {
|
||||
mRefreshLayout.finishRefresh();
|
||||
} else {
|
||||
mRefreshLayout.finishLoadmore(0);
|
||||
}
|
||||
}
|
||||
public void onRequestRoomOnlineListSuccess(List<RoomOnlineUserBean> list) {
|
||||
mOnlineUserAdapter.setNewData(list);
|
||||
mRefreshLayout.finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestChatMemberByPageFail(String errorStr, int page) {
|
||||
Logger.i(ResUtil.getString(R.string.avroom_fragment_onlineuserfragment_01) + page);
|
||||
mPage = page;
|
||||
if (mPage == Constants.PAGE_START) {
|
||||
mRefreshLayout.finishRefresh();
|
||||
} else {
|
||||
mRefreshLayout.finishLoadmore(0);
|
||||
}
|
||||
mRefreshLayout.finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -166,16 +119,12 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int position) {
|
||||
RoomInfo currentRoom = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoom != null) {
|
||||
List<OnlineChatMember> chatRoomMembers = mOnlineUserAdapter.getData();
|
||||
List<RoomOnlineUserBean> chatRoomMembers = mOnlineUserAdapter.getData();
|
||||
if (ListUtils.isListEmpty(chatRoomMembers)) return;
|
||||
OnlineChatMember onlineChatMember = chatRoomMembers.get(position);
|
||||
ChatRoomMember chatRoomMember = onlineChatMember.chatRoomMember;
|
||||
if (chatRoomMember != null) {
|
||||
if (onlineChatMember.getItemType() == OnlineChatMember.NOBLE) {
|
||||
return;
|
||||
}
|
||||
RoomOnlineUserBean onlineChatMember = chatRoomMembers.get(position);
|
||||
if (onlineChatMember != null) {
|
||||
UserInfoDialog.showNewUserInfoDialog(mContext,
|
||||
JavaUtil.str2long(chatRoomMember.getAccount()),
|
||||
onlineChatMember.getUid(),
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
@@ -185,28 +134,25 @@ public class OnlineUserFragment extends BaseMvpFragment<IHomePartyUserListView,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberIn(String account, List<OnlineChatMember> dataList) {
|
||||
// if (!isResumed()) return;
|
||||
// getMvpPresenter().onMemberInRefreshData(account, dataList, mPage);
|
||||
public void onMemberIn(String account) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberExit(String account, List<OnlineChatMember> dataList) {
|
||||
public void onMemberExit(String account) {
|
||||
// if (!isResumed()) return;
|
||||
// if (!isShowToUser()) return;
|
||||
// firstLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMemberDownUpMic(String account, boolean isUpMic, List<OnlineChatMember> dataList) {
|
||||
if (!isResumed()) return;
|
||||
getMvpPresenter().onMemberDownUpMic(account, isUpMic, dataList, mPage);
|
||||
public void onMemberDownUpMic(String account, boolean isUpMic) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateMemberManager(String account, boolean isRemoveManager, List<OnlineChatMember> dataList) {
|
||||
if (!isResumed()) return;
|
||||
getMvpPresenter().onUpdateMemberManager(account, dataList, isRemoveManager, mPage);
|
||||
public void onUpdateMemberManager(String account, boolean isRemoveManager) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -16,6 +16,7 @@ import com.yizhuan.erban.avroom.adapter.SingleRoomPKMicroViewAdapter
|
||||
import com.yizhuan.erban.avroom.dialog.RequestUpMicDialog
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.yizhuan.erban.avroom.presenter.SingleRoomPresenter
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
import com.yizhuan.erban.avroom.singleroompk.SingleRoomPkFinishDialog
|
||||
import com.yizhuan.erban.avroom.singleroompk.SingleRoomPkForceFinishDialog
|
||||
@@ -29,9 +30,10 @@ import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.fansteam.FansTeamInitInfo
|
||||
import com.yizhuan.xchat_android_core.fansteam.bean.FansTeamInitInfo
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.FansTeamMsgAttachment
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RequestUpmicAttachment
|
||||
@@ -109,7 +111,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
}
|
||||
|
||||
gameBinding.tvHourRank.setOnClickListener {
|
||||
gameBinding.layoutHourRank.setOnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
UriProvider.getSingleRoomHourRankUrl(AvRoomDataManager.get().roomUid)
|
||||
@@ -120,16 +122,10 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateFansTeamInfo(initInfo: FansTeamInitInfo) {
|
||||
var clickListener: View.OnClickListener? = null
|
||||
if (!AvRoomDataManager.get().isRoomOwner && !initInfo.isAnchorFans && initInfo.hasFansTeamCurrentRoom) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.isVisible = false
|
||||
} else {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
}
|
||||
|
||||
if (initInfo.hasFansTeamCurrentRoom) {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text = "粉絲團(${initInfo.anchorFansNum})"
|
||||
clickListener = View.OnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
@@ -139,12 +135,16 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
} else {
|
||||
if (initInfo.isAnchorFans) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text =
|
||||
"粉絲LV.${if (initInfo.fansLevelSeq == 0) 1 else initInfo.fansLevelSeq}"
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinedActivity.start(requireContext())
|
||||
}
|
||||
} else {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.isVisible = false
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinActivity.start(requireContext())
|
||||
}
|
||||
@@ -152,6 +152,8 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text = "開通粉絲團"
|
||||
clickListener = View.OnClickListener {
|
||||
CommonWebViewActivity.start(
|
||||
@@ -160,7 +162,9 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
)
|
||||
}
|
||||
} else {
|
||||
gameBinding.tvFansTeamOpt.text = "該主播暫未開通粉絲團"
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text = "TA暫未開通粉絲團"
|
||||
}
|
||||
}
|
||||
gameBinding.flFansTeam.setOnClickListener(clickListener)
|
||||
@@ -230,6 +234,11 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
bottomView.setBottomViewListener(BaseRoomBottomViewWrapper())
|
||||
}
|
||||
|
||||
override fun onEnterRoom() {
|
||||
super.onEnterRoom()
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
}
|
||||
|
||||
override fun updateView() {
|
||||
super.updateView()
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode && gameBinding.microView.adapter !is SingleRoomPKMicroViewAdapter) {
|
||||
@@ -266,5 +275,11 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
override fun initWidget() {
|
||||
super.initWidget()
|
||||
registerWidget(RedPackageWidget::class.java.simpleName, gameBinding.redPackageWidget)
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
}
|
||||
|
||||
override fun onInitMusicPlayerView(view: MusicPlayerView) {
|
||||
super.onInitMusicPlayerView(view)
|
||||
view.linkIconView(gameBinding.ivMusic, gameBinding.ivMusic)
|
||||
}
|
||||
}
|
@@ -14,7 +14,7 @@ import com.google.gson.Gson
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.game.GameCfg
|
||||
import com.yizhuan.xchat_android_core.room.game.bean.GameCfg
|
||||
import com.yizhuan.xchat_android_core.room.game.GameModel
|
||||
import com.yizhuan.xchat_android_core.room.game.GameStatus
|
||||
import com.yizhuan.xchat_android_core.room.model.HomePartyModel
|
||||
|
@@ -6,7 +6,7 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
import com.yizhuan.xchat_android_core.utils.CoreTextUtils
|
||||
|
||||
class RewardAdapter :
|
||||
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_new_user_charge_reward) {
|
||||
@@ -16,6 +16,6 @@ class RewardAdapter :
|
||||
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, "(${item.showTime})")
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
.setGone(R.id.tv_time, !CoreTextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
}
|
@@ -21,6 +21,7 @@ import com.netease.nimlib.sdk.util.Entry;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.avroom.core.AudioRoomContext;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean;
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext;
|
||||
import com.yizhuan.erban.avroom.view.IAvRoomView;
|
||||
import com.yizhuan.erban.base.BaseMvpPresenter;
|
||||
@@ -120,7 +121,6 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
exitRoom();
|
||||
}
|
||||
AvRoomDataManager.get().updateServiceRoomInfo(roomInfo);
|
||||
initAnotherPKData();
|
||||
mAvRoomModel.enterRoom(roomInfo.getRoomId(), 3, fromType, fromNick, fromUid)
|
||||
.flatMap(this::dealServerMicInfo)
|
||||
.map(this::dealMicMemberFromIMNet)
|
||||
@@ -143,6 +143,7 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
.subscribe((stringServiceResult) -> EventBus.getDefault().post(new AudioPartyOpenEvent()));
|
||||
mAvRoomModel.loadMessageHistory(AvRoomDataManager.get().clearScreenTime);
|
||||
IMNetEaseManager.get().joinAvRoom();
|
||||
initAnotherPKData();
|
||||
}, this::dealEnterRoomError);
|
||||
}
|
||||
|
||||
@@ -151,7 +152,15 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
RoomPKModel.INSTANCE.getRoomPKData(AvRoomDataManager.get().getRoomUid())
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(roomPkBean -> AvRoomDataManager.get().roomPkLiveData.setValue(roomPkBean));
|
||||
.subscribe(roomPkBean -> {
|
||||
AvRoomDataManager.get().roomPkLiveData.setValue(roomPkBean);
|
||||
if (AvRoomDataManager.get().isSingleRoom()){
|
||||
AudioEngineManager.get().setRemoteMute(roomPkBean.getAUid(), roomPkBean.getAMicStatus() == 0);
|
||||
if (AvRoomDataManager.get().isRoomOwner()) {
|
||||
AudioEngineManager.get().connectOtherRoom(String.valueOf(roomPkBean.getARoomId()), roomPkBean.getAUid());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -525,20 +525,6 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void loadRoomRank() {
|
||||
String type = AvRoomDataManager.get().isSingleRoom() ? RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING : RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING;
|
||||
RoomContributeListModel.get().getSingleRoomRanking(1, type)
|
||||
.compose(bindToLifecycle())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.subscribe(roomContributeDataInfo -> {
|
||||
if (getMvpView() == null) {
|
||||
return;
|
||||
}
|
||||
getMvpView().updateRoomRanks(roomContributeDataInfo.getRankings());
|
||||
});
|
||||
}
|
||||
|
||||
/***
|
||||
* 發送房間消息
|
||||
* @param message
|
||||
|
@@ -2,15 +2,9 @@ package com.yizhuan.erban.avroom.presenter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyUserListView;
|
||||
import com.yizhuan.erban.base.BaseMvpPresenter;
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.room.model.HomePartyUserListModel;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
@@ -26,49 +20,17 @@ public class HomePartyUserListPresenter extends BaseMvpPresenter<IHomePartyUserL
|
||||
mHomePartyUserListMode = new HomePartyUserListModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取房间成员:第一页包含队列成员,固定成员,游客50人,之后每一页获取游客50人
|
||||
*
|
||||
* @param page 页数
|
||||
* @param time 固定成员列表用updateTime,
|
||||
* 游客列表用进入enterTime,
|
||||
* 填0会使用当前服务器最新时间开始查询,即第一页,单位毫秒
|
||||
*/
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void requestChatMemberByPage(final int page, long time, List<OnlineChatMember> oldList) {
|
||||
mHomePartyUserListMode.getOnLinePageMembers(page, time, oldList)
|
||||
.subscribe(onlineChatMembers -> {
|
||||
Logger.i(ResUtil.getString(R.string.avroom_presenter_homepartyuserlistpresenter_01), page, onlineChatMembers.size());
|
||||
if (getMvpView() != null) {
|
||||
getMvpView().onRequestChatMemberByPageSuccess(onlineChatMembers, page);
|
||||
}
|
||||
}, throwable -> {
|
||||
throwable.printStackTrace();
|
||||
Logger.i(ResUtil.getString(R.string.avroom_presenter_homepartyuserlistpresenter_02), page, throwable.getMessage());
|
||||
if (getMvpView() != null) {
|
||||
getMvpView().onRequestChatMemberByPageFail(throwable.getMessage(), page);
|
||||
}
|
||||
});
|
||||
public void requestRoomOnlineList(long roomUid){
|
||||
mHomePartyUserListMode.getRoomOnlineList(roomUid).compose(bindToLifecycle()).subscribe((data, throwable) -> {
|
||||
if (getMvpView() != null) {
|
||||
if (data != null) {
|
||||
getMvpView().onRequestRoomOnlineListSuccess(data);
|
||||
} else {
|
||||
getMvpView().onRequestChatMemberByPageFail(throwable.getMessage(), 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onMemberDownUpMic(String account, boolean isUpMic, List<OnlineChatMember> dataList,
|
||||
final int page) {
|
||||
mHomePartyUserListMode.onMemberDownUpMic(account, isUpMic, dataList)
|
||||
.subscribe(onlineChatMembers -> {
|
||||
if (getMvpView() != null)
|
||||
getMvpView().onRequestChatMemberByPageSuccess(onlineChatMembers, page);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void onUpdateMemberManager(String account, List<OnlineChatMember> dataList,
|
||||
boolean isRemoveManager, final int page) {
|
||||
mHomePartyUserListMode.onUpdateMemberManager(account, isRemoveManager, dataList)
|
||||
.subscribe(onlineChatMembers -> {
|
||||
if (getMvpView() != null)
|
||||
getMvpView().onRequestChatMemberByPageSuccess(onlineChatMembers, page);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -70,10 +70,20 @@ public class RoomManagerPresenter extends BaseMvpPresenter<IRoomManagerView> {
|
||||
Iterator<ChatRoomMember> iterator = paramList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ChatRoomMember member = iterator.next();
|
||||
if (member != null
|
||||
&& !TextUtils.isEmpty(member.getAccount())
|
||||
&& map.containsKey(member.getAccount())) {
|
||||
iterator.remove();
|
||||
if (member != null && !TextUtils.isEmpty(member.getAccount())) {
|
||||
if (map.containsKey(member.getAccount())) {
|
||||
iterator.remove();
|
||||
} else {
|
||||
if (member.getNick() == null || member.getAvatar() == null) {
|
||||
for (UserInfo info : userInfos) {
|
||||
if (String.valueOf(info.getUid()).equals(member.getAccount())) {
|
||||
member.setNick(info.getNick());
|
||||
member.setAvatar(info.getAvatar());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return paramList;
|
||||
|
@@ -0,0 +1,94 @@
|
||||
package com.yizhuan.erban.avroom.rank
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.chuhai.utils.ktx.singleClick
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.RoomRankWidgetBinding
|
||||
import com.yizhuan.erban.ui.utils.loadAvatar
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.xchat_android_core.support.room.FrameLayoutRoomWidget
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomWidget
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeDataInfo
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeUserInfo
|
||||
import com.yizhuan.xchat_android_core.room.model.RoomContributeListModel
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||
|
||||
/**
|
||||
* 房间榜单入口
|
||||
*/
|
||||
class RoomRankWidget : FrameLayoutRoomWidget, RoomWidget {
|
||||
|
||||
private val binding: RoomRankWidgetBinding =
|
||||
DataBindingUtil.inflate(
|
||||
LayoutInflater.from(
|
||||
context
|
||||
), R.layout.room_rank_widget, this, true
|
||||
)
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
init {
|
||||
this.singleClick {
|
||||
DialogWebViewActivity.start(context, UriProvider.getRoomRanking())
|
||||
refreshData()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onInitialize(roomView: RoomView, roomContext: RoomContext) {
|
||||
super.onInitialize(roomView, roomContext)
|
||||
refreshData()
|
||||
}
|
||||
|
||||
override fun onUnbindContext() {
|
||||
super.onUnbindContext()
|
||||
updateView(null)
|
||||
}
|
||||
|
||||
private fun refreshData() {
|
||||
val disposable = RoomContributeListModel.get()
|
||||
.getSingleRoomRanking(1, RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.subscribe { roomContributeDataInfo: RoomContributeDataInfo ->
|
||||
updateView(roomContributeDataInfo.rankings)
|
||||
}
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
private fun updateView(list: List<RoomContributeUserInfo>?) {
|
||||
arrayListOf(
|
||||
binding.ivRank0, binding.ivRank1, binding.ivRank2
|
||||
).forEachIndexed { index, imageView ->
|
||||
val url = list?.getOrNull(index)?.avatar
|
||||
if (url.isNullOrEmpty()) {
|
||||
imageView.isVisible = false
|
||||
} else {
|
||||
imageView.loadAvatar(url)
|
||||
imageView.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setContentBackgroundResource(resId: Int) {
|
||||
binding.layoutRoot.setBackgroundResource(resId)
|
||||
}
|
||||
}
|
@@ -60,7 +60,7 @@ public class MyRecommendCardActivity extends BaseViewBindingActivity<ActivityMyR
|
||||
@Override
|
||||
public void performAction(View view) {
|
||||
CommonWebViewActivity.start(context, UriProvider.JAVA_WEB_URL +
|
||||
"/peko/modules/recommend-card/help.html");
|
||||
"/repo/modules/recommend-card/help.html");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -10,8 +10,8 @@ import com.yizhuan.erban.common.widget.dialog.DialogManager
|
||||
import com.yizhuan.erban.databinding.DialogRedPackageGoRoomBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
|
@@ -10,7 +10,7 @@ import com.yizhuan.xchat_android_core.im.custom.bean.RedPackageAttachment
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomHandler
|
||||
|
||||
|
@@ -13,7 +13,7 @@ import com.yizhuan.erban.avroom.redpackage.open.RedPackageOpenDialog
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager
|
||||
import com.yizhuan.erban.databinding.RedPackageWidgetBinding
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.support.room.FrameLayoutRoomWidget
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView
|
||||
@@ -21,7 +21,6 @@ import com.yizhuan.xchat_android_core.support.room.RoomWidget
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.disposables.Disposable
|
||||
import okhttp3.internal.toLongOrDefault
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -56,8 +55,6 @@ class RedPackageWidget : FrameLayoutRoomWidget, RoomWidget {
|
||||
), R.layout.red_package_widget, this, true
|
||||
)
|
||||
|
||||
private var compositeDisposable: CompositeDisposable? = null
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
@@ -218,26 +215,14 @@ class RedPackageWidget : FrameLayoutRoomWidget, RoomWidget {
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
private fun getCompositeDisposable(): CompositeDisposable {
|
||||
var disposable = compositeDisposable
|
||||
if (disposable == null) {
|
||||
disposable = CompositeDisposable()
|
||||
compositeDisposable = disposable
|
||||
}
|
||||
return disposable
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
this.dialogManager?.dismissDialog()
|
||||
this.dialogManager = null
|
||||
this.roomView = null
|
||||
}
|
||||
|
||||
override fun onUnbindContext() {
|
||||
super.onUnbindContext()
|
||||
compositeDisposable?.dispose()
|
||||
compositeDisposable = null
|
||||
loadData(null)
|
||||
}
|
||||
|
||||
|
@@ -32,6 +32,10 @@ import com.yizhuan.xchat_android_core.home.model.CollectionRoomModel
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||
import com.yizhuan.xchat_android_core.redpackage.*
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedEnvelopeState
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageData
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageInfo
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.support.config.Constants
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.yizhuan.erban.avroom.redpackage.open
|
||||
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.core.view.isVisible
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
@@ -9,8 +8,8 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.loadAvatar
|
||||
import com.yizhuan.erban.utils.UserUtils
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedEnvelopeItemVO
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedEnvelopeItemVO
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
@@ -21,7 +21,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.utils.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toIntOrDef
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||
|
@@ -17,7 +17,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.utils.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toIntOrDef
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||
import com.yizhuan.xchat_android_library.utils.codec.DESUtils
|
||||
|
@@ -10,7 +10,7 @@ import androidx.appcompat.widget.AppCompatTextView;
|
||||
|
||||
import com.chuhai.utils.UiUtils;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
|
@@ -7,7 +7,7 @@ import com.yizhuan.erban.avroom.bean.RoomAlbumPhotoInfo
|
||||
import com.yizhuan.erban.base.BaseViewModel
|
||||
import com.yizhuan.xchat_android_core.Constants
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
|
||||
class RoomAlbumFragmentViewModel : BaseViewModel() {
|
||||
|
||||
|
@@ -8,7 +8,7 @@ import com.yizhuan.erban.base.Event
|
||||
import com.yizhuan.xchat_android_core.file.FileModel
|
||||
import com.yizhuan.xchat_android_core.gift.bean.GiftInfo
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
|
@@ -17,8 +17,10 @@ import com.yizhuan.erban.ui.user.activity.UserInfoActivity
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SingleRoomPKModel
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@@ -30,7 +32,7 @@ class SingleRoomPKBoardView @JvmOverloads constructor(
|
||||
) : FrameLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
private val binding = LayoutSingleRoomPkBoardViewBinding.inflate(LayoutInflater.from(context))
|
||||
private val observer = Observer<RoomPkBean> { updateView(it) }
|
||||
private val observer = Observer<RoomPkBean?> { updateView(it) }
|
||||
private var disposable: Disposable? = null
|
||||
private var roomPkBean: RoomPkBean? = null
|
||||
|
||||
@@ -55,6 +57,20 @@ class SingleRoomPKBoardView @JvmOverloads constructor(
|
||||
SingleRoomPkRuleDialog.newInstance().show(context)
|
||||
}
|
||||
|
||||
binding.ivMuteAnother.setOnClickListener {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
roomPkBean?.let {
|
||||
if (it.roundId == null) {
|
||||
return@let
|
||||
}
|
||||
SingleRoomPKModel
|
||||
.muteSingleRoomPkOtherMic(it.roundId, it.aMicStatus xor 1)
|
||||
.subscribe()
|
||||
}
|
||||
} else {
|
||||
"主播已關閉對方房間的聲音".toast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
@@ -118,7 +134,13 @@ class SingleRoomPKBoardView @JvmOverloads constructor(
|
||||
binding.ivPkResult.isVisible = true
|
||||
binding.ivPkResult.setImageResource(R.drawable.single_room_pk_ic_result_win)
|
||||
}
|
||||
|
||||
if (roomPkBean?.aMicStatus == 0) {
|
||||
binding.ivMuteAnother.isVisible = true
|
||||
binding.ivMuteAnother.setImageResource(R.drawable.single_room_pk_ic_another_mic_close)
|
||||
} else {
|
||||
binding.ivMuteAnother.setImageResource(R.drawable.single_room_pk_ic_another_mic_open)
|
||||
binding.ivMuteAnother.isVisible = AvRoomDataManager.get().isRoomOwner
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -16,10 +16,10 @@ import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SingleRoomPKModel
|
||||
import com.yizhuan.xchat_android_core.utils.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class SingleRoomPKCreateActivity : BaseViewBindingActivity<ActivitySingleRoomPkCreateBinding>() {
|
||||
@@ -94,7 +94,8 @@ class SingleRoomPKCreateActivity : BaseViewBindingActivity<ActivitySingleRoomPkC
|
||||
|
||||
binding.tvOk.setOnClickListener {
|
||||
if (pkTime < 5 || pkTime > 30) {
|
||||
ResUtil.getString(R.string.avroom_singleroompk_singleroompkcreateactivity_01).toast()
|
||||
ResUtil.getString(R.string.avroom_singleroompk_singleroompkcreateactivity_01)
|
||||
.toast()
|
||||
return@setOnClickListener
|
||||
}
|
||||
currSimpleRoomInfo?.let {
|
||||
|
@@ -8,7 +8,7 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
|
||||
class SingleRoomPKSearchAdapter :
|
||||
BaseQuickAdapter<SimpleRoomInfo, BaseViewHolder>(R.layout.item_single_room_pk_search) {
|
||||
|
@@ -9,7 +9,7 @@ import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogSingleRoomPkFinishBinding
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
@@ -8,7 +8,7 @@ import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogSingleRoomPkForceFinishBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
|
||||
class SingleRoomPkForceFinishDialog : BaseDialog<DialogSingleRoomPkForceFinishBinding>() {
|
||||
|
||||
|
@@ -8,9 +8,9 @@ import com.yizhuan.erban.databinding.DialogSingleRoomPkReceivedBinding
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SingleRoomPKModel
|
||||
import com.yizhuan.xchat_android_core.utils.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
@@ -4,7 +4,7 @@ import android.text.method.ScrollingMovementMethod
|
||||
import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogSingleRoomPkRuleBinding
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SingleRoomPKModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
|
||||
class SingleRoomPkRuleDialog : BaseDialog<DialogSingleRoomPkRuleBinding>() {
|
||||
|
||||
|
@@ -71,6 +71,4 @@ interface IBaseRoomView : IMvpBaseView {
|
||||
|
||||
fun updateMicView()
|
||||
|
||||
fun updateRoomRanks(data: List<RoomContributeUserInfo>)
|
||||
|
||||
}
|
@@ -3,6 +3,7 @@ package com.yizhuan.erban.avroom.view;
|
||||
|
||||
|
||||
import com.yizhuan.xchat_android_core.room.bean.OnlineChatMember;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomOnlineUserBean;
|
||||
import com.yizhuan.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
@@ -14,7 +15,8 @@ import java.util.List;
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public interface IHomePartyUserListView extends IMvpBaseView {
|
||||
void onRequestChatMemberByPageSuccess(List<OnlineChatMember> memberList, int page);
|
||||
|
||||
void onRequestRoomOnlineListSuccess(List<RoomOnlineUserBean> list);
|
||||
|
||||
void onRequestChatMemberByPageFail(String errorStr, int page);
|
||||
|
||||
|
@@ -39,7 +39,7 @@ import com.yizhuan.xchat_android_core.room.bean.RoomModeType;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_core.utils.extension.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
|
||||
|
@@ -34,7 +34,7 @@ import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.common.svga.SimpleSvgaParseCompletion;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.xchat_android_core.fansteam.FansTeamMsgInfo;
|
||||
import com.yizhuan.xchat_android_core.fansteam.bean.FansTeamMsgInfo;
|
||||
import com.yizhuan.xchat_android_core.gift.GiftModel;
|
||||
import com.yizhuan.xchat_android_core.gift.bean.GiftEffectInfo;
|
||||
import com.yizhuan.xchat_android_core.gift.bean.GiftInfo;
|
||||
|
@@ -73,7 +73,7 @@ import com.yizhuan.erban.UIHelper;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.avroom.dialog.PKResultDialog;
|
||||
import com.yizhuan.erban.avroom.room_album.UnlockRoomAlbumPhotoDialog;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
import com.yizhuan.erban.common.widget.CustomAutoWidthImageSpan;
|
||||
import com.yizhuan.erban.common.widget.CustomImageSpan;
|
||||
import com.yizhuan.erban.common.widget.OriginalDrawStatusClickSpan;
|
||||
@@ -95,7 +95,7 @@ import com.yizhuan.xchat_android_core.DemoCache;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.bean.attachmsg.RoomQueueMsgAttachment;
|
||||
import com.yizhuan.xchat_android_core.decoration.car.bean.CarInfo;
|
||||
import com.yizhuan.xchat_android_core.fansteam.FansTeamMsgInfo;
|
||||
import com.yizhuan.xchat_android_core.fansteam.bean.FansTeamMsgInfo;
|
||||
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.GiftList;
|
||||
@@ -157,11 +157,11 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.miniworld.bean.MiniWorldInWorldInfo;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterHuntingResult;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterProtocol;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.monsterhunting.bean.MonsterDataBean;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.praise.PraiseModel;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedEnvelopeRoomMsg;
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedEnvelopeRoomMsg;
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowUserInfoDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.room.bean.DatingNotifyInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
@@ -177,14 +177,14 @@ import com.yizhuan.xchat_android_core.room.pk.bean.RoomPKInvitedUpMicMember;
|
||||
import com.yizhuan.xchat_android_core.room.pk.bean.RoomPkData;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.attachment.QueuingMicAttachment;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.bean.QueuingMicInfo;
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.FairyMsgInfoBean;
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.bean.FairyMsgInfoBean;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.ExtensionUtil;
|
||||
import com.yizhuan.xchat_android_core.utils.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_core.utils.extension.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_core.vip.VipMessageInfo;
|
||||
import com.yizhuan.xchat_android_core.vip.bean.VipMessageInfo;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||
import com.yizhuan.xchat_android_library.utils.FormatUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
@@ -898,7 +898,7 @@ public class MessageView extends FrameLayout {
|
||||
} else if (first == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MONSTER_HUNTING) {
|
||||
switch (second) {
|
||||
case CustomAttachment.CUSTOM_MSG_SUB_TYPE_MONSTER_HUNTING:
|
||||
MonsterProtocol.DataBean dataBean = ((MonsterStatusAttachment) attachment).getDataBean();
|
||||
MonsterDataBean dataBean = ((MonsterStatusAttachment) attachment).getDataBean();
|
||||
setMonsterNotifyMessage(tvContent, dataBean.getNotifyMessage());
|
||||
break;
|
||||
case CustomAttachment.CUSTOM_NOTI_SUB_GAME_RESULT:
|
||||
@@ -2248,8 +2248,12 @@ public class MessageView extends FrameLayout {
|
||||
//等級
|
||||
builder.append(userLevel, expLevelHeight);
|
||||
//銘牌
|
||||
boolean isCustom = NobleUtil.getExtBoolean( chatRoomMessage,UserInfo.NAMEPLATE_IS_CUSTOM,false);
|
||||
String tvNamePlate = NobleUtil.getNamePlate(UserInfo.NAMEPLATE_WORD, chatRoomMessage).trim();
|
||||
String ivNamePlate = NobleUtil.getNamePlate(UserInfo.NAMEPLATE_PIC, chatRoomMessage);
|
||||
if (isCustom) {
|
||||
tvNamePlate = null;
|
||||
}
|
||||
if (!TextUtils.isEmpty(tvNamePlate) && !TextUtils.isEmpty(ivNamePlate)) { // extension != null 表示自己
|
||||
builder.appendBgAndContent(ivNamePlate, tvNamePlate);
|
||||
} else if (!TextUtils.isEmpty(ivNamePlate)) {
|
||||
@@ -3030,7 +3034,7 @@ public class MessageView extends FrameLayout {
|
||||
} else if (attachment.getFirst() == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MONSTER_HUNTING) {
|
||||
switch (attachment.getSecond()) {
|
||||
case CustomAttachment.CUSTOM_MSG_SUB_TYPE_MONSTER_HUNTING:
|
||||
MonsterProtocol.DataBean dataBean = ((MonsterStatusAttachment) attachment).getDataBean();
|
||||
MonsterDataBean dataBean = ((MonsterStatusAttachment) attachment).getDataBean();
|
||||
RoomInfo mCurrentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (!Objects.equals(mCurrentRoomInfo.getUid(), dataBean.getAppearRoomUid())) {
|
||||
AVRoomActivity.start(getContext(), dataBean.getAppearRoomUid());
|
||||
|
@@ -51,7 +51,7 @@ import com.yizhuan.xchat_android_core.room.bean.DatingNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import com.yizhuan.xchat_android_library.utils.StringUtils
|
||||
|
@@ -19,8 +19,12 @@ import android.view.animation.AnimationUtils
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.NonNull
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.text.HtmlCompat
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.chuhai.utils.UiUtils
|
||||
import com.chuhai.utils.ktx.setPadding2
|
||||
import com.coorchice.library.SuperTextView
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage
|
||||
@@ -31,6 +35,7 @@ import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||
import com.yizhuan.erban.avroom.bean.RoomPlayBean
|
||||
import com.yizhuan.erban.avroom.helper.AnimHelper
|
||||
import com.yizhuan.erban.base.TitleBar
|
||||
import com.yizhuan.erban.common.svga.SimpleSvgaCallback
|
||||
import com.yizhuan.erban.databinding.LayoutRoomEffectBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
@@ -39,8 +44,9 @@ import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.erban.ui.utils.loadAnim
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.erban.ui.widget.SimpleAnimListener
|
||||
import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftGoRoomTipsDialog
|
||||
import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftGoRoomTipsDialog.Companion.isNeedTips
|
||||
import com.yizhuan.erban.ui.widget.drawgift.DrawGiftPlayHelper
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.yizhuan.erban.utils.MsgBuilder
|
||||
import com.yizhuan.erban.utils.RegexUtil
|
||||
import com.yizhuan.erban.utils.SpannableBuilder
|
||||
@@ -56,7 +62,7 @@ import com.yizhuan.xchat_android_core.room.bean.DatingNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.extension.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import com.yizhuan.xchat_android_library.utils.StringUtils
|
||||
@@ -134,14 +140,22 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
|
||||
private val drawGiftPlayHelper: DrawGiftPlayHelper by lazy { DrawGiftPlayHelper(context as Activity) }
|
||||
|
||||
private var isPlayAnim = false
|
||||
private var playNotifyStateLiveData: MutableLiveData<Boolean>? = null
|
||||
|
||||
private var onPlayAnimCallback: (() -> Boolean)? = null
|
||||
fun setPlayNotifyStateListener(stateLiveData: MutableLiveData<Boolean>) {
|
||||
this.playNotifyStateLiveData = stateLiveData
|
||||
}
|
||||
|
||||
fun setOnPlayAnimCallback(onPlayAnimCallback: (() -> Boolean)) {
|
||||
this.onPlayAnimCallback = onPlayAnimCallback
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private fun isShowingGiftNotify(): Boolean {
|
||||
return onPlayAnimCallback?.invoke() ?: false
|
||||
}
|
||||
|
||||
private fun loopCarAnim() {
|
||||
if (context.isDestroyed()) return
|
||||
isSvgaPlaying = false
|
||||
@@ -230,7 +244,7 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
|
||||
RoomEvent.ROOM_PK_NOTIFY -> addRoomPKNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.SINGLE_ROOM_PK_NOTIFY -> addSingleRoomPKNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.SINGLE_ROOM_RANK_TOP_NOTIFY -> showRoomRankNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.SINGLE_ROOM_RANK_TOP_NOTIFY -> showSingleRoomRankNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.ROOM_RANK_TOP_NOTIFY -> showRoomRankNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.ROOM_CAR_EFFECT_HIDE -> {
|
||||
isHideCarEffect = true
|
||||
@@ -265,6 +279,11 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
loopCarAnim()
|
||||
}
|
||||
})
|
||||
var statusBarHeight = TitleBar.getStatusBarHeight()
|
||||
if (statusBarHeight == 0) {
|
||||
statusBarHeight = UiUtils.dip2px(25f)
|
||||
}
|
||||
binding.clNotify.setPadding2(top = binding.clNotify.paddingTop + statusBarHeight)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -285,29 +304,15 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
if (binding.flPlayNotify.childCount != 0) {
|
||||
return@subscribe
|
||||
}
|
||||
|
||||
if (binding.flLuckyBagNotify.childCount != 0) {
|
||||
return@subscribe
|
||||
}
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
when (messagesPlay[0].event) {
|
||||
RoomEvent.BOX_NOTIFY -> {//寻爱
|
||||
if ((mContext as AVRoomActivity).isTopActivity) {
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 180.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
} else {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 60.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
}
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showBoxNotify(
|
||||
messagesPlay.removeAt(0)
|
||||
)
|
||||
@@ -316,50 +321,16 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
|
||||
RoomEvent.BOX_NOTIFY_SVGA -> {//寻爱
|
||||
if ((mContext as AVRoomActivity).isTopActivity) {
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 180.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
} else {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 60.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
}
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showBoxNotifyBySVGA(messagesPlay.removeAt(0))
|
||||
}
|
||||
}
|
||||
|
||||
RoomEvent.TAROT_NOTIFY -> {
|
||||
if ((mContext as AVRoomActivity).isTopActivity) {
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 180.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
} else {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 60.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
}
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showTarotNotify(
|
||||
messagesPlay.removeAt(0)
|
||||
)
|
||||
@@ -368,25 +339,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
|
||||
RoomEvent.TAROT_NOTIFY_SVGA -> {
|
||||
if ((mContext as AVRoomActivity).isTopActivity) {
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 180.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
} else {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 60.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
}
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showTarotNotifyBySVGA(messagesPlay.removeAt(0))
|
||||
}
|
||||
}
|
||||
@@ -395,17 +349,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
if (!(mContext as AVRoomActivity).isTopActivity) {
|
||||
return@subscribe
|
||||
}
|
||||
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, if (isPlay) 180.0 else 60.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
val msg = messagesPlay.removeAt(0)
|
||||
val attachment = msg.chatRoomMessage.attachment as NotifyH5Attachment
|
||||
val bean = attachment.bean ?: return@subscribe
|
||||
@@ -418,39 +363,24 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
RoomEvent.RECEIVE_ROOM_LUCKY_BAG_NOTICE, RoomEvent.RECEIVE_SERVICE_LUCKY_BAG_NOTICE -> {//福袋
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(binding.clNotify, 0, UIUtil.dip2px(context, 180.0), 0, 0)
|
||||
} else {
|
||||
margin(binding.clNotify, 0, UIUtil.dip2px(context, 60.0), 0, 0)
|
||||
}
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showLuckyBagNotify(
|
||||
messagesPlay.removeAt(0)
|
||||
)
|
||||
}
|
||||
|
||||
RoomEvent.LUCKY_SEA_GIFT_ROOM_NOTIFY -> {//星级厨房
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(binding.clNotify, 0, UIUtil.dip2px(context, 180.0), 0, 0)
|
||||
} else {
|
||||
margin(binding.clNotify, 0, UIUtil.dip2px(context, 60.0), 0, 0)
|
||||
}
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showLuckySeaNotify(
|
||||
messagesPlay.removeAt(0)
|
||||
)
|
||||
}
|
||||
|
||||
RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY -> {//星级厨房
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(binding.clNotify, 0, UIUtil.dip2px(context, 180.0), 0, 0)
|
||||
} else {
|
||||
margin(binding.clNotify, 0, UIUtil.dip2px(context, 60.0), 0, 0)
|
||||
}
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showLuckySeaNotifyBySVGA(
|
||||
messagesPlay.removeAt(0)
|
||||
)
|
||||
@@ -461,13 +391,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
RoomEvent.FAIRY_CONVERT_L1,
|
||||
RoomEvent.FAIRY_CONVERT_L2,
|
||||
RoomEvent.FAIRY_CONVERT_L3 -> {//夺宝
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(binding.clNotify, 0, UIUtil.dip2px(context, 180.0), 0, 0)
|
||||
} else {
|
||||
margin(binding.clNotify, 0, UIUtil.dip2px(context, 60.0), 0, 0)
|
||||
}
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showFairyNotify(
|
||||
messagesPlay.removeAt(0)
|
||||
)
|
||||
@@ -494,8 +419,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
textView.startAnimation(animationPlay)
|
||||
binding.flPlayNotify.postDelayed(
|
||||
{
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(textView)
|
||||
isPlayAnim = false
|
||||
},
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
@@ -521,8 +446,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
override fun onFinished() {
|
||||
binding.flPlayNotify.post {
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(svgaImageView)
|
||||
isPlayAnim = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -641,6 +566,19 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
) + "…"
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置玩法飘窗间距
|
||||
*/
|
||||
private fun resetPlayNotifyMargin() {
|
||||
var top = 0
|
||||
if (isShowingGiftNotify()) {
|
||||
// 有礼物飘窗展示时,需要在它下面展示
|
||||
// 间距 = 礼物飘窗高度(375:69) + 10DP间距
|
||||
top = (width / 375f * 69).toInt() + UiUtils.dip2px(10f)
|
||||
}
|
||||
margin(binding.clNotify, 0, top, 0, 0)
|
||||
}
|
||||
|
||||
private fun margin(v: View, l: Int, t: Int, r: Int, b: Int) {
|
||||
if (v.layoutParams is MarginLayoutParams) {
|
||||
val params = v.layoutParams as MarginLayoutParams
|
||||
@@ -653,89 +591,69 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
val message = roomPlayBean.chatRoomMessage
|
||||
val attachment = message.attachment as? RoomReceivedLuckyGiftAttachment ?: return
|
||||
val noticeInfo = attachment.luckyBagNoticeInfo ?: return
|
||||
val roomView = LayoutInflater.from(mContext)
|
||||
.inflate(R.layout.layout_room_lucky_bag_notify, null)
|
||||
val bagImageView = roomView.findViewById<ImageView>(R.id.iv_bag)
|
||||
bagImageView.load(noticeInfo.luckyBagGiftPic)
|
||||
val giftImageView = roomView.findViewById<ImageView>(R.id.iv_gift)
|
||||
giftImageView.load(noticeInfo.giftPic)
|
||||
val messageTextView = roomView.findViewById<TextView>(R.id.tv_message)
|
||||
val text = SpannableBuilder()
|
||||
.append(
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_04),
|
||||
noticeInfo.nick.subAndReplaceDot(6),
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_FFF45E))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_027),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
noticeInfo.nick.subAndReplaceDot(6) + " ",
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
noticeInfo.luckyBagName,
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_FFF45E))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_05),
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_028),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
noticeInfo.luckyBagName + " ",
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
noticeInfo.goldPrice + ResUtil.getString(R.string.diamond_name),
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.notice_nick))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_06),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
noticeInfo.goldPrice + " ",
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_07),
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_029),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
noticeInfo.giftName,
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.notice_nick))
|
||||
)
|
||||
if (noticeInfo.giftNum > 1) {
|
||||
text.append(
|
||||
"X" + noticeInfo.giftNum,
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.white))
|
||||
)
|
||||
|
||||
val svgaImageView = SVGAImageView(mContext)
|
||||
svgaImageView.loops = 1
|
||||
svgaImageView.clearsAfterStop = true
|
||||
shareParser().decodeFromAssets(
|
||||
"svga/lucky_gift_notify.svga",
|
||||
object : SVGAParser.ParseCompletion {
|
||||
override fun onComplete(videoItem: SVGAVideoEntity) {
|
||||
binding.flPlayNotify.addView(svgaImageView)
|
||||
val dynamicEntity = SVGADynamicEntity()
|
||||
val textPaint = TextPaint()
|
||||
textPaint.color = Color.WHITE //字體顏色
|
||||
textPaint.textSize = 24f //字體大小
|
||||
dynamicEntity.setDynamicText(
|
||||
StaticLayout(
|
||||
text.build(),
|
||||
0,
|
||||
text.build().length,
|
||||
textPaint,
|
||||
0,
|
||||
Layout.Alignment.ALIGN_CENTER,
|
||||
1.0f,
|
||||
0.0f,
|
||||
false
|
||||
), "fdpp_copywriting"
|
||||
)
|
||||
if (AvRoomDataManager.get().roomUid == noticeInfo.roomUid) {
|
||||
dynamicEntity.setHidden(true, "img_206")
|
||||
} else {
|
||||
svgaImageView.setOnClickListener {
|
||||
//跳轉房間要移除監聽,不然可能NPE
|
||||
svgaImageView.callback = null
|
||||
AVRoomActivity.start(mContext, noticeInfo.roomUid)
|
||||
}
|
||||
}
|
||||
val drawable = SVGADrawable(videoItem, dynamicEntity)
|
||||
svgaImageView.setImageDrawable(drawable)
|
||||
svgaImageView.stepToFrame(0, true)
|
||||
}
|
||||
|
||||
override fun onError() {}
|
||||
})
|
||||
svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
override fun onFinished() {
|
||||
binding.flPlayNotify.post {
|
||||
binding.flPlayNotify.removeView(svgaImageView)
|
||||
isPlayAnim = false
|
||||
}
|
||||
}
|
||||
}
|
||||
messageTextView.text = text.build()
|
||||
bagImageView.setOnClickListener {
|
||||
goRoom(noticeInfo.roomTitle, noticeInfo.roomUid)
|
||||
}
|
||||
giftImageView.setOnClickListener {
|
||||
goRoom(noticeInfo.roomTitle, noticeInfo.roomUid)
|
||||
}
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
binding.flLuckyBagNotify.addView(roomView)
|
||||
roomView.startAnimation(animationPlay)
|
||||
binding.flLuckyBagNotify.postDelayed(
|
||||
{
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
roomView.startAnimation(animationPlay)
|
||||
},
|
||||
6500
|
||||
)
|
||||
binding.flLuckyBagNotify.postDelayed({
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flLuckyBagNotify.removeView(roomView)
|
||||
}, 7000)
|
||||
}
|
||||
|
||||
private fun showLuckySeaNotify(roomPlayBean: RoomPlayBean) {
|
||||
@@ -780,8 +698,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
textView.startAnimation(animationPlay)
|
||||
binding.flPlayNotify.postDelayed(
|
||||
{
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(textView)
|
||||
isPlayAnim = false
|
||||
},
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
@@ -828,8 +746,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
override fun onFinished() {
|
||||
binding.flPlayNotify.post {
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(svgaImageView)
|
||||
isPlayAnim = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -873,7 +791,7 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
|
||||
private fun showNotifyH5(data: NotifyH5Info) {
|
||||
val textView = LayoutInflater.from(mContext)
|
||||
.inflate(R.layout.layout_notify_h5, null) as TextView
|
||||
.inflate(R.layout.layout_notify_h5, null) as TextView
|
||||
textView.text = data.content
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
binding.flPlayNotify.addView(textView)
|
||||
@@ -886,8 +804,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
binding.flPlayNotify.postDelayed({
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(textView)
|
||||
isPlayAnim = false
|
||||
}, CLOSE_TIME.toLong())
|
||||
}
|
||||
|
||||
@@ -901,8 +819,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
override fun onFinished() {
|
||||
binding.flPlayNotify.post {
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(svgaImageView)
|
||||
isPlayAnim = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -962,8 +880,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
binding.flPlayNotify.postDelayed({
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(textView)
|
||||
isPlayAnim = false
|
||||
}, CLOSE_TIME.toLong())
|
||||
}
|
||||
|
||||
@@ -1005,8 +923,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
binding.flPlayNotify.postDelayed({
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(textView)
|
||||
isPlayAnim = false
|
||||
}, CLOSE_TIME.toLong())
|
||||
}
|
||||
|
||||
@@ -1028,8 +946,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
override fun onFinished() {
|
||||
binding.flPlayNotify.post {
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(svgaImageView)
|
||||
isPlayAnim = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1100,8 +1018,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
animationPlay!!.setAnimationListener(object : SimpleAnimationListener() {
|
||||
override fun onAnimationEnd(animation: Animation?) {
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(svgaImageView)
|
||||
isPlayAnim = false
|
||||
}
|
||||
})
|
||||
binding.flPlayNotify.startAnimation(animationPlay)
|
||||
@@ -1907,6 +1825,27 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
)
|
||||
}
|
||||
|
||||
private fun showSingleRoomRankNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
if (binding.clNotify.visibility == GONE) {
|
||||
binding.clNotify.visibility = VISIBLE
|
||||
}
|
||||
val roomPkBean = (chatRoomMessage.attachment as SingleRoomRankAttachment).msgBean
|
||||
val rootView =
|
||||
LayoutInflater.from(mContext).inflate(R.layout.layout_single_room_rank_notify, null)
|
||||
(rootView.findViewById<View>(R.id.tv_nick) as TextView).text =
|
||||
roomPkBean.nick.subAndReplaceDot(6)
|
||||
(rootView.findViewById<View>(R.id.tv_desc) as TextView).text = roomPkBean.desc
|
||||
rootView.findViewById<ImageView>(R.id.iv_avatar).load(roomPkBean.avatar)
|
||||
rootView.setOnClickListener { AVRoomActivity.start(context, roomPkBean.uid) }
|
||||
binding.flSingleRoomRankNotify.addView(rootView)
|
||||
animationLuckyGift = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
rootView.startAnimation(animationLuckyGift)
|
||||
binding.flSingleRoomRankNotify.postDelayed({
|
||||
binding.flSingleRoomRankNotify.removeView(
|
||||
rootView
|
||||
)
|
||||
}, SHOW_TIME.toLong())
|
||||
}
|
||||
|
||||
private fun showRoomRankNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
if (binding.clNotify.visibility == GONE) {
|
||||
@@ -1935,10 +1874,6 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
}, SHOW_TIME.toLong())
|
||||
}
|
||||
|
||||
fun getIsPlayAnim(): Boolean {
|
||||
return isPlayAnim
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
playDisposable?.dispose()
|
||||
@@ -1952,7 +1887,20 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
disposableRoomPK?.dispose()
|
||||
disposableSingleRoomPK?.dispose()
|
||||
disposableGiftCompound?.dispose()
|
||||
isPlayAnim = false
|
||||
playNotifyStateLiveData?.value = false
|
||||
}
|
||||
|
||||
private fun goRoom(roomTitle: String, roomUid: Long) {
|
||||
if (roomUid <= 0L) {
|
||||
return
|
||||
}
|
||||
if (roomUid == AvRoomDataManager.get().roomUid) {
|
||||
return
|
||||
}
|
||||
if (isNeedTips()) {
|
||||
AllServiceGiftGoRoomTipsDialog(context, roomTitle, roomUid).show()
|
||||
} else {
|
||||
AVRoomActivity.start(context, roomUid)
|
||||
}
|
||||
}
|
||||
}
|
@@ -110,21 +110,21 @@ 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.mentoring_relationship.event.GrabApprenticesEvent;
|
||||
import com.yizhuan.xchat_android_core.newbie.NewbieHelloInfo;
|
||||
import com.yizhuan.xchat_android_core.newbie.bean.NewbieHelloInfo;
|
||||
import com.yizhuan.xchat_android_core.newbie.event.NewbieHelloDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.noble.AllServiceGiftProtocol;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleProtocol;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.AllServiceGiftProtocolDataBean;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.bean.NobleProtocol;
|
||||
import com.yizhuan.xchat_android_core.pay.PayModel;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.WalletInfo;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo;
|
||||
import com.yizhuan.xchat_android_core.redpackage.bean.RedPackageNotifyInfo;
|
||||
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.RoomContext;
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.FairyMsgInfoBean;
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.bean.FairyMsgInfoBean;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_core.vip.VipMessageInfo;
|
||||
import com.yizhuan.xchat_android_core.vip.bean.VipMessageInfo;
|
||||
import com.yizhuan.xchat_android_library.common.util.DeviceUtil;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||
import com.yizhuan.xchat_android_library.utils.AppMetaDataUtil;
|
||||
@@ -177,7 +177,7 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
private boolean isShowingChargeDialog;
|
||||
|
||||
private Dialog giftDialog;
|
||||
private LinkedList<AllServiceGiftProtocol.DataBean> giftList;
|
||||
private LinkedList<AllServiceGiftProtocolDataBean> giftList;
|
||||
|
||||
private Dialog playEffectDialog;
|
||||
private LinkedList<PlayEffectInfo> playEffectList;
|
||||
@@ -988,21 +988,14 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
giftList = new LinkedList<>();
|
||||
}
|
||||
int second2 = baseProtocol.getSecond();
|
||||
AllServiceGiftProtocol.DataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocol.DataBean.class);
|
||||
AllServiceGiftProtocolDataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocolDataBean.class);
|
||||
if (data == null || data.getGiftUrl() == null) return;
|
||||
giftList.add(data);
|
||||
if (second2 == CUSTOM_MSG_ALL_SERVICE_GIFT) {
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
// 如果当前以及有礼物弹窗在展示,则需要等到他 dismiss 后再显示下一个
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
return;
|
||||
} else {
|
||||
giftDialog.dismiss();
|
||||
}
|
||||
} else {
|
||||
showGiftDialog();
|
||||
if (isShowingPlayNotify()) {
|
||||
return;
|
||||
}
|
||||
showGiftDialog();
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_BOX://寻爱之旅
|
||||
@@ -1187,8 +1180,11 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
|
||||
private void showPlayEffectDialog() {
|
||||
if (playEffectList.size() == 0) return;
|
||||
playEffectDialog = new AllPlayEffectDialog(this, playEffectList.peekFirst());
|
||||
PlayEffectInfo info = playEffectList.peekFirst();
|
||||
if (info == null) return;
|
||||
playEffectDialog = new AllPlayEffectDialog(this, info, isShowingGiftNotify());
|
||||
playEffectDialog.setOnDismissListener(dialog -> {
|
||||
tryShowGiftDialog();
|
||||
playEffectList.pollFirst();
|
||||
PlayEffectInfo dataBean = playEffectList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
@@ -1206,19 +1202,27 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
}
|
||||
}
|
||||
|
||||
private void tryShowGiftDialog() {
|
||||
showGiftDialog();
|
||||
}
|
||||
|
||||
private void showGiftDialog() {
|
||||
if (giftList == null) return;
|
||||
if (giftList.size() == 0) return;
|
||||
AllServiceGiftProtocol.DataBean data = giftList.peekFirst();
|
||||
AllServiceGiftProtocolDataBean data = giftList.peekFirst();
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
return;
|
||||
}
|
||||
if (!data.isHomeShow()) {
|
||||
return;
|
||||
}
|
||||
giftDialog = generateAllServiceGiftDialog(this, data);
|
||||
giftDialog.setOnDismissListener(dialog -> {
|
||||
giftList.pollFirst();
|
||||
AllServiceGiftProtocol.DataBean dataBean = giftList.peekFirst();
|
||||
AllServiceGiftProtocolDataBean dataBean = giftList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
if (isValid()) {
|
||||
showGiftDialog();
|
||||
@@ -1234,7 +1238,21 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
}
|
||||
}
|
||||
|
||||
private AllServiceGiftLevelDialog generateAllServiceGiftDialog(@NonNull Context context, @NonNull AllServiceGiftProtocol.DataBean dataBean) {
|
||||
private boolean isShowingGiftNotify() {
|
||||
if (giftDialog != null && giftDialog.isShowing()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isShowingPlayNotify() {
|
||||
if (playEffectDialog != null && playEffectDialog.isShowing()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private AllServiceGiftLevelDialog generateAllServiceGiftDialog(@NonNull Context context, @NonNull AllServiceGiftProtocolDataBean dataBean) {
|
||||
return new AllServiceGiftLevelDialog(context, dataBean);
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@ import java.lang.reflect.ParameterizedType
|
||||
abstract class BaseDialog<T : ViewBinding> : RxDialogFragment() {
|
||||
|
||||
val isViewLoaded: Boolean get() = _binding != null
|
||||
private var _binding: T? = null
|
||||
protected var _binding: T? = null
|
||||
private var onDismissListener: (() -> Unit)? = null
|
||||
val binding get() = _binding!!
|
||||
open var width = ScreenUtil.getDialogWidth()
|
||||
|
@@ -4,7 +4,7 @@ import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_core.utils.extension.toast
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.exception.ExceptionHandle
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
@@ -19,7 +19,7 @@ public abstract class CommonAdapter<T, K extends BaseViewHolder> extends Recycle
|
||||
|
||||
private List<T> mData;
|
||||
|
||||
private OnItemClickListener<T, K> mOnItemClickListener;
|
||||
private OnItemParentClickListener<T, K> mOnItemClickListener;
|
||||
|
||||
private OnItemChildClickListener<T, K> mOnItemChildClickListener;
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class CommonAdapter<T, K extends BaseViewHolder> extends Recycle
|
||||
return this;
|
||||
}
|
||||
|
||||
public CommonAdapter<T, K> setOnItemClickListener(OnItemClickListener<T, K> onItemClickListener) {
|
||||
public CommonAdapter<T, K> setOnItemClickListener(OnItemParentClickListener<T, K> onItemClickListener) {
|
||||
this.mOnItemClickListener = onItemClickListener;
|
||||
return this;
|
||||
}
|
||||
|
@@ -4,6 +4,6 @@ package com.yizhuan.erban.base.list;
|
||||
* Created by lvzebiao on 2018/12/18.
|
||||
*/
|
||||
|
||||
public interface OnItemClickListener<T, K extends BaseViewHolder> {
|
||||
public interface OnItemParentClickListener<T, K extends BaseViewHolder> {
|
||||
void onItemClick(K holder, T item, int position);
|
||||
}
|
@@ -10,7 +10,7 @@ import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import com.yizhuan.erban.common.util.Utils;
|
||||
import com.yizhuan.xchat_android_library.common.util.Utils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -6,7 +6,7 @@ import android.content.Context;
|
||||
import com.yizhuan.erban.application.XChatApplication;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.utils.ActWhiteListMrg;
|
||||
import com.yizhuan.xchat_android_core.utils.Logger;
|
||||
import com.yizhuan.xchat_android_core.utils.CoreLogger;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
@@ -84,7 +84,7 @@ public class ActivityStack {
|
||||
}
|
||||
Activity existActivity = getActivity(activity.getClass());
|
||||
if (existActivity != null) {
|
||||
Logger.error(TAG, "已存在多个相同的实例:" + existActivity.getClass());
|
||||
CoreLogger.error(TAG, "已存在多个相同的实例:" + existActivity.getClass());
|
||||
existActivity.finish();//如果onActivityCreated回调时返回栈里面已存在当前Activity的实例,则先关掉之前的Activity,避免创建过多实例消耗太多内存
|
||||
}
|
||||
for (WeakReference<Activity> ac : mActivity) {
|
||||
|
@@ -11,9 +11,8 @@ import com.yizhuan.xchat_android_library.common.application.BaseApp
|
||||
import com.yizhuan.xchat_android_library.common.delegate.SpDelegate
|
||||
import com.yizhuan.xchat_android_library.common.file.FileHelper
|
||||
import com.yizhuan.xchat_android_library.common.glide.GlideEngine
|
||||
import com.yizhuan.xchat_android_library.common.util.Logger
|
||||
import com.yizhuan.xchat_android_library.common.util.LibLogger
|
||||
import com.yizhuan.xchat_android_library.easyphoto.EasyPhotos
|
||||
import com.yizhuan.xchat_android_library.easyphoto.constant.Type.*
|
||||
import com.yizhuan.xchat_android_library.easyphoto.models.album.entity.Photo
|
||||
import com.yizhuan.xchat_android_library.utils.TimeUtils
|
||||
import com.yizhuan.xchat_android_library.utils.TimeUtils.TIME_FORMAT
|
||||
@@ -160,7 +159,7 @@ object PhotoProvider {
|
||||
val path = "$foldPath${it.name}"
|
||||
if (FileHelper.copyFileFromUri(it.uri, path, true)) {
|
||||
newPaths.add(path)
|
||||
Logger.debug(TAG, "path: ${it.path} , displayName: ${it.name} , newPath: $path ")
|
||||
LibLogger.debug(TAG, "path: ${it.path} , displayName: ${it.name} , newPath: $path ")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,7 +173,7 @@ object PhotoProvider {
|
||||
* 清除复制缓存
|
||||
*/
|
||||
fun clearCache() {
|
||||
Logger.debug(
|
||||
LibLogger.debug(
|
||||
TAG, "clearCache => mLastSelectTime: ${TimeUtils.getDateTimeString(
|
||||
mLastSelectTime, TIME_FORMAT)}")
|
||||
FileHelper.removeAllFile(getInternalPath() + File.separator)
|
||||
|
@@ -14,7 +14,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import com.yizhuan.xchat_android_library.common.util.Logger;
|
||||
import com.yizhuan.xchat_android_library.common.util.LibLogger;
|
||||
|
||||
/**
|
||||
* Created by wushaocheng
|
||||
@@ -41,7 +41,7 @@ public class BitmapUtil {
|
||||
|
||||
final int height = options.outHeight;
|
||||
final int width = options.outWidth;
|
||||
Logger.info(TAG, "origin, w= " + width + " h=" + height);
|
||||
LibLogger.info(TAG, "origin, w= " + width + " h=" + height);
|
||||
int inSampleSize = 1;
|
||||
|
||||
if (height > reqHeight || width > reqWidth) {
|
||||
@@ -54,13 +54,13 @@ public class BitmapUtil {
|
||||
}
|
||||
}
|
||||
|
||||
Logger.info(TAG, "sampleSize:" + inSampleSize);
|
||||
LibLogger.info(TAG, "sampleSize:" + inSampleSize);
|
||||
return inSampleSize;
|
||||
}
|
||||
|
||||
public static Bitmap setImgSize(Bitmap bm, float newWidth, float newHeight) {
|
||||
if (bm == null) {
|
||||
Logger.error(TAG, "bitmap is null.");
|
||||
LibLogger.error(TAG, "bitmap is null.");
|
||||
return null;
|
||||
}
|
||||
// 获得图片的宽高.
|
||||
|
@@ -1,227 +0,0 @@
|
||||
package com.yizhuan.erban.common.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.xchat_android_core.utils.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.yizhuan.xchat_android_library.common.base.BaseDialogFragment;
|
||||
import com.yizhuan.xchat_android_library.common.util.ActivityHelper;
|
||||
import com.yizhuan.xchat_android_library.common.util.ReflectionUtils;
|
||||
|
||||
|
||||
/**
|
||||
* User: wukai
|
||||
* Date: 2017/04/06
|
||||
* Description:
|
||||
*/
|
||||
public class DialogFragmentUtils {
|
||||
|
||||
private static final String TAG = "DialogFragmentUtils";
|
||||
|
||||
public static final String KEY_DIALOG_TAG = "dialog_tag";
|
||||
private static int mFragmentIndex = 0;
|
||||
|
||||
public static String getFragmentTag(String tag, boolean appendIndexTag) {
|
||||
if (appendIndexTag) {
|
||||
return String.format("%s_%d", tag, mFragmentIndex++);
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
public static String getTag(Bundle bundle) {
|
||||
return bundle.getString(KEY_DIALOG_TAG);
|
||||
}
|
||||
|
||||
public static boolean isShowing(String fragmentTag, Activity activity) {
|
||||
if (activity == null) {
|
||||
Logger.debug(TAG, "check isShowing activity is null return");
|
||||
return false;
|
||||
}
|
||||
if (activity.isFinishing()) {
|
||||
Logger.debug(TAG, "check isShowing activity isFinishing return");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (activity.isDestroyed()) {
|
||||
Logger.debug(TAG, "check isShowing activity is isDestroyed");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(activity instanceof BaseActivity)) {
|
||||
Logger.error(TAG, "check isShowing activity fail, activity is not BaseActivity");
|
||||
return false;
|
||||
}
|
||||
|
||||
FragmentManager fragmentManager = ((BaseActivity) activity).getSupportFragmentManager();
|
||||
|
||||
Fragment fragmentByTag = fragmentManager.findFragmentByTag(fragmentTag);
|
||||
if (fragmentByTag == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fragmentByTag instanceof DialogFragment) {
|
||||
DialogFragment dialogFragment = (DialogFragment) fragmentByTag;
|
||||
return dialogFragment.getDialog() != null && dialogFragment.getDialog().isShowing();
|
||||
} else return fragmentByTag.isVisible();
|
||||
|
||||
}
|
||||
|
||||
public static BaseDialogFragment show(String fragmentTag, Activity activity, Class<? extends BaseDialogFragment> clazz, Bundle bundle, boolean appendIndexTag) {
|
||||
try {
|
||||
BaseDialogFragment baseDialogFragment = clazz.newInstance();
|
||||
return show(fragmentTag, activity, baseDialogFragment, bundle, appendIndexTag);
|
||||
} catch (Exception e1) {
|
||||
Logger.error(TAG, String.valueOf(e1));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static BaseDialogFragment show(String fragmentTag, Activity activity, BaseDialogFragment baseDialogFragment, Bundle bundle, boolean appendIndexTag) {
|
||||
if (TextUtils.isEmpty(fragmentTag)) {
|
||||
Logger.error(TAG, "show dialog failure, fragmentTag = null");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!ActivityHelper.isCanUse(activity)) {
|
||||
Logger.error(TAG, "show dialog failure, activity is not can use");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(activity instanceof BaseActivity)) {
|
||||
Logger.error(TAG, "show dialog activity fail, activity is not BaseActivity");
|
||||
return null;
|
||||
}
|
||||
|
||||
FragmentManager fragmentManager = ((BaseActivity) activity).getSupportFragmentManager();
|
||||
|
||||
if (bundle == null) {
|
||||
bundle = new Bundle();
|
||||
}
|
||||
|
||||
String newFragmentTag = DialogFragmentUtils.getFragmentTag(fragmentTag, appendIndexTag);
|
||||
Logger.debug(TAG, "showDialog: " + newFragmentTag);
|
||||
|
||||
Fragment fragment = fragmentManager.findFragmentByTag(newFragmentTag);
|
||||
if (fragment == null) {
|
||||
bundle.putString(KEY_DIALOG_TAG, newFragmentTag);
|
||||
baseDialogFragment.setArguments(bundle);
|
||||
} else {
|
||||
if (ActivityHelper.isCanUse(activity)) {
|
||||
baseDialogFragment = ((BaseDialogFragment) fragment);
|
||||
baseDialogFragment.dismissAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
|
||||
if (ActivityHelper.isCanUse(activity) && baseDialogFragment != null) {
|
||||
try {
|
||||
doShow(fragmentManager, baseDialogFragment, newFragmentTag);
|
||||
} catch (Exception e) {
|
||||
Logger.error(TAG, String.valueOf(e));
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return baseDialogFragment;
|
||||
}
|
||||
|
||||
|
||||
public static void doShow(final FragmentManager fragmentManager, final BaseDialogFragment dialogFragment, final String tag) {
|
||||
PauseWorkerHandler.instance().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fragmentManager.isStateSaved()) { // 保证只有在activity存在的时候弹出dialog,防止崩溃
|
||||
// Fix 快速显示同一个弹窗报 Fragment already added: 异常
|
||||
if (isInvokeShow(dialogFragment)) {
|
||||
Logger.error(TAG, "Already has fragment=" + dialogFragment.getTag());
|
||||
return;
|
||||
}
|
||||
dialogFragment.show(fragmentManager, tag);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static BaseDialogFragment show(String fragmentTag, Activity activity, Class<? extends BaseDialogFragment> clazz, Bundle bundle) {
|
||||
return show(fragmentTag, activity, clazz, bundle, true);
|
||||
}
|
||||
|
||||
public static BaseDialogFragment show(String fragmentTag, Activity activity, Class<? extends BaseDialogFragment> clazz) {
|
||||
return show(fragmentTag, activity, clazz, null, true);
|
||||
}
|
||||
|
||||
public static void dismiss(String fragmentTag, Activity activity) {
|
||||
if (TextUtils.isEmpty(fragmentTag)) {
|
||||
Logger.error(TAG, "dismiss dialog failure, fragmentTag = null");
|
||||
return;
|
||||
}
|
||||
if (activity == null) {
|
||||
Logger.error(TAG, "dismiss %s dialog failure, Activity = null, tag=" + fragmentTag);
|
||||
return;
|
||||
}
|
||||
if (activity.isFinishing()) {
|
||||
Logger.error(TAG, "dismiss %s dialog failure, Activity is finish, tag=" + fragmentTag);
|
||||
return;
|
||||
}
|
||||
if (activity.isDestroyed()) {
|
||||
Logger.error(TAG, "dismiss %s dialog failure, Activity is null, tag=" + fragmentTag);
|
||||
return;
|
||||
}
|
||||
if (!(activity instanceof BaseActivity)) {
|
||||
Logger.error(TAG, "dismiss %s dialog failure, Activity is not BaseActivity, tag=" + fragmentTag);
|
||||
return;
|
||||
}
|
||||
FragmentManager manager = ((BaseActivity) activity).getSupportFragmentManager();
|
||||
Utils.executePendingTransactionsSafely(fragmentTag, manager);
|
||||
Fragment fragment = manager.findFragmentByTag(fragmentTag);
|
||||
if (fragment == null) {
|
||||
Logger.error(TAG, "dismiss %s dialog failure, Fragment = null, tag="+fragmentTag);
|
||||
tryCleanDialogFragment(fragmentTag, manager);
|
||||
} else {
|
||||
Logger.debug(TAG, "closeDialog=" + fragmentTag);
|
||||
((DialogFragment) fragment).dismissAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
|
||||
public static void tryCleanDialogFragment(String fragmentTag, FragmentManager fragmentManager) {
|
||||
List<Fragment> fragmentList = fragmentManager.getFragments();
|
||||
int sizeChildFrgList = fragmentList.size();
|
||||
for (int i = sizeChildFrgList - 1; i >= 0; i--) {
|
||||
Fragment brotherFragment = fragmentList.get(i);
|
||||
if (brotherFragment == null) {
|
||||
continue;
|
||||
}
|
||||
Bundle arguments = brotherFragment.getArguments();
|
||||
if (arguments == null) {
|
||||
continue;
|
||||
}
|
||||
String findTag = getTag(arguments);
|
||||
if (!TextUtils.isEmpty(findTag) &&
|
||||
brotherFragment instanceof DialogFragment && findTag.equals(fragmentTag)) {
|
||||
Logger.debug(TAG, "closeDialog " + fragmentTag + "by tryCleanDialogFragment");
|
||||
((DialogFragment) brotherFragment).dismissAllowingStateLoss();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isInvokeShow(DialogFragment dialogFragment) {
|
||||
Object value = ReflectionUtils.getFieldValue(dialogFragment, "mShownByMe");
|
||||
if (value == null) {
|
||||
Logger.error(TAG, "isInvokeShow value is null");
|
||||
return false;
|
||||
}
|
||||
boolean isShown = (boolean) value;
|
||||
Logger.debug(TAG, "isInvokeShow isShown=" + isShown);
|
||||
return isShown;
|
||||
}
|
||||
|
||||
}
|
@@ -2,7 +2,7 @@ package com.yizhuan.erban.common.util;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import com.yizhuan.xchat_android_core.utils.Logger;
|
||||
import com.yizhuan.xchat_android_core.utils.CoreLogger;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
@@ -47,7 +47,7 @@ public class PauseWorkerHandler {
|
||||
@Override
|
||||
public void run() {
|
||||
boolean isBackground = AppLifeCycleHelper.isBackground();
|
||||
Logger.info(TAG, "onAppVisibleChangeEvent isBackground="+isBackground);
|
||||
CoreLogger.info(TAG, "onAppVisibleChangeEvent isBackground="+isBackground);
|
||||
if (isBackground) {
|
||||
pause();
|
||||
} else {
|
||||
|
@@ -1,106 +0,0 @@
|
||||
package com.yizhuan.erban.common.util;
|
||||
|
||||
import com.yizhuan.xchat_android_library.utils.FP;
|
||||
|
||||
public class StringUtils {
|
||||
|
||||
public static boolean isNullOrEmpty(String str) {
|
||||
return FP.empty(str);
|
||||
}
|
||||
|
||||
public static boolean isNotNullOrEmpty(String str) {
|
||||
return !StringUtils.isNullOrEmpty(str);
|
||||
}
|
||||
|
||||
public static boolean equal(String s1, String s2) {
|
||||
return StringUtils.equal(s1, s2, false);
|
||||
}
|
||||
|
||||
public static boolean equal(String s1, String s2, boolean ignoreCase) {
|
||||
if (s1 != null && s2 != null) {
|
||||
if (ignoreCase) {
|
||||
return s1.equalsIgnoreCase(s2);
|
||||
}
|
||||
return s1.equals(s2);
|
||||
}
|
||||
return s1 == null && s2 == null;
|
||||
}
|
||||
|
||||
public static int find(String pattern, String s) {
|
||||
return StringUtils.find(pattern, s, false);
|
||||
}
|
||||
|
||||
public static int find(String pattern, String s, boolean ignoreCase) {
|
||||
return StringUtils.find(pattern, s, ignoreCase, false);
|
||||
}
|
||||
|
||||
public static int find(String pattern, String s, boolean ignoreCase, boolean ignoreWidth) {
|
||||
if (FP.empty(s)) {
|
||||
return -1;
|
||||
} else {
|
||||
pattern = FP.ref(pattern);
|
||||
if (ignoreCase) {
|
||||
pattern = pattern.toLowerCase();
|
||||
s = s.toLowerCase();
|
||||
}
|
||||
|
||||
if (ignoreWidth) {
|
||||
pattern = narrow(pattern);
|
||||
s = narrow(s);
|
||||
}
|
||||
|
||||
return s.indexOf(pattern);
|
||||
}
|
||||
}
|
||||
|
||||
public static String narrow(String s) {
|
||||
if (FP.empty(s)) {
|
||||
return "";
|
||||
} else {
|
||||
char[] cs = s.toCharArray();
|
||||
|
||||
for (int i = 0; i < cs.length; ++i) {
|
||||
cs[i] = narrow(cs[i]);
|
||||
}
|
||||
|
||||
return new String(cs);
|
||||
}
|
||||
}
|
||||
|
||||
public static char narrow(char c) {
|
||||
if (c >= '!' && c <= '}') {
|
||||
return (char) (c - 'ﻠ');
|
||||
} else if (c == 12288) {
|
||||
return (char) (c - 12288 + 32);
|
||||
} else if (c == '。') {
|
||||
return '。';
|
||||
} else if (c == 12539) {
|
||||
return '·';
|
||||
} else {
|
||||
return c == 8226 ? '·' : c;
|
||||
}
|
||||
}
|
||||
|
||||
public static int ord(char c) {
|
||||
if ('a' <= c && c <= 'z') {
|
||||
return c;
|
||||
} else {
|
||||
return 'A' <= c && c <= 'Z' ? c - 65 + 97 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static int compare(String x, String y) {
|
||||
return FP.ref(x).compareTo(FP.ref(y));
|
||||
}
|
||||
|
||||
public static long parseLong(String s) {
|
||||
long l = 0L;
|
||||
try {
|
||||
l = Long.parseLong(s.trim());
|
||||
} catch (Exception e) {
|
||||
return l;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user