Compare commits

...

81 Commits

Author SHA1 Message Date
Max
e29884b40e feat:调整google-service.json配置,调整mob配置 2024-01-08 19:02:20 +08:00
Max
b4e700397f 同步peko:调整普通房/牌照房 主麦位置UI 2024-01-08 19:00:06 +08:00
Max
1d7740e593 feat:修改支付key 2024-01-08 16:40:38 +08:00
Max
5540d6c6bc feat:加密方式改为Native-SO 2024-01-08 16:01:45 +08:00
Max
5c1da135aa feat:替换新包相关资源配置:包名、签名、logo、域名等 2024-01-08 15:06:16 +08:00
Max
37bb28af69 同步hiyoo混淆规则:处理影响混淆的内部类AllServiceGiftProtocol 2024-01-07 19:18:16 +08:00
Max
acbecf1b51 同步hiyoo混淆规则:添加相关脚本,调整adbResGuard白名单 2024-01-07 19:09:59 +08:00
Max
463d9ec4b4 同步hiyoo混淆配置:增加aabResGuard与xml-class-guard依赖 2024-01-07 10:14:19 +08:00
Max
f4811c9fe5 同步hiyoo混淆配置:调整material版本为1.6.1(aab转apks失败) 2024-01-06 18:12:12 +08:00
Max
5ceb15f807 同步hiyoo混淆配置:调整混淆规则(减少范围) 2024-01-06 18:08:45 +08:00
Max
f7edaffd44 同步hiyoo混淆配置:清理无用类 2024-01-06 17:13:38 +08:00
Max
8bd9f91892 同步hiyoo混淆配置:处理影响打包的同名类Utils 2024-01-06 17:12:38 +08:00
Max
acfb446eb0 同步hiyoo混淆配置:处理影响打包同名类BaseViewHolder 2024-01-06 16:58:55 +08:00
Max
4daf77adb8 同步hiyoo混淆配置:处理影响打包同名类OnItemClickListener 2024-01-06 16:53:18 +08:00
Max
426bea9ac5 同步hiyoo混淆配置:处理影响打包的同名类 2024-01-06 16:44:56 +08:00
Max
7cf8865727 同步hiyoo混淆配置:清理影响打包的无用类 2024-01-06 16:41:12 +08:00
Max
c997896a9b 同步hiyoo混淆配置:ItemEventListener独立,避免干扰 2024-01-06 16:39:43 +08:00
Max
043b79553e 同步hiyoo混淆配置:处理xml%databind混淆导致引用错误 2024-01-06 16:38:19 +08:00
Max
2d002958cd 同步hiyoo混淆配置:io.agora.rtc2.UserInfo同类名混淆冲突调整 2024-01-06 16:17:16 +08:00
Max
be75ae855a 同步hiyoo混淆配置:kotlin扩展类文件隔离 2024-01-06 16:11:54 +08:00
Max
e30784cfc9 同步hiyoo混淆配置:ImageGestureListener冲突处理 2024-01-06 16:09:00 +08:00
Max
ebe6ee2918 同步hiyoo混淆配置:调整StringUtils 2024-01-06 14:55:20 +08:00
Max
c74873c837 同步hiyoo混淆配置:删除无用类ArrayUtils 2024-01-06 14:48:06 +08:00
Max
9b88c65f9c 同步hiyoo混淆配置:SystemUtils处理 2024-01-06 14:46:32 +08:00
Max
7679937945 同步hiyoo混淆配置:重命名Looger 2024-01-06 14:38:14 +08:00
Max
4fd2afe8e0 同步hiyoo混淆配置:重命名Looger 2024-01-06 14:36:03 +08:00
Max
7f6e82c7a8 同步hiyoo混淆配置:重命名TextUtils 2024-01-06 14:33:48 +08:00
Max
615089d1e1 feat:删掉测试代码 2024-01-06 11:48:14 +08:00
Max
47b38458df feat:去掉调试日志 2024-01-06 11:42:31 +08:00
Max
91be03ea07 fix:修复个播PK进房未加入对方房间问题 2024-01-05 19:23:38 +08:00
Max
f7a500770a feat:补充加入频道失败的异常提示 2024-01-05 18:50:36 +08:00
Max
d82bb55c4e feat:调整部分图标(年度盛典) 2024-01-05 18:20:06 +08:00
Max
dc1383be70 fix:修复福袋飘窗礼物数量展示问题 2024-01-05 18:04:47 +08:00
Max
368ed2bf70 fix:修复个播PK声音状态异常(多线程不同步导致)
fix:PK数据接口字段适配
fix:修复PK麦克风状态更新不及时问题(接收到PK数据后就更新麦位状态)
2024-01-05 17:54:43 +08:00
Max
d595ed469e Merge branch 'peko_feature/notify' into peko_test/2.5.0 2024-01-05 11:33:49 +08:00
Max
792ad5141c fix:调整福袋飘窗点击跳转区域 2024-01-05 11:20:19 +08:00
Max
de6a4fe524 fix:修复房间内福袋飘窗文本展示问题;增加跳转提示 2024-01-05 11:07:32 +08:00
Max
d0cb9e43b1 Merge branch 'peko_feature/notify' into peko_test/2.5.0 2024-01-04 20:41:01 +08:00
Max
ef8d9b0b6f feat:完成飘窗优先级控制 2024-01-04 20:40:49 +08:00
Max
e781369be1 Merge branch 'peko_feature/notify' into peko_test/2.5.0 2024-01-03 19:41:38 +08:00
Max
3bd13e732a Merge branch 'peko_feature/pk' into peko_test/2.5.0 2024-01-03 19:41:28 +08:00
Max
67babbaebd feat:初步完成声网个播PK功能 2024-01-03 18:27:09 +08:00
Max
c392b20f21 feat:完成全局福袋飘窗点击跳转提示;调整飘窗文案 2024-01-03 11:07:05 +08:00
Max
0a1ae82d42 feat:完成全服福袋通知样式调整 2024-01-02 20:15:35 +08:00
Max
6dc63e1d26 Merge branch 'peko_feature/online' into peko_test/2.5.0 2024-01-02 18:23:19 +08:00
Max
2dcbcf7179 feat:完成铭牌渲染优化 2024-01-02 17:38:17 +08:00
Max
bcd6faf213 feat:调整房间在线列表-房主判断字段,适配隐身进房展示 2024-01-02 16:15:46 +08:00
Max
072c837c99 feat:完成房间内福袋飘窗UI调整 2024-01-02 15:29:26 +08:00
Max
067f97d6be feat:完成房间在线列表优化需求 2024-01-02 11:32:05 +08:00
Max
15b317d5d0 feat:写了接口请求部分,未实现UI等部分;(接口500,下周继续) 2023-12-29 19:46:46 +08:00
Max
16712197e3 feat:完成私聊限制需求(每发消息都请求接口) 2023-12-29 17:02:22 +08:00
Max
24ccadc593 fix:修复个播小时榜点击无效问题 2023-12-19 16:33:40 +08:00
Max
88767208bd 同步hiyoo:调整房间小时榜、音乐、房间榜入口位置 2023-12-19 15:30:56 +08:00
Max
91bb8f7871 fix:修复相亲房布局导致的异常 2023-12-18 10:58:59 +08:00
Max
dedb075c56 fix:补充公会搜索的空判断 2023-12-15 20:18:02 +08:00
Max
1b1f477494 fix:修复公会搜索不出结果问题 2023-12-15 20:17:58 +08:00
Max
9a015aff0b feat:新增个播-人气礼物 2023-12-15 20:17:39 +08:00
Max
9500554550 feat:调整个播默认背景和默认麦位头饰 2023-12-15 20:17:32 +08:00
Max
23e05ccab1 fix:修复选择幸运礼物后被自动重置为选中第一个的问题 2023-12-15 20:17:03 +08:00
Max
0417e53b85 feat:调整客态视角下粉丝团提醒文案 2023-12-15 20:16:52 +08:00
Max
df96cfe5d4 fix:调整加入粉丝团入口UI 2023-12-11 17:00:54 +08:00
Max
213efcba31 fix:修复添加管理员后管理员列表中无法正常展示昵称头像问题 2023-12-11 16:14:04 +08:00
Max
9e36225b77 fix:修复个播小时榜飘窗无法展示问题 2023-12-11 15:22:39 +08:00
Max
da3d72ebff fix:修复升级弹窗偶发异常 2023-12-11 11:47:10 +08:00
Max
fd3dc7cb3c fix:个播在麦时禁止滑动 2023-12-11 11:07:25 +08:00
Max
eebe231a45 Merge branch 'peko_feature/search' into peko_test/2.4.0 2023-12-08 16:01:34 +08:00
Max
276f2002f9 Merge branch 'peko_feature/region' into peko_test/2.4.0 2023-12-08 16:01:30 +08:00
Max
2942e2f0bb feat;完成地区选择器优化(调整地区数据、支持字母索引、有效展示当前地区) 2023-12-08 15:59:59 +08:00
Max
406077b43b fix:修复房间用户详情弹窗边框展示问题 2023-12-07 18:07:45 +08:00
Max
55a8d037e0 feat:完成搜索结果条目信息展示调整(去掉性别,新增等级信息) 2023-12-07 17:10:58 +08:00
Max
ba58b0bd40 feat:刚刚少提交依赖 2023-12-07 16:02:43 +08:00
Max
151b1c37d0 feat:修复RectRoundImageView导致的图片加载问题 2023-12-07 16:01:55 +08:00
Max
4a7af141aa feat:声网RTC配置debug环境KEY 2023-12-07 15:11:28 +08:00
Max
cec6e00e09 feat:同步音萌完成个播PK屏蔽麦功能 2023-12-07 14:50:01 +08:00
Max
bf6ef26eca fix:修复个播粉丝团入口展示问题(进入有密码房间时因请求时机导致未正确加载状态) 2023-12-06 17:45:39 +08:00
Max
07845b5e60 fix:修复断网时被踢,重连后未退房问题 2023-12-06 17:03:55 +08:00
Max
097ead1327 fix:修复公会高管设置入口展示问题 2023-12-06 14:25:52 +08:00
Max
2b45d35d40 feat:升级vasdolly版本 2023-12-06 11:58:31 +08:00
Max
e6f4b40e66 fix:修复粉丝团入口逻辑 2023-12-06 11:10:33 +08:00
Max
c46f19f03f fix:修复pk-某liveData空类型导致异常 2023-12-05 18:59:35 +08:00
Max
37196025cc fix:修复个播房闪退:pk的一个liveData空类型问题 2023-12-05 18:01:44 +08:00
680 changed files with 4870 additions and 4590 deletions

View File

View File

View File

@@ -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",
]
}

View File

@@ -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
View File

@@ -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 {*;}

View File

@@ -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 -->

View 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"}]

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -1,4 +1,4 @@
package com.vele.pekolive.lineapi;
package app.repo.cam.lineapi;
import cn.sharesdk.line.LineHandlerActivity;

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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");
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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);
}
}
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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();
}

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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

View File

@@ -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

View File

@@ -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>() {

View File

@@ -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>() {

View File

@@ -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)

View File

@@ -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>() {

View File

@@ -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>() {

View File

@@ -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

View File

@@ -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>() {

View File

@@ -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>() {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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))
}
}

View File

@@ -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))
}
}

View File

@@ -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) {
}
}

View File

@@ -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)
}
}

View File

@@ -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)
}
}

View File

@@ -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)
}
}

View File

@@ -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) {

View File

@@ -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);
}
}

View File

@@ -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

View File

@@ -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)
}
}

View File

@@ -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

View File

@@ -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))
}
}

View File

@@ -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());
}
}
});
}
}

View File

@@ -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

View File

@@ -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);
});
}
}

View File

@@ -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;

View File

@@ -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)
}
}

View File

@@ -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");
}
});
}

View File

@@ -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

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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() {

View File

@@ -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

View File

@@ -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
}
}
}

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -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

View File

@@ -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>() {

View File

@@ -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

View File

@@ -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>() {

View File

@@ -71,6 +71,4 @@ interface IBaseRoomView : IMvpBaseView {
fun updateMicView()
fun updateRoomRanks(data: List<RoomContributeUserInfo>)
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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());

View File

@@ -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

View File

@@ -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)
}
}
}

View File

@@ -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);
}

View File

@@ -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()

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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)

View File

@@ -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;
}
// 获得图片的宽高.

View File

@@ -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;
}
}

View File

@@ -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 {

View File

@@ -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