Compare commits
179 Commits
master
...
release_1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ea19645fe8 | ||
![]() |
d48844dc14 | ||
![]() |
a939c29e3e | ||
![]() |
e55b4d7348 | ||
![]() |
0e30b8e303 | ||
![]() |
3325ccaee9 | ||
![]() |
277c1a637e | ||
![]() |
8660f0e826 | ||
![]() |
dc46c16f3e | ||
![]() |
1dfa9e9d25 | ||
![]() |
5376774ab6 | ||
![]() |
cfe2a45e4b | ||
![]() |
d8a39a4729 | ||
![]() |
05935ca7f2 | ||
![]() |
f1ae820a5a | ||
![]() |
5cddd9f18d | ||
![]() |
19d6fed2fb | ||
![]() |
fb1bcfb642 | ||
![]() |
046ae8e04e | ||
![]() |
73f7998445 | ||
![]() |
c68419f2af | ||
![]() |
1f65f99221 | ||
![]() |
5125f08a20 | ||
![]() |
1d9e119f89 | ||
![]() |
30e468bdf3 | ||
![]() |
c5862701f5 | ||
![]() |
66dd5a0f16 | ||
![]() |
da8cbda0fa | ||
![]() |
5158ff178e | ||
![]() |
bf5c6436da | ||
![]() |
c65e7bfc3b | ||
![]() |
3f92ca82e9 | ||
![]() |
5909ccbc6c | ||
![]() |
cf2490b9e2 | ||
![]() |
fab25bd4f6 | ||
![]() |
c616082b21 | ||
![]() |
63cedcc467 | ||
![]() |
8d9781cf56 | ||
![]() |
b935216b6e | ||
![]() |
c5155aed0d | ||
![]() |
2e812f60f5 | ||
![]() |
49810b42b0 | ||
![]() |
6ba4f05b17 | ||
![]() |
8ec2e32240 | ||
![]() |
d740e2bcdb | ||
![]() |
f6068d745d | ||
![]() |
8c02426f6d | ||
![]() |
9eb632116e | ||
![]() |
76cca091d6 | ||
![]() |
16f8cf006a | ||
![]() |
92577ba1f1 | ||
![]() |
892b8192cc | ||
![]() |
71b8b4caf6 | ||
![]() |
b9c165f355 | ||
![]() |
b17077fe17 | ||
![]() |
faec2f542e | ||
![]() |
3defba88a5 | ||
![]() |
ca2b411bac | ||
![]() |
86b9f1b35f | ||
![]() |
10e9a630d2 | ||
![]() |
af3f90c0c8 | ||
![]() |
044fe4b53e | ||
![]() |
7fd56533f7 | ||
![]() |
2b078390e4 | ||
![]() |
8990405c6f | ||
![]() |
15cf083657 | ||
![]() |
529d1500ba | ||
![]() |
4c98e9422c | ||
![]() |
3de4273531 | ||
![]() |
60d60d3578 | ||
![]() |
56fdb706b4 | ||
![]() |
c1a1867511 | ||
![]() |
a59a2897e7 | ||
![]() |
28c2841923 | ||
![]() |
b1269a5c2a | ||
![]() |
24606d7b44 | ||
![]() |
f2b755cf77 | ||
![]() |
f7d62e6aa0 | ||
![]() |
2cfc74fa85 | ||
![]() |
3def5cebda | ||
![]() |
d29a2c1245 | ||
![]() |
a304b4b07b | ||
![]() |
87b4ea4935 | ||
![]() |
ee320f0591 | ||
![]() |
d05e8e9a53 | ||
![]() |
31266aaee0 | ||
![]() |
2bb57e2b3f | ||
![]() |
10b48eeb0e | ||
![]() |
7a7a394b03 | ||
![]() |
ce93e02d8a | ||
![]() |
3e07b3d9d7 | ||
![]() |
b8645b2058 | ||
![]() |
2f238e0447 | ||
![]() |
34b061996f | ||
![]() |
58a5556fc0 | ||
![]() |
4f2d895f38 | ||
![]() |
8ee3bcef6e | ||
![]() |
3e29eb1c32 | ||
![]() |
486da1d028 | ||
![]() |
cb21a12b95 | ||
![]() |
ee1d528027 | ||
![]() |
684bd5260d | ||
![]() |
c678061633 | ||
![]() |
e208dc6950 | ||
![]() |
ec9c3a9a42 | ||
![]() |
5298e69eed | ||
![]() |
0bbe0c8b64 | ||
![]() |
20a745e955 | ||
![]() |
e2a667fb90 | ||
![]() |
4716157368 | ||
![]() |
00866e7c73 | ||
![]() |
63bd50479d | ||
![]() |
9dd27c723c | ||
![]() |
362c58da6d | ||
![]() |
4ca4d25644 | ||
![]() |
362fb3b6c3 | ||
![]() |
7dcd553fba | ||
![]() |
ce63fdcd12 | ||
![]() |
bd14980c14 | ||
![]() |
a8b993572c | ||
![]() |
adac9ad536 | ||
![]() |
3be3591b15 | ||
![]() |
1feda0e047 | ||
![]() |
72643d7753 | ||
![]() |
331e3404a6 | ||
![]() |
655f7d9c40 | ||
![]() |
c94b40fe8a | ||
![]() |
e7193e9ef4 | ||
![]() |
5b987ecccc | ||
![]() |
5b7ef4c86d | ||
![]() |
f9254a3f15 | ||
![]() |
87c1dddbab | ||
![]() |
1a363a19e3 | ||
![]() |
8c8f93580d | ||
![]() |
6234480529 | ||
![]() |
cd7b4db946 | ||
![]() |
eb25a1244c | ||
![]() |
83810d088a | ||
![]() |
17c7129f87 | ||
![]() |
0cbdea2e6f | ||
![]() |
fb4aeba530 | ||
![]() |
e807dab42f | ||
![]() |
deac16a90a | ||
![]() |
3642ae2748 | ||
![]() |
7331d8e205 | ||
![]() |
311202c075 | ||
![]() |
119546866c | ||
![]() |
c21768d3d0 | ||
![]() |
860e41c45e | ||
![]() |
bb00f6433f | ||
![]() |
4c17cf30ef | ||
![]() |
48fa73353d | ||
![]() |
da01c04dcc | ||
![]() |
cd0898ae68 | ||
![]() |
df31666b29 | ||
![]() |
4fec80e42a | ||
![]() |
4490a5e54e | ||
![]() |
20fded3771 | ||
![]() |
efeea38cc1 | ||
![]() |
aa2635c652 | ||
![]() |
95d94f95b2 | ||
![]() |
d26205bd1f | ||
![]() |
abbe516b3a | ||
![]() |
ac2f16f308 | ||
![]() |
dae987e9e0 | ||
![]() |
fc0c688916 | ||
![]() |
be16a0a810 | ||
![]() |
fadc41bb84 | ||
![]() |
9290fdbd02 | ||
![]() |
aa94a834ce | ||
![]() |
213cfb97cb | ||
![]() |
0ac2bdc775 | ||
![]() |
b23d8b6fa5 | ||
![]() |
f7b36c40ab | ||
![]() |
fa47dad924 | ||
![]() |
a15ae87fd5 | ||
![]() |
83e4cfc629 | ||
![]() |
0c7fb5dcf1 | ||
![]() |
9d0b9d79e9 |
@@ -2,11 +2,11 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
minSdkVersion MIN_SDK_VERSION.toInteger()
|
||||
targetSdkVersion TARGET_SDK_VERSION.toInteger()
|
||||
|
||||
testApplicationId 'com.soundcloud.android.crop.test'
|
||||
testInstrumentationRunner 'android.test.InstrumentationTestRunner'
|
||||
@@ -20,12 +20,21 @@ android {
|
||||
}
|
||||
|
||||
buildToolsVersion = '30.0.3'
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api 'androidx.annotation:annotation:1.1.0'
|
||||
api 'androidx.annotation:annotation:1.2.0'
|
||||
api 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation "androidx.core:core-ktx:1.3.2"
|
||||
implementation "androidx.core:core-ktx:1.7.0"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
repositories {
|
||||
|
@@ -33,7 +33,7 @@
|
||||
"project_id":"736430079244645870",
|
||||
"app_id":"102953045",
|
||||
"api_key":"DAEDAN1bqknzqRuvualUo98vO7U9uXBJtBZ0rNQHgSo03bXgkl98tD4sytVBCBB1Y7ha0NcY++dSp9JLsws9BzDN+/fS3v8J9We3nA==",
|
||||
"package_name":"com.voice.magic"
|
||||
"package_name":"cn.nnbc123.voice"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_id":"102953045",
|
||||
@@ -41,7 +41,7 @@
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"102953045",
|
||||
"package_name":"com.voice.magic"
|
||||
"package_name":"cn.nnbc123.voice"
|
||||
},
|
||||
"service":{
|
||||
"analytics":{
|
||||
@@ -75,12 +75,12 @@
|
||||
"configuration_version":"3.0",
|
||||
"appInfos":[
|
||||
{
|
||||
"package_name":"com.voice.magic",
|
||||
"package_name":"cn.nnbc123.voice",
|
||||
"client":{
|
||||
"app_id":"102953045"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"com.voice.magic",
|
||||
"package_name":"cn.nnbc123.voice",
|
||||
"app_id":"102953045"
|
||||
},
|
||||
"oauth_client":{
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
app/aliyun-libs/rpsdk-4.16.2-open.aar
Normal file
BIN
app/aliyun-libs/rpsdk-4.16.2-open.aar
Normal file
Binary file not shown.
BIN
app/aliyun-libs/securitybody-5.6.14.28528155-preinstall.aar
Normal file
BIN
app/aliyun-libs/securitybody-5.6.14.28528155-preinstall.aar
Normal file
Binary file not shown.
BIN
app/aliyun-libs/securityguardsdk-5.6.14.28528155-preinstall.aar
Normal file
BIN
app/aliyun-libs/securityguardsdk-5.6.14.28528155-preinstall.aar
Normal file
Binary file not shown.
BIN
app/aliyun-libs/sgmiddletier-5.6.14.28528155-preinstall.aar
Normal file
BIN
app/aliyun-libs/sgmiddletier-5.6.14.28528155-preinstall.aar
Normal file
Binary file not shown.
@@ -10,40 +10,51 @@ apply plugin: 'android-junk-code'
|
||||
def onlyArm64 = Boolean.parseBoolean(only_arm64)
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.voice.magic"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
applicationId "cn.nnbc123.voice"
|
||||
minSdkVersion MIN_SDK_VERSION.toInteger()
|
||||
targetSdkVersion TARGET_SDK_VERSION.toInteger()
|
||||
versionCode Integer.valueOf(version_code)
|
||||
versionName version_name
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
|
||||
ndk {
|
||||
//设置支持的SO库架构
|
||||
if (onlyArm64) {
|
||||
abiFilters "arm64-v8a"
|
||||
} else {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||||
}
|
||||
|
||||
flavorDimensions 'default'
|
||||
}
|
||||
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include 'armeabi-v7a', 'arm64-v8a', 'x86'
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
|
||||
//在apk文件后边生成版本号信息
|
||||
android.applicationVariants.all {
|
||||
variant ->
|
||||
variant.outputs.all {
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
outputFileName = "magic_${buildType.name}_v${defaultConfig.versionName}-${date}.apk"
|
||||
android.applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach { output ->
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
|
||||
def outputFile = output.outputFile
|
||||
if (outputFile == null || !outputFile.name.endsWith('.apk')) {
|
||||
return
|
||||
}
|
||||
|
||||
def abi = output.getFilter(com.android.build.OutputFile.ABI)
|
||||
if (abi == null) {
|
||||
abi = "universal"
|
||||
}
|
||||
outputFileName = "yinmeng_${buildType.name}_v${defaultConfig.versionName}_${abi}_${date}.apk"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
disable 'MissingTranslation'
|
||||
@@ -65,19 +76,19 @@ android {
|
||||
signingConfigs {
|
||||
|
||||
v2 {
|
||||
storeFile file('../magic.jks')
|
||||
storePassword "magic2020"
|
||||
keyAlias "magic"
|
||||
keyPassword "magic2020"
|
||||
storeFile file('../yinmeng.jks')
|
||||
storePassword "yinmeng2023"
|
||||
keyAlias "yinmeng"
|
||||
keyPassword "yinmeng2023"
|
||||
v2SigningEnabled true
|
||||
v1SigningEnabled true
|
||||
}
|
||||
|
||||
v1 {
|
||||
storeFile file('../magic.jks')
|
||||
storePassword "magic2020"
|
||||
keyAlias "magic"
|
||||
keyPassword "magic2020"
|
||||
storeFile file('../yinmeng.jks')
|
||||
storePassword "yinmeng2023"
|
||||
keyAlias "yinmeng"
|
||||
keyPassword "yinmeng2023"
|
||||
v2SigningEnabled false
|
||||
v1SigningEnabled true
|
||||
}
|
||||
@@ -136,7 +147,8 @@ android {
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
buildConfigField "String", "BASE_URL", "\"https://yinyou.api.shengxuanwangluo.com/\""
|
||||
buildConfigField "String", "BASE_URL", "\"https://api.nnbc123.cn/\""
|
||||
buildConfigField "String", "WEB_URL", "\"https://h5.nnbc123.cn/\""
|
||||
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_STAGING", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_RELEASE", "BASE_URL"
|
||||
@@ -147,37 +159,40 @@ android {
|
||||
}
|
||||
|
||||
debug {
|
||||
buildConfigField "String", "BASE_URL", "\"http://api.uat.lecheng163.com/\""
|
||||
buildConfigField "String", "BASE_URL", "\"http://beta.api.nnbc123.cn/\""
|
||||
buildConfigField "String", "WEB_URL", "\"http://beta.api.nnbc123.cn\""
|
||||
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
|
||||
buildConfigField "String", "BASE_URL_STAGING", "\"https://yinyou.api.shengxuanwangluo.com/\""
|
||||
buildConfigField "String", "BASE_URL_RELEASE", "\"https://yinyou.api.shengxuanwangluo.com/\""
|
||||
buildConfigField "String", "BASE_URL_STAGING", "\"https://api.nnbc123.cn/\""
|
||||
buildConfigField "String", "BASE_URL_RELEASE", "\"https://api.nnbc123.cn/\""
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
signingConfig signingConfigs.v1
|
||||
signingConfig signingConfigs.v2
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
jvmTarget = "11"
|
||||
}
|
||||
|
||||
buildToolsVersion = '30.0.3'
|
||||
|
||||
}
|
||||
|
||||
def Lombok = "1.18.18"
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
implementation fileTree(dir: 'aliyun-libs', include: ['*.jar', '*.aar'])
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
api 'androidx.multidex:multidex:2.0.1'
|
||||
|
||||
@@ -202,7 +217,7 @@ dependencies {
|
||||
api "com.jakewharton:butterknife:10.2.3"
|
||||
annotationProcessor "com.jakewharton:butterknife-compiler:10.2.3"
|
||||
implementation "com.llew.huawei:verifier:1.0.3"
|
||||
annotationProcessor 'androidx.annotation:annotation:1.1.0'
|
||||
annotationProcessor 'androidx.annotation:annotation:1.2.0'
|
||||
|
||||
implementation 'io.github.h07000223:flycoTabLayout:3.0.0'
|
||||
|
||||
@@ -216,8 +231,6 @@ dependencies {
|
||||
api 'com.jungly:gridPasswordView:0.3'
|
||||
api 'com.google.android.flexbox:flexbox:3.0.0'
|
||||
|
||||
compileOnly "org.projectlombok:lombok:${Lombok}"
|
||||
annotationProcessor "org.projectlombok:lombok:${Lombok}"
|
||||
implementation 'nl.dionsegijn:konfetti:1.1.2'
|
||||
|
||||
//数字滚动效果
|
||||
@@ -249,6 +262,10 @@ dependencies {
|
||||
implementation "io.github.tencent:vap:2.0.24"
|
||||
|
||||
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
|
||||
|
||||
implementation 'com.qiyukf.unicorn:unicorn:8.2.0'
|
||||
|
||||
implementation 'com.github.yalantis:ucrop:2.2.7'
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -264,7 +281,7 @@ channel {
|
||||
outputDir = new File(project.buildDir, "channelapk")
|
||||
//多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime}
|
||||
def only64 = onlyArm64 ? "-only64" : ""
|
||||
apkNameFormat = 'magic-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
|
||||
apkNameFormat = 'yinmeng-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
|
||||
//快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
|
||||
fastMode = false
|
||||
//buildTime的时间格式,默认格式:yyyyMMdd-HHmmss
|
||||
@@ -278,7 +295,7 @@ android.applicationVariants.all { variant ->
|
||||
switch (variant.name) {//变体名称,如果没有设置productFlavors就是buildType名称,如果有设置productFlavors就是flavor+buildType,例如(freeRelease、proRelease)
|
||||
case "release":
|
||||
androidJunkCode.configMap.put(variant.name, {
|
||||
packageBase = "com.mango.plugin.ui" //生成java类根包名
|
||||
packageBase = "com.nnbc123.plugin.ui" //生成java类根包名
|
||||
packageCount = 30 //生成包数量
|
||||
activityCountPerPackage = 30 //每个包下生成Activity类数量
|
||||
excludeActivityJavaFile = false
|
||||
|
52
app/proguard-rules.pro
vendored
52
app/proguard-rules.pro
vendored
@@ -115,19 +115,19 @@
|
||||
-keep class com.netease.** {*;}
|
||||
|
||||
# Presenter 相关
|
||||
-keep class com.mango.moshen.base.** { *; }
|
||||
-keep public class * extends com.mango.moshen.base.BaseMvpPresenter
|
||||
-keep public class * extends com.mango.xchat_android_library.base.factory.AbstractMvpPresenter
|
||||
-keep class com.nnbc123.app.base.** { *; }
|
||||
-keep public class * extends com.nnbc123.app.base.BaseMvpPresenter
|
||||
-keep public class * extends com.nnbc123.library.base.factory.AbstractMvpPresenter
|
||||
|
||||
# 云信自定义 ViewHolder 配置
|
||||
-dontwarn com.mango.moshen.ui.im.recent.holder.**
|
||||
-keep class com.mango.moshen.ui.im.recent.holder.** {*;}
|
||||
-keep class com.mango.moshen.ui.im.chat.** {*;}
|
||||
-keep class com.mango.moshen.luckymoney.viewholder.** {*;}
|
||||
-keep class com.mango.moshen.share.viewholder.** {*;}
|
||||
-keep class com.mango.moshen.public_chat_hall.msg.viewholder.** {*;}
|
||||
-keep class com.mango.moshen.module_hall.im.msgholder.** {*;}
|
||||
-keep class com.mango.moshen.mentoring_relationship.viewholder.** {*;}
|
||||
-dontwarn com.nnbc123.app.ui.im.recent.holder.**
|
||||
-keep class com.nnbc123.app.ui.im.recent.holder.** {*;}
|
||||
-keep class com.nnbc123.app.ui.im.chat.** {*;}
|
||||
-keep class com.nnbc123.app.luckymoney.viewholder.** {*;}
|
||||
-keep class com.nnbc123.app.share.viewholder.** {*;}
|
||||
-keep class com.nnbc123.app.public_chat_hall.msg.viewholder.** {*;}
|
||||
-keep class com.nnbc123.app.module_hall.im.msgholder.** {*;}
|
||||
-keep class com.nnbc123.app.mentoring_relationship.viewholder.** {*;}
|
||||
-keep public class * extends com.netease.nim.uikit.common.ui.recyclerview.holder.RecyclerViewHolder {*;}
|
||||
-keep public class * extends com.netease.nim.uikit.business.session.viewholder.MsgViewHolderBase {*;}
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
|
||||
#-------------TakePhoto的混淆配置------------
|
||||
-keep class com.jph.takephoto.** { *; }
|
||||
-keep class com.nnbc123.app.takephoto.** { *; }
|
||||
-dontwarn com.jph.takephoto.**
|
||||
|
||||
-keep class com.darsh.multipleimageselect.** { *; }
|
||||
@@ -207,8 +207,8 @@
|
||||
<init>(...);
|
||||
}
|
||||
|
||||
-dontwarn com.mango.moshen.bindadapter.**
|
||||
-keep class com.mango.moshen.bindadapter.** {*;}
|
||||
-dontwarn com.nnbc123.app.bindadapter.**
|
||||
-keep class com.nnbc123.app.bindadapter.** {*;}
|
||||
|
||||
# Ping++ 混淆过滤
|
||||
-dontwarn com.pingplusplus.**
|
||||
@@ -239,8 +239,8 @@
|
||||
|
||||
# TODO 网络加载 一些业务bean gson 时候混淆问题
|
||||
-keep class org.json.** {*;}
|
||||
-dontwarn com.moshen.core.**
|
||||
-keep class com.mango.core.** {*;}
|
||||
-dontwarn com.nnbc123.core.**
|
||||
-keep class com.nnbc123.core.** {*;}
|
||||
|
||||
|
||||
#百度统计
|
||||
@@ -314,8 +314,8 @@
|
||||
-keep class com.autonavi.aps.amapapi.model.**{*;}
|
||||
|
||||
#暂时keep这个View排查华为oom问题
|
||||
-keep class com.mango.moshen.avroom.widget.MicroView{*;}
|
||||
-keep class com.mango.moshen.ui.widget.rollviewpager.RollPagerView{*;}
|
||||
-keep class com.nnbc123.app.avroom.widget.MicroView{*;}
|
||||
-keep class com.nnbc123.app.ui.widget.rollviewpager.RollPagerView{*;}
|
||||
|
||||
#linkedMe
|
||||
-keep class com.microquation.linkedme.android.** { *; }
|
||||
@@ -373,7 +373,7 @@
|
||||
-dontwarn com.meizu.cloud.**
|
||||
-keep class com.meizu.cloud.** {*;}
|
||||
|
||||
-keep class com.mango.moshen.ui.widget.AppBarLayoutBehavior {*;}
|
||||
-keep class com.nnbc123.app.ui.widget.AppBarLayoutBehavior {*;}
|
||||
|
||||
#ViewBinding使用的反射生成的对应Binding
|
||||
-keepclassmembers class * implements androidx.viewbinding.ViewBinding {
|
||||
@@ -436,9 +436,6 @@
|
||||
# linkedme
|
||||
-keep class com.microquation.linkedme.android.** { *; }
|
||||
|
||||
# 数美天网
|
||||
-keep class com.ishumei.dfp.SMSDK { *; }
|
||||
|
||||
-dontwarn com.alibaba.**
|
||||
-dontwarn com.taobao.**
|
||||
-dontwarn com.google.**
|
||||
@@ -453,5 +450,14 @@
|
||||
-keep class android.support.v8.renderscript.** { *; }
|
||||
-keep class androidx.renderscript.** { *; }
|
||||
|
||||
-keep class com.yinyou.plugin.**{*;}
|
||||
-keep class com.nnbc123.plugin.ui.**{*;}
|
||||
|
||||
-dontwarn com.qiyukf.**
|
||||
-keep class com.qiyukf.** {*;}
|
||||
-dontwarn org.slf4j.**
|
||||
-keep class org.slf4j.** { *; }
|
||||
|
||||
# For BannerViewPager
|
||||
-keep class androidx.recyclerview.widget.** { *; }
|
||||
-keep class androidx.viewpager2.widget.** { *; }
|
||||
-keep class io.agora.**{*;}
|
||||
|
@@ -1,28 +0,0 @@
|
||||
package com.mango.moshen;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.mango.moshen_android_client", appContext.getPackageName());
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.nnbc123.app;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.nnbc123.app_android_client", appContext.getPackageName());
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/dialog_charge_bg_checked" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/dialog_charge_bg_checked" android:state_checked="true" />
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#ffffe710" />
|
||||
<solid android:color="#26ffe710" />
|
||||
<corners android:bottomLeftRadius="8dp" android:bottomRightRadius="8dp" android:topLeftRadius="8dp" android:topRightRadius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
<corners android:radius="8dp"/>
|
||||
<solid android:color="#fff8f8fa" />
|
||||
<corners android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" android:topLeftRadius="10dp" android:topRightRadius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
9
app/src/common/res/drawable/shape_black_t35_12.xml
Normal file
9
app/src/common/res/drawable/shape_black_t35_12.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners
|
||||
android:radius="@dimen/dp_12"
|
||||
/>
|
||||
<solid
|
||||
android:color="@color/black_transparent_35"
|
||||
/>
|
||||
</shape>
|
6
app/src/common/res/drawable/shape_ffe974_corner_12dp.xml
Normal file
6
app/src/common/res/drawable/shape_ffe974_corner_12dp.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="@dimen/dp_12" />
|
||||
<stroke android:color="#FFE974" android:width="1px"/>
|
||||
<solid android:color="#0D002F"/>
|
||||
</shape>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
app/src/main/assets/svga/home_avatar_online.svga
Normal file
BIN
app/src/main/assets/svga/home_avatar_online.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/home_living.svga
Normal file
BIN
app/src/main/assets/svga/home_living.svga
Normal file
Binary file not shown.
Binary file not shown.
BIN
app/src/main/assets/svga/living_black.svga
Normal file
BIN
app/src/main/assets/svga/living_black.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/living_white.svga
Normal file
BIN
app/src/main/assets/svga/living_white.svga
Normal file
Binary file not shown.
BIN
app/src/main/assets/svga/login.svga
Normal file
BIN
app/src/main/assets/svga/login.svga
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,10 +0,0 @@
|
||||
package com.jph.takephoto.permission;
|
||||
|
||||
import com.jph.takephoto.model.InvokeParam;
|
||||
|
||||
/**
|
||||
* 授权管理回调
|
||||
*/
|
||||
public interface InvokeListener {
|
||||
PermissionManager.TPermissionType invoke(InvokeParam invokeParam);
|
||||
}
|
@@ -1,93 +0,0 @@
|
||||
package com.jph.takephoto.uitl;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
|
||||
import com.darsh.multipleimageselect.activities.AlbumSelectActivity;
|
||||
import com.darsh.multipleimageselect.helpers.Constants;
|
||||
import com.jph.takephoto.model.CropOptions;
|
||||
import com.jph.takephoto.model.TContextWrap;
|
||||
|
||||
/**
|
||||
* Intent工具类用于生成拍照、
|
||||
* 从相册选择照片,裁剪照片所需的Intent
|
||||
* Author: JPH
|
||||
* Date: 2016/6/7 0007 13:41
|
||||
*/
|
||||
public class IntentUtils {
|
||||
private static final String TAG = IntentUtils.class.getName();
|
||||
|
||||
/**
|
||||
* 获取图片多选的Intent
|
||||
* @param limit 最多选择图片张数的限制
|
||||
* */
|
||||
public static Intent getPickMultipleIntent(TContextWrap contextWrap, int limit){
|
||||
Intent intent = new Intent(contextWrap.getActivity(), AlbumSelectActivity.class);
|
||||
intent.putExtra(Constants.INTENT_EXTRA_LIMIT, limit>0? limit:1);
|
||||
return intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取裁剪照片的Intent
|
||||
* @param targetUri 要裁剪的照片
|
||||
* @param outPutUri 裁剪完成的照片
|
||||
* @param options 裁剪配置
|
||||
* @return
|
||||
*/
|
||||
public static Intent getCropIntentWithOtherApp(Uri targetUri, Uri outPutUri, CropOptions options) {
|
||||
boolean isReturnData = TUtils.isReturnData();
|
||||
Log.w(TAG, "getCaptureIntentWithCrop:isReturnData:" + (isReturnData ? "true" : "false"));
|
||||
Intent intent = new Intent("com.android.camera.action.CROP");
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
intent.setDataAndType(targetUri, "image/*");
|
||||
intent.putExtra("crop", "true");
|
||||
if (options.getAspectX()*options.getAspectY()>0){
|
||||
intent.putExtra("aspectX", options.getAspectX());
|
||||
intent.putExtra("aspectY", options.getAspectY());
|
||||
}
|
||||
if (options.getOutputX()*options.getOutputY()>0){
|
||||
intent.putExtra("outputX", options.getOutputX());
|
||||
intent.putExtra("outputY", options.getOutputY());
|
||||
}
|
||||
intent.putExtra("scale", true);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outPutUri);
|
||||
intent.putExtra("return-data", isReturnData);
|
||||
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
|
||||
intent.putExtra("noFaceDetection", true); // no face detection
|
||||
return intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取拍照的Intent
|
||||
* @return
|
||||
*/
|
||||
public static Intent getCaptureIntent(Uri outPutUri) {
|
||||
Intent intent = new Intent();
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);//设置Action为拍照
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outPutUri);//将拍取的照片保存到指定URI
|
||||
return intent;
|
||||
}
|
||||
/**
|
||||
* 获取选择照片的Intent
|
||||
* @return
|
||||
*/
|
||||
public static Intent getPickIntentWithGallery() {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_PICK);//Pick an item from the data
|
||||
intent.setType("image/*");//从所有图片中进行选择
|
||||
return intent;
|
||||
}
|
||||
/**
|
||||
* 获取从文件中选择照片的Intent
|
||||
* @return
|
||||
*/
|
||||
public static Intent getPickIntentWithDocuments() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("image/*");
|
||||
return intent;
|
||||
}
|
||||
}
|
@@ -1,55 +0,0 @@
|
||||
package com.mango.moshen.application;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||
import com.mango.moshen.utils.ActWhiteListMrg;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
/**
|
||||
* create by lvzebiao @2019/8/8
|
||||
*/
|
||||
public class ActivityStackManager {
|
||||
|
||||
/**
|
||||
* 用于保持最顶的Activity实例,排除中转的activity
|
||||
* 比如{@link com.mango.moshen.MiddleActivity}
|
||||
*/
|
||||
@Getter
|
||||
private WeakReference<Activity> topUpgradeWeakRef;
|
||||
|
||||
@Getter
|
||||
private WeakReference<Activity> avRoomActWeakRef;
|
||||
|
||||
public void setTopUpgradeActivity(Activity activity) {
|
||||
if (!ActWhiteListMrg.isTempActivity(activity)) {
|
||||
topUpgradeWeakRef = new WeakReference<>(activity);
|
||||
}
|
||||
}
|
||||
|
||||
public void addActivity(Activity activity){
|
||||
if (activity instanceof AVRoomActivity) {
|
||||
avRoomActWeakRef = new WeakReference<>(activity);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeActivity(Activity activity){
|
||||
if (activity instanceof AVRoomActivity) {
|
||||
avRoomActWeakRef = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class Helper {
|
||||
public static final ActivityStackManager INSTANCE = new ActivityStackManager();
|
||||
}
|
||||
|
||||
public static ActivityStackManager getInstance() {
|
||||
return Helper.INSTANCE;
|
||||
}
|
||||
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
package com.mango.moshen.audio.helper;
|
||||
|
||||
/**
|
||||
* create by lvzebiao @2019/6/11
|
||||
*/
|
||||
public interface OnRefreshListener {
|
||||
|
||||
void refresh();
|
||||
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.mango.moshen.audio.presenter;
|
||||
|
||||
import com.mango.moshen.audio.view.IMyVoiceView;
|
||||
import com.mango.moshen.base.BaseMvpPresenter;
|
||||
import com.mango.core.audio.AudioModel;
|
||||
import com.mango.core.audio.bean.UserVoiceInfo;
|
||||
import com.mango.core.auth.AuthModel;
|
||||
import com.mango.core.utils.net.DontWarnObserver;
|
||||
import com.mango.xchat_android_library.base.PresenterEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 我的声音页面
|
||||
*/
|
||||
public class MyVoicePresenter extends BaseMvpPresenter<IMyVoiceView> {
|
||||
|
||||
public void getUserVoiceInfo() {
|
||||
getMvpView().showLoadingView();
|
||||
AudioModel.get().getMyVoiceInfoList(AuthModel.get().getCurrentUid())
|
||||
.compose(bindUntilEvent(PresenterEvent.DESTROY))
|
||||
.subscribe(new DontWarnObserver<List<UserVoiceInfo>>() {
|
||||
@Override
|
||||
public void accept(List<UserVoiceInfo> userVoiceInfos, String error) {
|
||||
super.accept(userVoiceInfos, error);
|
||||
if (getMvpView() == null) {
|
||||
return;
|
||||
}
|
||||
getMvpView().hideLoadingView();
|
||||
getMvpView().showVoiceInfo(userVoiceInfos);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
package com.mango.moshen.audio.view;
|
||||
|
||||
import com.mango.core.audio.bean.VoiceMatchInfo;
|
||||
|
||||
/**
|
||||
* create by lvzebiao @2019/6/19
|
||||
*/
|
||||
public interface IBottleOpListener {
|
||||
|
||||
void onLimit(boolean isRight);
|
||||
|
||||
void onLikeOrUnLike(VoiceMatchInfo info, boolean isRight, boolean needLoading);
|
||||
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
package com.mango.moshen.audio.view;
|
||||
|
||||
import com.mango.core.audio.bean.UserVoiceInfo;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 我的声音页面
|
||||
*/
|
||||
public interface IMyVoiceView extends IMvpBaseView {
|
||||
/**
|
||||
* 显示声音数据消息
|
||||
*/
|
||||
void showVoiceInfo(List<UserVoiceInfo> voiceList);
|
||||
|
||||
/**
|
||||
* 请稍后
|
||||
*/
|
||||
void showLoadingView();
|
||||
|
||||
void hideLoadingView();
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
package com.mango.moshen.avroom;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import com.mango.moshen.avroom.widget.ViewItem;
|
||||
import com.mango.moshen.ui.widget.GiftDialog;
|
||||
|
||||
/**
|
||||
* 用户卡片的管理
|
||||
* Created by lvzebiao on 2018/11/12.
|
||||
*/
|
||||
|
||||
public class UserCardButtonManager {
|
||||
|
||||
|
||||
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils
|
||||
import com.mango.core.home.bean.HomeRoomInfo
|
||||
import com.mango.core.utils.subAndReplaceDot
|
||||
|
||||
class ExitRoomAdapter :
|
||||
BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.item_exit_room) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: HomeRoomInfo) {
|
||||
|
||||
ImageLoadUtils.loadImage(mContext, item.avatar, helper.getView(R.id.iv_avatar))
|
||||
ImageLoadUtils.loadImage(mContext, item.tagPict, helper.getView(R.id.iv_tag))
|
||||
helper.setText(R.id.tv_online_num, item.onlineNum.toString())
|
||||
.setText(R.id.tv_title, item.title.subAndReplaceDot(8))
|
||||
}
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter;
|
||||
|
||||
import com.mango.core.room.queue.bean.MicMemberInfo;
|
||||
|
||||
/**
|
||||
* Created by lvzebiao on 2018/11/5.
|
||||
*/
|
||||
public interface OnMicroItemClickListener {
|
||||
void onAvatarBtnClick(int position);
|
||||
|
||||
void onUpMicBtnClick(int position, MicMemberInfo chatRoomMember);
|
||||
|
||||
void onLockBtnClick(int position);
|
||||
|
||||
void onRoomSettingsClick();
|
||||
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 右滑操作的,写了暂时不用
|
||||
* Created by lvzebiao
|
||||
*/
|
||||
|
||||
public class RoomBlackListAdapter extends BaseQuickAdapter<ChatRoomMember, BaseViewHolder>{
|
||||
|
||||
private Context context;
|
||||
|
||||
private int itemWidth;
|
||||
|
||||
public RoomBlackListAdapter(Context context) {
|
||||
super(R.layout.list_item_room_black);
|
||||
this.context = context;
|
||||
itemWidth = UIUtil.getScreenWidth(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, ChatRoomMember chatRoomMember) {
|
||||
helper.setText(R.id.nick, chatRoomMember.getNick());
|
||||
ImageLoadUtils.loadAvatar(context, chatRoomMember.getAvatar(), helper.getView(R.id.avatar));
|
||||
helper.getView(R.id.layout_item).getLayoutParams().width = itemWidth;
|
||||
}
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomRankFragmentPageAdapter extends FragmentPagerAdapter {
|
||||
|
||||
private List<Fragment> fragmentList;
|
||||
|
||||
public RoomRankFragmentPageAdapter(FragmentManager fm, List<Fragment> fragmentList) {
|
||||
super(fm);
|
||||
this.fragmentList = fragmentList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return fragmentList.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fragmentList.size();
|
||||
}
|
||||
}
|
@@ -1,63 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.fragment.RoomRankDialogUtils;
|
||||
import com.mango.moshen.common.widget.CircleImageView;
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils;
|
||||
import com.mango.core.room.bean.RoomRankHalfHourRankInfo;
|
||||
import com.mango.core.room.bean.RoomRankMultiItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class RoomRankHalfHourListAdapter extends BaseMultiItemQuickAdapter<RoomRankMultiItem, BaseViewHolder> {
|
||||
|
||||
public final static int TYPE_TIPS = 4;
|
||||
|
||||
public RoomRankHalfHourListAdapter(Context context) {
|
||||
super(new ArrayList<>());
|
||||
addItemType(RoomRankMultiItem.TYPE_LINEAR, R.layout.item_room_rank_layout);
|
||||
addItemType(RoomRankMultiItem.TYPE_EMPTY, R.layout.item_empty_list);
|
||||
addItemType(TYPE_TIPS, R.layout.item_rank_half_tips);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder baseViewHolder, RoomRankMultiItem roomConsumeInfo) {
|
||||
if (roomConsumeInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (roomConsumeInfo.getItemType() == RoomRankMultiItem.TYPE_LINEAR) {
|
||||
setLinearData(baseViewHolder, roomConsumeInfo);
|
||||
} else if (roomConsumeInfo.getItemType() == RoomRankMultiItem.TYPE_EMPTY) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void setLinearData(BaseViewHolder baseViewHolder, RoomRankMultiItem roomConsumeInfo) {
|
||||
if (roomConsumeInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
RoomRankHalfHourRankInfo roomRankHalfHourRankInfo = (RoomRankHalfHourRankInfo) roomConsumeInfo.getData();
|
||||
if (roomRankHalfHourRankInfo == null)
|
||||
return;
|
||||
|
||||
// 值
|
||||
TextView valueTV = baseViewHolder.getView(R.id.tv_room_rank_value);
|
||||
valueTV.setText(RoomRankDialogUtils.getRoomRankValueText(roomRankHalfHourRankInfo.getTotalNum()));
|
||||
|
||||
int drawable = RoomRankDialogUtils.getNumberImage(roomRankHalfHourRankInfo.getSeqNo());
|
||||
if (drawable != 0)
|
||||
baseViewHolder.setImageResource(R.id.iv_number, drawable);
|
||||
// 标题
|
||||
baseViewHolder.setText(R.id.tv_room_rank_title, roomRankHalfHourRankInfo.getRoomTitle());
|
||||
// 头像
|
||||
CircleImageView avatarView = baseViewHolder.getView(R.id.iv_room_rank_avatar);
|
||||
ImageLoadUtils.loadAvatar(mContext, roomRankHalfHourRankInfo.getAvatar(), avatarView, true);
|
||||
baseViewHolder.setText(R.id.tv_room_rank_id, "ID:" + roomRankHalfHourRankInfo.getErbanNo());
|
||||
}
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
package com.mango.moshen.avroom.anotherroompk
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils
|
||||
import com.mango.core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.mango.core.utils.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,"ID:${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)
|
||||
}
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
package com.mango.moshen.avroom.anotherroompk
|
||||
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.DialogRoomPkRuleBinding
|
||||
|
||||
class RoomPkRuleDialog : BaseDialog<DialogRoomPkRuleBinding>() {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(): RoomPkRuleDialog {
|
||||
return RoomPkRuleDialog()
|
||||
}
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.mango.moshen.avroom.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.method.ScrollingMovementMethod;
|
||||
import android.view.View;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.databinding.DialogDatingVipRuleBinding;
|
||||
import com.mango.moshen.treasure_box.widget.dialog.BaseBindingDialog;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_dating_vip_rule)
|
||||
public class DatingVipRuleDialog extends BaseBindingDialog<DialogDatingVipRuleBinding> implements View.OnClickListener {
|
||||
|
||||
|
||||
public DatingVipRuleDialog(Context context) {
|
||||
super(context, R.style.DialogFragment);
|
||||
}
|
||||
|
||||
public static DatingVipRuleDialog newInstance(Context context) {
|
||||
return new DatingVipRuleDialog(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
binding.setClick(this);
|
||||
binding.tvRule.setMovementMethod(ScrollingMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
closeDialog();
|
||||
}
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
package com.mango.moshen.avroom.dialog
|
||||
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.DialogNewUserGiftBinding
|
||||
import com.mango.moshen.ui.utils.load
|
||||
import com.mango.core.gift.bean.GiftInfo
|
||||
import com.mango.core.statistic.StatisticManager
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||
|
||||
class NewUserGiftDialog(val giftInfo: GiftInfo) :
|
||||
BaseDialog<DialogNewUserGiftBinding>() {
|
||||
|
||||
override fun init() {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_NUGIVE_POP_SHOW, "房间礼物赠送弹窗曝光")
|
||||
binding.ivClose.setOnClickListener {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_NUGIVE_POP_CLICK, "房间礼物赠送弹窗关闭点击")
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
binding.ivGift.load(giftInfo.giftUrl)
|
||||
binding.tvGiftName.text = "${giftInfo.giftName}*${giftInfo.count}"
|
||||
}
|
||||
|
||||
}
|
@@ -1,44 +0,0 @@
|
||||
package com.mango.moshen.avroom.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.databinding.DialogRequestUpmicBinding
|
||||
import com.mango.moshen.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.mango.core.manager.AvRoomDataManager
|
||||
import com.mango.core.manager.IMNetEaseManager
|
||||
import com.mango.core.user.bean.BaseInfo
|
||||
import com.mango.core.user.bean.UserInfo
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_request_upmic)
|
||||
class RequestUpMicDialog(context: Context) :
|
||||
BaseBindingDialog<DialogRequestUpmicBinding>(context, R.style.dialog),
|
||||
View.OnClickListener {
|
||||
private var userInfo: UserInfo? = null
|
||||
override fun init() {
|
||||
binding.click = this
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.btn_cancel -> {
|
||||
closeDialog()
|
||||
}
|
||||
R.id.btn_ok -> {
|
||||
userInfo?.let {
|
||||
val baseInfo = BaseInfo(it.uid, it.nick)
|
||||
val position = AvRoomDataManager.get().findFreePosition()
|
||||
if ( position == Int.MIN_VALUE) return@let
|
||||
IMNetEaseManager.get().inviteMicroPhoneBySdk(baseInfo, position ).subscribe()
|
||||
}
|
||||
closeDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setUser(userInfo: UserInfo) {
|
||||
this.userInfo = userInfo
|
||||
binding.user = userInfo
|
||||
}
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
package com.mango.moshen.avroom.firstcharge
|
||||
|
||||
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.mango.moshen.R
|
||||
import com.mango.core.pay.bean.FirstChargeReward
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils
|
||||
import com.mango.core.utils.TextUtils
|
||||
|
||||
class RewardAdapter(private val itemWidth: Int) :
|
||||
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_first_charge_reward) {
|
||||
override fun convert(helper: BaseViewHolder, item: FirstChargeReward) {
|
||||
helper.itemView.updateLayoutParams<RecyclerView.LayoutParams> {
|
||||
width = itemWidth
|
||||
}
|
||||
ImageLoadUtils.loadImage(
|
||||
mContext,
|
||||
item.showPir,
|
||||
helper.getView(R.id.iv_pic),
|
||||
R.drawable.default_cover
|
||||
)
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, item.showTime)
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
}
|
@@ -1,687 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewStub;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||
import com.mango.moshen.avroom.activity.RoomOnlineUserActivity;
|
||||
import com.mango.moshen.avroom.adapter.SelectGameAdapter;
|
||||
import com.mango.moshen.avroom.dialog.ExitRoomPopupWindow;
|
||||
import com.mango.moshen.avroom.widget.GiftV2View;
|
||||
import com.mango.moshen.base.BaseFragment;
|
||||
import com.mango.moshen.databinding.FragmentChatroomGameMainBinding;
|
||||
import com.mango.moshen.friend.view.SelectFriendActivity;
|
||||
import com.mango.moshen.home.helper.OpenRoomHelper;
|
||||
import com.mango.moshen.ui.widget.ShareDialog;
|
||||
import com.mango.moshen.utils.RegexUtil;
|
||||
import com.mango.core.gift.bean.GiftMultiReceiverInfo;
|
||||
import com.mango.core.gift.bean.GiftReceiveInfo;
|
||||
import com.mango.core.gift.bean.LuckyBagGifts;
|
||||
import com.mango.core.gift.bean.MultiGiftReceiveInfo;
|
||||
import com.mango.core.home.event.FollowRoomEvent;
|
||||
import com.mango.core.home.event.ShareRoomEvent;
|
||||
import com.mango.core.home.model.CollectionRoomModel;
|
||||
import com.mango.core.im.custom.bean.CustomAttachment;
|
||||
import com.mango.core.im.custom.bean.RoomInfoAttachment;
|
||||
import com.mango.core.magic.bean.MagicReceivedInfo;
|
||||
import com.mango.core.magic.bean.MultiMagicReceivedInfo;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.manager.IMNetEaseManager;
|
||||
import com.mango.core.manager.RoomEvent;
|
||||
import com.mango.core.praise.PraiseModel;
|
||||
import com.mango.core.room.bean.RoomInfo;
|
||||
import com.mango.core.room.bean.RoomModeType;
|
||||
import com.mango.core.room.game.GameInfo;
|
||||
import com.mango.core.room.game.GameModel;
|
||||
import com.mango.core.room.queuing_mic.event.HasAnimationEffect;
|
||||
import com.mango.core.share.ShareModel;
|
||||
import com.mango.core.statistic.StatisticManager;
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.mango.core.super_admin.util.SuperAdminUtil;
|
||||
import com.mango.core.user.UserModel;
|
||||
import com.mango.core.user.bean.UserInfo;
|
||||
import com.mango.xchat_android_library.utils.JavaUtil;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import cn.sharesdk.framework.Platform;
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Action;
|
||||
|
||||
/**
|
||||
* 轰趴房
|
||||
* Created by 2016/9/22.
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
public class HomePartyFragment extends BaseFragment implements View.OnClickListener, ShareDialog.OnShareDialogItemClick {
|
||||
|
||||
private Fragment roomFragment;
|
||||
|
||||
private TextView roomTitle;
|
||||
private TextView roomId;
|
||||
private ImageView ivFollowRoom;
|
||||
private AppCompatImageView mIvGoodNumber;
|
||||
|
||||
private ImageView roomMore;
|
||||
private GiftV2View giftView;
|
||||
private ViewStub mVsGift2View;
|
||||
|
||||
private SVGAImageView svgaRoomBg;
|
||||
private String[] bgPicture = new String[]{""};
|
||||
|
||||
private UserInfo mUserInfo;
|
||||
private FragmentChatroomGameMainBinding gameMainBinding;
|
||||
|
||||
private ShareDialog shareDialog;
|
||||
|
||||
//收藏房间
|
||||
private String FOLLOW_ROOM_TYPE = "";
|
||||
private SelectGameAdapter gameAdapter;
|
||||
|
||||
|
||||
public static HomePartyFragment newInstance() {
|
||||
HomePartyFragment homePartyFragment = new HomePartyFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
homePartyFragment.setArguments(bundle);
|
||||
return homePartyFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
// clear views
|
||||
roomTitle.setText("");
|
||||
setRoomId(0, 0);
|
||||
updateOnlineNumberView(0);
|
||||
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||
((HomePartyRoomFragment) roomFragment).onNewIntent(intent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
private void setRoomId(long id, int onlineNumber) {
|
||||
String htmlText = "ID:" + id;
|
||||
roomId.setText(htmlText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_chatroom_game_main;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
gameMainBinding = DataBindingUtil.bind(mView);
|
||||
roomTitle = mView.findViewById(R.id.room_title);
|
||||
setupRoomTitleMarquee();
|
||||
roomMore = mView.findViewById(R.id.room_more);
|
||||
roomId = mView.findViewById(R.id.room_id);
|
||||
mVsGift2View = mView.findViewById(R.id.vs_gift_view);
|
||||
mIvGoodNumber = mView.findViewById(R.id.iv_good_number);
|
||||
ivFollowRoom = mView.findViewById(R.id.iv_follow_room);
|
||||
svgaRoomBg = mView.findViewById(R.id.svga_image_view_bg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加跑马灯
|
||||
* 以及反射一些参数影响跑马灯
|
||||
*/
|
||||
private void setupRoomTitleMarquee() {
|
||||
try {
|
||||
ViewConfiguration configuration = ViewConfiguration.get(getContext());
|
||||
Class claz = configuration.getClass();
|
||||
Field field = claz.getDeclaredField("mFadingMarqueeEnabled");
|
||||
field.setAccessible(true);
|
||||
field.set(configuration, true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
roomTitle.setSelected(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
roomMore.setOnClickListener(this);
|
||||
ivFollowRoom.setOnClickListener(this);
|
||||
gameMainBinding.llRoomInfo.setOnClickListener(this);
|
||||
gameMainBinding.ivBack.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void initiate() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
if (!AvRoomDataManager.get().haveSelfChange) {
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect = AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect();
|
||||
}
|
||||
}
|
||||
|
||||
private void initRvGame() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null || gameAdapter != null) return;
|
||||
gameMainBinding.rvGame.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
gameMainBinding.rvGame.setAdapter(gameAdapter = new SelectGameAdapter());
|
||||
gameMainBinding.llSelectGame.setOnClickListener(v -> {
|
||||
if (gameMainBinding.rvGame.getVisibility() == View.VISIBLE) {
|
||||
gameMainBinding.rvGame.setVisibility(View.GONE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
|
||||
} else {
|
||||
if (!isShowChangeGame()) {
|
||||
SingleToastUtil.showToast("请关闭其他模式再切换游戏!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isGamePlaying()) {
|
||||
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!");
|
||||
} else {
|
||||
gameMainBinding.rvGame.setVisibility(View.VISIBLE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gameAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
if (AvRoomDataManager.get().isGamePlaying()) {
|
||||
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!");
|
||||
}
|
||||
if (!isShowChangeGame()) {
|
||||
SingleToastUtil.showToast("请关闭其他模式再切换游戏!");
|
||||
return;
|
||||
}
|
||||
|
||||
GameInfo gameInfo = gameAdapter.getItem(position);
|
||||
if (gameInfo != null) {
|
||||
int type;
|
||||
long mgId = 0;
|
||||
if (Objects.equals("扩列交友", gameInfo.getName())) {
|
||||
type = RoomInfo.ROOMTYPE_HOME_PARTY;
|
||||
} else {
|
||||
type = RoomInfo.ROOMTYPE_GAME;
|
||||
mgId = JavaUtil.str2long(gameInfo.getMgId());
|
||||
}
|
||||
gameMainBinding.rvGame.setVisibility(View.GONE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
|
||||
OpenRoomHelper.updateRoomInfo(
|
||||
getBaseActivity(),
|
||||
AvRoomDataManager.get().mCurrentRoomInfo,
|
||||
type,
|
||||
mgId,
|
||||
false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//这里的2和4是服务端定义的错误状态 关闭排麦模式和关闭PK模式!
|
||||
private boolean isShowChangeGame() {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
return currentRoomInfo != null &&
|
||||
AvRoomDataManager.get().isRoomOwner() &&
|
||||
currentRoomInfo.getIsPermitRoom() != 1 &&
|
||||
currentRoomInfo.getType() != RoomInfo.ROOM_TYPE_SINGLE &&
|
||||
(currentRoomInfo.getRoomModeType() == RoomModeType.NORMAL_MODE ||
|
||||
currentRoomInfo.getRoomModeType() == 2 ||
|
||||
currentRoomInfo.getRoomModeType() == 4);
|
||||
}
|
||||
|
||||
public void setRoomBg(RoomInfo roomInfo) {
|
||||
if (svgaRoomBg == null) return;
|
||||
updateView(roomInfo);
|
||||
AVRoomActivity.setBackBg(mContext, roomInfo, svgaRoomBg, bgPicture);
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
updateView(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(roomEvent -> {
|
||||
if (roomEvent == null) return;
|
||||
int event = roomEvent.getEvent();
|
||||
switch (event) {
|
||||
case RoomEvent.ENTER_ROOM:
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
updateOnlineNumberView(AvRoomDataManager.get().mCurrentRoomInfo.onlineNum);
|
||||
}
|
||||
addTipMsg();
|
||||
case RoomEvent.ROOM_INFO_UPDATE:
|
||||
setRoomBg(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
break;
|
||||
case RoomEvent.RECEIVE_NORMALE_GIFT:
|
||||
onReceiveGiftMsg(roomEvent.getGiftReceiveInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVE_MUTLT_NORMALEI_GIFT://普通多人
|
||||
onReceiveMultiGiftMsg(roomEvent.getGiftMultiReceiverInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVE_ALL_MIC__NORMALEI_GIFT://普通全麦
|
||||
onReceiveAllMicGiftMsg(roomEvent.getMultiGiftReceiveInfo());
|
||||
break;
|
||||
//福袋礼物
|
||||
case RoomEvent.RECEIVE_LUCKY_GIFT:
|
||||
case RoomEvent.RECEIVE_MULTI_LUCKY_GIFT:
|
||||
case RoomEvent.RECEIVE_ALL_MIC_LUCKY_GIFT:
|
||||
onReceiveLuckyGiftToMultiMsg(roomEvent.getLuckygiftMultiReceiverInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVED_SINGLE_MAGIC:
|
||||
onReceiveMagicMsg(roomEvent.getMagicReceivedInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVED_ALL_MIC_MAGIC:
|
||||
onReceiveMultiMagicMsg(roomEvent.getMultiMagicReceivedInfo());
|
||||
break;
|
||||
case RoomEvent.FANS_TEAM_JOIN:
|
||||
onReceiveFansTeamJoinMsg(roomEvent.getChatRoomMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void onReceiveLuckyGiftToMultiMsg(LuckyBagGifts giftMultiReceiverInfo) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveLuckyGiftToMultiMsg(giftMultiReceiverInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入房间时的提示信息
|
||||
*/
|
||||
private void addTipMsg() {
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null && AvRoomDataManager.get().mCurrentRoomInfo.isCloseScreen()) {
|
||||
MsgAttachment attachment = new RoomInfoAttachment(CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO,
|
||||
CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_SCREEN);
|
||||
ChatRoomMessage closeMsg = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
closeMsg.setContent("管理员已关闭聊天公屏");
|
||||
IMNetEaseManager.get().addCloseScreenMessages(closeMsg);
|
||||
} else if (AvRoomDataManager.get().mCurrentRoomInfo != null && !AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect()) {
|
||||
ChatRoomMessage tipMessage = ChatRoomMessageBuilder.createTipMessage("");
|
||||
tipMessage.setContent("礼物特效");
|
||||
IMNetEaseManager.get().addCloseScreenMessages(tipMessage);
|
||||
}
|
||||
}
|
||||
|
||||
private void setIdOnlineData() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
|
||||
UserModel.get().getUserInfo(roomInfo.getUid()).subscribe(new SingleObserver<UserInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mCompositeDisposable.add(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(UserInfo userInfo) {
|
||||
mUserInfo = userInfo;
|
||||
setRoomId(mUserInfo.getErbanNo(), roomInfo.onlineNum);
|
||||
mIvGoodNumber.setVisibility(mUserInfo.isHasPrettyErbanNo() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
setRoomId(0, roomInfo.onlineNum);
|
||||
mIvGoodNumber.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
gameMainBinding.setRoomInfo(roomInfo);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void updateView(RoomInfo currentRoomInfo) {
|
||||
if (currentRoomInfo != null) {
|
||||
|
||||
Fragment tempFragment = roomFragment;
|
||||
switch (currentRoomInfo.getType()) {
|
||||
case RoomInfo.ROOMTYPE_GAME:
|
||||
if (!(tempFragment instanceof GameRoomFragment)) {
|
||||
tempFragment = GameRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
case RoomInfo.ROOM_TYPE_SINGLE:
|
||||
if (!(tempFragment instanceof SingleRoomFragment)) {
|
||||
tempFragment = SingleRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (!(tempFragment instanceof HomePartyRoomFragment)) {
|
||||
tempFragment = HomePartyRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (tempFragment != roomFragment) {
|
||||
roomFragment = tempFragment;
|
||||
getChildFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.container, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
gameMainBinding.setRoomInfo(currentRoomInfo);
|
||||
updateHasAnimationEffect();
|
||||
roomTitle.setText(RegexUtil.getPrintableString(currentRoomInfo.getTitle()));
|
||||
if (!StringUtil.isEmpty(currentRoomInfo.getRoomPwd())) {
|
||||
roomTitle.setCompoundDrawablesWithIntrinsicBounds(null, null,
|
||||
getResources().getDrawable(R.drawable.icon_room_lock), null);
|
||||
} else {
|
||||
roomTitle.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
|
||||
}
|
||||
|
||||
|
||||
ivFollowRoom.setVisibility(AvRoomDataManager.get().isRoomOwner() ? View.GONE : View.VISIBLE);
|
||||
FOLLOW_ROOM_TYPE = AvRoomDataManager.get().isRoomFans ? "2" : "1";
|
||||
ivFollowRoom.setImageResource(AvRoomDataManager.get().isRoomFans ? R.drawable.icon_room_liked : R.drawable.icon_room_like);
|
||||
|
||||
setIdOnlineData();
|
||||
if (isShowChangeGame()) {
|
||||
initRvGame();
|
||||
gameMainBinding.llChangeGame.setVisibility(View.VISIBLE);
|
||||
if (AvRoomDataManager.get().isOpenGame()) {
|
||||
gameMainBinding.tvCurrGame.setText(currentRoomInfo.getMgName());
|
||||
} else {
|
||||
gameMainBinding.tvCurrGame.setText("扩列交友");
|
||||
}
|
||||
GameModel.INSTANCE.getGameList()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(gameInfos -> {
|
||||
if (AvRoomDataManager.get().isOpenGame()) {
|
||||
for (int i = 0; i < gameInfos.size(); i++) {
|
||||
GameInfo gameInfo = gameInfos.get(i);
|
||||
if (JavaUtil.str2long(gameInfo.getMgId()) == currentRoomInfo.getMgId()) {
|
||||
gameInfos.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
GameInfo gameInfo = new GameInfo();
|
||||
gameInfo.setName("扩列交友");
|
||||
gameInfos.add(gameInfo);
|
||||
}
|
||||
gameAdapter.setNewData(gameInfos);
|
||||
});
|
||||
} else {
|
||||
gameMainBinding.llChangeGame.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateHasAnimationEffect() {
|
||||
if (!AvRoomDataManager.get().haveSelfChange && AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect = AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect();
|
||||
}
|
||||
gameMainBinding.setHasAnimationEffect(AvRoomDataManager.get().mIsNeedGiftEffect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新特效开关提示
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void updateHasAnimation(HasAnimationEffect event) {
|
||||
updateHasAnimationEffect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.room_more:
|
||||
ExitRoomPopupWindow.newInstance((AVRoomActivity) requireActivity())
|
||||
.showAtLocation(gameMainBinding.getRoot(), Gravity.END, 0, 0);
|
||||
break;
|
||||
case R.id.ll_room_info:
|
||||
RoomOnlineUserActivity.start(getActivity());
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_ONLINE_LIST_CLICK, "房间在线列表点击");
|
||||
break;
|
||||
case R.id.iv_follow_room:
|
||||
followRoom();
|
||||
break;
|
||||
case R.id.iv_back:
|
||||
if (getActivity() instanceof AVRoomActivity) {
|
||||
((AVRoomActivity) getActivity()).onBackPressed();
|
||||
}
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_RETURN_CLICK, "房间返回按钮点击");
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public void dismissSendRedPackageDialog() {
|
||||
if (roomFragment instanceof BaseRoomFragment) {
|
||||
((BaseRoomFragment) roomFragment).clearDialog();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏房间
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void followRoom() {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoomInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, String> arguments = new HashMap<>();
|
||||
arguments.put("room_id", String.valueOf(mUserInfo == null ? currentRoomInfo.getUid() : mUserInfo.getErbanNo()));
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_COLLECT_ICON_CLICK, "语音房_收藏顶部按钮", arguments);
|
||||
|
||||
CollectionRoomModel.get().followRoom(FOLLOW_ROOM_TYPE, currentRoomInfo.getUid())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doOnError(throwable -> {
|
||||
toast(throwable.getMessage());
|
||||
})
|
||||
.subscribe(s -> {
|
||||
AvRoomDataManager.get().isRoomFans = !AvRoomDataManager.get().isRoomFans;
|
||||
FOLLOW_ROOM_TYPE = AvRoomDataManager.get().isRoomFans ? "2" : "1";
|
||||
ivFollowRoom.setImageResource(AvRoomDataManager.get().isRoomFans ? R.drawable.icon_room_liked : R.drawable.icon_room_like);
|
||||
if (AvRoomDataManager.get().isRoomFans) {
|
||||
SingleToastUtil.showToast("收藏成功!");
|
||||
PraiseModel.get().setFollowRoomSuccessRoomTip(currentRoomInfo.getUid());
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_FOLLOW_BUTTON_CLICK, "语音房_收藏顶部按钮");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onFollowRoomEvent(FollowRoomEvent event) {
|
||||
ivFollowRoom.setImageResource(AvRoomDataManager.get().isRoomFans ? R.drawable.icon_room_liked : R.drawable.icon_room_like);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onShareRoomEvent(ShareRoomEvent event) {
|
||||
shareRoom();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享房间
|
||||
*/
|
||||
public void shareRoom() {
|
||||
if (shareDialog != null && shareDialog.isShowing()) {
|
||||
shareDialog.dismiss();
|
||||
}
|
||||
shareDialog = new ShareDialog(getActivity());
|
||||
shareDialog.setOnShareDialogItemClick(this);
|
||||
shareDialog.show();
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_SHARE_CLICK, "语音房_分享");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInAppSharingItemClick() {
|
||||
shareDialog.dismiss();
|
||||
SelectFriendActivity.startForSharingRoom(getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharePlatformClick(Platform platform) {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoomInfo != null) {
|
||||
UserModel.get().getUserInfo(currentRoomInfo.getUid())
|
||||
.flatMap(userInfo -> ShareModel.get().shareRoom(
|
||||
platform,
|
||||
currentRoomInfo.getUid(),
|
||||
userInfo.getErbanNo(),
|
||||
currentRoomInfo.getTitle(),
|
||||
currentRoomInfo.getAvatar()
|
||||
))
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doAfterTerminate(new Action() {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
getDialogManager().dismissDialog();
|
||||
}
|
||||
})
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
toast(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
toast(e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (giftView != null) {
|
||||
giftView.release();
|
||||
}
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
roomFragment.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
public void onRoomOnlineNumberSuccess(int onlineNumber) {
|
||||
updateOnlineNumberView(onlineNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通多人
|
||||
*
|
||||
* @param giftMultiReceiverInfo
|
||||
*/
|
||||
private void onReceiveMultiGiftMsg(GiftMultiReceiverInfo giftMultiReceiverInfo) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveGiftToMultiMsg(giftMultiReceiverInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通全麦
|
||||
*
|
||||
* @param multiGiftReceiveInfo
|
||||
*/
|
||||
private void onReceiveAllMicGiftMsg(MultiGiftReceiveInfo multiGiftReceiveInfo) {
|
||||
if (multiGiftReceiveInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMultiGiftMsg(multiGiftReceiveInfo);
|
||||
}
|
||||
|
||||
private void onReceiveGiftMsg(GiftReceiveInfo giftReceiveInfo) {
|
||||
if (giftReceiveInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveGiftMsg(giftReceiveInfo);
|
||||
}
|
||||
|
||||
private void onReceiveMagicMsg(MagicReceivedInfo magicReceivedInfo) {
|
||||
if (magicReceivedInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMagicMsg(magicReceivedInfo);
|
||||
}
|
||||
|
||||
|
||||
private void onReceiveMultiMagicMsg(MultiMagicReceivedInfo multiMagicReceivedInfo) {
|
||||
if (multiMagicReceivedInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMultiMagicMsg(multiMagicReceivedInfo);
|
||||
}
|
||||
|
||||
private void onReceiveFansTeamJoinMsg(ChatRoomMessage message) {
|
||||
if (message == null || !isResumed())
|
||||
return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveFansTeamOpenMsg(message);
|
||||
}
|
||||
|
||||
private void updateOnlineNumberView(int onlineNumber) {
|
||||
if (!SuperAdminUtil.isSuperAdmin()) {
|
||||
if (onlineNumber < 1) {
|
||||
onlineNumber = 1;
|
||||
}
|
||||
}
|
||||
gameMainBinding.roomNums.setText("在线" + onlineNumber);
|
||||
}
|
||||
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
public interface IRoomRankDialogChangePageListener {
|
||||
void onChangePage(int pos);
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
public interface IRoomRankDialogDismissListener {
|
||||
void onDismiss();
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import com.mango.core.room.bean.RoomRankHalfHourMeInfo;
|
||||
import com.mango.core.room.bean.RoomRankHalfHourRankInfo;
|
||||
import com.mango.core.room.bean.RoomRankMultiItem;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IRoomRankHalfHourView extends IMvpBaseView {
|
||||
void showMeInfo(RoomRankHalfHourMeInfo dataInfo/*, int progress, String onListTip*/);
|
||||
|
||||
void showTop3Info(List<RoomRankHalfHourRankInfo> dataInfoList);
|
||||
|
||||
void showRankListInfo(List<RoomRankMultiItem> dataList);
|
||||
|
||||
void loadDataFailure();
|
||||
}
|
@@ -1,41 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.mango.moshen.avroom.widget.RankNavigatorAdapter;
|
||||
import com.mango.moshen.base.BaseBindingFragment;
|
||||
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.mango.core.room.bean.RoomContributeDataInfo;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.mango.moshen.databinding.FragmentRoomCharmListBinding;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ActLayoutRes(R.layout.fragment_room_charm_list)
|
||||
public class RoomCharmListFragment extends BaseBindingFragment<FragmentRoomCharmListBinding> {
|
||||
|
||||
public static RoomCharmListFragment newInstance() {
|
||||
return new RoomCharmListFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
ArrayList<Fragment> fragments = new ArrayList<>(2);
|
||||
fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING));
|
||||
fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING));
|
||||
mBinding.vpCharmRankings.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), fragments));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(false);
|
||||
|
||||
RankNavigatorAdapter indicator = new RankNavigatorAdapter(false);
|
||||
indicator.setOnItemSelectListener(position -> mBinding.vpCharmRankings.setCurrentItem(position));
|
||||
commonNavigator.setAdapter(indicator);
|
||||
mBinding.viewIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(mBinding.viewIndicator, mBinding.vpCharmRankings);
|
||||
}
|
||||
|
||||
}
|
@@ -1,61 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.mango.moshen.avroom.widget.RankNavigatorAdapter;
|
||||
import com.mango.moshen.base.BaseMvpFragment;
|
||||
import com.mango.moshen.ui.widget.magicindicator.MagicIndicator;
|
||||
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.room.bean.RoomContributeDataInfo;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by MadisonRong on 25/04/2018.
|
||||
*/
|
||||
public class RoomContributeListFragment extends BaseMvpFragment implements IMvpBaseView {
|
||||
|
||||
private ViewPager viewPager;
|
||||
private MagicIndicator viewIndicator;
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
viewIndicator = mView.findViewById(R.id.view_indicator);
|
||||
viewPager = mView.findViewById(R.id.vp_contribute_rankings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
ArrayList<Fragment> fragments = new ArrayList<>(2);
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING));
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING));
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_MONTH_RANKING));
|
||||
}
|
||||
viewPager.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), fragments));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(false);
|
||||
RankNavigatorAdapter indicator = new RankNavigatorAdapter(AvRoomDataManager.get().isDatingMode());
|
||||
indicator.setOnItemSelectListener(position -> viewPager.setCurrentItem(position));
|
||||
commonNavigator.setAdapter(indicator);
|
||||
viewIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(viewIndicator, viewPager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_room_contribute;
|
||||
}
|
||||
|
||||
}
|
@@ -1,99 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.appcompat.app.AppCompatDialogFragment;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.adapter.RoomRankFragmentPageAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RoomRankDialogFragment extends AppCompatDialogFragment implements IRoomRankDialogDismissListener, IRoomRankDialogChangePageListener {
|
||||
|
||||
private ViewPager mViewPager;
|
||||
|
||||
|
||||
public static RoomRankDialogFragment newInstance() {
|
||||
Bundle args = new Bundle();
|
||||
RoomRankDialogFragment fragment = new RoomRankDialogFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
if (getActivity() != null) {
|
||||
Dialog dialog = new Dialog(getActivity(), R.style.room_rank_dialog);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(R.layout.dialog_fragment_room_rank);
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
|
||||
// 设置弹出框布局参数,宽度铺满全屏,底部。
|
||||
Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.BOTTOM;
|
||||
wlp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
window.setDimAmount(0.3f);
|
||||
window.setAttributes(wlp);
|
||||
window.setBackgroundDrawableResource(R.drawable.bg_room_rank);
|
||||
return dialog;
|
||||
} else {
|
||||
return super.onCreateDialog(savedInstanceState);
|
||||
}
|
||||
} else {
|
||||
return super.onCreateDialog(savedInstanceState);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.dialog_fragment_room_rank, container, false);
|
||||
mViewPager = view.findViewById(R.id.vp_room_rank);
|
||||
List<Fragment> fragmentList = new ArrayList<>();
|
||||
if (getChildFragmentManager().getFragments() != null && getChildFragmentManager().getFragments().size() != 0) {
|
||||
fragmentList = getChildFragmentManager().getFragments();
|
||||
} else {
|
||||
RoomRankListFragment roomInsideFragment = RoomRankListFragment.newInstance();
|
||||
roomInsideFragment.setDismissListener(this);
|
||||
roomInsideFragment.setChangePageListener(this);
|
||||
fragmentList.add(roomInsideFragment);
|
||||
}
|
||||
mViewPager.setAdapter(new RoomRankFragmentPageAdapter(getChildFragmentManager(), fragmentList));
|
||||
mViewPager.setOffscreenPageLimit(fragmentList.size());
|
||||
mViewPager.setCurrentItem(0, false);
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setCancelable(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangePage(int pos) {
|
||||
mViewPager.setCurrentItem(pos, false);
|
||||
}
|
||||
}
|
@@ -1,64 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class RoomRankDialogUtils {
|
||||
public static String getRoomRankValueText(int value) {
|
||||
if (value >= 10000) {
|
||||
BigDecimal bigDecimal = new BigDecimal(value / 10000.0);
|
||||
double doubleValue = bigDecimal.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
return String.valueOf(doubleValue) + "万";
|
||||
} else {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getNumberImage(int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return R.drawable.ic_rank_1;
|
||||
case 2:
|
||||
return R.drawable.ic_rank_2;
|
||||
case 3:
|
||||
return R.drawable.ic_rank_3;
|
||||
case 4:
|
||||
return R.drawable.ic_rank_4;
|
||||
case 5:
|
||||
return R.drawable.ic_rank_5;
|
||||
case 6:
|
||||
return R.drawable.ic_rank_6;
|
||||
case 7:
|
||||
return R.drawable.ic_rank_7;
|
||||
case 8:
|
||||
return R.drawable.ic_rank_8;
|
||||
case 9:
|
||||
return R.drawable.ic_rank_9;
|
||||
case 10:
|
||||
return R.drawable.ic_rank_10;
|
||||
case 11:
|
||||
return R.drawable.ic_rank_11;
|
||||
case 12:
|
||||
return R.drawable.ic_rank_12;
|
||||
case 13:
|
||||
return R.drawable.ic_rank_13;
|
||||
case 14:
|
||||
return R.drawable.ic_rank_14;
|
||||
case 15:
|
||||
return R.drawable.ic_rank_15;
|
||||
case 16:
|
||||
return R.drawable.ic_rank_16;
|
||||
case 17:
|
||||
return R.drawable.ic_rank_17;
|
||||
case 18:
|
||||
return R.drawable.ic_rank_18;
|
||||
case 19:
|
||||
return R.drawable.ic_rank_19;
|
||||
case 20:
|
||||
return R.drawable.ic_rank_20;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,79 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.View;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.mango.moshen.avroom.widget.RoomRankNavigatorAdapter;
|
||||
import com.mango.moshen.base.BaseBindingFragment;
|
||||
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.mango.moshen.databinding.FragmentRoomRankListBinding;
|
||||
|
||||
@ActLayoutRes(R.layout.fragment_room_rank_list)
|
||||
public class RoomRankListFragment extends BaseBindingFragment<FragmentRoomRankListBinding> implements View.OnClickListener, IRoomRankDialogDismissListener{
|
||||
|
||||
public static RoomRankListFragment newInstance() {
|
||||
return new RoomRankListFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
mBinding.setClick(this);
|
||||
List<Fragment> list = new ArrayList<>(2);
|
||||
list.add(new RoomContributeListFragment());
|
||||
list.add(RoomCharmListFragment.newInstance());
|
||||
mBinding.viewPager.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), list));
|
||||
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(true);
|
||||
|
||||
RoomRankNavigatorAdapter indicator = new RoomRankNavigatorAdapter();
|
||||
indicator.setOnItemSelectListener(position -> mBinding.viewPager.setCurrentItem(position));
|
||||
commonNavigator.setAdapter(indicator);
|
||||
mBinding.miRoomRank.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(mBinding.miRoomRank, mBinding.viewPager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.tv_room_rank_half_hour_tab:
|
||||
goToChangePage(0);
|
||||
break;
|
||||
|
||||
case R.id.tv_room_rank_in_room_tab:
|
||||
goToChangePage(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private IRoomRankDialogDismissListener dismissListener;
|
||||
private IRoomRankDialogChangePageListener changePageListener;
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
if (dismissListener != null) {
|
||||
dismissListener.onDismiss();
|
||||
}
|
||||
}
|
||||
public void setDismissListener(IRoomRankDialogDismissListener dismissListener) {
|
||||
this.dismissListener = dismissListener;
|
||||
}
|
||||
/**
|
||||
* 修改最外层Dialog的显示页面
|
||||
*/
|
||||
private void goToChangePage(int pos) {
|
||||
if (changePageListener != null) {
|
||||
changePageListener.onChangePage(pos);
|
||||
}
|
||||
}
|
||||
|
||||
public void setChangePageListener(IRoomRankDialogChangePageListener changePageListener) {
|
||||
this.changePageListener = changePageListener;
|
||||
}
|
||||
}
|
@@ -1,338 +0,0 @@
|
||||
package com.mango.moshen.avroom.fragment
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.isGone
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.viewModels
|
||||
import com.mango.core.UriProvider
|
||||
import com.mango.core.auth.AuthModel
|
||||
import com.mango.core.fansteam.FansTeamInitInfo
|
||||
import com.mango.core.home.bean.BannerInfo
|
||||
import com.mango.core.im.custom.bean.FansTeamMsgAttachment
|
||||
import com.mango.core.im.custom.bean.RequestUpmicAttachment
|
||||
import com.mango.core.im.custom.bean.RoomPKAttachment
|
||||
import com.mango.core.manager.AvRoomDataManager
|
||||
import com.mango.core.manager.RoomEvent
|
||||
import com.mango.core.pay.event.FirstChargeEvent
|
||||
import com.mango.core.room.anotherroompk.ShowPkMatchEvent
|
||||
import com.mango.core.room.anotherroompk.SingleRoomPKModel
|
||||
import com.mango.core.statistic.StatisticManager
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||
import com.mango.core.user.UserModel
|
||||
import com.mango.core.user.bean.UserInfo
|
||||
import com.mango.core.utils.CurrentTimeUtils
|
||||
import com.mango.core.utils.toast
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.avroom.adapter.OnMicroItemClickListener
|
||||
import com.mango.moshen.avroom.adapter.SingleAnchorMicroViewAdapter
|
||||
import com.mango.moshen.avroom.adapter.SingleRoomPKMicroViewAdapter
|
||||
import com.mango.moshen.avroom.dialog.RequestUpMicDialog
|
||||
import com.mango.moshen.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.mango.moshen.avroom.presenter.SingleRoomPresenter
|
||||
import com.mango.moshen.avroom.singleroompk.SingleRoomPkFinishDialog
|
||||
import com.mango.moshen.avroom.singleroompk.SingleRoomPkForceFinishDialog
|
||||
import com.mango.moshen.avroom.singleroompk.SingleRoomPkReceivedDialog
|
||||
import com.mango.moshen.avroom.view.ISingleRoomView
|
||||
import com.mango.moshen.databinding.FragmentSingleRoomBinding
|
||||
import com.mango.moshen.fansteam.FansTeamJoinActivity
|
||||
import com.mango.moshen.fansteam.FansTeamJoinedActivity
|
||||
import com.mango.moshen.fansteam.FansTeamViewModel
|
||||
import com.mango.moshen.ui.webview.CommonWebViewActivity
|
||||
import com.mango.moshen.ui.webview.DialogWebViewActivity
|
||||
import com.mango.xchat_android_library.base.factory.CreatePresenter
|
||||
import com.mango.xchat_android_library.utils.TimeUtils
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.math.max
|
||||
|
||||
/**
|
||||
* 个播房间
|
||||
*
|
||||
* @author chenran
|
||||
* @date 2017/7/26
|
||||
*/
|
||||
@CreatePresenter(SingleRoomPresenter::class)
|
||||
class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresenter?>(),
|
||||
ISingleRoomView, OnMicroItemClickListener {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun newInstance(): SingleRoomFragment {
|
||||
val roomFragment = SingleRoomFragment()
|
||||
val bundle = Bundle()
|
||||
roomFragment.arguments = bundle
|
||||
return roomFragment
|
||||
}
|
||||
}
|
||||
|
||||
private lateinit var gameBinding: FragmentSingleRoomBinding
|
||||
private lateinit var upMicDialog: RequestUpMicDialog
|
||||
private var pkMatchDisposable: Disposable? = null
|
||||
|
||||
private val fansTeamViewModel: FansTeamViewModel by viewModels()
|
||||
override fun getRootLayoutId(): Int {
|
||||
return R.layout.fragment_single_room
|
||||
}
|
||||
|
||||
override fun onFindViews() {
|
||||
super.onFindViews()
|
||||
gameBinding = DataBindingUtil.bind(mView)!!
|
||||
gameBinding.lifecycleOwner = this
|
||||
gameBinding.click = this
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun initiate() {
|
||||
super.initiate()
|
||||
mvpPresenter?.getBannerList()
|
||||
initSpeedyMessage(gameBinding.flSpeedyMessage)
|
||||
UserModel.get().currentUserInfo
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe { userInfo ->
|
||||
gameBinding.ivFirstChargeEnter.isVisible = userInfo.isFirstCharge
|
||||
if (userInfo.isFirstCharge) {
|
||||
StatisticManager.Instance()
|
||||
.onEvent(
|
||||
StatisticsProtocol.EVENT_ROOM_POP_SHOW,
|
||||
"房间pop曝光",
|
||||
mapOf("name" to "新人充值")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
|
||||
fansTeamViewModel.fansTeamInitInfoLiveData.observe(viewLifecycleOwner) {
|
||||
it?.let {
|
||||
updateFansTeamInfo(it)
|
||||
}
|
||||
}
|
||||
|
||||
initRoomPkOrder(AvRoomDataManager.get().pkMatchStartTime)
|
||||
gameBinding.llRoomPkOrder.setOnClickListener {
|
||||
dialogManager.showOkCancelDialog("是否取消PK匹配?") {
|
||||
SingleRoomPKModel.cancelSingleRoomPkMatch()
|
||||
.doOnSuccess {
|
||||
initRoomPkOrder(0L)
|
||||
AvRoomDataManager.get().pkMatchStartTime = 0
|
||||
"取消PK匹配成功!".toast()
|
||||
}
|
||||
.doOnError { it.message.toast() }
|
||||
.subscribe()
|
||||
}
|
||||
}
|
||||
|
||||
gameBinding.tvHourRank.setOnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
UriProvider.getSingleRoomHourRankUrl(AvRoomDataManager.get().roomUid)
|
||||
)
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_RANKLIST_CLICK, "房间小时榜点击")
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateFansTeamInfo(initInfo: FansTeamInitInfo) {
|
||||
var clickListener: View.OnClickListener? = null
|
||||
gameBinding.flFansTeam.isGone =
|
||||
!AvRoomDataManager.get().isRoomOwner && !initInfo.hasFansTeamCurrentRoom
|
||||
if (initInfo.hasFansTeamCurrentRoom) {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.tvFansTeamOpt.text = "粉丝团(${initInfo.anchorFansNum})"
|
||||
clickListener = View.OnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
requireContext(),
|
||||
UriProvider.getFansTeamMyFansUrl(AvRoomDataManager.get().roomUid)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (initInfo.isAnchorFans) {
|
||||
gameBinding.tvFansTeamOpt.text =
|
||||
"粉丝LV.${if (initInfo.fansLevelSeq == 0) 1 else initInfo.fansLevelSeq}"
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinedActivity.start(requireContext())
|
||||
}
|
||||
} else {
|
||||
gameBinding.tvFansTeamOpt.text = "加入粉丝团"
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinActivity.start(requireContext())
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.tvFansTeamOpt.text = "开通粉丝团"
|
||||
clickListener = View.OnClickListener {
|
||||
CommonWebViewActivity.start(
|
||||
requireContext(),
|
||||
UriProvider.getFansTeamOpenUrl(AvRoomDataManager.get().roomUid)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
gameBinding.tvFansTeamOpt.text = "该主播暂未开通粉丝团"
|
||||
}
|
||||
}
|
||||
gameBinding.flFansTeam.setOnClickListener(clickListener)
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun onReceiveRoomEvent(roomEvent: RoomEvent?) {
|
||||
super.onReceiveRoomEvent(roomEvent)
|
||||
if (roomEvent == null) return
|
||||
when (roomEvent.event) {
|
||||
RoomEvent.ENTER_ROOM -> {
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
initRoomPkOrder(AvRoomDataManager.get().pkMatchStartTime)
|
||||
}
|
||||
RoomEvent.REQUEST_UP_MIC -> {
|
||||
(roomEvent.chatRoomMessage?.attachment as? RequestUpmicAttachment)?.userInfo?.let {
|
||||
showInviteDialog(it)
|
||||
}
|
||||
}
|
||||
RoomEvent.FANS_TEAM_OPEN_SUCCESS,
|
||||
RoomEvent.FANS_TEAM_OPEN_FAILED,
|
||||
RoomEvent.FANS_TEAM_JOIN,
|
||||
RoomEvent.FANS_TEAM_EXIT -> {
|
||||
(roomEvent.chatRoomMessage?.attachment as? FansTeamMsgAttachment)?.fansTeamMsgInfo?.let {
|
||||
val currFansTeamInitInfo = fansTeamViewModel.fansTeamInitInfoLiveData.value
|
||||
updateFansTeamInfo(
|
||||
FansTeamInitInfo(
|
||||
it.count,
|
||||
currFansTeamInitInfo?.fansLevelSeq ?: 1,
|
||||
roomEvent.event != RoomEvent.FANS_TEAM_OPEN_FAILED,
|
||||
if (AuthModel.get().currentUid == it.uid) {
|
||||
roomEvent.event == RoomEvent.FANS_TEAM_JOIN
|
||||
} else {
|
||||
currFansTeamInitInfo?.isAnchorFans ?: false
|
||||
},
|
||||
AvRoomDataManager.get().isRoomOwner,
|
||||
roomEvent.event == RoomEvent.FANS_TEAM_OPEN_FAILED
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
RoomEvent.ROOM_PK_INVITE ->
|
||||
SingleRoomPkReceivedDialog.newInstance((roomEvent.chatRoomMessage.attachment as RoomPKAttachment).roomPkBean)
|
||||
.show(mContext)
|
||||
RoomEvent.ROOM_PK_FINISH -> {
|
||||
val roomPkBean =
|
||||
(roomEvent.chatRoomMessage.attachment as RoomPKAttachment).roomPkBean
|
||||
if (roomPkBean.isForce) {
|
||||
SingleRoomPkForceFinishDialog.newInstance(roomPkBean).show(mContext)
|
||||
} else {
|
||||
SingleRoomPkFinishDialog.newInstance(roomPkBean).show(mContext)
|
||||
}
|
||||
gameBinding.microView.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
RoomEvent.ROOM_PK_TIMEOUT -> {
|
||||
dialogManager.showOkCancelDialog("暂未匹配到合适的PK对象是否继续?") {
|
||||
SingleRoomPKModel.initSingleRoomPkMatch()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
AvRoomDataManager.get().pkMatchStartTime = it.toLong()
|
||||
initRoomPkOrder(it.toLong())
|
||||
}, {
|
||||
it.message.toast()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//显示请求上麦弹窗
|
||||
private fun showInviteDialog(userInfo: UserInfo) {
|
||||
if (!this::upMicDialog.isInitialized) {
|
||||
upMicDialog = RequestUpMicDialog(requireContext())
|
||||
}
|
||||
if (!upMicDialog.isShowing) {
|
||||
upMicDialog.openDialog()
|
||||
upMicDialog.setUser(userInfo)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSetListener() {
|
||||
super.onSetListener()
|
||||
bottomView.setBottomViewListener(BaseRoomBottomViewWrapper())
|
||||
}
|
||||
|
||||
override fun updateView() {
|
||||
super.updateView()
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode && gameBinding.microView.adapter !is SingleRoomPKMicroViewAdapter) {
|
||||
gameBinding.microView.bindAdapter(SingleRoomPKMicroViewAdapter(context))
|
||||
gameBinding.viewPkBoard.isVisible = true
|
||||
gameBinding.microView.updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||
topMargin = ScreenUtil.dip2px(140f)
|
||||
}
|
||||
} else if (!AvRoomDataManager.get().isOpenAnotherPKMode && gameBinding.microView.adapter !is SingleAnchorMicroViewAdapter) {
|
||||
gameBinding.microView.bindAdapter(SingleAnchorMicroViewAdapter(context))
|
||||
gameBinding.viewPkBoard.isVisible = false
|
||||
gameBinding.microView.updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||
topMargin = ScreenUtil.dip2px(110f)
|
||||
}
|
||||
} else {
|
||||
gameBinding.microView.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initRoomPkOrder(pkMatchStartTime: Long) {
|
||||
if (!AvRoomDataManager.get().isRoomOwner) return
|
||||
pkMatchDisposable?.dispose()
|
||||
if (pkMatchStartTime > 0L) {
|
||||
val residueSeconds = max((CurrentTimeUtils.getCurrentTime() - pkMatchStartTime) / 1000,0)
|
||||
gameBinding.llRoomPkOrder.visibility = View.VISIBLE
|
||||
pkMatchDisposable =
|
||||
Observable.intervalRange(
|
||||
residueSeconds,
|
||||
Int.MAX_VALUE.toLong(),
|
||||
0,
|
||||
1,
|
||||
TimeUnit.SECONDS
|
||||
)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe { aLong: Long ->
|
||||
gameBinding.tvRoomPkOrderTime.text = TimeUtils.ms2MS(
|
||||
aLong * 1000,
|
||||
true
|
||||
)
|
||||
}
|
||||
} else {
|
||||
gameBinding.llRoomPkOrder.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onShowBanner(dialogInfos: List<BannerInfo>) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfos, 10f)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFirstRechargeEvent(event: FirstChargeEvent) {
|
||||
gameBinding.ivFirstChargeEnter.visibility = View.GONE
|
||||
FirstChargePrizeDialog(
|
||||
requireContext(),
|
||||
event.chargeProdTitle,
|
||||
event.firstChargeRewardList
|
||||
).openDialog()
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onShowPkMatchEvent(event: ShowPkMatchEvent) {
|
||||
initRoomPkOrder(event.pkMatchStartTime)
|
||||
}
|
||||
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
package com.mango.moshen.avroom.helper;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 房间数据的一些管理
|
||||
* Created by lvzebiao on 2018/11/16.
|
||||
*/
|
||||
|
||||
public class RoomViewModel extends ViewModel {
|
||||
|
||||
@Getter
|
||||
private final MutableLiveData<Boolean> isKtvModel = new MutableLiveData<>();
|
||||
|
||||
@Getter
|
||||
private final MutableLiveData<Boolean> isGameModel = new MutableLiveData<>();
|
||||
|
||||
public void init() {
|
||||
isKtvModel.setValue(false);
|
||||
isGameModel.postValue(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCleared() {
|
||||
super.onCleared();
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
package com.mango.moshen.avroom.newuserchargegift
|
||||
|
||||
import android.content.Context
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.databinding.DialogNewUserChargePrizeBinding
|
||||
import com.mango.moshen.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.mango.moshen.ui.utils.RVDelegate
|
||||
import com.mango.core.pay.bean.FirstChargeReward
|
||||
import com.mango.core.statistic.StatisticManager
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_new_user_charge_prize)
|
||||
class NewUserChargePrizeDialog(
|
||||
context: Context,
|
||||
val title: String?,
|
||||
private val firstChargeRewardList: List<FirstChargeReward>?
|
||||
) : BaseBindingDialog<DialogNewUserChargePrizeBinding>(context) {
|
||||
|
||||
private lateinit var rvDelegate: RVDelegate<FirstChargeReward>
|
||||
|
||||
override fun init() {
|
||||
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||
.setAdapter(RewardAdapter())
|
||||
.setLayoutManager(LinearLayoutManager(context, RecyclerView.HORIZONTAL, false))
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.build()
|
||||
binding.ivKnow.setOnClickListener {
|
||||
closeDialog()
|
||||
}
|
||||
rvDelegate.setNewData(firstChargeRewardList)
|
||||
StatisticManager.Instance()
|
||||
.onEvent(
|
||||
StatisticsProtocol.EVENT_NUGIFT_POP_FINISH_CLICK,
|
||||
"新人专享礼物弹窗充值完成后弹窗",
|
||||
mapOf("charge_money" to title)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
package com.mango.moshen.avroom.newuserchargegift
|
||||
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.ui.utils.load
|
||||
import com.mango.core.pay.bean.FirstChargeReward
|
||||
import com.mango.core.utils.TextUtils
|
||||
|
||||
class RewardAdapter :
|
||||
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_new_user_charge_reward) {
|
||||
override fun convert(helper: BaseViewHolder, item: FirstChargeReward) {
|
||||
|
||||
helper.getView<ImageView>(R.id.iv_pic).load(item.showPir)
|
||||
|
||||
helper.setText(R.id.tv_name, item.showText)
|
||||
.setText(R.id.tv_time, "(${item.showTime})")
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||
}
|
||||
}
|
@@ -1,103 +0,0 @@
|
||||
package com.mango.moshen.avroom.presenter;
|
||||
|
||||
import com.mango.moshen.avroom.fragment.IRoomRankHalfHourView;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.room.bean.RoomInfo;
|
||||
import com.mango.core.room.bean.RoomRankHalfHourDataInfo;
|
||||
import com.mango.core.room.bean.RoomRankHalfHourRankInfo;
|
||||
import com.mango.core.room.bean.RoomRankMultiItem;
|
||||
import com.mango.core.room.model.RoomRankModel;
|
||||
import com.mango.xchat_android_library.base.factory.AbstractMvpPresenter;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class RoomRankHalfHourPresenter extends AbstractMvpPresenter<IRoomRankHalfHourView> {
|
||||
|
||||
public void getRankListInfo() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null) {
|
||||
RoomRankModel.get()
|
||||
.getRoomRankHalfHourList(roomInfo.getUid())
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(new SingleObserver<RoomRankHalfHourDataInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(RoomRankHalfHourDataInfo roomRankHalfHourDataInfo) {
|
||||
if (roomRankHalfHourDataInfo != null) {
|
||||
|
||||
if (mMvpView != null) {
|
||||
if (roomRankHalfHourDataInfo.getMe() != null) {
|
||||
mMvpView.showMeInfo(roomRankHalfHourDataInfo.getMe());
|
||||
} else
|
||||
mMvpView.showMeInfo(null);
|
||||
|
||||
transformData(roomRankHalfHourDataInfo.getRankVoList());
|
||||
}
|
||||
|
||||
} else {
|
||||
if (mMvpView != null)
|
||||
mMvpView.loadDataFailure();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (mMvpView != null)
|
||||
mMvpView.loadDataFailure();
|
||||
SingleToastUtil.showToast(e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void transformData(List<RoomRankHalfHourRankInfo> dataInfoList) {
|
||||
|
||||
if (dataInfoList != null) {
|
||||
List<RoomRankHalfHourRankInfo> top3rankInfo;
|
||||
if (dataInfoList.size() >= 3) {
|
||||
top3rankInfo = dataInfoList.subList(0, 3);
|
||||
} else {
|
||||
top3rankInfo = dataInfoList;
|
||||
}
|
||||
mMvpView.showTop3Info(top3rankInfo);
|
||||
// 第四名开始以后的信息
|
||||
List<RoomRankMultiItem> otherRankInfo = new ArrayList<>();
|
||||
if (dataInfoList.size() > 3) {
|
||||
|
||||
for (int i = 3; i < dataInfoList.size(); i++) {
|
||||
RoomRankHalfHourRankInfo info = dataInfoList.get(i);
|
||||
RoomRankMultiItem item = new RoomRankMultiItem();
|
||||
item.setItemType(RoomRankMultiItem.TYPE_LINEAR);
|
||||
item.setData(info);
|
||||
otherRankInfo.add(item);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// RoomRankMultiItem item = new RoomRankMultiItem();
|
||||
// item.setItemType(RoomRankHalfHourListAdapter.TYPE_TIPS);
|
||||
// otherRankInfo.add(item);
|
||||
mMvpView.showRankListInfo(otherRankInfo);
|
||||
|
||||
} else {
|
||||
mMvpView.showTop3Info(null);
|
||||
|
||||
List<RoomRankMultiItem> otherRankInfo = new ArrayList<>();
|
||||
RoomRankMultiItem item = new RoomRankMultiItem();
|
||||
item.setItemType(RoomRankMultiItem.TYPE_EMPTY);
|
||||
otherRankInfo.add(item);
|
||||
mMvpView.showRankListInfo(otherRankInfo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +0,0 @@
|
||||
package com.mango.moshen.avroom.redpackage;
|
||||
|
||||
public class RedPackageEvent {
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
package com.mango.moshen.avroom.singleroompk
|
||||
|
||||
import com.mango.core.room.anotherroompk.SingleRoomPKModel
|
||||
import com.mango.core.utils.toast
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.DialogSingleRoomPkRuleBinding
|
||||
|
||||
class SingleRoomPkRuleDialog : BaseDialog<DialogSingleRoomPkRuleBinding>() {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(): SingleRoomPkRuleDialog {
|
||||
return SingleRoomPkRuleDialog()
|
||||
}
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
SingleRoomPKModel.getSingleRoomPkRule()
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
binding.tvContent.text = it.replace("\\n", "\n").replace("\\r", "\r")
|
||||
}
|
||||
.doOnError { it?.message.toast() }
|
||||
.subscribe()
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
* @Description
|
||||
* @Date 2018/12/28
|
||||
*/
|
||||
public interface ICreatePKView extends IMvpBaseView {
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.core.home.bean.BannerInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public interface IGameRoomView extends IBaseRoomView {
|
||||
|
||||
void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
|
||||
|
||||
import com.mango.core.room.bean.OnlineChatMember;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public interface IHomePartyUserListView extends IMvpBaseView {
|
||||
void onRequestChatMemberByPageSuccess(List<OnlineChatMember> memberList, int page);
|
||||
|
||||
void onRequestChatMemberByPageFail(String errorStr, int page);
|
||||
|
||||
void onMemberInRefresh();
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.core.home.bean.BannerInfo;
|
||||
import com.mango.core.room.bean.RoomInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public interface IHomePartyView extends IBaseRoomView {
|
||||
|
||||
//玩龙珠时换坑
|
||||
void onDragonBarChangeMic(int micPosition, String uId, boolean isInviteUpMic, RoomInfo roomInfo);
|
||||
|
||||
/**
|
||||
* 礼物值模式下换麦
|
||||
*/
|
||||
void onGiftValueChangeMic(int micPosition, String uId, boolean isInviteUpMic, RoomInfo roomInfo);
|
||||
|
||||
void onShowBanner(List<BannerInfo> bannerInfos);
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
|
||||
|
||||
import com.mango.core.room.queue.bean.RoomConsumeInfo;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/24
|
||||
*/
|
||||
public interface ILightChatConsumeView extends IMvpBaseView {
|
||||
|
||||
void onGetRoomConsumeListSuccess(List<RoomConsumeInfo> roomConsumeInfos);
|
||||
|
||||
void onGetRoomConsumeListFail(String error);
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
* @Description
|
||||
* @Date 2018/12/29
|
||||
*/
|
||||
public interface IRecordForPKView extends IMvpBaseView {
|
||||
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.core.room.bean.RoomRankMultiItem;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IRoomCharmRankingListView extends IMvpBaseView {
|
||||
|
||||
void roomCharmListSuccess(List<RoomRankMultiItem> list);
|
||||
void roomCharListFail(String message);
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
|
||||
import com.mango.core.room.bean.RoomContributeDataInfo;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
/**
|
||||
* Created by MadisonRong on 25/04/2018.
|
||||
*/
|
||||
|
||||
public interface IRoomContributeListView extends IMvpBaseView {
|
||||
|
||||
void getSingleRankingSuccess(RoomContributeDataInfo roomContributeDataInfo);
|
||||
|
||||
void getSingleRakingFail(int errorCode, String errorMsg);
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package com.mango.moshen.avroom.view;
|
||||
|
||||
import com.mango.core.home.bean.BannerInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public interface ISingleRoomView extends IBaseRoomView {
|
||||
|
||||
void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
|
||||
}
|
@@ -1,119 +0,0 @@
|
||||
package com.mango.moshen.avroom.widget;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
|
||||
/**
|
||||
* 从library拿到client
|
||||
* Created by lvzebiao on 2018/11/9.
|
||||
*/
|
||||
|
||||
public class ViewItem {
|
||||
public static final int BUTTON_TYPE_NORMAL = 0;
|
||||
public static final int BUTTON_TYPE_CANCEL = 1;
|
||||
/**放置在资料卡片的底部位置的button*/
|
||||
public static final int BUTTON_TYPE_USER_CAR_BOTTOM = 2;
|
||||
|
||||
|
||||
/** 发送礼物 */
|
||||
public static final int SEND_GIFT_ITEM = 0;
|
||||
/** 锁坑 */
|
||||
public static final int SEND_LOCK_MIC_ITEM = 1;
|
||||
/** 踢下麦 */
|
||||
public static final int SEND_KICKDOWN_MIC_ITEM = 2;
|
||||
/** 踢出房间 */
|
||||
public static final int SEND_KICKOUT_ROOM_ITEM = 3;
|
||||
/** 查看个人信息 */
|
||||
public static final int SEND_SHOW_USER_INCO_ITEM = 4;
|
||||
/** 下麦 */
|
||||
public static final int SEND_DOWN_MIC_ITEM = 5;
|
||||
/** 释放麦 */
|
||||
public static final int SEND_FREE_MIC_ITEM = 6;
|
||||
/** 设置管理员 */
|
||||
public static final int SEND_MARK_MANAGER_ITEM = 7;
|
||||
/** 取消管理员 */
|
||||
public static final int SEND_NOMARK_MANAGER_ITEM = 11;
|
||||
/** 加入黑名单 */
|
||||
public static final int SEND_MARK_BLACK_ITEM = 8;
|
||||
/** 开麦 */
|
||||
public static final int SEND_OPEN_MUTE_ITEM = 9;
|
||||
/**
|
||||
* 装扮
|
||||
*/
|
||||
public static final int SEND_DECORATION_ITEM = 10;
|
||||
/** 抱上麦 */
|
||||
public static final int SEND_INVITE_MIC_ITEM = 12;
|
||||
/** 发起竞拍 */
|
||||
public static final int START_AUCTION = 13;
|
||||
/**关注or取消*/
|
||||
public static final int ATTENT_ITEM = 15;
|
||||
/**房间外送礼物*/
|
||||
public final static int SEND_GIFT_OUT_ROOM = 16;
|
||||
/**房间内送礼物*/
|
||||
public final static int SEND_MAGIC_OUT_ROOM = 17;
|
||||
|
||||
/**是否是关注按钮*/
|
||||
public boolean isAttent = false;
|
||||
/**ture则的话,则显示在个人资料卡片底部*/
|
||||
public boolean isBottom = false;
|
||||
/**
|
||||
* 找到Ta
|
||||
*/
|
||||
public boolean isFindTa = false;
|
||||
|
||||
/**
|
||||
* @Ta
|
||||
*/
|
||||
public boolean isAt = false;
|
||||
|
||||
public String mText;
|
||||
public int resourceID;
|
||||
public int imgRes;
|
||||
public OnClickListener mClickListener;
|
||||
public int mButtonType;
|
||||
public int mTheme = -1;
|
||||
public boolean noDissmis;
|
||||
public ViewItem(String text, int imgRes, OnClickListener l) {
|
||||
this(text, imgRes,BUTTON_TYPE_NORMAL, l);
|
||||
}
|
||||
public ViewItem(String text, int imgRes, boolean noDissmis, OnClickListener l) {
|
||||
this(text, imgRes,BUTTON_TYPE_NORMAL, l);
|
||||
this.noDissmis = noDissmis;
|
||||
}
|
||||
public ViewItem(String text, int imgRes, int buttonType, OnClickListener l) {
|
||||
mText = text;
|
||||
mClickListener = l;
|
||||
mButtonType = buttonType;
|
||||
this.imgRes = imgRes;
|
||||
resourceID = R.layout.dialog_user_card_item;
|
||||
}
|
||||
|
||||
public ViewItem(String text, int imgRes, int buttonType, int theme, OnClickListener l) {
|
||||
mText = text;
|
||||
this.imgRes = imgRes;
|
||||
mClickListener = l;
|
||||
mButtonType = buttonType;
|
||||
resourceID = R.layout.dialog_user_card_item;
|
||||
mTheme = theme;
|
||||
}
|
||||
|
||||
/**用户卡片的底部item*/
|
||||
public ViewItem(String text, OnClickListener l) {
|
||||
mText = text;
|
||||
mClickListener = l;
|
||||
mButtonType = BUTTON_TYPE_USER_CAR_BOTTOM;
|
||||
resourceID = R.layout.item_room_user_dialog_bottom_button;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.mText = text;
|
||||
}
|
||||
|
||||
public void setClickListener(OnClickListener mClickListener) {
|
||||
this.mClickListener = mClickListener;
|
||||
}
|
||||
|
||||
public interface OnClickListener {
|
||||
void onClick();
|
||||
}
|
||||
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
package com.mango.moshen.avroom.wishlist
|
||||
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.mango.core.gift.bean.SimpleUserInfo
|
||||
import com.mango.core.room.wishlist.WishItemInfo
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.ui.utils.load
|
||||
|
||||
|
||||
class WishListPanelUserAdapter :
|
||||
BaseQuickAdapter<SimpleUserInfo, BaseViewHolder>(R.layout.item_wish_list_panel_user) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: SimpleUserInfo) {
|
||||
helper.getView<ImageView>(R.id.iv_avatar).load(item.avatar)
|
||||
}
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
package com.mango.moshen.avroom.wishlist.history
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.mango.core.bean.response.ListResult
|
||||
import com.mango.core.room.wishlist.WishHistoryInfo
|
||||
import com.mango.core.room.wishlist.WishListModel
|
||||
import com.mango.moshen.base.BaseViewModel
|
||||
|
||||
class WishListHistoryViewModel : BaseViewModel() {
|
||||
|
||||
private val _wishHistoryLiveData = MutableLiveData<ListResult<WishHistoryInfo>>()
|
||||
val wishHistoryLiveData: LiveData<ListResult<WishHistoryInfo>> = _wishHistoryLiveData
|
||||
|
||||
fun getWisHistoryList() {
|
||||
safeLaunch(true, onError = {
|
||||
_wishHistoryLiveData.value = ListResult.failed(1)
|
||||
}, block = {
|
||||
val result = WishListModel.getWisHistoryList()
|
||||
_wishHistoryLiveData.value = ListResult.success(result, 1)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,12 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
import com.mango.xchat_android_library.base.factory.AbstractMvpPresenter;
|
||||
|
||||
/**
|
||||
* @author alvin hwang
|
||||
*/
|
||||
public abstract class BaseMvpActivity<V extends IMvpBaseView, P extends AbstractMvpPresenter<V>> extends AbstractMvpActivity<V, P>
|
||||
implements IDataStatus, DialogManagerInterface {
|
||||
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
import com.mango.xchat_android_library.base.factory.AbstractMvpPresenter;
|
||||
|
||||
/**
|
||||
* @author alvin hwang
|
||||
*/
|
||||
public abstract class BaseMvpFragment<V extends IMvpBaseView, P extends AbstractMvpPresenter<V>> extends AbstractMvpFragment<V, P>
|
||||
implements KeyEvent.Callback, IDataStatus, FragmentManager.OnBackStackChangedListener, IAcitivityBase {
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
import com.mango.xchat_android_library.base.factory.AbstractMvpPresenter;
|
||||
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
* @Description
|
||||
* @Date 2018/5/9
|
||||
*/
|
||||
|
||||
public class BaseMvpPresenter<V extends IMvpBaseView> extends AbstractMvpPresenter<V> {
|
||||
|
||||
@Override
|
||||
public void onCreatePresenter(@Nullable Bundle saveState) {
|
||||
super.onCreatePresenter(saveState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyPresenter() {
|
||||
super.onDestroyPresenter();
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/5/7.
|
||||
*/
|
||||
|
||||
public class BaseVM {
|
||||
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||
|
||||
/**
|
||||
* 返回通用的dialogmanager
|
||||
*/
|
||||
public interface DialogManagerInterface {
|
||||
DialogManager getDialogManager();
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
package com.mango.moshen.base;
|
||||
|
||||
/**
|
||||
* Created by zhouxiangfeng on 17/3/5.
|
||||
*/
|
||||
public interface IBase {
|
||||
}
|
@@ -1,507 +0,0 @@
|
||||
/**
|
||||
* Copyright 2013 Joan Zapata
|
||||
* <p>
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* <p>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.mango.moshen.base.list;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.text.util.Linkify;
|
||||
import android.util.SparseArray;
|
||||
import android.view.View;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.widget.Adapter;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Checkable;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RatingBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* https://github.com/CymChad/BaseRecyclerViewAdapterHelper
|
||||
*/
|
||||
public class BaseViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
/**
|
||||
* Views indexed with their IDs
|
||||
*/
|
||||
private final SparseArray<View> views;
|
||||
|
||||
public Set<Integer> getNestViews() {
|
||||
return nestViews;
|
||||
}
|
||||
|
||||
private final HashSet<Integer> nestViews;
|
||||
|
||||
private final LinkedHashSet<Integer> childClickViewIds;
|
||||
|
||||
private final LinkedHashSet<Integer> itemChildLongClickViewIds;
|
||||
private CommonAdapter adapter;
|
||||
/**
|
||||
* use itemView instead
|
||||
*/
|
||||
@Deprecated
|
||||
public View convertView;
|
||||
|
||||
/**
|
||||
* Package private field to retain the associated user object and detect a change
|
||||
*/
|
||||
Object associatedObject;
|
||||
|
||||
|
||||
public BaseViewHolder(final View view) {
|
||||
super(view);
|
||||
this.views = new SparseArray<>();
|
||||
this.childClickViewIds = new LinkedHashSet<>();
|
||||
this.itemChildLongClickViewIds = new LinkedHashSet<>();
|
||||
this.nestViews = new HashSet<>();
|
||||
convertView = view;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public HashSet<Integer> getItemChildLongClickViewIds() {
|
||||
return itemChildLongClickViewIds;
|
||||
}
|
||||
|
||||
public HashSet<Integer> getChildClickViewIds() {
|
||||
return childClickViewIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* use itemView instead
|
||||
*
|
||||
* @return the ViewHolder root view
|
||||
*/
|
||||
@Deprecated
|
||||
public View getConvertView() {
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will set the text of a TextView.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param value The text to put in the text view.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setText(@IdRes int viewId, CharSequence value) {
|
||||
TextView view = getView(viewId);
|
||||
view.setText(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BaseViewHolder setText(@IdRes int viewId, @StringRes int strId) {
|
||||
TextView view = getView(viewId);
|
||||
view.setText(strId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will set the image of an ImageView from a resource id.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param imageResId The image resource id.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setImageResource(@IdRes int viewId, @DrawableRes int imageResId) {
|
||||
ImageView view = getView(viewId);
|
||||
view.setImageResource(imageResId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will set background color of a view.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param color A color, not a resource id.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setBackgroundColor(@IdRes int viewId, @ColorInt int color) {
|
||||
View view = getView(viewId);
|
||||
view.setBackgroundColor(color);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will set background of a view.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param backgroundRes A resource to use as a background.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setBackgroundRes(@IdRes int viewId, @DrawableRes int backgroundRes) {
|
||||
View view = getView(viewId);
|
||||
view.setBackgroundResource(backgroundRes);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will set text color of a TextView.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param textColor The text color (not a resource id).
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setTextColor(@IdRes int viewId, @ColorInt int textColor) {
|
||||
TextView view = getView(viewId);
|
||||
view.setTextColor(textColor);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Will set the image of an ImageView from a drawable.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param drawable The image drawable.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setImageDrawable(@IdRes int viewId, Drawable drawable) {
|
||||
ImageView view = getView(viewId);
|
||||
view.setImageDrawable(drawable);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an action to set the image of an image view. Can be called multiple times.
|
||||
*/
|
||||
public BaseViewHolder setImageBitmap(@IdRes int viewId, Bitmap bitmap) {
|
||||
ImageView view = getView(viewId);
|
||||
view.setImageBitmap(bitmap);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an action to set the alpha of a view. Can be called multiple times.
|
||||
* Alpha between 0-1.
|
||||
*/
|
||||
public BaseViewHolder setAlpha(@IdRes int viewId, float value) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
getView(viewId).setAlpha(value);
|
||||
} else {
|
||||
// Pre-honeycomb hack to set Alpha value
|
||||
AlphaAnimation alpha = new AlphaAnimation(value, value);
|
||||
alpha.setDuration(0);
|
||||
alpha.setFillAfter(true);
|
||||
getView(viewId).startAnimation(alpha);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a view visibility to VISIBLE (true) or GONE (false).
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param visible True for VISIBLE, false for GONE.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setGone(@IdRes int viewId, boolean visible) {
|
||||
View view = getView(viewId);
|
||||
view.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a view visibility to VISIBLE (true) or INVISIBLE (false).
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param visible True for VISIBLE, false for INVISIBLE.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setVisible(@IdRes int viewId, boolean visible) {
|
||||
View view = getView(viewId);
|
||||
view.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add links into a TextView.
|
||||
*
|
||||
* @param viewId The id of the TextView to linkify.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder linkify(@IdRes int viewId) {
|
||||
TextView view = getView(viewId);
|
||||
Linkify.addLinks(view, Linkify.ALL);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the typeface to the given viewId, and enable subpixel rendering.
|
||||
*/
|
||||
public BaseViewHolder setTypeface(@IdRes int viewId, Typeface typeface) {
|
||||
TextView view = getView(viewId);
|
||||
view.setTypeface(typeface);
|
||||
view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the typeface to all the given viewIds, and enable subpixel rendering.
|
||||
*/
|
||||
public BaseViewHolder setTypeface(Typeface typeface, int... viewIds) {
|
||||
for (int viewId : viewIds) {
|
||||
TextView view = getView(viewId);
|
||||
view.setTypeface(typeface);
|
||||
view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the progress of a ProgressBar.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param progress The progress.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setProgress(@IdRes int viewId, int progress) {
|
||||
ProgressBar view = getView(viewId);
|
||||
view.setProgress(progress);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the progress and max of a ProgressBar.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param progress The progress.
|
||||
* @param max The max value of a ProgressBar.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setProgress(@IdRes int viewId, int progress, int max) {
|
||||
ProgressBar view = getView(viewId);
|
||||
view.setMax(max);
|
||||
view.setProgress(progress);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the range of a ProgressBar to 0...max.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param max The max value of a ProgressBar.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setMax(@IdRes int viewId, int max) {
|
||||
ProgressBar view = getView(viewId);
|
||||
view.setMax(max);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the rating (the number of stars filled) of a RatingBar.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param rating The rating.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setRating(@IdRes int viewId, float rating) {
|
||||
RatingBar view = getView(viewId);
|
||||
view.setRating(rating);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the rating (the number of stars filled) and max of a RatingBar.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param rating The rating.
|
||||
* @param max The range of the RatingBar to 0...max.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setRating(@IdRes int viewId, float rating, int max) {
|
||||
RatingBar view = getView(viewId);
|
||||
view.setMax(max);
|
||||
view.setRating(rating);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the on click listener of the view.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param listener The on click listener;
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
@Deprecated
|
||||
public BaseViewHolder setOnClickListener(@IdRes int viewId, View.OnClickListener listener) {
|
||||
View view = getView(viewId);
|
||||
view.setOnClickListener(listener);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the on touch listener of the view.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param listener The on touch listener;
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
@Deprecated
|
||||
public BaseViewHolder setOnTouchListener(@IdRes int viewId, View.OnTouchListener listener) {
|
||||
View view = getView(viewId);
|
||||
view.setOnTouchListener(listener);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the listview or gridview's item long click listener of the view
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param listener The item long click listener;
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setOnItemLongClickListener(@IdRes int viewId, AdapterView.OnItemLongClickListener listener) {
|
||||
AdapterView view = getView(viewId);
|
||||
view.setOnItemLongClickListener(listener);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the listview or gridview's item selected click listener of the view
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param listener The item selected click listener;
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setOnItemSelectedClickListener(@IdRes int viewId, AdapterView.OnItemSelectedListener listener) {
|
||||
AdapterView view = getView(viewId);
|
||||
view.setOnItemSelectedListener(listener);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the on checked change listener of the view.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param listener The checked change listener of compound button.
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setOnCheckedChangeListener(@IdRes int viewId, CompoundButton.OnCheckedChangeListener listener) {
|
||||
CompoundButton view = getView(viewId);
|
||||
view.setOnCheckedChangeListener(listener);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the tag of the view.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param tag The tag;
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setTag(@IdRes int viewId, Object tag) {
|
||||
View view = getView(viewId);
|
||||
view.setTag(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the tag of the view.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param key The key of tag;
|
||||
* @param tag The tag;
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setTag(@IdRes int viewId, int key, Object tag) {
|
||||
View view = getView(viewId);
|
||||
view.setTag(key, tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the checked status of a checkable.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param checked The checked status;
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
public BaseViewHolder setChecked(@IdRes int viewId, boolean checked) {
|
||||
View view = getView(viewId);
|
||||
// View unable cast to Checkable
|
||||
if (view instanceof Checkable) {
|
||||
((Checkable) view).setChecked(checked);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the adapter of a adapter view.
|
||||
*
|
||||
* @param viewId The view id.
|
||||
* @param adapter The adapter;
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public BaseViewHolder setAdapter(@IdRes int viewId, Adapter adapter) {
|
||||
AdapterView view = getView(viewId);
|
||||
view.setAdapter(adapter);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the adapter of a adapter view.
|
||||
*
|
||||
* @param adapter The adapter;
|
||||
* @return The BaseViewHolder for chaining.
|
||||
*/
|
||||
protected BaseViewHolder setAdapter(CommonAdapter adapter) {
|
||||
this.adapter = adapter;
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends View> T getView(@IdRes int viewId) {
|
||||
View view = views.get(viewId);
|
||||
if (view == null) {
|
||||
view = itemView.findViewById(viewId);
|
||||
views.put(viewId, view);
|
||||
}
|
||||
return (T) view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the last converted object on this view.
|
||||
*/
|
||||
public Object getAssociatedObject() {
|
||||
return associatedObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should be called during convert
|
||||
*/
|
||||
public void setAssociatedObject(Object associatedObject) {
|
||||
this.associatedObject = associatedObject;
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
package com.mango.moshen.base.list;
|
||||
|
||||
/**
|
||||
* Created by lvzebiao on 2018/12/18.
|
||||
*/
|
||||
|
||||
public interface OnItemClickListener<T, K extends BaseViewHolder> {
|
||||
void onItemClick(K holder, T item, int position);
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
package com.mango.moshen.bills.presenter;
|
||||
|
||||
import com.mango.moshen.base.BaseMvpPresenter;
|
||||
import com.mango.moshen.bills.view.IBillGiftIncomeGroupView;
|
||||
|
||||
public class BillGiftIncomeGroupPresenter extends BaseMvpPresenter<IBillGiftIncomeGroupView> {
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
package com.mango.moshen.bills.view;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
public interface IBillGiftIncomeGroupView extends IMvpBaseView {
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
package com.mango.moshen.bills.view;
|
||||
|
||||
import com.mango.core.bills.bean.IncomeListInfo;
|
||||
|
||||
public interface IGiftIncomeView extends ISmoothToTopView {
|
||||
void onGetDataError(String message);
|
||||
void onGetIncomeBills(IncomeListInfo data);
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
package com.mango.moshen.bills.view;
|
||||
|
||||
import com.mango.core.bills.bean.ExpendListInfo;
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
public interface IGiftOutputView extends IMvpBaseView {
|
||||
void smoothScrollToTop();
|
||||
void onGetDataError(String message);
|
||||
void onGetExpendBills(ExpendListInfo data);
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
package com.mango.moshen.bills.view;
|
||||
|
||||
import com.mango.core.bills.bean.RadishGiftListInfo;
|
||||
|
||||
public interface IRadishGiftView extends ISmoothToTopView {
|
||||
void getRadishRecordSuccess(RadishGiftListInfo list);
|
||||
void getRadishRecordFail(String message);
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
package com.mango.moshen.bills.view;
|
||||
|
||||
import com.mango.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
public interface ISmoothToTopView extends IMvpBaseView {
|
||||
void smoothScrollToTop();
|
||||
}
|
@@ -1,299 +0,0 @@
|
||||
/*
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.mango.moshen.common.permission;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.mango.moshen.common.widget.dialog.BaseAlertDialogBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* Android M (API >= 23).
|
||||
*/
|
||||
public class EasyPermissions {
|
||||
|
||||
public static final int SETTINGS_REQ_CODE = 16061;
|
||||
|
||||
private static final String TAG = "EasyPermissions";
|
||||
|
||||
public interface PermissionCallbacks extends
|
||||
ActivityCompat.OnRequestPermissionsResultCallback {
|
||||
|
||||
void onPermissionsGranted(int requestCode, List<String> perms);
|
||||
|
||||
void onPermissionsDenied(int requestCode, List<String> perms);
|
||||
|
||||
void onPermissionsAllGranted();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
public static boolean hasPermissions(Context context, String... perms) {
|
||||
// Always return true for SDK < M, let the system deal with the permissions
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (String perm : perms) {
|
||||
boolean hasPerm = (ContextCompat.checkSelfPermission(context, perm) ==
|
||||
PackageManager.PERMISSION_GRANTED);
|
||||
if (!hasPerm) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
public static void requestPermissions(final Object object, String rationale,
|
||||
final int requestCode, final String... perms) {
|
||||
requestPermissions(object, rationale,
|
||||
android.R.string.ok,
|
||||
android.R.string.cancel,
|
||||
requestCode, perms);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
public static void requestPermissions(final Object object, String rationale,
|
||||
@StringRes int positiveButton,
|
||||
@StringRes int negativeButton,
|
||||
final int requestCode, final String... perms) {
|
||||
|
||||
checkCallingObjectSuitability(object);
|
||||
|
||||
boolean shouldShowRationale = false;
|
||||
for (String perm : perms) {
|
||||
shouldShowRationale =
|
||||
shouldShowRationale || shouldShowRequestPermissionRationale(object, perm);
|
||||
}
|
||||
|
||||
if (shouldShowRationale) {
|
||||
Activity activity = getActivity(object);
|
||||
if (null == activity) {
|
||||
return;
|
||||
}
|
||||
|
||||
AlertDialog dialog = new BaseAlertDialogBuilder(activity)
|
||||
.setMessage(rationale)
|
||||
.setPositiveButton(positiveButton, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
executePermissionsRequest(object, perms, requestCode);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(negativeButton, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// act as if the permissions were denied
|
||||
if (object instanceof PermissionCallbacks) {
|
||||
((PermissionCallbacks) object).onPermissionsDenied(requestCode, Arrays.asList(perms));
|
||||
}
|
||||
}
|
||||
}).create();
|
||||
dialog.show();
|
||||
dialog.getButton(dialog.BUTTON_POSITIVE).setTextColor(Color.BLACK);
|
||||
dialog.getButton(dialog.BUTTON_NEGATIVE).setTextColor(Color.BLACK);
|
||||
} else {
|
||||
executePermissionsRequest(object, perms, requestCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static void onRequestPermissionsResult(int requestCode, String[] permissions,
|
||||
int[] grantResults, Object object) {
|
||||
|
||||
checkCallingObjectSuitability(object);
|
||||
|
||||
// Make a collection of granted and denied permissions from the request.
|
||||
ArrayList<String> granted = new ArrayList<>();
|
||||
ArrayList<String> denied = new ArrayList<>();
|
||||
for (int i = 0; i < permissions.length; i++) {
|
||||
String perm = permissions[i];
|
||||
if (grantResults[i] == PackageManager.PERMISSION_GRANTED) {
|
||||
granted.add(perm);
|
||||
} else {
|
||||
denied.add(perm);
|
||||
}
|
||||
}
|
||||
|
||||
// Report granted permissions, if any.
|
||||
if (!granted.isEmpty()) {
|
||||
// Notify callbacks
|
||||
if (object instanceof PermissionCallbacks) {
|
||||
((PermissionCallbacks) object).onPermissionsGranted(requestCode, granted);
|
||||
}
|
||||
}
|
||||
|
||||
// Report denied permissions, if any.
|
||||
if (!denied.isEmpty()) {
|
||||
if (object instanceof PermissionCallbacks) {
|
||||
((PermissionCallbacks) object).onPermissionsDenied(requestCode, denied);
|
||||
}
|
||||
}
|
||||
|
||||
// If 100% successful, call annotated methods
|
||||
if (!granted.isEmpty() && denied.isEmpty()) {
|
||||
if (object instanceof PermissionCallbacks)
|
||||
((PermissionCallbacks) object).onPermissionsAllGranted();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean checkDeniedPermissionsNeverAskAgain(final Object object,
|
||||
String rationale,
|
||||
@StringRes int positiveButton,
|
||||
@StringRes int negativeButton,
|
||||
List<String> deniedPerms) {
|
||||
return checkDeniedPermissionsNeverAskAgain(object, rationale,
|
||||
positiveButton, negativeButton, null, deniedPerms);
|
||||
}
|
||||
|
||||
|
||||
public static boolean checkDeniedPermissionsNeverAskAgain(final Object object,
|
||||
String rationale,
|
||||
@StringRes int positiveButton,
|
||||
@StringRes int negativeButton,
|
||||
@Nullable DialogInterface.OnClickListener negativeButtonOnClickListener,
|
||||
List<String> deniedPerms) {
|
||||
boolean shouldShowRationale;
|
||||
for (String perm : deniedPerms) {
|
||||
shouldShowRationale = shouldShowRequestPermissionRationale(object, perm);
|
||||
if (!shouldShowRationale) {
|
||||
final Activity activity = getActivity(object);
|
||||
if (null == activity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
AlertDialog dialog = new BaseAlertDialogBuilder(activity)
|
||||
.setMessage(rationale)
|
||||
.setPositiveButton(positiveButton, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", activity.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startAppSettingsScreen(object, intent);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(negativeButton, negativeButtonOnClickListener)
|
||||
.create();
|
||||
dialog.show();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@TargetApi(23)
|
||||
private static boolean shouldShowRequestPermissionRationale(Object object, String perm) {
|
||||
if (object instanceof Activity) {
|
||||
return ActivityCompat.shouldShowRequestPermissionRationale((Activity) object, perm);
|
||||
} else if (object instanceof Fragment) {
|
||||
return ((Fragment) object).shouldShowRequestPermissionRationale(perm);
|
||||
} else if (object instanceof android.app.Fragment) {
|
||||
return ((android.app.Fragment) object).shouldShowRequestPermissionRationale(perm);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(23)
|
||||
private static void executePermissionsRequest(Object object, String[] perms, int requestCode) {
|
||||
checkCallingObjectSuitability(object);
|
||||
|
||||
if (object instanceof Activity) {
|
||||
ActivityCompat.requestPermissions((Activity) object, perms, requestCode);
|
||||
} else if (object instanceof Fragment) {
|
||||
((Fragment) object).requestPermissions(perms, requestCode);
|
||||
} else if (object instanceof android.app.Fragment) {
|
||||
((android.app.Fragment) object).requestPermissions(perms, requestCode);
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(11)
|
||||
private static Activity getActivity(Object object) {
|
||||
if (object instanceof Activity) {
|
||||
return ((Activity) object);
|
||||
} else if (object instanceof Fragment) {
|
||||
return ((Fragment) object).getActivity();
|
||||
} else if (object instanceof android.app.Fragment) {
|
||||
return ((android.app.Fragment) object).getActivity();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(11)
|
||||
private static void startAppSettingsScreen(Object object,
|
||||
Intent intent) {
|
||||
if (object instanceof Activity) {
|
||||
((Activity) object).startActivityForResult(intent, SETTINGS_REQ_CODE);
|
||||
} else if (object instanceof Fragment) {
|
||||
((Fragment) object).startActivityForResult(intent, SETTINGS_REQ_CODE);
|
||||
} else if (object instanceof android.app.Fragment) {
|
||||
((android.app.Fragment) object).startActivityForResult(intent, SETTINGS_REQ_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void checkCallingObjectSuitability(Object object) {
|
||||
// Make sure Object is an Activity or Fragment
|
||||
boolean isActivity = object instanceof Activity;
|
||||
boolean isSupportFragment = object instanceof Fragment;
|
||||
boolean isAppFragment = object instanceof android.app.Fragment;
|
||||
boolean isMinSdkM = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
|
||||
|
||||
if (!(isSupportFragment || isActivity || (isAppFragment && isMinSdkM))) {
|
||||
if (isAppFragment) {
|
||||
throw new IllegalArgumentException(
|
||||
"Target SDK needs to be greater than 23 if caller is android.app.Fragment");
|
||||
} else {
|
||||
throw new IllegalArgumentException("Caller must be an Activity or a Fragment.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,59 +0,0 @@
|
||||
|
||||
package com.mango.moshen.common.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
|
||||
|
||||
/**
|
||||
* 描述:Loading加载控件
|
||||
*
|
||||
* @author zhengsun
|
||||
* @since 2014年8月28日 下午4:13:37
|
||||
*/
|
||||
public class LoadingImageView extends ImageView {
|
||||
|
||||
public LoadingImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public LoadingImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
public LoadingImageView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(getContext(),
|
||||
R.anim.comm_loading);
|
||||
startAnimation(hyperspaceJumpAnimation);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
clearAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onVisibilityChanged(View changedView, int visibility) {
|
||||
super.onVisibilityChanged(changedView, visibility);
|
||||
if (visibility == View.INVISIBLE || visibility == View.GONE) {
|
||||
clearAnimation();
|
||||
return;
|
||||
}
|
||||
Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(getContext(),
|
||||
R.anim.comm_loading);
|
||||
startAnimation(hyperspaceJumpAnimation);
|
||||
}
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
package com.mango.moshen.common.widget;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import android.text.TextPaint;
|
||||
import android.text.style.ClickableSpan;
|
||||
|
||||
public abstract class OriginalDrawStatusClickSpan extends ClickableSpan {
|
||||
|
||||
private final Integer mColor;
|
||||
private final boolean underlineText;
|
||||
|
||||
public OriginalDrawStatusClickSpan() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public OriginalDrawStatusClickSpan(@ColorInt Integer color) {
|
||||
this.mColor = color;
|
||||
this.underlineText = true;
|
||||
}
|
||||
|
||||
public OriginalDrawStatusClickSpan(@ColorInt Integer color, boolean underlineText) {
|
||||
this.mColor = color;
|
||||
this.underlineText = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDrawState(@NonNull TextPaint ds) {
|
||||
if (mColor != null) {
|
||||
ds.setColor(mColor);
|
||||
ds.setUnderlineText(underlineText);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user