Compare commits
189 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ae55f87fa | |||
| d70c3a8b27 | |||
| 73847c46a3 | |||
| c91947ce71 | |||
|
|
62e50ae310 | ||
|
|
5baea0f156 | ||
|
|
419e3a7ab5 | ||
|
|
66822139ba | ||
|
|
5a924d9fea | ||
|
|
9c9eb34756 | ||
|
|
1b57d8bc8f | ||
|
|
4bd1e4bc91 | ||
|
|
cb2729433e | ||
|
|
985e626cb5 | ||
|
|
efce2ad93c | ||
|
|
6132338c6c | ||
|
|
8c89fc1de1 | ||
|
|
a061637492 | ||
|
|
bbb5a12899 | ||
|
|
680780145c | ||
|
|
19c270ad22 | ||
|
|
ce9336737f | ||
|
|
39cf76439f | ||
|
|
11c9a53028 | ||
|
|
c4d378daba | ||
|
|
efa698ebfa | ||
|
|
6496440e5d | ||
|
|
d3de01666c | ||
| 9621d8a6d8 | |||
| 07f97fefdb | |||
|
|
278801b77a | ||
|
|
b0c5d44d1c | ||
|
|
d9b1149832 | ||
|
|
9711b1f8d4 | ||
|
|
0252963b2e | ||
|
|
ff8e75768e | ||
|
|
01dfb81a46 | ||
|
|
0afee3543e | ||
|
|
d5f78cc83a | ||
|
|
cf48be7d15 | ||
|
|
26a71ff825 | ||
|
|
b6d0ea1fba | ||
|
|
cbf517bed6 | ||
|
|
dc0ae1124f | ||
|
|
3167ab0be8 | ||
|
|
0b218157d2 | ||
|
|
6a4ac35203 | ||
|
|
93dbee14b3 | ||
|
|
cb376aa83a | ||
| 92d1861d8f | |||
| 0ff0cb52f6 | |||
|
|
afef088555 | ||
|
|
73414f3349 | ||
|
|
abfd15f751 | ||
| 8d87dda691 | |||
| fcd13751c9 | |||
| e24805cf9b | |||
| 489a99e522 | |||
| 6a51b39134 | |||
| 86bbf6a7f3 | |||
|
|
95ded2f77c | ||
| 599e88acc6 | |||
|
|
d78055cdd9 | ||
| 2093306d36 | |||
|
|
b4adf4c77c | ||
| 8e2acc3417 | |||
| d28d0dd3d7 | |||
|
|
7d46ab8520 | ||
| 150bdba795 | |||
| 651fe12edd | |||
| d0c0f8f82e | |||
| 1f12187766 | |||
|
|
754f2a9294 | ||
|
|
9320d6c209 | ||
| 1c9493d7c8 | |||
| 34e4765e13 | |||
| d4d191fad6 | |||
|
|
8228c45a4d | ||
|
|
4147e3c5f5 | ||
|
|
583740e866 | ||
|
|
0db8eefbe6 | ||
|
|
3f68e2a3aa | ||
|
|
11ba2c45f8 | ||
|
|
320584769d | ||
|
|
5922f4c08b | ||
|
|
b29b0a1688 | ||
|
|
f88356cea2 | ||
|
|
2a67cf7228 | ||
|
|
a100ab1a4a | ||
|
|
69b45f1d21 | ||
|
|
479a743d29 | ||
|
|
382c53ab1f | ||
|
|
1c22f5fd48 | ||
|
|
09bef7afa6 | ||
|
|
88b96267ef | ||
|
|
7c006e8e03 | ||
|
|
f35b547c0d | ||
|
|
490c558e03 | ||
|
|
bbf5d159b4 | ||
|
|
e982994ecd | ||
|
|
a0294a8405 | ||
|
|
756cbb1ce1 | ||
| 9e5427bd35 | |||
|
|
f626ab03d4 | ||
|
|
0d7bdce4f0 | ||
|
|
cd3feebb94 | ||
|
|
3cca1a9e54 | ||
|
|
0b7b959151 | ||
| 1f1ac71bb0 | |||
|
|
ce7b6decc1 | ||
|
|
4a4a52aa61 | ||
|
|
123b9dd74a | ||
|
|
28dba93f17 | ||
|
|
285515345b | ||
|
|
f24744afe8 | ||
|
|
1e466ac13d | ||
|
|
d37b490088 | ||
|
|
a61bc8fbb8 | ||
| 9db23a32d1 | |||
|
|
5f1eadc47b | ||
|
|
de11b5123d | ||
|
|
5b0f5f03ab | ||
|
|
6095d2d04a | ||
|
|
3953e146a5 | ||
|
|
f04a2865af | ||
|
|
f94b3f27e3 | ||
|
|
61a966ea41 | ||
|
|
d0f2ac2c60 | ||
|
|
5dff64ec99 | ||
|
|
cad8236e5c | ||
|
|
faa401245f | ||
|
|
4fc021e866 | ||
|
|
f9a21d0357 | ||
|
|
d72a9a39c6 | ||
|
|
0317b339f8 | ||
|
|
4fabf3aba3 | ||
|
|
4693954a72 | ||
|
|
859810f1f6 | ||
|
|
53f389ddc8 | ||
|
|
ddc9bc344e | ||
|
|
cf34e73d32 | ||
|
|
1981fb553a | ||
|
|
3b6d586b58 | ||
|
|
50b6deaf01 | ||
|
|
bc8d916445 | ||
|
|
6870037683 | ||
|
|
8af7f907eb | ||
| 4d96bcc667 | |||
| f7845dde6f | |||
| ae9ef1f8a1 | |||
|
|
1023c0ab4d | ||
|
|
8184cf6c7f | ||
| df735af252 | |||
|
|
6f71a825b5 | ||
|
|
08e009e5f9 | ||
|
|
1a4a0632ee | ||
|
|
b3a02f8c2c | ||
| aa9bc7326c | |||
| 22769b981d | |||
|
|
85b4facfe8 | ||
| aef0435b93 | |||
| 9cc30186cd | |||
| f99641ed35 | |||
|
|
0552f56eb4 | ||
|
|
7ab4081f0b | ||
|
|
e7ef492015 | ||
| 1aa6cb8f55 | |||
| dc87fc7048 | |||
|
|
04b70d910a | ||
| a4ce44d9ba | |||
| 469e3e30ad | |||
|
|
7e7616ef29 | ||
|
|
dd64568fdf | ||
| 50fb801cf7 | |||
| e0200a9c7f | |||
| 5a32047c6d | |||
|
|
45fd56ba66 | ||
|
|
30b2884c46 | ||
| 0c07e8c2be | |||
|
|
508e9f1931 | ||
| 78d870ed89 | |||
|
|
c00afb1db0 | ||
|
|
dfca615735 | ||
|
|
a920b61bc4 | ||
|
|
3effb630c5 | ||
| 0e596e9be9 | |||
|
|
0a70cc027f | ||
| 47077a465a | |||
|
|
aa62dda844 |
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
apply plugin: 'img-optimizer'
|
apply plugin: 'img-optimizer'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-parcelize'
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@@ -33,7 +33,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
@@ -58,15 +58,15 @@ repositories {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation rootProject.ext.dependencies["appcompat-androidx"]
|
api rootProject.ext.dependencies["appcompat-androidx"]
|
||||||
implementation rootProject.ext.dependencies["recyclerview-androidx"]
|
api rootProject.ext.dependencies["recyclerview-androidx"]
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
//common
|
//common
|
||||||
implementation project(path: ':common')
|
api project(path: ':common')
|
||||||
|
|
||||||
implementation 'com.faceunity:core:8.3.1'
|
api 'com.faceunity:core:8.7.0'
|
||||||
implementation 'com.faceunity:model:8.3.1'
|
api 'com.faceunity:model:8.7.0'
|
||||||
//implementation 'com.faceunity:nama:8.3.1' //底层库-标准版
|
//implementation 'com.faceunity:nama:8.3.1' //底层库-标准版
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.yunbao.faceunity;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry;
|
import androidx.test.platform.app.Instrimport com.yunbao.common.utils.MobclickAgent;ntationRegistry;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|||||||
@@ -96,11 +96,17 @@ public class FaceManager implements SensorEventListener {
|
|||||||
faceUnityView.setIFaceUnityInter(new FaceUnityView.IFaceUnityInter() {
|
faceUnityView.setIFaceUnityInter(new FaceUnityView.IFaceUnityInter() {
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
|
if(onMirrorChanged!=null){
|
||||||
|
onMirrorChanged.onChange(false);
|
||||||
|
}
|
||||||
pauseFace = true;
|
pauseFace = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
|
if(onMirrorChanged!=null){
|
||||||
|
onMirrorChanged.onChange(true);
|
||||||
|
}
|
||||||
pauseFace = false;
|
pauseFace = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -295,7 +301,18 @@ public class FaceManager implements SensorEventListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnMirrorChanged onMirrorChanged;
|
||||||
|
|
||||||
|
public void setOnMirrorChanged(OnMirrorChanged onMirrorChanged) {
|
||||||
|
this.onMirrorChanged = onMirrorChanged;
|
||||||
|
}
|
||||||
|
|
||||||
public interface FaceStatusChanged {
|
public interface FaceStatusChanged {
|
||||||
void onFaceChanged(int num);
|
void onFaceChanged(int num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface OnMirrorChanged{
|
||||||
|
void onChange(boolean falg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ public class FURenderer extends IFURenderer {
|
|||||||
|
|
||||||
|
|
||||||
/* 特效FURenderKit*/
|
/* 特效FURenderKit*/
|
||||||
private FURenderKit mFURenderKit;
|
public FURenderKit mFURenderKit;
|
||||||
|
|
||||||
/* AI道具*/
|
/* AI道具*/
|
||||||
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor.bundle";
|
||||||
public static String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
public static String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
||||||
|
|
||||||
/* GL 线程 ID */
|
/* GL 线程 ID */
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class FaceUnityConfig {
|
|||||||
|
|
||||||
/************************** 算法Model ******************************/
|
/************************** 算法Model ******************************/
|
||||||
// 人脸识别
|
// 人脸识别
|
||||||
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor.bundle";
|
||||||
// 手势
|
// 手势
|
||||||
public static String BUNDLE_AI_HAND = "model" + File.separator + "ai_hand_processor.bundle";
|
public static String BUNDLE_AI_HAND = "model" + File.separator + "ai_hand_processor.bundle";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
apply plugin: 'img-optimizer'
|
apply plugin: 'img-optimizer'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-parcelize'
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@@ -33,7 +33,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.yunbao.share;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -10,6 +10,26 @@ android {
|
|||||||
project.tasks.getByName("tasks").doFirst {
|
project.tasks.getByName("tasks").doFirst {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/* flavorDimensions "packageApk"
|
||||||
|
productFlavors {
|
||||||
|
LinkTest {
|
||||||
|
dimension "packageApk"
|
||||||
|
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
|
||||||
|
}
|
||||||
|
LinkOfficial {
|
||||||
|
dimension "packageApk"
|
||||||
|
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
|
||||||
|
}
|
||||||
|
GoogleTest {
|
||||||
|
dimension "packageApk"
|
||||||
|
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
|
||||||
|
}
|
||||||
|
GoogleOfficial{
|
||||||
|
dimension "packageApk"
|
||||||
|
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
|
||||||
|
}
|
||||||
|
|
||||||
|
}*/
|
||||||
/* applicationVariants.all { variant ->
|
/* applicationVariants.all { variant ->
|
||||||
variant.mergeAssetsProvider.configure {
|
variant.mergeAssetsProvider.configure {
|
||||||
doLast {
|
doLast {
|
||||||
@@ -119,19 +139,32 @@ android {
|
|||||||
processManifestTask.doLast { pm ->
|
processManifestTask.doLast { pm ->
|
||||||
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
|
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
|
||||||
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
||||||
if (file(manifestPath).exists() && isGooglePlay) {
|
println "谷歌版本:" + isGooglePlay
|
||||||
|
println "文件存在" + file(manifestPath).exists()
|
||||||
|
println "" + (isGooglePlay != 0)
|
||||||
|
println "" + (file(manifestPath).exists() && isGooglePlay != 0)
|
||||||
|
if (file(manifestPath).exists() && isGooglePlay != 0) {
|
||||||
def manifestContent = file(manifestPath).getText()
|
def manifestContent = file(manifestPath).getText()
|
||||||
|
println "移除权限"
|
||||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||||
|
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
||||||
file(manifestPath).write(manifestContent)
|
file(manifestPath).write(manifestContent)
|
||||||
} else {
|
} else {
|
||||||
print "not Exists = " + manifestPath
|
print "not Exists = " + manifestPath
|
||||||
}
|
}
|
||||||
|
manifestPath = "build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml"
|
||||||
|
if (file(manifestPath).exists() && isGooglePlay != 0) {
|
||||||
|
def manifestContent = file(manifestPath).getText()
|
||||||
|
println "移除权限2"
|
||||||
|
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||||
|
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
||||||
|
file(manifestPath).write(manifestContent)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
variant.mergeAssetsProvider.configure {
|
variant.mergeAssetsProvider.configure {
|
||||||
doLast {
|
doLast {
|
||||||
delete(fileTree(dir: outputDir, includes: ['model/ai_bgseg_green.bundle',
|
delete(fileTree(dir: outputDir, includes: ['model/ai_bgseg_green.bundle',
|
||||||
'model/ai_face_processor.bundle',
|
//'model/ai_face_processor.bundle',
|
||||||
//'model/ai_face_processor_lite.bundle',
|
//'model/ai_face_processor_lite.bundle',
|
||||||
'model/ai_hairseg.bundle',
|
'model/ai_hairseg.bundle',
|
||||||
'model/ai_hand_processor.bundle',
|
'model/ai_hand_processor.bundle',
|
||||||
@@ -158,7 +191,7 @@ android {
|
|||||||
]))
|
]))
|
||||||
println "isPluginModel = " + rootProject.ext.manifestPlaceholders.isPluginModel
|
println "isPluginModel = " + rootProject.ext.manifestPlaceholders.isPluginModel
|
||||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||||
delete(fileTree(dir: outputDir, includes: ['model/ai_face_processor_lite.bundle',
|
delete(fileTree(dir: outputDir, includes: ['model/ai_face_processor.bundle',
|
||||||
'graphics/face_beautification.bundle']))
|
'graphics/face_beautification.bundle']))
|
||||||
} else {
|
} else {
|
||||||
println "不删除bundle"
|
println "不删除bundle"
|
||||||
@@ -171,7 +204,7 @@ android {
|
|||||||
isGoogle = "谷歌"
|
isGoogle = "谷歌"
|
||||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
||||||
isGoogle = "Huawei"
|
isGoogle = "Huawei"
|
||||||
}else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) {
|
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) {
|
||||||
isGoogle = "Samsung"
|
isGoogle = "Samsung"
|
||||||
}
|
}
|
||||||
def isPlugin = "完整"
|
def isPlugin = "完整"
|
||||||
@@ -183,7 +216,6 @@ android {
|
|||||||
isTest = "正式服"
|
isTest = "正式服"
|
||||||
}
|
}
|
||||||
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
@@ -225,7 +257,8 @@ android {
|
|||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
ndk {
|
ndk {
|
||||||
// TODO: 谷歌商城需要兼容两个平台
|
// TODO: 谷歌商城需要兼容两个平台
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
//abiFilters "armeabi-v7a", "arm64-v8a"
|
||||||
|
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
annotationProcessorOptions {
|
annotationProcessorOptions {
|
||||||
|
|||||||
16
app/proguard-rules.pro
vendored
16
app/proguard-rules.pro
vendored
@@ -190,6 +190,8 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
|||||||
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl*
|
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl*
|
||||||
|
|
||||||
#--------ARouter
|
#--------ARouter
|
||||||
|
|
||||||
|
-keep public class com.alibaba.android.arouter.**{*;}
|
||||||
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
||||||
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
||||||
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
||||||
@@ -275,6 +277,18 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
|||||||
-keep class tech.sud.mgp.hello.ui.main.settings.model.** {*;}
|
-keep class tech.sud.mgp.hello.ui.main.settings.model.** {*;}
|
||||||
-keep class tech.sud.mgp.hello.ui.main.nft.model.** {*;}
|
-keep class tech.sud.mgp.hello.ui.main.nft.model.** {*;}
|
||||||
-keep class tech.sud.mgp.hello.common.event.model.** {*;}
|
-keep class tech.sud.mgp.hello.common.event.model.** {*;}
|
||||||
|
-keep class tech.sud.mgp.**{*;}
|
||||||
|
|
||||||
|
-keep class bitter.jnibridge.** { *; }
|
||||||
|
-keep class com.google.androidgamesdk.** { *; }
|
||||||
|
-keep class com.unity3d.** { *; }
|
||||||
|
-keep class do.do.do.** { *; }
|
||||||
|
-keep class do.if.do.** { *; }
|
||||||
|
-keep class for.do.** { *; }
|
||||||
|
-keep class if.do.do.do.** { *; }
|
||||||
|
-keep class org.fmod.** { *; }
|
||||||
|
-keep class tech.sud.** { *; }
|
||||||
|
-keep class tech.unity3d.** { *; }
|
||||||
|
|
||||||
-keep class com.yunbao.common.sud.** {*;}
|
-keep class com.yunbao.common.sud.** {*;}
|
||||||
|
|
||||||
@@ -292,3 +306,5 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
|||||||
|
|
||||||
-keep class com.shayu.lib_google.**{*;}
|
-keep class com.shayu.lib_google.**{*;}
|
||||||
-keep class com.shayu.lib_huawei.**{*;}
|
-keep class com.shayu.lib_huawei.**{*;}
|
||||||
|
|
||||||
|
-keep class io.agora.**{*;}
|
||||||
|
|||||||
@@ -89,6 +89,11 @@
|
|||||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||||
|
|
||||||
|
<!-- 声网新增 -->
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||||
|
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
|
||||||
|
|
||||||
<queries>
|
<queries>
|
||||||
<package android:name="com.twitter.android" />
|
<package android:name="com.twitter.android" />
|
||||||
<package android:name="jp.naver.line.android" />
|
<package android:name="jp.naver.line.android" />
|
||||||
@@ -157,6 +162,12 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="firebase_crashlytics_collection_enabled"
|
android:name="firebase_crashlytics_collection_enabled"
|
||||||
android:value="${isUploadLog}" />
|
android:value="${isUploadLog}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="BUILD_TIME"
|
||||||
|
android:value="${buildTime}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="SW_RELEASE_MODEL"
|
||||||
|
android:value="${swReleaseModel}" />
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.openinstall.APP_KEY"
|
android:name="com.openinstall.APP_KEY"
|
||||||
android:value="smvslm" />
|
android:value="smvslm" />
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.app.Activity;
|
|||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.http.HttpResponseCache;
|
import android.net.http.HttpResponseCache;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
@@ -29,8 +30,9 @@ import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
|||||||
import com.tencent.imsdk.v2.V2TIMManager;
|
import com.tencent.imsdk.v2.V2TIMManager;
|
||||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||||
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.yunbao.common.http.Data;
|
||||||
import com.umeng.commonsdk.UMConfigure;
|
import com.yunbao.common.manager.OpenAdManager;
|
||||||
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.BuildConfig;
|
import com.yunbao.common.BuildConfig;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
@@ -50,9 +52,11 @@ import com.yunbao.common.utils.L;
|
|||||||
import com.yunbao.common.utils.SpUtil;
|
import com.yunbao.common.utils.SpUtil;
|
||||||
import com.yunbao.live.socket.SocketReceiveBean;
|
import com.yunbao.live.socket.SocketReceiveBean;
|
||||||
import com.yunbao.live.socket.SocketRyClient;
|
import com.yunbao.live.socket.SocketRyClient;
|
||||||
|
import com.yunbao.live.socket.SocketSwClient;
|
||||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||||
import com.yunbao.live.views.PortraitLiveManager;
|
import com.yunbao.live.views.PortraitLiveManager;
|
||||||
import com.yunbao.live.views.RecommendLiveRoomProvider;
|
import com.yunbao.live.views.RecommendLiveRoomProvider;
|
||||||
|
import com.yunbao.main.activity.LoginActivity;
|
||||||
import com.yunbao.main.activity.MsgSettActivity;
|
import com.yunbao.main.activity.MsgSettActivity;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@@ -61,6 +65,8 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.rong.imkit.config.RongConfigCenter;
|
import io.rong.imkit.config.RongConfigCenter;
|
||||||
@@ -106,27 +112,31 @@ public class AppContext extends CommonAppContext {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityDestroyed(@NonNull Activity activity) {
|
public void onActivityDestroyed(@NonNull Activity activity) {
|
||||||
|
AppManager.getInstance().removeActivity(activity);
|
||||||
for (WeakReference<Activity> reference : activities) {
|
for (WeakReference<Activity> reference : activities) {
|
||||||
if (reference.get() == activity) {
|
if (reference.get() == activity) {
|
||||||
activities.remove(reference);
|
activities.remove(reference);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AppManager.getInstance().removeActivity(activity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||||
activities.add(new WeakReference<>(activity));
|
activities.add(new WeakReference<>(activity));
|
||||||
|
if (activity instanceof LoginActivity) {
|
||||||
|
AppManager.getInstance().clear();
|
||||||
|
}
|
||||||
CrashSaveBean.getInstance().setActivitySize(activities);
|
CrashSaveBean.getInstance().setActivitySize(activities);
|
||||||
AppManager.getInstance().addActivity(activity);
|
AppManager.getInstance().addActivity(activity);
|
||||||
|
OpenAdManager.getInstance().dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityStarted(@NonNull Activity activity) {
|
public void onActivityStarted(@NonNull Activity activity) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -140,6 +150,7 @@ public class AppContext extends CommonAppContext {
|
|||||||
registerError();
|
registerError();
|
||||||
registerFirebaseCrash();
|
registerFirebaseCrash();
|
||||||
LogUtils.start(this);
|
LogUtils.start(this);
|
||||||
|
//DebugDialog.getInstance().setParams("初始化","启动");
|
||||||
sInstance = this;
|
sInstance = this;
|
||||||
L.setDeBug(BuildConfig.DEBUG);
|
L.setDeBug(BuildConfig.DEBUG);
|
||||||
AppEventsLogger.activateApp(this);
|
AppEventsLogger.activateApp(this);
|
||||||
@@ -162,20 +173,20 @@ public class AppContext extends CommonAppContext {
|
|||||||
OpenInstall.init(this);
|
OpenInstall.init(this);
|
||||||
}
|
}
|
||||||
//设置LOG开关,默认为false
|
//设置LOG开关,默认为false
|
||||||
UMConfigure.setLogEnabled(true);
|
//UMConfigure.setLogEnabled(true);
|
||||||
|
|
||||||
|
|
||||||
//友盟正式初始化
|
//友盟正式初始化
|
||||||
UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
//UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
||||||
|
|
||||||
//集成umeng-crash-vx.x.x.aar,则需要关闭原有统计SDK异常捕获功能
|
//集成umeng-crash-vx.x.x.aar,则需要关闭原有统计SDK异常捕获功能
|
||||||
MobclickAgent.setCatchUncaughtExceptions(false);
|
MobclickAgent.setCatchUncaughtExceptions(false);
|
||||||
//PushSDK初始化(如使用推送SDK,必须调用此方法)
|
//PushSDK初始化(如使用推送SDK,必须调用此方法)
|
||||||
|
|
||||||
//统计SDK是否支持采集在子进程中打点的自定义事件,默认不支持
|
//统计SDK是否支持采集在子进程中打点的自定义事件,默认不支持
|
||||||
UMConfigure.setProcessEvent(true);//支持多进程打点
|
//UMConfigure.setProcessEvent(true);//支持多进程打点
|
||||||
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
//MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
||||||
UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
//UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
||||||
|
|
||||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||||
//初始化 AndroidUtilCode
|
//初始化 AndroidUtilCode
|
||||||
@@ -196,7 +207,7 @@ public class AppContext extends CommonAppContext {
|
|||||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onReceived(io.rong.imlib.model.Message message, int i, boolean b, boolean b1) {
|
public boolean onReceived(io.rong.imlib.model.Message message, int i, boolean b, boolean b1) {
|
||||||
Log.e("wewe", message.getConversationType() + "112121");
|
Log.e("wewe", message.getConversationType() + "112121 " + message.getContent());
|
||||||
MessageIMManager.get(sInstance).getSystemForRongcloud(message);
|
MessageIMManager.get(sInstance).getSystemForRongcloud(message);
|
||||||
//融云直播间聊天
|
//融云直播间聊天
|
||||||
Message msg = Message.obtain();
|
Message msg = Message.obtain();
|
||||||
@@ -207,6 +218,31 @@ public class AppContext extends CommonAppContext {
|
|||||||
if (content.getContent().contains("_method_")) {
|
if (content.getContent().contains("_method_")) {
|
||||||
msg.obj = content.getContent();
|
msg.obj = content.getContent();
|
||||||
//观众页面
|
//观众页面
|
||||||
|
|
||||||
|
String time = String.valueOf(new Date().getTime());
|
||||||
|
//声网
|
||||||
|
if (SocketSwClient.mSocketHandler != null && (TextUtils.equals("__system__", message.getTargetId()) || ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
||||||
|
SocketSwClient.mSocketHandler.sendMessage(msg);
|
||||||
|
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
||||||
|
SocketReceiveBean received = JSON.parseObject(content.getContent(), SocketReceiveBean.class);
|
||||||
|
JSONObject map = received.getMsg().getJSONObject(0);
|
||||||
|
sendStartAnchorLive(map);
|
||||||
|
} else if (message.getTargetId().contains("v")) {
|
||||||
|
/*String contentJson = ((TextMessage) message.getContent()).getContent();
|
||||||
|
Log.e("wewe", contentJson);
|
||||||
|
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
|
||||||
|
if (sudGameSocketImEvent.getMsg().isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sudGameSocketImEvent.getMsg().get(0).setTime(time);
|
||||||
|
Bus.get().post(sudGameSocketImEvent);*/
|
||||||
|
}
|
||||||
|
//主播页面
|
||||||
|
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketSwClient.mSocketHandler != null) {
|
||||||
|
SocketSwClient.mSocketHandler.sendMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
//融云
|
||||||
if (SocketRyClient.mSocketHandler != null && (TextUtils.equals("__system__", message.getTargetId()) || ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
if (SocketRyClient.mSocketHandler != null && (TextUtils.equals("__system__", message.getTargetId()) || ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
||||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||||
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
||||||
@@ -217,13 +253,16 @@ public class AppContext extends CommonAppContext {
|
|||||||
String contentJson = ((TextMessage) message.getContent()).getContent();
|
String contentJson = ((TextMessage) message.getContent()).getContent();
|
||||||
Log.e("wewe", contentJson);
|
Log.e("wewe", contentJson);
|
||||||
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
|
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
|
||||||
|
if (sudGameSocketImEvent.getMsg().isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sudGameSocketImEvent.getMsg().get(0).setTime(time);
|
||||||
Bus.get().post(sudGameSocketImEvent);
|
Bus.get().post(sudGameSocketImEvent);
|
||||||
}
|
}
|
||||||
//主播页面
|
//主播页面
|
||||||
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketRyClient.mSocketHandler != null) {
|
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketRyClient.mSocketHandler != null) {
|
||||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
||||||
EventBus.getDefault().post(message);
|
EventBus.getDefault().post(message);
|
||||||
}
|
}
|
||||||
@@ -272,9 +311,9 @@ public class AppContext extends CommonAppContext {
|
|||||||
|
|
||||||
});
|
});
|
||||||
configSPApp();
|
configSPApp();
|
||||||
|
|
||||||
//初始化美颜SDK
|
//初始化美颜SDK
|
||||||
// FaceManager.initFaceUnity(this);
|
// FaceManager.initFaceUnity(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -350,5 +389,17 @@ public class AppContext extends CommonAppContext {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String uid = CommonAppConfig.getInstance().getUid();
|
String uid = CommonAppConfig.getInstance().getUid();
|
||||||
|
|
||||||
|
if (CommonAppConfig.IS_GOOGLE_PLAY != 2) {
|
||||||
|
GoogleUtils.newInstance(sInstance).setFirebaseCrashData(
|
||||||
|
uid,
|
||||||
|
SpUtil.getInstance().getStringValue(SpUtil.USER_INFO),
|
||||||
|
String.valueOf(CommonAppConfig.IS_GOOGLE_PLAY),
|
||||||
|
Arrays.toString(Build.SUPPORTED_ABIS),
|
||||||
|
String.valueOf(CrashSaveBean.getInstance().getStartTime()),
|
||||||
|
String.valueOf(CrashSaveBean.getInstance().getEnterRoom()),
|
||||||
|
String.valueOf(CrashSaveBean.getInstance().getSlidingRoom()),
|
||||||
|
String.valueOf(CrashSaveBean.getInstance().getPlaySvga()), CrashSaveBean.getInstance().getActivitySize());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
|||||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||||
@@ -144,7 +145,11 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
|
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
|
||||||
LogUtil.uploadErrorLog(AppContext.sInstance);
|
try {
|
||||||
|
LogUtil.uploadErrorLog(AppContext.sInstance);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
SpUtil.getInstance().setBooleanValue("NOTIFICATION", NotificationManagerCompat.from(this).areNotificationsEnabled());
|
SpUtil.getInstance().setBooleanValue("NOTIFICATION", NotificationManagerCompat.from(this).areNotificationsEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,7 +234,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
|||||||
} else {
|
} else {
|
||||||
checkUidAndToken();
|
checkUidAndToken();
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
ToastUtil.show(getString(R.string.net_error));
|
ToastUtil.show(getString(R.string.net_error));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a","arm64-v8a"
|
abiFilters "armeabi-v7a","arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a","arm64-v8a"
|
abiFilters "armeabi-v7a","arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
|
|||||||
@@ -52,4 +52,10 @@ allprojects {
|
|||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
}
|
}
|
||||||
|
ext {
|
||||||
|
IS_PUBLISH_LOCAL=true
|
||||||
|
LIB_VERSION="1.0.6"
|
||||||
|
AGORA_RTC_SDK= 'io.agora.rtc:agora-special-full:4.2.6.12'
|
||||||
|
// AGORA_RTC_SDK= "${rootProject.rootDir.absolutePath}/sdk"
|
||||||
|
// AGORA_RTC_SDK="io.agora.rtc:full-sdk:4.2.6"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
apply plugin: 'img-optimizer'
|
apply plugin: 'img-optimizer'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@@ -13,7 +14,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,9 +201,7 @@ dependencies {
|
|||||||
//自定义圆角图片
|
//自定义圆角图片
|
||||||
api 'com.makeramen:roundedimageview:2.3.0'
|
api 'com.makeramen:roundedimageview:2.3.0'
|
||||||
// 友盟统计SDK
|
// 友盟统计SDK
|
||||||
api 'com.umeng.umsdk:common:9.6.3'// 必选
|
// api(name: 'umeng-common-9.6.8+000', ext: 'aar')
|
||||||
api 'com.umeng.umsdk:asms:1.8.0'// 必选
|
|
||||||
api 'com.umeng.umsdk:uyumao:1.1.2'
|
|
||||||
//高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。
|
//高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。
|
||||||
// 标准版本SudMGP SDK
|
// 标准版本SudMGP SDK
|
||||||
api 'tech.sud.mgp:SudMGP:1.3.3.1158'
|
api 'tech.sud.mgp:SudMGP:1.3.3.1158'
|
||||||
@@ -221,5 +220,14 @@ dependencies {
|
|||||||
//samsung插件包
|
//samsung插件包
|
||||||
api project(':IAP6Helper')
|
api project(':IAP6Helper')
|
||||||
|
|
||||||
|
//文字渐变色
|
||||||
|
api 'com.github.FlyJingFish:GradientTextView:1.2.4'
|
||||||
|
//轮播 一屏显示多个
|
||||||
|
api 'com.github.xiaohaibin:XBanner:androidx_v1.2.6'
|
||||||
|
//声网SDK
|
||||||
|
//api 'io.agora.rtc:agora-special-full:4.2.6.245'
|
||||||
|
|
||||||
|
//ExoPlayer,腾讯的播放器不支持无缝切换
|
||||||
|
api 'com.google.android.exoplayer:exoplayer:2.18.2'
|
||||||
|
api 'com.google.android.exoplayer:exoplayer-core:2.18.2@aar'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ public class CommonAppConfig {
|
|||||||
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
||||||
//是否为插件包模式
|
//是否为插件包模式
|
||||||
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
||||||
|
public static final String BUILD_TIME = getMetaDataString("BUILD_TIME");
|
||||||
|
public static final boolean IS_SW_RELEASE = getMetaDataBoolean("SW_RELEASE_MODEL");
|
||||||
|
|
||||||
//外部sd卡
|
//外部sd卡
|
||||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||||
@@ -76,7 +78,30 @@ public class CommonAppConfig {
|
|||||||
public static boolean isGetNewWrap = false;//是否获取到新的包裹礼物
|
public static boolean isGetNewWrap = false;//是否获取到新的包裹礼物
|
||||||
public static int alert_time = 1;
|
public static int alert_time = 1;
|
||||||
public static int alert_end_time = 1;
|
public static int alert_end_time = 1;
|
||||||
|
public static String SWToken = ""; //声网Token
|
||||||
|
public static final String SWChannelPrefix = "g";
|
||||||
|
//测试服
|
||||||
|
public static final String SWAPPId_debug = "4cf0376582d742ac8a96778b25b1079e";
|
||||||
|
//正式服
|
||||||
|
public static final String SWAPPId = "d4a5879524d74c20a7bdd667b0f2ca21";
|
||||||
|
|
||||||
|
public static String getSwAppId() {
|
||||||
|
if (IS_SW_RELEASE) {
|
||||||
|
return SWAPPId;
|
||||||
|
} else {
|
||||||
|
return SWAPPId_debug;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取通道
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getChannelName() {
|
||||||
|
return SWChannelPrefix + getInstance().getUid();
|
||||||
|
}
|
||||||
|
|
||||||
private CommonAppConfig() {
|
private CommonAppConfig() {
|
||||||
|
|
||||||
@@ -119,8 +144,7 @@ public class CommonAppConfig {
|
|||||||
|
|
||||||
public String getUid() {
|
public String getUid() {
|
||||||
if (TextUtils.isEmpty(mUid)) {
|
if (TextUtils.isEmpty(mUid)) {
|
||||||
String[] uidAndToken = SpUtil.getInstance()
|
String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||||
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
|
||||||
if (uidAndToken != null) {
|
if (uidAndToken != null) {
|
||||||
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
||||||
mUid = uidAndToken[0];
|
mUid = uidAndToken[0];
|
||||||
@@ -311,9 +335,7 @@ public class CommonAppConfig {
|
|||||||
mUid = null;
|
mUid = null;
|
||||||
mToken = null;
|
mToken = null;
|
||||||
mLoginIM = false;
|
mLoginIM = false;
|
||||||
SpUtil.getInstance().removeValue(
|
SpUtil.getInstance().removeValue(SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN);
|
||||||
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -349,12 +371,7 @@ public class CommonAppConfig {
|
|||||||
mProvince = null;
|
mProvince = null;
|
||||||
mCity = null;
|
mCity = null;
|
||||||
mDistrict = null;
|
mDistrict = null;
|
||||||
SpUtil.getInstance().removeValue(
|
SpUtil.getInstance().removeValue(SpUtil.LOCATION_LNG, SpUtil.LOCATION_LAT, SpUtil.LOCATION_PROVINCE, SpUtil.LOCATION_CITY, SpUtil.LOCATION_DISTRICT);
|
||||||
SpUtil.LOCATION_LNG,
|
|
||||||
SpUtil.LOCATION_LAT,
|
|
||||||
SpUtil.LOCATION_PROVINCE,
|
|
||||||
SpUtil.LOCATION_CITY,
|
|
||||||
SpUtil.LOCATION_DISTRICT);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -267,11 +267,15 @@ public class Constants {
|
|||||||
public static final String LIVE_PK_RANDOM_START="RankingStartRandomPK";
|
public static final String LIVE_PK_RANDOM_START="RankingStartRandomPK";
|
||||||
public static final int LIVE_SDK_KSY = 0;//金山推流
|
public static final int LIVE_SDK_KSY = 0;//金山推流
|
||||||
public static final int LIVE_SDK_TX = 1;//腾讯推流
|
public static final int LIVE_SDK_TX = 1;//腾讯推流
|
||||||
|
public static final int LIVE_SDK_SW = 2;//声网
|
||||||
|
|
||||||
|
public static final String LIVE_SDK_IS_SW = "liveSdkIsSw"; //是否是聲網
|
||||||
|
|
||||||
public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦
|
public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦
|
||||||
public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦
|
public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦
|
||||||
|
|
||||||
|
public static final String SOCKET_LIVE_ANCHOR_PK_DIALOG="GuildCompetitionNotice";//公会赛弹窗
|
||||||
|
|
||||||
//视频举报获取位置
|
//视频举报获取位置
|
||||||
public static int xIndex = 0;
|
public static int xIndex = 0;
|
||||||
public static int yindex = 0;
|
public static int yindex = 0;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class HtmlConfig {
|
|||||||
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";
|
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";
|
||||||
|
|
||||||
//在线商城
|
//在线商城
|
||||||
public static final String SHOP = CommonAppConfig.HOST + "/h5/shoppingMall.html";
|
public static final String SHOP = CommonAppConfig.HOST + "/h5/shop/index.html";
|
||||||
|
|
||||||
//社区
|
//社区
|
||||||
public static final String ENCOURAGE = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ";
|
public static final String ENCOURAGE = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ";
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.content.Intent;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.Typeface;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
@@ -24,13 +25,12 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.interfaces.LifeCycleListener;
|
import com.yunbao.common.interfaces.LifeCycleListener;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.ClickUtil;
|
import com.yunbao.common.utils.ClickUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -92,7 +92,8 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
protected void main() {
|
protected void main() {
|
||||||
|
|
||||||
}
|
}
|
||||||
protected void create(){
|
|
||||||
|
protected void create() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +108,17 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setTitleBold(boolean bold) {
|
||||||
|
TextView titleView = (TextView) findViewById(R.id.titleView);
|
||||||
|
if (titleView != null) {
|
||||||
|
if (bold) {
|
||||||
|
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
|
} else {
|
||||||
|
titleView.setTypeface(Typeface.DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void backClick(View v) {
|
public void backClick(View v) {
|
||||||
if (v.getId() == R.id.btn_back) {
|
if (v.getId() == R.id.btn_back) {
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@@ -181,14 +193,14 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
//友盟统计
|
//友盟统计
|
||||||
// MobclickAgent.onResume(this);
|
// MobclickAgent.onResume(this);
|
||||||
MobclickAgent.onPageStart(this.mTag);
|
MobclickAgent.onPageStart(this.mTag);
|
||||||
Log.e("MobclickAgent","MobclickAgent:_onResume_"+this.mTag);
|
Log.e("MobclickAgent", "MobclickAgent:_onResume_" + this.mTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
MobclickAgent.onPageEnd(this.mTag);
|
MobclickAgent.onPageEnd(this.mTag);
|
||||||
Log.e("MobclickAgent","MobclickAgent:_onPause_"+this.mTag);
|
Log.e("MobclickAgent", "MobclickAgent:_onPause_" + this.mTag);
|
||||||
if (mLifeCycleListeners != null) {
|
if (mLifeCycleListeners != null) {
|
||||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||||
listener.onPause();
|
listener.onPause();
|
||||||
@@ -382,7 +394,14 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean isKefu(String url){
|
|
||||||
|
public boolean isKefu(String url) {
|
||||||
|
if (url.contains("kefu")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (url.contains("https://newkf.yaoulive.com/")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return url.startsWith("https://kefu.yaoulive.com");
|
return url.startsWith("https://kefu.yaoulive.com");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.lxj.xpopup.XPopup;
|
|||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.HtmlConfig;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
import com.yunbao.common.bean.LiveBean;
|
||||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||||
@@ -100,7 +101,6 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
||||||
v_spacing = (View) findViewById(R.id.v_spacing);
|
v_spacing = (View) findViewById(R.id.v_spacing);
|
||||||
mWebView = findViewById(R.id.webView);
|
mWebView = findViewById(R.id.webView);
|
||||||
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
params.topMargin = DpUtil.dp2px(1);
|
params.topMargin = DpUtil.dp2px(1);
|
||||||
// mWebView.setLayoutParams(params);
|
// mWebView.setLayoutParams(params);
|
||||||
@@ -136,11 +136,17 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
if (url.contains("for")) {
|
if (url.contains("for")) {
|
||||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(url.startsWith(HtmlConfig.SHOP)){
|
||||||
|
//商店页不做动态变换
|
||||||
|
return;
|
||||||
|
}
|
||||||
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
||||||
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
||||||
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
||||||
if (!navigationGestureEnabled(mContext)) {
|
if (!navigationGestureEnabled(mContext)) {
|
||||||
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
// view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -194,6 +200,8 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
mWebView.getSettings().setAllowFileAccess(true);
|
mWebView.getSettings().setAllowFileAccess(true);
|
||||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||||
|
mWebView.setHorizontalScrollBarEnabled(false);
|
||||||
|
mWebView.setVerticalScrollBarEnabled(false);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
@@ -213,6 +221,9 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
ft_title.setVisibility(View.VISIBLE);
|
ft_title.setVisibility(View.VISIBLE);
|
||||||
v_spacing.setVisibility(View.GONE);
|
v_spacing.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
if(!StringUtil.isEmpty(url)&&url.startsWith(HtmlConfig.SHOP)){
|
||||||
|
ft_title.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -410,6 +421,8 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
|
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
|
||||||
//看直播
|
//看直播
|
||||||
gotoLive(event.getLiveId());
|
gotoLive(event.getLiveId());
|
||||||
|
}else if (TextUtils.equals(event.getMethod(), "androidtoCommunityVideo")) {
|
||||||
|
RouteUtil.forwardCommunityActivity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,7 +435,7 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) {
|
||||||
if (liveBean == null) {
|
if (liveBean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -438,7 +451,7 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||||
} else {
|
} else {
|
||||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk),isSw);
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,12 +40,15 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
|||||||
private final int RIGHTS_INTERESTS = 4;
|
private final int RIGHTS_INTERESTS = 4;
|
||||||
private final int RECOMMEND = 5;
|
private final int RECOMMEND = 5;
|
||||||
private String liveId;
|
private String liveId;
|
||||||
|
private boolean mIs_shengwang;
|
||||||
|
|
||||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||||
|
|
||||||
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
||||||
|
|
||||||
public CustomDrawerPopupAdapter(Context mContext) {
|
public CustomDrawerPopupAdapter(Context mContext,boolean mIs_shengwang) {
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
|
this.mIs_shengwang = mIs_shengwang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -114,6 +117,7 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
|||||||
map.put("num", "9");
|
map.put("num", "9");
|
||||||
map.put("live_recommend", "sidebar");
|
map.put("live_recommend", "sidebar");
|
||||||
map.put("refresh", "1");
|
map.put("refresh", "1");
|
||||||
|
map.put(" is_shengwang", mIs_shengwang?"1":"0");
|
||||||
//推荐位
|
//推荐位
|
||||||
MainNetManager.get((Activity) mContext)
|
MainNetManager.get((Activity) mContext)
|
||||||
.anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
.anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
public class DebugDialogAdapter extends RecyclerView.Adapter<DebugDialogAdapter.DebugViewHolder> {
|
||||||
|
HashMap<String, View> paramMap = new HashMap<>();
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public DebugDialogAdapter(Context mContext) {
|
||||||
|
this.mContext = mContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParamMap(HashMap<String, View> paramMap) {
|
||||||
|
Log.i("debug弹窗", "setParamMap: 添加值到view " + paramMap.size());
|
||||||
|
this.paramMap = paramMap;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public DebugViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
Log.i("debug弹窗", "onCreateViewHolder: 创建适配器");
|
||||||
|
return new DebugViewHolder(new LinearLayout(mContext));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull DebugViewHolder holder, int position) {
|
||||||
|
List<String> list = new ArrayList<>(paramMap.keySet());
|
||||||
|
Log.i("debug弹窗", "onBindViewHolder: 添加值到view " + list.size() + "|" + paramMap.size());
|
||||||
|
holder.setData(list.get(position), paramMap.get(list.get(position)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
Log.i("debug弹窗", "getItemCount: " + paramMap.size());
|
||||||
|
return paramMap.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DebugViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
public DebugViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(String msg, View view) {
|
||||||
|
Log.i("debug弹窗", "setData: 添加值到view " + view + "|" + msg + "|" + ((LinearLayout) itemView).indexOfChild(view));
|
||||||
|
if (view instanceof TextView && StringUtil.isEmpty(((TextView) view).getText().toString())) {
|
||||||
|
((TextView) view).setText(msg);
|
||||||
|
}
|
||||||
|
int indexOfChild = ((LinearLayout) itemView).indexOfChild(view);
|
||||||
|
if (indexOfChild != -1) {
|
||||||
|
if (((LinearLayout) itemView).getChildAt(indexOfChild) instanceof TextView) {
|
||||||
|
((TextView) ((LinearLayout) itemView).getChildAt(indexOfChild)).setText(msg);
|
||||||
|
} else {
|
||||||
|
((LinearLayout) itemView).removeViewAt(indexOfChild);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (view.getParent() != null) {
|
||||||
|
((ViewGroup) view.getParent()).removeView(view);
|
||||||
|
}
|
||||||
|
((LinearLayout) itemView).addView(view);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.os.CountDownTimer;
|
||||||
|
import android.util.SparseArray;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.sendMoneyLongListModel;
|
||||||
|
import com.yunbao.common.views.DragonSendMoneyListViewHolder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DragonSendMoneyListAdapter extends RecyclerView.Adapter {
|
||||||
|
RecyclerView send_money_list;
|
||||||
|
boolean isAnchor;
|
||||||
|
SparseArray<CountDownTimer> countDownMap;
|
||||||
|
boolean isAttention;
|
||||||
|
|
||||||
|
public DragonSendMoneyListAdapter setAnchor(boolean anchor) {
|
||||||
|
isAnchor = anchor;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DragonSendMoneyListAdapter setAttention(boolean attention) {
|
||||||
|
isAttention = attention;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<sendMoneyLongListModel> getMoneyLongListModels() {
|
||||||
|
return moneyLongListModels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DragonSendMoneyListAdapter(RecyclerView send_money_list) {
|
||||||
|
this.send_money_list = send_money_list;
|
||||||
|
countDownMap = new SparseArray<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<sendMoneyLongListModel> moneyLongListModels = new ArrayList<>();
|
||||||
|
DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack callBack;
|
||||||
|
|
||||||
|
public void setCallBack(DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack callBack) {
|
||||||
|
this.callBack = callBack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoneyLongListModels(List<sendMoneyLongListModel> models) {
|
||||||
|
|
||||||
|
moneyLongListModels.clear();
|
||||||
|
moneyLongListModels.addAll(models);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
|
||||||
|
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_dragon_send_money_list, parent, false);
|
||||||
|
|
||||||
|
return new DragonSendMoneyListViewHolder(goodGiftsView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
DragonSendMoneyListViewHolder sendMoneyListViewHolder = (DragonSendMoneyListViewHolder) holder;
|
||||||
|
// sendMoneyLongListModel model = moneyLongListModels.get(position);
|
||||||
|
// long mPkTimeCount2 = Long.parseLong(model.getCountdown());
|
||||||
|
// long time = mPkTimeCount2 * 1000;
|
||||||
|
// if (sendMoneyListViewHolder.countDownTimer != null) {
|
||||||
|
// sendMoneyListViewHolder.countDownTimer.cancel();
|
||||||
|
// }
|
||||||
|
// if (time > 0) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
sendMoneyListViewHolder.setData(moneyLongListModels.get(position), callBack, isAnchor,isAttention);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return moneyLongListModels.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position) {
|
||||||
|
return super.getItemViewType(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.PagerSnapHelper;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2018/11/28.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ImagePreviewAdapter extends RecyclerView.Adapter<ImagePreviewAdapter.Vh> {
|
||||||
|
|
||||||
|
private LayoutInflater mInflater;
|
||||||
|
private ActionListener mActionListener;
|
||||||
|
private int mPageCount;
|
||||||
|
private LinearLayoutManager mLayoutManager;
|
||||||
|
private int mCurPosition;
|
||||||
|
|
||||||
|
public ImagePreviewAdapter(Context context, int pageCount) {
|
||||||
|
mPageCount = pageCount;
|
||||||
|
mInflater = LayoutInflater.from(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
return new Vh(mInflater.inflate(R.layout.item_preview_img, parent, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull Vh vh, int position) {
|
||||||
|
vh.setData(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mPageCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Vh extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
ImageView mImg;
|
||||||
|
|
||||||
|
public Vh(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
mImg = (ImageView) itemView;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setData(int position) {
|
||||||
|
if (mActionListener != null) {
|
||||||
|
mActionListener.loadImage(mImg, position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActionListener(ActionListener actionListener) {
|
||||||
|
mActionListener = actionListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurPosition(int curPosition) {
|
||||||
|
mCurPosition = curPosition;
|
||||||
|
if (mActionListener != null) {
|
||||||
|
mActionListener.onPageChanged(curPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCurPosition(){
|
||||||
|
return mCurPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
|
||||||
|
super.onAttachedToRecyclerView(recyclerView);
|
||||||
|
mLayoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
|
||||||
|
PagerSnapHelper pagerSnapHelper = new PagerSnapHelper();
|
||||||
|
pagerSnapHelper.attachToRecyclerView(recyclerView);
|
||||||
|
recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||||
|
@Override
|
||||||
|
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
||||||
|
int position = mLayoutManager.findFirstCompletelyVisibleItemPosition();
|
||||||
|
if (position >= 0 && mCurPosition != position) {
|
||||||
|
mCurPosition = position;
|
||||||
|
if (mActionListener != null) {
|
||||||
|
mActionListener.onPageChanged(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface ActionListener {
|
||||||
|
void onPageChanged(int position);
|
||||||
|
|
||||||
|
void loadImage(ImageView imageView, int position);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,10 +18,14 @@ import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 侧边栏游戏列表适配器,改游戏列表数量在这里改
|
||||||
|
*/
|
||||||
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private boolean rigts;
|
private boolean rigts;
|
||||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||||
|
private List<CustomSidebarChildModel> srcChild = new ArrayList<>();
|
||||||
|
|
||||||
public InteractionGamesAdapter(Context mContext, boolean rigts) {
|
public InteractionGamesAdapter(Context mContext, boolean rigts) {
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
@@ -46,7 +50,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
||||||
if (activityID != 0) {
|
if (activityID != 0) {
|
||||||
Bus.get().post(new CustomDrawerPopupEvent()
|
Bus.get().post(new CustomDrawerPopupEvent()
|
||||||
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(child));
|
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -61,6 +65,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||||
child.clear();
|
child.clear();
|
||||||
|
srcChild.clear();
|
||||||
if (mChild.size() > 8) {
|
if (mChild.size() > 8) {
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
child.add(mChild.get(i));
|
child.add(mChild.get(i));
|
||||||
@@ -68,6 +73,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
} else {
|
} else {
|
||||||
child.addAll(mChild);
|
child.addAll(mChild);
|
||||||
}
|
}
|
||||||
|
srcChild.addAll(mChild);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.views.LiveBuyGuardPrivilegeViewHolder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LiveBuyGuardPrivilegeAdapter extends RecyclerView.Adapter {
|
||||||
|
List<String> guardPrivilege = new ArrayList<>();
|
||||||
|
|
||||||
|
public void setGuardPrivilege(List<String> privilege) {
|
||||||
|
guardPrivilege.clear();
|
||||||
|
guardPrivilege.addAll(privilege);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveBuyGuardPrivilegeAdapter(List<String> guardPrivilege) {
|
||||||
|
this.guardPrivilege = guardPrivilege;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_buy_guard_privilege_item, parent, false);
|
||||||
|
return new LiveBuyGuardPrivilegeViewHolder(herdView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
LiveBuyGuardPrivilegeViewHolder buyGuardSelectViewHolder = (LiveBuyGuardPrivilegeViewHolder) holder;
|
||||||
|
buyGuardSelectViewHolder.setData(guardPrivilege.get(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return guardPrivilege.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.GuardPriceModel;
|
||||||
|
import com.yunbao.common.views.LiveBuyGuardSelectViewHolder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LiveBuyGuardSelectAdapter extends RecyclerView.Adapter {
|
||||||
|
List<GuardPriceModel> price = new ArrayList<>();
|
||||||
|
GuardPriceModel model;
|
||||||
|
|
||||||
|
public LiveBuyGuardSelectAdapter(List<GuardPriceModel> price, GuardPriceModel mModel) {
|
||||||
|
this.price = price;
|
||||||
|
model = mModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_buy_guard_slelect_item, parent, false);
|
||||||
|
return new LiveBuyGuardSelectViewHolder(herdView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
LiveBuyGuardSelectViewHolder buyGuardSelectViewHolder = (LiveBuyGuardSelectViewHolder) holder;
|
||||||
|
buyGuardSelectViewHolder.setData(price.get(position), liveBuyGuardSelectClickListener,model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return price.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
private LiveBuyGuardSelectViewHolder.LiveBuyGuardSelectClickListener liveBuyGuardSelectClickListener;
|
||||||
|
|
||||||
|
public LiveBuyGuardSelectAdapter setLiveBuyGuardSelectClickListener(LiveBuyGuardSelectViewHolder.LiveBuyGuardSelectClickListener liveBuyGuardSelectClickListener) {
|
||||||
|
this.liveBuyGuardSelectClickListener = liveBuyGuardSelectClickListener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -67,13 +67,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||||
child.clear();
|
child.clear();
|
||||||
if (mChild.size() > 8) {
|
/* if (mChild.size() > 8) {
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
child.add(mChild.get(i));
|
child.add(mChild.get(i));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
child.addAll(mChild);
|
child.addAll(mChild);
|
||||||
}
|
}*/
|
||||||
|
child.addAll(mChild);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public class SudTitleSelectAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机器人助手IM消息
|
* 机器人助手IM消息
|
||||||
@@ -21,6 +24,9 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
//标签图片
|
//标签图片
|
||||||
@SerializedName("icon")
|
@SerializedName("icon")
|
||||||
private String icon;
|
private String icon;
|
||||||
|
@SerializedName("icon_en")
|
||||||
|
@JSONField(name = "icon_en")
|
||||||
|
private String iconEn;
|
||||||
//气泡背景
|
//气泡背景
|
||||||
@SerializedName("system_bubble")
|
@SerializedName("system_bubble")
|
||||||
private String systemBubble;
|
private String systemBubble;
|
||||||
@@ -35,7 +41,7 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getAiName() {
|
public String getAiName() {
|
||||||
return aiName+":";
|
return aiName + ":";
|
||||||
}
|
}
|
||||||
|
|
||||||
public AiAutomaticSpeechModel setAiName(String aiName) {
|
public AiAutomaticSpeechModel setAiName(String aiName) {
|
||||||
@@ -47,6 +53,16 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getIconEn() {
|
||||||
|
return iconEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AiAutomaticSpeechModel setIconEn(String iconEn) {
|
||||||
|
this.iconEn = iconEn;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public AiAutomaticSpeechModel setContent(String content) {
|
public AiAutomaticSpeechModel setContent(String content) {
|
||||||
this.content = content;
|
this.content = content;
|
||||||
return this;
|
return this;
|
||||||
@@ -62,6 +78,9 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getIcon() {
|
public String getIcon() {
|
||||||
|
if (!WordUtil.isNewZh() && !StringUtil.isEmpty(iconEn)) {
|
||||||
|
return iconEn;
|
||||||
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
25
common/src/main/java/com/yunbao/common/bean/AvatarBean.java
Normal file
25
common/src/main/java/com/yunbao/common/bean/AvatarBean.java
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
public class AvatarBean extends BaseModel {
|
||||||
|
private String avatar;
|
||||||
|
private String avatarThumb;
|
||||||
|
|
||||||
|
public AvatarBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar(String avatar) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatarThumb() {
|
||||||
|
return avatarThumb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatarThumb(String avatarThumb) {
|
||||||
|
this.avatarThumb = avatarThumb;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,6 +34,13 @@ public class BattlePassPoints extends BaseModel{
|
|||||||
@SerializedName("exchange_status_remark")
|
@SerializedName("exchange_status_remark")
|
||||||
private String exchangeMark;
|
private String exchangeMark;
|
||||||
|
|
||||||
|
@SerializedName("send_reward_type")
|
||||||
|
private int sendRewardType;
|
||||||
|
@SerializedName("send_gift_type")
|
||||||
|
private int sendGiftType;
|
||||||
|
@SerializedName("send_gift_needcoin")
|
||||||
|
private String sendGiftNeedcoin;
|
||||||
|
|
||||||
public BattlePassPoints() {
|
public BattlePassPoints() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,4 +179,54 @@ public class BattlePassPoints extends BaseModel{
|
|||||||
public void setPointsThresholdText(String pointsThresholdText) {
|
public void setPointsThresholdText(String pointsThresholdText) {
|
||||||
this.pointsThresholdText = pointsThresholdText;
|
this.pointsThresholdText = pointsThresholdText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getSendRewardType() {
|
||||||
|
return sendRewardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendRewardType(int sendRewardType) {
|
||||||
|
this.sendRewardType = sendRewardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSendGiftType() {
|
||||||
|
return sendGiftType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendGiftType(int sendGiftType) {
|
||||||
|
this.sendGiftType = sendGiftType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSendGiftNeedcoin() {
|
||||||
|
return sendGiftNeedcoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendGiftNeedcoin(String sendGiftNeedcoin) {
|
||||||
|
this.sendGiftNeedcoin = sendGiftNeedcoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "BattlePassPoints{" +
|
||||||
|
"id=" + id +
|
||||||
|
", type=" + type +
|
||||||
|
", rewardsName='" + rewardsName + '\'' +
|
||||||
|
", rewardsId=" + rewardsId +
|
||||||
|
", imageUrl='" + imageUrl + '\'' +
|
||||||
|
", pointsThreshold='" + pointsThreshold + '\'' +
|
||||||
|
", pointsThresholdText='" + pointsThresholdText + '\'' +
|
||||||
|
", rewardsValue='" + rewardsValue + '\'' +
|
||||||
|
", battlePassLevel=" + battlePassLevel +
|
||||||
|
", exchangeQuantity=" + exchangeQuantity +
|
||||||
|
", liveBattlePassTypeId=" + liveBattlePassTypeId +
|
||||||
|
", description='" + description + '\'' +
|
||||||
|
", restrictTime=" + restrictTime +
|
||||||
|
", sort=" + sort +
|
||||||
|
", exchangeStatus=" + exchangeStatus +
|
||||||
|
", userQuintyCount=" + userQuintyCount +
|
||||||
|
", exchangeMark='" + exchangeMark + '\'' +
|
||||||
|
", sendRewardType=" + sendRewardType +
|
||||||
|
", sendGiftType=" + sendGiftType +
|
||||||
|
", sendRewardNeedcoin='" + sendGiftNeedcoin + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.yunbao.common.bean;
|
|||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.BuildConfig;
|
||||||
|
|
||||||
public class CheckLiveModel extends BaseModel {
|
public class CheckLiveModel extends BaseModel {
|
||||||
|
|
||||||
@@ -13,6 +14,16 @@ public class CheckLiveModel extends BaseModel {
|
|||||||
private String typeMsg;
|
private String typeMsg;
|
||||||
@SerializedName("live_sdk")
|
@SerializedName("live_sdk")
|
||||||
private String liveSdk;
|
private String liveSdk;
|
||||||
|
@SerializedName("is_shengwang")
|
||||||
|
private String isShengwang;
|
||||||
|
|
||||||
|
public String getIsShengwang() {
|
||||||
|
return isShengwang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsShengwang(String isShengwang) {
|
||||||
|
this.isShengwang = isShengwang;
|
||||||
|
}
|
||||||
|
|
||||||
public static CheckLiveModel objectFromData(String str) {
|
public static CheckLiveModel objectFromData(String str) {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CheckUpgradesModel extends BaseModel {
|
||||||
|
/**
|
||||||
|
* {
|
||||||
|
* "level": 33, // 等级
|
||||||
|
* "rewards": [ // 奖励信息
|
||||||
|
* {
|
||||||
|
* "id": 1,
|
||||||
|
* "reward_name": "星之守護等級牌", // 奖励名称
|
||||||
|
* "image_path": "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png" // 图片链接
|
||||||
|
* },
|
||||||
|
* {
|
||||||
|
* "id": 2,
|
||||||
|
* "reward_name": "人氣票",
|
||||||
|
* "image_path": "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png"
|
||||||
|
* }
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
@SerializedName("level")
|
||||||
|
private String level;
|
||||||
|
@SerializedName("rewards")
|
||||||
|
private List<RewardsModel> rewards;
|
||||||
|
|
||||||
|
public String getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckUpgradesModel setLevel(String level) {
|
||||||
|
this.level = level;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RewardsModel> getRewards() {
|
||||||
|
return rewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckUpgradesModel setRewards(List<RewardsModel> rewards) {
|
||||||
|
this.rewards = rewards;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@ package com.yunbao.common.bean;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.BuildConfig;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -59,6 +61,9 @@ public class ConfigBean extends BaseModel {
|
|||||||
private String txPlayUgcLicenceUrl;//腾讯短视频鉴权
|
private String txPlayUgcLicenceUrl;//腾讯短视频鉴权
|
||||||
private String txVideoUgcKey;
|
private String txVideoUgcKey;
|
||||||
private String google_isup;
|
private String google_isup;
|
||||||
|
|
||||||
|
private String sud_game_speech;
|
||||||
|
|
||||||
@SerializedName("is_return_user")//是否需要弹窗(0否,1是)
|
@SerializedName("is_return_user")//是否需要弹窗(0否,1是)
|
||||||
private String isReturnUser="";
|
private String isReturnUser="";
|
||||||
@SerializedName("popup_img_url")//弹窗图片地址
|
@SerializedName("popup_img_url")//弹窗图片地址
|
||||||
@@ -182,6 +187,20 @@ public class ConfigBean extends BaseModel {
|
|||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isSw(){
|
||||||
|
return getSud_game_speech().equals("1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSONField(name = "sud_game_speech")
|
||||||
|
public String getSud_game_speech() {
|
||||||
|
return sud_game_speech;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSud_game_speech(String sud_game_speech) {
|
||||||
|
this.sud_game_speech = sud_game_speech;
|
||||||
|
}
|
||||||
|
|
||||||
@JSONField(name = "apk_ver")
|
@JSONField(name = "apk_ver")
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return version;
|
return version;
|
||||||
|
|||||||
@@ -114,6 +114,17 @@ public class EnterRoomInfoModel extends BaseModel {
|
|||||||
@SerializedName("gift_wall_lighten_total")
|
@SerializedName("gift_wall_lighten_total")
|
||||||
private String giftWallLightenTotal;
|
private String giftWallLightenTotal;
|
||||||
|
|
||||||
|
@SerializedName("connection_info")
|
||||||
|
private LivePkMicModel connectionInfo;
|
||||||
|
|
||||||
|
public LivePkMicModel getConnectionInfo() {
|
||||||
|
return connectionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConnectionInfo(LivePkMicModel connectionInfo) {
|
||||||
|
this.connectionInfo = connectionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
public String getGiftWallLightenNumber() {
|
public String getGiftWallLightenNumber() {
|
||||||
return giftWallLightenNumber;
|
return giftWallLightenNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,20 @@ public class EnterRoomNewModel extends BaseModel {
|
|||||||
private SudGameDateModel sudGameDateModel;
|
private SudGameDateModel sudGameDateModel;
|
||||||
@SerializedName("quick_gift_remaining_quantity")
|
@SerializedName("quick_gift_remaining_quantity")
|
||||||
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
||||||
|
|
||||||
@SerializedName("if_viewing_duration_complete")
|
@SerializedName("if_viewing_duration_complete")
|
||||||
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
||||||
|
@SerializedName("sendMoneyLongStatus")
|
||||||
|
private SendMoneyLongStatusModel model;
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel getModel() {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setModel(SendMoneyLongStatusModel model) {
|
||||||
|
this.model = model;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public int getQuickGiftRemainingQuantity() {
|
public int getQuickGiftRemainingQuantity() {
|
||||||
return quickGiftRemainingQuantity;
|
return quickGiftRemainingQuantity;
|
||||||
|
|||||||
@@ -0,0 +1,142 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GuardDataTipModel extends BaseModel {
|
||||||
|
/**
|
||||||
|
* {
|
||||||
|
* "guard_name": "星之守護", // 守护名称
|
||||||
|
* "guard_type": 1, // 守护类型
|
||||||
|
* "close_img": "https://ceshi.yaoulive.com/data/upload/20240304/guard_xing_close.png", // 未开通图标
|
||||||
|
* "open_img": "https://ceshi.yaoulive.com/data/upload/20240304/guard_xing_open.png", // 已开通图标
|
||||||
|
* "is_open": true, // 是否开通 是.true 否.false
|
||||||
|
* "price": { // 价格
|
||||||
|
* {
|
||||||
|
* "opening_time": "1個月", // 开通时长
|
||||||
|
* "original_price": "188000", // 原价
|
||||||
|
* "discount_price": "", // 折扣价
|
||||||
|
* "discount": "", // 折扣
|
||||||
|
* "price_key": 1
|
||||||
|
* },
|
||||||
|
* {
|
||||||
|
* "opening_time": "3個月",
|
||||||
|
* "original_price": "564000",
|
||||||
|
* "discount_price": "398000",
|
||||||
|
* "discount": "7.1折",
|
||||||
|
* "price_key": 3
|
||||||
|
* },
|
||||||
|
* {
|
||||||
|
* "opening_time": "6個月",
|
||||||
|
* "original_price": "1128000",
|
||||||
|
* "discount_price": "738000",
|
||||||
|
* "discount": "6.5折",
|
||||||
|
* "price_key": 6
|
||||||
|
* },
|
||||||
|
* {
|
||||||
|
* "opening_time": "12個月",
|
||||||
|
* "original_price": "2256000",
|
||||||
|
* "discount_price": "1314000",
|
||||||
|
* "discount": "5.8折",
|
||||||
|
* "price_key": 12
|
||||||
|
* }
|
||||||
|
* ],
|
||||||
|
* "guard_privilege": [
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png",
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_2.png",
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_3.png",
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png",
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_2.png",
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_3.png",
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png",
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png",
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_2.png",
|
||||||
|
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_3.png"
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
@SerializedName("guard_name")
|
||||||
|
private String guardName;
|
||||||
|
@SerializedName("guard_type")
|
||||||
|
private int guardType;
|
||||||
|
@SerializedName("close_img")
|
||||||
|
private String closeImg;
|
||||||
|
@SerializedName("open_img")
|
||||||
|
private String openImg;
|
||||||
|
@SerializedName("is_open")
|
||||||
|
private String isOpen;
|
||||||
|
@SerializedName("price")
|
||||||
|
private List<GuardPriceModel> price;
|
||||||
|
@SerializedName("guard_privilege")
|
||||||
|
private List<String> guardPrivilege;
|
||||||
|
|
||||||
|
public String getGuardName() {
|
||||||
|
return guardName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardDataTipModel setGuardName(String guardName) {
|
||||||
|
this.guardName = guardName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGuardType() {
|
||||||
|
return guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardDataTipModel setGuardType(int guardType) {
|
||||||
|
this.guardType = guardType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCloseImg() {
|
||||||
|
return closeImg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardDataTipModel setCloseImg(String closeImg) {
|
||||||
|
this.closeImg = closeImg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenImg() {
|
||||||
|
return openImg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardDataTipModel setOpenImg(String openImg) {
|
||||||
|
this.openImg = openImg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOpen() {
|
||||||
|
return TextUtils.equals(isOpen, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsOpen() {
|
||||||
|
return isOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardDataTipModel setIsOpen(String isOpen) {
|
||||||
|
this.isOpen = isOpen;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<GuardPriceModel> getPrice() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardDataTipModel setPrice(List<GuardPriceModel> price) {
|
||||||
|
this.price = price;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getGuardPrivilege() {
|
||||||
|
return guardPrivilege;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardDataTipModel setGuardPrivilege(List<String> guardPrivilege) {
|
||||||
|
this.guardPrivilege = guardPrivilege;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GuardGetGuardOpenInfoModel extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("user_info")
|
||||||
|
private GuardUserInfoModel userInfo;
|
||||||
|
@SerializedName("guard_data")
|
||||||
|
private List<GuardDataTipModel> guardData;
|
||||||
|
|
||||||
|
public GuardUserInfoModel getUserInfo() {
|
||||||
|
return userInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardOpenInfoModel setUserInfo(GuardUserInfoModel userInfo) {
|
||||||
|
this.userInfo = userInfo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<GuardDataTipModel> getGuardData() {
|
||||||
|
return guardData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardOpenInfoModel setGuardData(List<GuardDataTipModel> guardData) {
|
||||||
|
this.guardData = guardData;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class GuardGetGuardUserInfoModel extends BaseModel {
|
||||||
|
/**
|
||||||
|
* "info": {
|
||||||
|
* "uid": "98923", // 用户ID
|
||||||
|
* "user_avatar": "https://downs.yaoulive.com/20230706/0572c0f694601f4d2695cd210effbe93.jpeg?imageView2/2/w/600/h/600", // 用户头像链接
|
||||||
|
* "liveuid": "98889", // 主播ID
|
||||||
|
* "live_avatar": "https://ceshi.yaoulive.com/data/upload/20230522/20230526102906.png", // 主播头像链接
|
||||||
|
* "guard_type": 0, // 守护类型 0.未开通 1.星之守护 2.王之守护 3.神之守护
|
||||||
|
* "exp": 0, // 守护经验值
|
||||||
|
* "level": 0, // 守护等级
|
||||||
|
* "endtime": 0, // 到期时间
|
||||||
|
* "user_language": "chinese",
|
||||||
|
* "live_language": "chinese"
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
@SerializedName("uid")
|
||||||
|
private String uid;
|
||||||
|
@SerializedName("user_avatar")
|
||||||
|
private String userAvatar;
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
private String liveuid;
|
||||||
|
@SerializedName("live_avatar")
|
||||||
|
private String liveAvatar;
|
||||||
|
@SerializedName("guard_type")
|
||||||
|
private int guardType;
|
||||||
|
@SerializedName("exp")
|
||||||
|
private String exp;
|
||||||
|
@SerializedName("level")
|
||||||
|
private int level;
|
||||||
|
@SerializedName("endtime")
|
||||||
|
private long endtime;
|
||||||
|
@SerializedName("user_language")
|
||||||
|
private String userLanguage;
|
||||||
|
@SerializedName("live_language")
|
||||||
|
private String liveLanguage;
|
||||||
|
@SerializedName("is_open")
|
||||||
|
private String isOpen;
|
||||||
|
|
||||||
|
public String getIsOpen() {
|
||||||
|
return isOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setIsOpen(String isOpen) {
|
||||||
|
this.isOpen = isOpen;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserAvatar() {
|
||||||
|
return userAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setUserAvatar(String userAvatar) {
|
||||||
|
this.userAvatar = userAvatar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveAvatar() {
|
||||||
|
return liveAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setLiveAvatar(String liveAvatar) {
|
||||||
|
this.liveAvatar = liveAvatar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGuardType() {
|
||||||
|
return guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setGuardType(int guardType) {
|
||||||
|
this.guardType = guardType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExp() {
|
||||||
|
return exp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setExp(String exp) {
|
||||||
|
this.exp = exp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setLevel(int level) {
|
||||||
|
this.level = level;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getEndtime() {
|
||||||
|
return endtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setEndtime(long endtime) {
|
||||||
|
this.endtime = endtime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserLanguage() {
|
||||||
|
return userLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setUserLanguage(String userLanguage) {
|
||||||
|
this.userLanguage = userLanguage;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveLanguage() {
|
||||||
|
return liveLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardGetGuardUserInfoModel setLiveLanguage(String liveLanguage) {
|
||||||
|
this.liveLanguage = liveLanguage;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class GuardMaturityDateRemindModel extends BaseModel{
|
||||||
|
|
||||||
|
@SerializedName("_method_")
|
||||||
|
private String method;
|
||||||
|
@SerializedName("action")
|
||||||
|
private String action;
|
||||||
|
@SerializedName("is_overdue")
|
||||||
|
private int isOverdue;
|
||||||
|
@SerializedName("days")
|
||||||
|
private int days;
|
||||||
|
@SerializedName("uid")
|
||||||
|
private String uid;
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
private String liveuid;
|
||||||
|
@SerializedName("user_avatar")
|
||||||
|
private String userAvatar;
|
||||||
|
@SerializedName("user_nicename")
|
||||||
|
private String userNicename;
|
||||||
|
@SerializedName("live_avatar")
|
||||||
|
private String liveAvatar;
|
||||||
|
@SerializedName("live_nicename")
|
||||||
|
private String liveNicename;
|
||||||
|
@SerializedName("ct")
|
||||||
|
private String ct;
|
||||||
|
@SerializedName("guard_type")
|
||||||
|
private String guardType;
|
||||||
|
|
||||||
|
public String getGuardType() {
|
||||||
|
return guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardMaturityDateRemindModel setGuardType(String guardType) {
|
||||||
|
this.guardType = guardType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMethod() {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMethod(String method) {
|
||||||
|
this.method = method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAction() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAction(String action) {
|
||||||
|
this.action = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIsOverdue() {
|
||||||
|
return isOverdue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsOverdue(int isOverdue) {
|
||||||
|
this.isOverdue = isOverdue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDays() {
|
||||||
|
return days;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDays(int days) {
|
||||||
|
this.days = days;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserAvatar() {
|
||||||
|
return userAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserAvatar(String userAvatar) {
|
||||||
|
this.userAvatar = userAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserNicename() {
|
||||||
|
return userNicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserNicename(String userNicename) {
|
||||||
|
this.userNicename = userNicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveAvatar() {
|
||||||
|
return liveAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveAvatar(String liveAvatar) {
|
||||||
|
this.liveAvatar = liveAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveNicename() {
|
||||||
|
return liveNicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveNicename(String liveNicename) {
|
||||||
|
this.liveNicename = liveNicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCt() {
|
||||||
|
return ct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCt(String ct) {
|
||||||
|
this.ct = ct;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "GuardMaturityDateRemindModel{" +
|
||||||
|
"method='" + method + '\'' +
|
||||||
|
", action='" + action + '\'' +
|
||||||
|
", isOverdue=" + isOverdue +
|
||||||
|
", days=" + days +
|
||||||
|
", uid='" + uid + '\'' +
|
||||||
|
", liveuid='" + liveuid + '\'' +
|
||||||
|
", userAvatar='" + userAvatar + '\'' +
|
||||||
|
", userNicename='" + userNicename + '\'' +
|
||||||
|
", liveAvatar='" + liveAvatar + '\'' +
|
||||||
|
", liveNicename='" + liveNicename + '\'' +
|
||||||
|
", ct='" + ct + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,17 @@ public class GuardModel extends BaseModel {
|
|||||||
private String type;
|
private String type;
|
||||||
@SerializedName("endtime")
|
@SerializedName("endtime")
|
||||||
private String endtime;
|
private String endtime;
|
||||||
|
@SerializedName("guard_type")
|
||||||
|
private String guardType;
|
||||||
|
|
||||||
|
public String getGuardType() {
|
||||||
|
return guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardModel setGuardType(String guardType) {
|
||||||
|
this.guardType = guardType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class GuardPriceModel extends BaseModel {
|
||||||
|
/**
|
||||||
|
* {
|
||||||
|
* "opening_time": "1個月", // 开通时长
|
||||||
|
* "original_price": "188000", // 原价
|
||||||
|
* "discount_price": "", // 折扣价
|
||||||
|
* "discount": "", // 折扣
|
||||||
|
* "price_key": 1
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
@SerializedName("opening_time")
|
||||||
|
private String openingTime;
|
||||||
|
@SerializedName("original_price")
|
||||||
|
private String originalPrice;
|
||||||
|
@SerializedName("discount_price")
|
||||||
|
private String discountPrice;
|
||||||
|
@SerializedName("discount")
|
||||||
|
private String discount;
|
||||||
|
@SerializedName("price_key")
|
||||||
|
private int priceKey;
|
||||||
|
|
||||||
|
public String getOpeningTime() {
|
||||||
|
return openingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardPriceModel setOpeningTime(String openingTime) {
|
||||||
|
this.openingTime = openingTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalPrice() {
|
||||||
|
return originalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardPriceModel setOriginalPrice(String originalPrice) {
|
||||||
|
this.originalPrice = originalPrice;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDiscountPrice() {
|
||||||
|
return discountPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardPriceModel setDiscountPrice(String discountPrice) {
|
||||||
|
this.discountPrice = discountPrice;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDiscount() {
|
||||||
|
return discount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardPriceModel setDiscount(String discount) {
|
||||||
|
this.discount = discount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPriceKey() {
|
||||||
|
return priceKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardPriceModel setPriceKey(int priceKey) {
|
||||||
|
this.priceKey = priceKey;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class GuardUserInfoModel extends BaseModel {
|
||||||
|
/**
|
||||||
|
* {
|
||||||
|
* "user_info": { // 用户开通信息
|
||||||
|
* "uid": "98888", // 用户ID
|
||||||
|
* "user_avatar": "https://downs.yaoulive.com/mannine.png", // 用户头像链接
|
||||||
|
* "liveuid": "98889", // 主播ID
|
||||||
|
* "live_avatar": "https://ceshi.yaoulive.com/data/upload/20230522/20230526102906.png", // 主播头像链接
|
||||||
|
* "guard_type": 1, // 守护类型
|
||||||
|
* "exp": 0, // 经验值
|
||||||
|
* "level": 1, // 等级
|
||||||
|
* "endtime": 1710145929, // 到期时间
|
||||||
|
* "user_language": "chinese", // 用户语言
|
||||||
|
* "live_language": "chinese" // 主播语言
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
@SerializedName("uid")
|
||||||
|
private String uid;
|
||||||
|
@SerializedName("user_avatar")
|
||||||
|
private String userAvatar;
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
private String liveuid;
|
||||||
|
@SerializedName("live_avatar")
|
||||||
|
private String liveAvatar;
|
||||||
|
@SerializedName("guard_type")
|
||||||
|
private int guardType;
|
||||||
|
@SerializedName("exp")
|
||||||
|
private String exp;
|
||||||
|
@SerializedName("level")
|
||||||
|
private String level;
|
||||||
|
@SerializedName("endtime")
|
||||||
|
private String endtime;
|
||||||
|
@SerializedName("user_language")
|
||||||
|
private String userLanguage;
|
||||||
|
@SerializedName("live_language")
|
||||||
|
private String liveLanguage;
|
||||||
|
@SerializedName("is_open")
|
||||||
|
private String isOpen;
|
||||||
|
|
||||||
|
public String getIsOpen() {
|
||||||
|
return isOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setIsOpen(String isOpen) {
|
||||||
|
this.isOpen = isOpen;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserAvatar() {
|
||||||
|
return userAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setUserAvatar(String userAvatar) {
|
||||||
|
this.userAvatar = userAvatar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveAvatar() {
|
||||||
|
return liveAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setLiveAvatar(String liveAvatar) {
|
||||||
|
this.liveAvatar = liveAvatar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGuardType() {
|
||||||
|
return guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setGuardType(int guardType) {
|
||||||
|
this.guardType = guardType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExp() {
|
||||||
|
return exp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setExp(String exp) {
|
||||||
|
this.exp = exp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setLevel(String level) {
|
||||||
|
this.level = level;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndtime() {
|
||||||
|
return endtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setEndtime(String endtime) {
|
||||||
|
this.endtime = endtime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserLanguage() {
|
||||||
|
return userLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setUserLanguage(String userLanguage) {
|
||||||
|
this.userLanguage = userLanguage;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveLanguage() {
|
||||||
|
return liveLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuardUserInfoModel setLiveLanguage(String liveLanguage) {
|
||||||
|
this.liveLanguage = liveLanguage;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,12 +7,21 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class LiveBattlePassRewardsBean extends BaseModel{
|
public class LiveBattlePassRewardsBean extends BaseModel{
|
||||||
private int level;
|
private int level;
|
||||||
|
private int is_received;
|
||||||
private List<BattlePassType> live_battle_pass_type;
|
private List<BattlePassType> live_battle_pass_type;
|
||||||
private Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards;
|
private Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards;
|
||||||
|
|
||||||
public LiveBattlePassRewardsBean() {
|
public LiveBattlePassRewardsBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIs_received() {
|
||||||
|
return is_received;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_received(int is_received) {
|
||||||
|
this.is_received = is_received;
|
||||||
|
}
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
@@ -97,6 +106,15 @@ public class LiveBattlePassRewardsBean extends BaseModel{
|
|||||||
private String rewardName;
|
private String rewardName;
|
||||||
@SerializedName("image_url")
|
@SerializedName("image_url")
|
||||||
private String imageUrl;
|
private String imageUrl;
|
||||||
|
@SerializedName("send_reward_type")
|
||||||
|
private int sendRewardType;
|
||||||
|
@SerializedName("send_gift_type")
|
||||||
|
private int sendGiftType;
|
||||||
|
@SerializedName("send_reward_needcoin")
|
||||||
|
private String sendRewardNeedcoin;
|
||||||
|
@SerializedName("send_reward_restrict_time")
|
||||||
|
private String sendRewardRestrictTime;
|
||||||
|
|
||||||
private int lock;
|
private int lock;
|
||||||
private int received;
|
private int received;
|
||||||
|
|
||||||
@@ -159,6 +177,38 @@ public class LiveBattlePassRewardsBean extends BaseModel{
|
|||||||
this.received = received;
|
this.received = received;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getSendRewardType() {
|
||||||
|
return sendRewardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendRewardType(int sendRewardType) {
|
||||||
|
this.sendRewardType = sendRewardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSendGiftType() {
|
||||||
|
return sendGiftType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendGiftType(int sendGiftType) {
|
||||||
|
this.sendGiftType = sendGiftType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSendRewardNeedcoin() {
|
||||||
|
return sendRewardNeedcoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendRewardNeedcoin(String sendRewardNeedcoin) {
|
||||||
|
this.sendRewardNeedcoin = sendRewardNeedcoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSendRewardRestrictTime() {
|
||||||
|
return sendRewardRestrictTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendRewardRestrictTime(String sendRewardRestrictTime) {
|
||||||
|
this.sendRewardRestrictTime = sendRewardRestrictTime;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "LiveBattlePassReward{" +
|
return "LiveBattlePassReward{" +
|
||||||
@@ -167,6 +217,10 @@ public class LiveBattlePassRewardsBean extends BaseModel{
|
|||||||
", liveBattlePassTypeId=" + liveBattlePassTypeId +
|
", liveBattlePassTypeId=" + liveBattlePassTypeId +
|
||||||
", rewardName='" + rewardName + '\'' +
|
", rewardName='" + rewardName + '\'' +
|
||||||
", imageUrl='" + imageUrl + '\'' +
|
", imageUrl='" + imageUrl + '\'' +
|
||||||
|
", sendRewardType=" + sendRewardType +
|
||||||
|
", sendGiftType=" + sendGiftType +
|
||||||
|
", sendRewardNeedcoin='" + sendRewardNeedcoin + '\'' +
|
||||||
|
", sendRewardRestrictTime='" + sendRewardRestrictTime + '\'' +
|
||||||
", lock=" + lock +
|
", lock=" + lock +
|
||||||
", received=" + received +
|
", received=" + received +
|
||||||
'}';
|
'}';
|
||||||
|
|||||||
@@ -56,6 +56,18 @@ public class LiveBean implements Parcelable {
|
|||||||
private int redPacketStatus;
|
private int redPacketStatus;
|
||||||
@SerializedName("giftId")
|
@SerializedName("giftId")
|
||||||
private String giftId;
|
private String giftId;
|
||||||
|
@SerializedName("sendMoneyLongStatus ")
|
||||||
|
private int sendMoneyLongStatus ;
|
||||||
|
|
||||||
|
public int getSendMoneyLongStatus() {
|
||||||
|
return sendMoneyLongStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveBean setSendMoneyLongStatus(int sendMoneyLongStatus) {
|
||||||
|
this.sendMoneyLongStatus = sendMoneyLongStatus;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
private Map<String,String> params;//用于跳转Activity时扩展参数,例:从首页Banner跳转到直播间时需要根据携带参数判断是否弹出新人特惠对话框
|
private Map<String,String> params;//用于跳转Activity时扩展参数,例:从首页Banner跳转到直播间时需要根据携带参数判断是否弹出新人特惠对话框
|
||||||
|
|
||||||
public String getRecommendCardIconSizeTwo() {
|
public String getRecommendCardIconSizeTwo() {
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class LivePkMicModel extends BaseModel {
|
||||||
|
@SerializedName("pkuid")
|
||||||
|
private String pkuid;
|
||||||
|
@SerializedName("pkuname")
|
||||||
|
private String pkuname;
|
||||||
|
@SerializedName("pkuimg")
|
||||||
|
private String pkuimg;
|
||||||
|
|
||||||
|
public String getPkuid() {
|
||||||
|
return pkuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkuid(String pkuid) {
|
||||||
|
this.pkuid = pkuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkuname() {
|
||||||
|
return pkuname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkuname(String pkuname) {
|
||||||
|
this.pkuname = pkuname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkuimg() {
|
||||||
|
return pkuimg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkuimg(String pkuimg) {
|
||||||
|
this.pkuimg = pkuimg;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class NewGuardLevelModel extends BaseModel{
|
||||||
|
|
||||||
|
@SerializedName("guard_type")
|
||||||
|
private int guardType;
|
||||||
|
@SerializedName("cn")
|
||||||
|
private String cn;
|
||||||
|
@SerializedName("en")
|
||||||
|
private String en;
|
||||||
|
|
||||||
|
public int getGuardType() {
|
||||||
|
return guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGuardType(int guardType) {
|
||||||
|
this.guardType = guardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCn() {
|
||||||
|
return cn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCn(String cn) {
|
||||||
|
this.cn = cn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEn() {
|
||||||
|
return en;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEn(String en) {
|
||||||
|
this.en = en;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@ package com.yunbao.common.bean;
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
@@ -22,6 +21,8 @@ public class OpenAdModel extends BaseModel {
|
|||||||
public static final int SHOW_ONE = 3;//3. 仅弹出一次;
|
public static final int SHOW_ONE = 3;//3. 仅弹出一次;
|
||||||
@SerializedName("id")
|
@SerializedName("id")
|
||||||
private int id;
|
private int id;
|
||||||
|
@SerializedName("popup_name")
|
||||||
|
private String name;
|
||||||
@SerializedName("popup_location")
|
@SerializedName("popup_location")
|
||||||
private int type = TYPE_HOME;
|
private int type = TYPE_HOME;
|
||||||
@SerializedName("activity_url")
|
@SerializedName("activity_url")
|
||||||
@@ -35,24 +36,27 @@ public class OpenAdModel extends BaseModel {
|
|||||||
@SerializedName("popup_model")
|
@SerializedName("popup_model")
|
||||||
private int model = MODEL_SQUARE;
|
private int model = MODEL_SQUARE;
|
||||||
@SerializedName("start_show_time")
|
@SerializedName("start_show_time")
|
||||||
private String startTime;//活动开始时间
|
private String startTime;//活动开始时间 1
|
||||||
@SerializedName("end_show_time")
|
@SerializedName("end_show_time")
|
||||||
private String endTime;//活动结束时间
|
private String endTime;//活动结束时间 5
|
||||||
@SerializedName("popup_permission")
|
@SerializedName("popup_permission")
|
||||||
private int permission;
|
private int permission;
|
||||||
@SerializedName("popup_frequency")
|
@SerializedName("popup_frequency")
|
||||||
private int showModel = SHOW_DEF;//显示模式,1:杀死程序后弹出 2:指定时间内(本机时间) 3:1. 仅弹出一次
|
private int showModel = SHOW_DEF;//显示模式,1:杀死程序后弹出 2:指定时间内(本机时间) 3:1. 仅弹出一次
|
||||||
@SerializedName("popup_frequency_time")
|
@SerializedName("popup_frequency_time")
|
||||||
private String section = "0";// SHOW_DEF = 2
|
private String section = "0";// SHOW_DEF = 2 1
|
||||||
|
@SerializedName("popup_sort")
|
||||||
|
private int popupSort = 1;//弹框类型 1.图片 2.H5
|
||||||
|
@SerializedName("sort")
|
||||||
|
private int sort = 0;
|
||||||
|
|
||||||
public OpenAdModel() {
|
public OpenAdModel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OpenAdModel createTestData() {
|
public static OpenAdModel createTestData() {
|
||||||
OpenAdModel model = new OpenAdModel();
|
OpenAdModel model = new OpenAdModel();
|
||||||
model.id=3;
|
model.id = 3;
|
||||||
model.type=1;
|
model.type = 1;
|
||||||
model.url = "/h5/GuildTournament/20230821/rank.html";
|
model.url = "/h5/GuildTournament/20230821/rank.html";
|
||||||
model.imageUrl = "https://ceshi.yaoulive.com/data/upload/20230913/1694589490.png";
|
model.imageUrl = "https://ceshi.yaoulive.com/data/upload/20230913/1694589490.png";
|
||||||
model.showTime = 10;
|
model.showTime = 10;
|
||||||
@@ -66,6 +70,30 @@ public class OpenAdModel extends BaseModel {
|
|||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPopupSort() {
|
||||||
|
return popupSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSort(int sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPopupSort(int popupSort) {
|
||||||
|
this.popupSort = popupSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
public int getShowModel() {
|
public int getShowModel() {
|
||||||
return showModel;
|
return showModel;
|
||||||
}
|
}
|
||||||
@@ -91,10 +119,14 @@ public class OpenAdModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
if (!url.startsWith("http://") || !url.startsWith("https://")) {
|
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||||
url = CommonAppConfig.HOST + url;
|
url = CommonAppConfig.HOST + (url.startsWith("/") ? url : "/" + url);
|
||||||
}
|
}
|
||||||
return url + "?t=" + System.currentTimeMillis() / 1000;
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalUrl() {
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUrl(String url) {
|
public void setUrl(String url) {
|
||||||
@@ -195,6 +227,7 @@ public class OpenAdModel extends BaseModel {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return "OpenAdModel{" +
|
return "OpenAdModel{" +
|
||||||
"id=" + id +
|
"id=" + id +
|
||||||
|
", name='" + name + '\'' +
|
||||||
", type=" + type +
|
", type=" + type +
|
||||||
", url='" + url + '\'' +
|
", url='" + url + '\'' +
|
||||||
", imageUrl='" + imageUrl + '\'' +
|
", imageUrl='" + imageUrl + '\'' +
|
||||||
@@ -203,7 +236,10 @@ public class OpenAdModel extends BaseModel {
|
|||||||
", model=" + model +
|
", model=" + model +
|
||||||
", startTime='" + startTime + '\'' +
|
", startTime='" + startTime + '\'' +
|
||||||
", endTime='" + endTime + '\'' +
|
", endTime='" + endTime + '\'' +
|
||||||
", permission='" + permission + '\'' +
|
", permission=" + permission +
|
||||||
|
", showModel=" + showModel +
|
||||||
|
", section='" + section + '\'' +
|
||||||
|
", sort=" + popupSort +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,16 @@ public class RedPacketInfoModel extends BaseModel {
|
|||||||
//超级红包ID
|
//超级红包ID
|
||||||
@SerializedName("super_jackpot_id")
|
@SerializedName("super_jackpot_id")
|
||||||
private String superJackpotId;
|
private String superJackpotId;
|
||||||
|
@SerializedName("red_packet_type")
|
||||||
|
private int redPacketType;// 1.普通红包 2.特殊红包
|
||||||
|
|
||||||
|
public int getRedPacketType() {
|
||||||
|
return redPacketType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRedPacketType(int redPacketType) {
|
||||||
|
this.redPacketType = redPacketType;
|
||||||
|
}
|
||||||
|
|
||||||
public String getSuperJackpotId() {
|
public String getSuperJackpotId() {
|
||||||
return superJackpotId;
|
return superJackpotId;
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class RewardsModel extends BaseModel {
|
||||||
|
@SerializedName("id")
|
||||||
|
private int id;
|
||||||
|
@SerializedName("reward_name")
|
||||||
|
private String rewardName;
|
||||||
|
@SerializedName("image_path")
|
||||||
|
private String imagePath;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardsModel setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRewardName() {
|
||||||
|
return rewardName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardsModel setRewardName(String rewardName) {
|
||||||
|
this.rewardName = rewardName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImagePath() {
|
||||||
|
return imagePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardsModel setImagePath(String imagePath) {
|
||||||
|
this.imagePath = imagePath;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class SendMoneyLongModel extends BaseModel {
|
||||||
|
/**
|
||||||
|
* {
|
||||||
|
* "_method_": "SendMoneyLong",
|
||||||
|
* "action": "0",
|
||||||
|
* "uid": "98888",
|
||||||
|
* "user_nicename": "周末暴打小朋友",
|
||||||
|
* "user_avatar": "https://downs.yaoulive.com/mannine.png",
|
||||||
|
* "liveuid": "98889",
|
||||||
|
* "add_time": 1710318757,
|
||||||
|
* "gold_num": "5000"
|
||||||
|
* "countdown": 300 // 倒计时
|
||||||
|
* "send_money_long_key": "1710384258446",
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SerializedName("_method_")
|
||||||
|
private String method;
|
||||||
|
@SerializedName("action")
|
||||||
|
private String action;
|
||||||
|
@SerializedName("uid")
|
||||||
|
private String uid;
|
||||||
|
@SerializedName("user_nicename")
|
||||||
|
private String userNicename;
|
||||||
|
@SerializedName("user_avatar")
|
||||||
|
private String userAvatar;
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
private String liveuid;
|
||||||
|
@SerializedName("add_time")
|
||||||
|
private String addTime;
|
||||||
|
@SerializedName("gold_num")
|
||||||
|
private String goldNum;
|
||||||
|
@SerializedName("countdown")
|
||||||
|
private String countdown;
|
||||||
|
@SerializedName("send_money_long_key")
|
||||||
|
private String sendMoneyLongKey;
|
||||||
|
|
||||||
|
public String getSendMoneyLongKey() {
|
||||||
|
return sendMoneyLongKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongModel setSendMoneyLongKey(String sendMoneyLongKey) {
|
||||||
|
this.sendMoneyLongKey = sendMoneyLongKey;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountdown() {
|
||||||
|
return countdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongModel setCountdown(String countdown) {
|
||||||
|
this.countdown = countdown;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMethod() {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMethod(String method) {
|
||||||
|
this.method = method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAction() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAction(String action) {
|
||||||
|
this.action = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserNicename() {
|
||||||
|
return userNicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserNicename(String userNicename) {
|
||||||
|
this.userNicename = userNicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserAvatar() {
|
||||||
|
return userAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserAvatar(String userAvatar) {
|
||||||
|
this.userAvatar = userAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddTime() {
|
||||||
|
return addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddTime(String addTime) {
|
||||||
|
this.addTime = addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGoldNum() {
|
||||||
|
return goldNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGoldNum(String goldNum) {
|
||||||
|
this.goldNum = goldNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SendMoneyLongModel{" +
|
||||||
|
"method='" + method + '\'' +
|
||||||
|
", action='" + action + '\'' +
|
||||||
|
", uid='" + uid + '\'' +
|
||||||
|
", userNicename='" + userNicename + '\'' +
|
||||||
|
", userAvatar='" + userAvatar + '\'' +
|
||||||
|
", liveuid='" + liveuid + '\'' +
|
||||||
|
", addTime=" + addTime +
|
||||||
|
", goldNum='" + goldNum + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class SendMoneyLongStatusModel extends BaseModel {
|
||||||
|
/**
|
||||||
|
* "sendMoneyLongStatus": { // 未查询到数据时为空数组
|
||||||
|
* "liveuid": "98889", // 主播ID
|
||||||
|
* "uid": "98888", // 发起用户ID
|
||||||
|
* "addtime": "1710384258446", // 开始时间 毫秒时间戳
|
||||||
|
* "gold_num": "5000", // 金豆数量
|
||||||
|
* "user_nicename": "周末暴打小朋友", // 用户昵称
|
||||||
|
* "user_avatar": "https://downs.yaoulive.com/mannine.png", // 用户头像链接
|
||||||
|
* "countdown": 300 // 倒计时
|
||||||
|
* "start_status": false,
|
||||||
|
* "start_time": "",
|
||||||
|
* "send_money_long_key": "1710397575473",
|
||||||
|
* "participate": 0,
|
||||||
|
* "add_time": "1710397575473"
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
private String liveuid;
|
||||||
|
@SerializedName("uid")
|
||||||
|
private String uid;
|
||||||
|
@SerializedName("addtime")
|
||||||
|
private String addtime;
|
||||||
|
@SerializedName("gold_num")
|
||||||
|
private String goldNum;
|
||||||
|
@SerializedName("user_nicename")
|
||||||
|
private String userNicename;
|
||||||
|
@SerializedName("user_avatar")
|
||||||
|
private String userAvatar;
|
||||||
|
@SerializedName("countdown")
|
||||||
|
private String countdown;
|
||||||
|
@SerializedName("start_status")
|
||||||
|
private String startStatus;
|
||||||
|
@SerializedName("start_time")
|
||||||
|
private String startTime;
|
||||||
|
@SerializedName("send_money_long_key")
|
||||||
|
private String sendMoneyLongKey;
|
||||||
|
@SerializedName("participate")
|
||||||
|
private String participate;
|
||||||
|
@SerializedName("add_time")
|
||||||
|
private String addTime;
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddtime() {
|
||||||
|
return addtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setAddtime(String addtime) {
|
||||||
|
this.addtime = addtime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGoldNum() {
|
||||||
|
return goldNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setGoldNum(String goldNum) {
|
||||||
|
this.goldNum = goldNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserNicename() {
|
||||||
|
return userNicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setUserNicename(String userNicename) {
|
||||||
|
this.userNicename = userNicename;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserAvatar() {
|
||||||
|
return userAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setUserAvatar(String userAvatar) {
|
||||||
|
this.userAvatar = userAvatar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountdown() {
|
||||||
|
return countdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setCountdown(String countdown) {
|
||||||
|
this.countdown = countdown;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartStatus() {
|
||||||
|
return startStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setStartStatus(String startStatus) {
|
||||||
|
this.startStatus = startStatus;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setStartTime(String startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSendMoneyLongKey() {
|
||||||
|
return sendMoneyLongKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setSendMoneyLongKey(String sendMoneyLongKey) {
|
||||||
|
this.sendMoneyLongKey = sendMoneyLongKey;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParticipate() {
|
||||||
|
return participate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setParticipate(String participate) {
|
||||||
|
this.participate = participate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddTime() {
|
||||||
|
return addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMoneyLongStatusModel setAddTime(String addTime) {
|
||||||
|
this.addTime = addTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 声网token
|
||||||
|
*/
|
||||||
|
public class SwTokenModel extends BaseModel {
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
public SwTokenModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public SwTokenModel(String token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToken() {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToken(String token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -865,11 +865,20 @@ public class UserBean implements Parcelable {
|
|||||||
private String medal;
|
private String medal;
|
||||||
private String bubble;
|
private String bubble;
|
||||||
private String medal_new;
|
private String medal_new;
|
||||||
|
private String medal_new_en;
|
||||||
|
|
||||||
public String getMedal_new() {
|
public String getMedal_new() {
|
||||||
return medal_new;
|
return medal_new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMedal_new_en() {
|
||||||
|
return medal_new_en;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMedal_new_en(String medal_new_en) {
|
||||||
|
this.medal_new_en = medal_new_en;
|
||||||
|
}
|
||||||
|
|
||||||
public void setMedal_new(String medal_new) {
|
public void setMedal_new(String medal_new) {
|
||||||
this.medal_new = medal_new;
|
this.medal_new = medal_new;
|
||||||
}
|
}
|
||||||
@@ -898,6 +907,66 @@ public class UserBean implements Parcelable {
|
|||||||
this.bubble = bubble;
|
this.bubble = bubble;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "UserBean{" +
|
||||||
|
"id='" + id + '\'' +
|
||||||
|
", userNiceName='" + userNiceName + '\'' +
|
||||||
|
", avatar='" + avatar + '\'' +
|
||||||
|
", avatarThumb='" + avatarThumb + '\'' +
|
||||||
|
", sex=" + sex +
|
||||||
|
", signature='" + signature + '\'' +
|
||||||
|
", coin='" + coin + '\'' +
|
||||||
|
", gold='" + gold + '\'' +
|
||||||
|
", votes='" + votes + '\'' +
|
||||||
|
", consumption='" + consumption + '\'' +
|
||||||
|
", votestotal='" + votestotal + '\'' +
|
||||||
|
", province='" + province + '\'' +
|
||||||
|
", city='" + city + '\'' +
|
||||||
|
", location='" + location + '\'' +
|
||||||
|
", birthday='" + birthday + '\'' +
|
||||||
|
", level=" + level +
|
||||||
|
", levelAnchor=" + levelAnchor +
|
||||||
|
", lives=" + lives +
|
||||||
|
", follows=" + follows +
|
||||||
|
", fans=" + fans +
|
||||||
|
", vip=" + vip +
|
||||||
|
", liang=" + liang +
|
||||||
|
", car=" + car +
|
||||||
|
", medal_level=" + medal_level +
|
||||||
|
", medal_name='" + medal_name + '\'' +
|
||||||
|
", Dress=" + Dress +
|
||||||
|
", noble_id='" + noble_id + '\'' +
|
||||||
|
", yuanbao='" + yuanbao + '\'' +
|
||||||
|
", noble_name='" + noble_name + '\'' +
|
||||||
|
", islive='" + islive + '\'' +
|
||||||
|
", medal_no_display_src='" + medal_no_display_src + '\'' +
|
||||||
|
", hot_num='" + hot_num + '\'' +
|
||||||
|
", goodnum='" + goodnum + '\'' +
|
||||||
|
", fans_pic='" + fans_pic + '\'' +
|
||||||
|
", gifticon='" + gifticon + '\'' +
|
||||||
|
", department_name='" + department_name + '\'' +
|
||||||
|
", token_rong='" + token_rong + '\'' +
|
||||||
|
", noble_end_time='" + noble_end_time + '\'' +
|
||||||
|
", slide='" + slide + '\'' +
|
||||||
|
", users_type='" + users_type + '\'' +
|
||||||
|
", is_bind='" + is_bind + '\'' +
|
||||||
|
", mobile='" + mobile + '\'' +
|
||||||
|
", front_task='" + front_task + '\'' +
|
||||||
|
", is_admin='" + is_admin + '\'' +
|
||||||
|
", praise=" + praise +
|
||||||
|
", isHide=" + isHide +
|
||||||
|
", randomPk=" + randomPk +
|
||||||
|
", mRankPkImgUrl='" + mRankPkImgUrl + '\'' +
|
||||||
|
", user_info_complete=" + user_info_complete +
|
||||||
|
", fansLevel=" + fansLevel +
|
||||||
|
", typeMic=" + typeMic +
|
||||||
|
", isMicList=" + isMicList +
|
||||||
|
", isRequest=" + isRequest +
|
||||||
|
", fansEnterRoomUrl='" + fansEnterRoomUrl + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,154 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class sendMoneyLongListModel extends BaseModel {
|
||||||
|
/**
|
||||||
|
* {
|
||||||
|
* "liveuid": "98889", // 主播ID
|
||||||
|
* "uid": "98888", // 用户ID
|
||||||
|
* "addtime": "1710397350011", // 创建时间 毫秒时间戳
|
||||||
|
* "gold_num": "5000", // 金豆数量
|
||||||
|
* "user_nicename": "周末暴打小朋友", // 用户昵称
|
||||||
|
* "user_avatar": "https://downs.yaoulive.com/mannine.png", // 用户头像
|
||||||
|
* "countdown": 300, // 倒计时
|
||||||
|
* "start_status": false,
|
||||||
|
* "start_time": "",
|
||||||
|
* "send_money_long_key": "1710397485729",
|
||||||
|
* "participate": 0, // 是否参与活动 0.未参与 1.已参与
|
||||||
|
* "add_time": "1710397485729"
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
private String liveuid;
|
||||||
|
@SerializedName("uid")
|
||||||
|
private String uid;
|
||||||
|
@SerializedName("addtime")
|
||||||
|
private String addtime;
|
||||||
|
@SerializedName("gold_num")
|
||||||
|
private String goldNum;
|
||||||
|
@SerializedName("user_nicename")
|
||||||
|
private String userNicename;
|
||||||
|
@SerializedName("user_avatar")
|
||||||
|
private String userAvatar;
|
||||||
|
@SerializedName("countdown")
|
||||||
|
private String countdown;
|
||||||
|
@SerializedName("start_status")
|
||||||
|
private boolean startStatus;
|
||||||
|
@SerializedName("start_time")
|
||||||
|
private String startTime;
|
||||||
|
@SerializedName("send_money_long_key")
|
||||||
|
private String sendMoneyLongKey;
|
||||||
|
@SerializedName("participate")
|
||||||
|
private String participate;
|
||||||
|
@SerializedName("add_time")
|
||||||
|
private String addTime;
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddtime() {
|
||||||
|
return addtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setAddtime(String addtime) {
|
||||||
|
this.addtime = addtime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGoldNum() {
|
||||||
|
return goldNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setGoldNum(String goldNum) {
|
||||||
|
this.goldNum = goldNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserNicename() {
|
||||||
|
return userNicename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setUserNicename(String userNicename) {
|
||||||
|
this.userNicename = userNicename;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserAvatar() {
|
||||||
|
return userAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setUserAvatar(String userAvatar) {
|
||||||
|
this.userAvatar = userAvatar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountdown() {
|
||||||
|
return countdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setCountdown(String countdown) {
|
||||||
|
this.countdown = countdown;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStartStatus() {
|
||||||
|
return startStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setStartStatus(boolean startStatus) {
|
||||||
|
this.startStatus = startStatus;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setStartTime(String startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSendMoneyLongKey() {
|
||||||
|
return sendMoneyLongKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setSendMoneyLongKey(String sendMoneyLongKey) {
|
||||||
|
this.sendMoneyLongKey = sendMoneyLongKey;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParticipate() {
|
||||||
|
return participate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setParticipate(String participate) {
|
||||||
|
this.participate = participate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddTime() {
|
||||||
|
return addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sendMoneyLongListModel setAddTime(String addTime) {
|
||||||
|
this.addTime = addTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.lxj.xpopup.core.CenterPopupView;
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.CoolConfig;
|
import com.yunbao.common.bean.CoolConfig;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.google.gson.Gson;
|
|||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.lxj.xpopup.core.BottomPopupView;
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
import com.lxj.xpopup.enums.PopupPosition;
|
import com.lxj.xpopup.enums.PopupPosition;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||||
@@ -45,6 +46,9 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 半屏创建游戏房间
|
||||||
|
*/
|
||||||
public class CreateSudGamePopup extends BottomPopupView {
|
public class CreateSudGamePopup extends BottomPopupView {
|
||||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||||
private TextView createGameType, selectCurrencyType;
|
private TextView createGameType, selectCurrencyType;
|
||||||
@@ -150,8 +154,6 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
.asCustom(new SudGameListSelectPopup(getContext(), 4, customSidebarChildModels, interactionID))
|
.asCustom(new SudGameListSelectPopup(getContext(), 4, customSidebarChildModels, interactionID))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.room_back),
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.room_back),
|
||||||
@@ -279,7 +281,11 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
public void onSuccess(CreateSudRoomModel data) {
|
public void onSuccess(CreateSudRoomModel data) {
|
||||||
if (isHome) {
|
if (isHome) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(data));
|
if(CommonAppConfig.getInstance().getConfig().isSw()){
|
||||||
|
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data),true,isHome);
|
||||||
|
}else{
|
||||||
|
RouteUtil.forwardRySudGameActivity(new Gson().toJson(data),true,isHome);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||||
|
|
||||||
@@ -312,20 +318,50 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
animator.setDuration(animDuration);
|
animator.setDuration(animDuration);
|
||||||
animator.setInterpolator(new LinearInterpolator());
|
animator.setInterpolator(new LinearInterpolator());
|
||||||
animator.start();
|
animator.start();
|
||||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
if (hasMoveUp) {
|
||||||
builder.hasShadowBg(false)
|
InputMethodManager imm = getSystemService(getContext(), InputMethodManager.class);
|
||||||
.isDestroyOnDismiss(true)
|
if (imm != null) {
|
||||||
.isLightStatusBar(false)
|
imm.hideSoftInputFromWindow(roomName.getWindowToken(), 0);
|
||||||
.popupPosition(PopupPosition.Bottom)
|
imm.hideSoftInputFromWindow(gameSill.getWindowToken(), 0);
|
||||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
}
|
||||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void onDismiss(DialogInterface dialog) {
|
public void run() {
|
||||||
closeAnimSudGameListEvent();
|
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
||||||
}
|
builder.hasShadowBg(false)
|
||||||
})
|
.isDestroyOnDismiss(true)
|
||||||
)
|
.isLightStatusBar(false)
|
||||||
.show();
|
.popupPosition(PopupPosition.Bottom)
|
||||||
|
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
||||||
|
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||||
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
closeAnimSudGameListEvent();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
}else {
|
||||||
|
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
||||||
|
builder.hasShadowBg(false)
|
||||||
|
.isDestroyOnDismiss(true)
|
||||||
|
.isLightStatusBar(false)
|
||||||
|
.popupPosition(PopupPosition.Bottom)
|
||||||
|
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
||||||
|
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||||
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
closeAnimSudGameListEvent();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
172
common/src/main/java/com/yunbao/common/dialog/DebugDialog.java
Normal file
172
common/src/main/java/com/yunbao/common/dialog/DebugDialog.java
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
|
import com.lzf.easyfloat.enums.ShowPattern;
|
||||||
|
import com.lzf.easyfloat.interfaces.OnPermissionResult;
|
||||||
|
import com.lzf.easyfloat.permission.PermissionUtils;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.adapter.DebugDialogAdapter;
|
||||||
|
import com.yunbao.common.utils.AppManager;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
|
||||||
|
public class DebugDialog {
|
||||||
|
RecyclerView recyclerView;
|
||||||
|
LinkedHashMap<String, View> params;
|
||||||
|
DebugDialogAdapter adapter;
|
||||||
|
private static DebugDialog debugDialog;
|
||||||
|
Context mContext;
|
||||||
|
private ShowPattern showPattern = ShowPattern.CURRENT_ACTIVITY;
|
||||||
|
|
||||||
|
private DebugDialogRunnable runnable;
|
||||||
|
|
||||||
|
public static void getInstance(DebugDialogRunnable runnable) {
|
||||||
|
if (debugDialog == null) {
|
||||||
|
debugDialog = new DebugDialog(runnable);
|
||||||
|
} else {
|
||||||
|
runnable.run(debugDialog);
|
||||||
|
}
|
||||||
|
debugDialog.showPattern = ShowPattern.CURRENT_ACTIVITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean checkShow() {
|
||||||
|
return EasyFloat.isShow("debug");
|
||||||
|
}
|
||||||
|
|
||||||
|
public DebugDialog clear() {
|
||||||
|
params.clear();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParams(String tag, String msg) {
|
||||||
|
Log.i("debug弹窗", "setParams: " + tag + "|" + msg);
|
||||||
|
if (params.containsKey(tag)) {
|
||||||
|
((TextView) params.get(tag)).setText(tag + ":" + msg);
|
||||||
|
} else {
|
||||||
|
TextView textView = new TextView(mContext);
|
||||||
|
textView.setText(tag + ":" + msg);
|
||||||
|
params.put(tag, textView);
|
||||||
|
adapter.setParamMap(params);
|
||||||
|
}
|
||||||
|
EasyFloat.updateFloat("debug");
|
||||||
|
}
|
||||||
|
|
||||||
|
private DebugDialog(DebugDialogRunnable runnable) {
|
||||||
|
this.runnable = runnable;
|
||||||
|
if (params == null) {
|
||||||
|
Log.i("debug弹窗", "DebugDialog: 初始化参数");
|
||||||
|
params = new LinkedHashMap<>();
|
||||||
|
}
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
this.mContext = AppManager.getInstance().getMainActivity();
|
||||||
|
if (mContext == null) {
|
||||||
|
startWaitMainActivity();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
runnable.run(this);
|
||||||
|
// createView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startWaitMainActivity() {
|
||||||
|
new Timer().schedule(new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Log.i("debug弹窗", "run: " + AppManager.getInstance().getMainActivity());
|
||||||
|
if (AppManager.getInstance().getMainActivity() != null) {
|
||||||
|
init();
|
||||||
|
cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 0, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
EasyFloat.dismiss("debug");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
if (recyclerView != null) return;
|
||||||
|
if (showPattern == ShowPattern.CURRENT_ACTIVITY) {
|
||||||
|
createView();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (PermissionUtils.checkPermission(mContext)) {
|
||||||
|
createView();
|
||||||
|
} else {
|
||||||
|
PermissionUtils.requestPermission((Activity) mContext, new OnPermissionResult() {
|
||||||
|
@Override
|
||||||
|
public void permissionResult(boolean b) {
|
||||||
|
ToastUtil.show("悬浮权限" + b);
|
||||||
|
if (b) {
|
||||||
|
createView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void createView() {
|
||||||
|
recyclerView = new RecyclerView(mContext);
|
||||||
|
adapter = new DebugDialogAdapter(mContext);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||||
|
recyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||||
|
recyclerView.setAdapter(adapter);
|
||||||
|
recyclerView.setBackgroundColor(Color.WHITE);
|
||||||
|
TextView textView = new TextView(mContext);
|
||||||
|
textView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
ToastUtil.show("debug弹窗:" + params.size());
|
||||||
|
EasyFloat.updateFloat("debug");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
params.put("发包时间:" + CommonAppConfig.BUILD_TIME, textView);
|
||||||
|
adapter.setParamMap(params);
|
||||||
|
|
||||||
|
EasyFloat.with(mContext)
|
||||||
|
.setTag("debug")
|
||||||
|
.setShowPattern(this.showPattern)
|
||||||
|
.setLayout(recyclerView)
|
||||||
|
.show();
|
||||||
|
runnable.run(this);
|
||||||
|
Log.i("debug弹窗", "createView: 创建");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setView(String value, View view, View.OnClickListener onClickListener) {
|
||||||
|
if (params.containsKey(value)) {
|
||||||
|
params.get(value).setOnClickListener(onClickListener);
|
||||||
|
} else {
|
||||||
|
view.setOnClickListener(onClickListener);
|
||||||
|
params.put(value, view);
|
||||||
|
}
|
||||||
|
adapter.setParamMap(params);
|
||||||
|
EasyFloat.updateFloat("debug");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowPattern(ShowPattern showPattern) {
|
||||||
|
this.showPattern = showPattern;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface DebugDialogRunnable {
|
||||||
|
void run(DebugDialog dialog);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
public class DragonRulePopup extends CenterPopupView {
|
||||||
|
LinearLayout list_no;
|
||||||
|
LinearLayout list;
|
||||||
|
|
||||||
|
boolean isList;
|
||||||
|
|
||||||
|
public DragonRulePopup(@NonNull Context context, boolean isList) {
|
||||||
|
super(context);
|
||||||
|
this.isList = isList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回自定义弹窗的布局
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.dragon_rule_popup;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
list_no = findViewById(R.id.list_no);
|
||||||
|
list = findViewById(R.id.list);
|
||||||
|
if (!isList){
|
||||||
|
list_no.setVisibility(VISIBLE);
|
||||||
|
list.setVisibility(GONE);
|
||||||
|
}else {
|
||||||
|
list_no.setVisibility(GONE);
|
||||||
|
list.setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dragon_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
|
||||||
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
public class GuardBuyTipsDialog {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param context
|
||||||
|
* @param coin 钻石
|
||||||
|
* @param content 购买类型名称
|
||||||
|
* @param simpleCallback
|
||||||
|
*/
|
||||||
|
public static void showBuyOrRenewDialog(Context context, String coin, String content,
|
||||||
|
boolean isOpen, GuardGetGuardUserInfoModel mGuardUserInfoModel, int guardType,
|
||||||
|
DialogUitl.SimpleCallback simpleCallback) {
|
||||||
|
if (context instanceof Activity) {
|
||||||
|
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final Dialog dialog = new Dialog(context, R.style.dialog2);
|
||||||
|
dialog.setContentView(R.layout.dialog_guard_buy_tips);
|
||||||
|
dialog.setCancelable(true);
|
||||||
|
dialog.setCanceledOnTouchOutside(true);
|
||||||
|
TextView btn_confirm = dialog.findViewById(R.id.btn_confirm);
|
||||||
|
TextView content1 = dialog.findViewById(R.id.content1);
|
||||||
|
TextView content2 = dialog.findViewById(R.id.content2);
|
||||||
|
TextView contentTextView = dialog.findViewById(R.id.content);
|
||||||
|
TextView buyTypeTextView = dialog.findViewById(R.id.buyType);
|
||||||
|
content1.setVisibility(View.VISIBLE);
|
||||||
|
contentTextView.setVisibility(View.VISIBLE);
|
||||||
|
buyTypeTextView.setVisibility(View.VISIBLE);
|
||||||
|
content2.setVisibility(View.GONE);
|
||||||
|
if (TextUtils.isEmpty(coin) && mGuardUserInfoModel == null && !isOpen && guardType == -200) {
|
||||||
|
content1.setVisibility(View.GONE);
|
||||||
|
contentTextView.setVisibility(View.VISIBLE);
|
||||||
|
buyTypeTextView.setVisibility(View.GONE);
|
||||||
|
content2.setVisibility(View.GONE);
|
||||||
|
contentTextView.setText(content);
|
||||||
|
} else {
|
||||||
|
if (!isOpen) {
|
||||||
|
if (!TextUtils.isEmpty(coin)) {
|
||||||
|
contentTextView.setText(context.getString(R.string.guard_buy_tips_1, coin));
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(content)) {
|
||||||
|
buyTypeTextView.setText("【" + content + "】");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!TextUtils.isEmpty(coin)) {
|
||||||
|
contentTextView.setText(context.getString(R.string.guard_buy_tips_2, coin));
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(content)) {
|
||||||
|
buyTypeTextView.setText("【" + content + "】");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mGuardUserInfoModel != null) {
|
||||||
|
if (mGuardUserInfoModel.getGuardType() != 0) {
|
||||||
|
if (TextUtils.equals(mGuardUserInfoModel.getIsOpen(), "1") &&
|
||||||
|
guardType < mGuardUserInfoModel.getGuardType()) {
|
||||||
|
content1.setVisibility(View.GONE);
|
||||||
|
contentTextView.setVisibility(View.GONE);
|
||||||
|
buyTypeTextView.setVisibility(View.GONE);
|
||||||
|
content2.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
} else if (TextUtils.equals(mGuardUserInfoModel.getIsOpen(), "1") && guardType > mGuardUserInfoModel.getGuardType()) {
|
||||||
|
content1.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
content1.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
content1.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
content1.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
btn_confirm.setText(WordUtil.isNewZh() ? "確認" : "Confirm");
|
||||||
|
btn_confirm.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (content2.getVisibility() == View.VISIBLE) {
|
||||||
|
dialog.dismiss();
|
||||||
|
} else {
|
||||||
|
simpleCallback.onConfirmClick(dialog, "");
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.CheckUpgradesModel;
|
||||||
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
|
import com.yunbao.common.bean.RewardsModel;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
|
||||||
|
public class GuardUpgradePopup extends CenterPopupView {
|
||||||
|
FragmentActivity activity;
|
||||||
|
String mLiveUid;
|
||||||
|
CheckUpgradesModel mUpgradesModel;
|
||||||
|
TextView leave_hint;
|
||||||
|
LinearLayout rewards_line1, rewards_line2, rewards_line3;
|
||||||
|
ImageView rewards_img1, rewards_img2, rewards_img3;
|
||||||
|
TextView rewards_text1, rewards_text2, rewards_text3;
|
||||||
|
|
||||||
|
public GuardUpgradePopup(@NonNull Context context, String liveUid, CheckUpgradesModel upgradesModel, GuardUpgradeCallBack guardUpgradeCallBack) {
|
||||||
|
super(context);
|
||||||
|
activity = (FragmentActivity) context;
|
||||||
|
mLiveUid = liveUid;
|
||||||
|
mUpgradesModel = upgradesModel;
|
||||||
|
mGuardUpgradeCallBack = guardUpgradeCallBack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.guard_upgrade_popup;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
leave_hint = findViewById(R.id.leave_hint);
|
||||||
|
rewards_line1 = findViewById(R.id.rewards_line1);
|
||||||
|
rewards_line2 = findViewById(R.id.rewards_line2);
|
||||||
|
rewards_line3 = findViewById(R.id.rewards_line3);
|
||||||
|
rewards_img1 = findViewById(R.id.rewards_img1);
|
||||||
|
rewards_img2 = findViewById(R.id.rewards_img2);
|
||||||
|
rewards_img3 = findViewById(R.id.rewards_img3);
|
||||||
|
rewards_text1 = findViewById(R.id.rewards_text1);
|
||||||
|
rewards_text2 = findViewById(R.id.rewards_text2);
|
||||||
|
rewards_text3 = findViewById(R.id.rewards_text3);
|
||||||
|
StringBuffer hintStringBuffer = new StringBuffer();
|
||||||
|
if (WordUtil.isNewZh()) {
|
||||||
|
hintStringBuffer.append("您的守護等級已達到")
|
||||||
|
.append(mUpgradesModel.getLevel())
|
||||||
|
.append("級 可以領取以下獎勵");
|
||||||
|
} else {
|
||||||
|
hintStringBuffer.append("Your guardian level has reached level ")
|
||||||
|
.append(mUpgradesModel.getLevel())
|
||||||
|
.append(" You can receive the following rewards")
|
||||||
|
;
|
||||||
|
}
|
||||||
|
leave_hint.setText(hintStringBuffer.toString());
|
||||||
|
if (mUpgradesModel.getRewards().size() > 0) {
|
||||||
|
if (mUpgradesModel.getRewards().size() == 1) {
|
||||||
|
rewards_line1.setVisibility(INVISIBLE);
|
||||||
|
rewards_line2.setVisibility(VISIBLE);
|
||||||
|
rewards_line3.setVisibility(INVISIBLE);
|
||||||
|
RewardsModel rewardsModel = mUpgradesModel.getRewards().get(0);
|
||||||
|
ImgLoader.display(getContext(), rewardsModel.getImagePath(), rewards_img2);
|
||||||
|
rewards_text2.setText(rewardsModel.getRewardName());
|
||||||
|
} else if (mUpgradesModel.getRewards().size() == 2) {
|
||||||
|
rewards_line1.setVisibility(VISIBLE);
|
||||||
|
rewards_line2.setVisibility(INVISIBLE);
|
||||||
|
rewards_line3.setVisibility(VISIBLE);
|
||||||
|
RewardsModel rewardsModel1 = mUpgradesModel.getRewards().get(0);
|
||||||
|
RewardsModel rewardsModel3 = mUpgradesModel.getRewards().get(1);
|
||||||
|
|
||||||
|
ImgLoader.display(getContext(), rewardsModel1.getImagePath(), rewards_img1);
|
||||||
|
rewards_text1.setText(rewardsModel1.getRewardName());
|
||||||
|
|
||||||
|
ImgLoader.display(getContext(), rewardsModel3.getImagePath(), rewards_img3);
|
||||||
|
rewards_text3.setText(rewardsModel3.getRewardName());
|
||||||
|
|
||||||
|
} else if (mUpgradesModel.getRewards().size() == 3) {
|
||||||
|
rewards_line1.setVisibility(VISIBLE);
|
||||||
|
rewards_line2.setVisibility(VISIBLE);
|
||||||
|
rewards_line3.setVisibility(VISIBLE);
|
||||||
|
RewardsModel rewardsModel1 = mUpgradesModel.getRewards().get(0);
|
||||||
|
RewardsModel rewardsModel2 = mUpgradesModel.getRewards().get(1);
|
||||||
|
RewardsModel rewardsModel3 = mUpgradesModel.getRewards().get(2);
|
||||||
|
|
||||||
|
ImgLoader.display(getContext(), rewardsModel1.getImagePath(), rewards_img1);
|
||||||
|
rewards_text1.setText(rewardsModel1.getRewardName());
|
||||||
|
|
||||||
|
ImgLoader.display(getContext(), rewardsModel2.getImagePath(), rewards_img2);
|
||||||
|
rewards_text2.setText(rewardsModel2.getRewardName());
|
||||||
|
|
||||||
|
ImgLoader.display(getContext(), rewardsModel3.getImagePath(), rewards_img3);
|
||||||
|
rewards_text3.setText(rewardsModel3.getRewardName());
|
||||||
|
} else {
|
||||||
|
rewards_line1.setVisibility(INVISIBLE);
|
||||||
|
rewards_line2.setVisibility(INVISIBLE);
|
||||||
|
rewards_line3.setVisibility(INVISIBLE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rewards_line1.setVisibility(INVISIBLE);
|
||||||
|
rewards_line2.setVisibility(INVISIBLE);
|
||||||
|
rewards_line3.setVisibility(INVISIBLE);
|
||||||
|
}
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.confirm), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
LiveNetManager.get(getContext())
|
||||||
|
.guardGetRewards(mUpgradesModel.getLevel(), mLiveUid, new HttpCallback<Object>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Object data) {
|
||||||
|
ToastUtil.show(WordUtil.isNewZh() ? "領取成功" : "Receive successfully");
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
ToastUtil.show(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.view_grade), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
if (mGuardUpgradeCallBack != null) {
|
||||||
|
mGuardUpgradeCallBack.onGuardLevel();
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
|
StringBuffer htmlUrl = new StringBuffer();
|
||||||
|
IMLoginModel userInfo = IMLoginManager.get(getContext()).getUserInfo();
|
||||||
|
htmlUrl.append(CommonAppConfig.HOST)
|
||||||
|
.append("/h5/Guard/level.html?")
|
||||||
|
.append("token=")
|
||||||
|
.append(userInfo.getToken())
|
||||||
|
.append("&uid=")
|
||||||
|
.append(userInfo.getId())
|
||||||
|
.append("&anchorUid=")
|
||||||
|
.append(mLiveUid)
|
||||||
|
.append("&isZh=")
|
||||||
|
.append(((WordUtil.isNewZh()) ? "1" : "0"));
|
||||||
|
RouteUtil.forwardZhuangBanActivity(htmlUrl.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private GuardUpgradeCallBack mGuardUpgradeCallBack;
|
||||||
|
|
||||||
|
public interface GuardUpgradeCallBack {
|
||||||
|
void onGuardLevel();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.animation.Animator;
|
||||||
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
import android.animation.ValueAnimator;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.adapter.ImagePreviewAdapter;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Martin on 2024/3/15.
|
||||||
|
* 图片预览弹窗
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ImagePreviewDialog extends AbsDialogFragment implements View.OnClickListener {
|
||||||
|
|
||||||
|
private View mBg;
|
||||||
|
private RecyclerView mRecyclerView;
|
||||||
|
private ValueAnimator mAnimator;
|
||||||
|
private int mPosition;
|
||||||
|
private int mPageCount;
|
||||||
|
private ActionListener mActionListener;
|
||||||
|
private TextView mCount;
|
||||||
|
private ImagePreviewAdapter mAdapter;
|
||||||
|
private boolean mNeedDelete;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.view_preview_image;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getDialogStyle() {
|
||||||
|
return R.style.dialog2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canCancel() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setWindowAttributes(Window window) {
|
||||||
|
WindowManager.LayoutParams params = window.getAttributes();
|
||||||
|
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
|
params.height = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
|
window.setAttributes(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
mBg = mRootView.findViewById(R.id.bg);
|
||||||
|
mCount = (TextView) findViewById(R.id.count);
|
||||||
|
findViewById(R.id.btn_close).setOnClickListener(this);
|
||||||
|
if (mNeedDelete) {
|
||||||
|
View btnDelete = findViewById(R.id.btn_delete);
|
||||||
|
btnDelete.setVisibility(View.VISIBLE);
|
||||||
|
btnDelete.setOnClickListener(this);
|
||||||
|
}
|
||||||
|
mRecyclerView = mRootView.findViewById(R.id.recyclerView);
|
||||||
|
mRecyclerView.setHasFixedSize(true);
|
||||||
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||||
|
mAnimator = ValueAnimator.ofFloat(0, 1);
|
||||||
|
mAnimator.setDuration(150);
|
||||||
|
mAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||||
|
mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationUpdate(ValueAnimator animation) {
|
||||||
|
float v = (float) animation.getAnimatedValue();
|
||||||
|
mBg.setAlpha(v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
if (mRecyclerView != null && mPageCount > 0) {
|
||||||
|
ImagePreviewAdapter adapter = new ImagePreviewAdapter(mContext, mPageCount);
|
||||||
|
mAdapter = adapter;
|
||||||
|
adapter.setActionListener(new ImagePreviewAdapter.ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onPageChanged(int position) {
|
||||||
|
if (mCount != null) {
|
||||||
|
mCount.setText(StringUtil.contact(String.valueOf(position + 1), "/", String.valueOf(mPageCount)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadImage(ImageView imageView, int position) {
|
||||||
|
if (mActionListener != null) {
|
||||||
|
mActionListener.loadImage(imageView, position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mRecyclerView.setAdapter(adapter);
|
||||||
|
if (mPosition >= 0 && mPosition < mPageCount) {
|
||||||
|
adapter.setCurPosition(mPosition);
|
||||||
|
mRecyclerView.scrollToPosition(mPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mAnimator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageInfo(int pageCount, int position, boolean needDelete, ActionListener actionListener) {
|
||||||
|
mActionListener = actionListener;
|
||||||
|
mPageCount = pageCount;
|
||||||
|
mPosition = position;
|
||||||
|
mNeedDelete = needDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
if (mAnimator != null) {
|
||||||
|
mAnimator.cancel();
|
||||||
|
}
|
||||||
|
mContext = null;
|
||||||
|
mActionListener = null;
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
int i = v.getId();
|
||||||
|
if (i == R.id.btn_close) {
|
||||||
|
dismiss();
|
||||||
|
} else if (i == R.id.btn_delete) {
|
||||||
|
delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void delete() {
|
||||||
|
if (mAdapter != null && mActionListener != null) {
|
||||||
|
mActionListener.onDeleteClick(mAdapter.getCurPosition());
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ActionListener {
|
||||||
|
void loadImage(ImageView imageView, int position);
|
||||||
|
|
||||||
|
void onDeleteClick(int position);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.core.AttachPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.adapter.LiveBuyGuardSelectAdapter;
|
||||||
|
import com.yunbao.common.bean.GuardPriceModel;
|
||||||
|
import com.yunbao.common.views.LiveBuyGuardSelectViewHolder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LiveBuyGuardSelectPopup extends AttachPopupView {
|
||||||
|
private int mType;
|
||||||
|
private DialogInterface.OnDismissListener onDismissListener;
|
||||||
|
|
||||||
|
private LiveBuyGuardSelectListener buyGuardSelectListener;
|
||||||
|
List<GuardPriceModel> price = new ArrayList<>();
|
||||||
|
LiveBuyGuardSelectAdapter liveBuyGuardSelectAdapter;
|
||||||
|
RecyclerView live_buy_guard_list;
|
||||||
|
GuardPriceModel model;
|
||||||
|
|
||||||
|
public LiveBuyGuardSelectPopup(@NonNull Context context, List<GuardPriceModel> mPrice, GuardPriceModel mModel) {
|
||||||
|
super(context);
|
||||||
|
price = mPrice;
|
||||||
|
model = mModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.view_live_buy_guard_slelect;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
live_buy_guard_list = findViewById(R.id.live_buy_guard_list);
|
||||||
|
liveBuyGuardSelectAdapter = new LiveBuyGuardSelectAdapter(price,model);
|
||||||
|
live_buy_guard_list.setAdapter(liveBuyGuardSelectAdapter);
|
||||||
|
live_buy_guard_list.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
liveBuyGuardSelectAdapter.setLiveBuyGuardSelectClickListener(new LiveBuyGuardSelectViewHolder.LiveBuyGuardSelectClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClickListener(GuardPriceModel guardPriceModel) {
|
||||||
|
dialog.dismiss();
|
||||||
|
if (onDismissListener != null) {
|
||||||
|
onDismissListener.onDismiss(null);
|
||||||
|
}
|
||||||
|
if (buyGuardSelectListener != null) {
|
||||||
|
buyGuardSelectListener.onLiveBuyGuardSelectListener(guardPriceModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.one_month), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
// @Override
|
||||||
|
// public void onViewClicks() {
|
||||||
|
// dialog.dismiss();
|
||||||
|
// if (onDismissListener != null) {
|
||||||
|
// onDismissListener.onDismiss(null);
|
||||||
|
// }
|
||||||
|
// if (buyGuardSelectListener != null) {
|
||||||
|
// buyGuardSelectListener.onLiveBuyGuardSelectListener(0);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.tree_month), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
// @Override
|
||||||
|
// public void onViewClicks() {
|
||||||
|
// dialog.dismiss();
|
||||||
|
// if (onDismissListener != null) {
|
||||||
|
// onDismissListener.onDismiss(null);
|
||||||
|
// }
|
||||||
|
// if (buyGuardSelectListener != null) {
|
||||||
|
// buyGuardSelectListener.onLiveBuyGuardSelectListener(1);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.six_month), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
// @Override
|
||||||
|
// public void onViewClicks() {
|
||||||
|
// dialog.dismiss();
|
||||||
|
// if (onDismissListener != null) {
|
||||||
|
// onDismissListener.onDismiss(null);
|
||||||
|
// }
|
||||||
|
// if (buyGuardSelectListener != null) {
|
||||||
|
// buyGuardSelectListener.onLiveBuyGuardSelectListener(2);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.one_two_month), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
// @Override
|
||||||
|
// public void onViewClicks() {
|
||||||
|
// dialog.dismiss();
|
||||||
|
// if (onDismissListener != null) {
|
||||||
|
// onDismissListener.onDismiss(null);
|
||||||
|
// }
|
||||||
|
// if (buyGuardSelectListener != null) {
|
||||||
|
// buyGuardSelectListener.onLiveBuyGuardSelectListener(3);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
if (model == null) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveBuyGuardSelectPopup setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
|
||||||
|
this.onDismissListener = onDismissListener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveBuyGuardSelectPopup setBuyGuardSelectListener(LiveBuyGuardSelectListener buyGuardSelectListener) {
|
||||||
|
this.buyGuardSelectListener = buyGuardSelectListener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDismiss() {
|
||||||
|
super.onDismiss();
|
||||||
|
if (onDismissListener != null) {
|
||||||
|
onDismissListener.onDismiss(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface LiveBuyGuardSelectListener {
|
||||||
|
void onLiveBuyGuardSelectListener(GuardPriceModel guardPriceModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ import org.greenrobot.eventbus.ThreadMode;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
//游戏弹窗
|
||||||
public class LiveNewRolePopup extends BottomPopupView {
|
public class LiveNewRolePopup extends BottomPopupView {
|
||||||
private boolean showRed = false;
|
private boolean showRed = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.yunbao.common.dialog;
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
@@ -9,12 +13,21 @@ import com.lxj.xpopup.XPopup;
|
|||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.activity.WebViewActivity;
|
import com.yunbao.common.activity.WebViewActivity;
|
||||||
import com.yunbao.common.bean.OpenAdModel;
|
import com.yunbao.common.bean.OpenAdModel;
|
||||||
|
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.utils.DpUtil;
|
||||||
|
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||||
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||||
private ImageView mImageView;
|
|
||||||
private ImageView mClose;
|
private ImageView mClose;
|
||||||
|
private LinearLayout contentLayout;
|
||||||
private OpenAdModel model;
|
private OpenAdModel model;
|
||||||
private OnItemClickListener<OpenAdModel> mListener;
|
private OnItemClickListener<OpenAdModel> mListener;
|
||||||
|
|
||||||
@@ -27,6 +40,11 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
|||||||
@Override
|
@Override
|
||||||
public void buildDialog(XPopup.Builder builder) {
|
public void buildDialog(XPopup.Builder builder) {
|
||||||
builder.animationDuration(0);
|
builder.animationDuration(0);
|
||||||
|
builder.hasShadowBg(true);
|
||||||
|
if(model.getPopupSort()==2){
|
||||||
|
builder.dismissOnTouchOutside(false);
|
||||||
|
builder.dismissOnBackPressed(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -51,8 +69,63 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate() {
|
protected void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
mImageView = findViewById(R.id.img);
|
contentLayout = findViewById(R.id.content_layout);
|
||||||
mClose = findViewById(R.id.close);
|
mClose = findViewById(R.id.close);
|
||||||
|
if (model.getPopupSort() == 1) {
|
||||||
|
setImage();
|
||||||
|
} else {
|
||||||
|
setWeb();
|
||||||
|
}
|
||||||
|
|
||||||
|
mClose.setOnClickListener(v -> dismiss());
|
||||||
|
if (model.getShowTime() > 0) {
|
||||||
|
mClose.postDelayed(this::dismiss, model.getShowTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWeb() {
|
||||||
|
WebView mWebView = new WebView(mContext);
|
||||||
|
mWebView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
|
||||||
|
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext((Activity) mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
|
||||||
|
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||||
|
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||||
|
mWebView.getSettings().setDomStorageEnabled(true);
|
||||||
|
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||||
|
// mWebView.getSettings().setAppCachePath(appCachePath);
|
||||||
|
mWebView.getSettings().setAllowFileAccess(true);
|
||||||
|
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||||
|
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||||
|
mWebView.setHorizontalScrollBarEnabled(false);
|
||||||
|
mWebView.setVerticalScrollBarEnabled(false);
|
||||||
|
mWebView.setWebViewClient(new WebViewClient() {
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
|
L.e("H5-------->" + url);
|
||||||
|
view.loadUrl(url);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageFinished(WebView view, String url) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
String url=model.getUrl();
|
||||||
|
if(url.contains("?")){
|
||||||
|
url+="&uid="+ IMLoginManager.get(mContext).getUserInfo().getId()+"&token="+IMLoginManager.get(mContext).getUserInfo().getToken();
|
||||||
|
}else{
|
||||||
|
url+="?uid="+ IMLoginManager.get(mContext).getUserInfo().getId()+"&token="+IMLoginManager.get(mContext).getUserInfo().getToken();
|
||||||
|
}
|
||||||
|
mWebView.loadUrl(url);
|
||||||
|
contentLayout.addView(mWebView);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setImage() {
|
||||||
|
int width = ScreenDimenUtil.getInstance().getScreenWdith();
|
||||||
|
int height = (int) (width * 1.4);
|
||||||
|
|
||||||
|
ImageView mImageView = new ImageView(mContext);
|
||||||
|
mImageView.setLayoutParams(new LinearLayout.LayoutParams(width, height));
|
||||||
mImageView.setOnClickListener(v -> {
|
mImageView.setOnClickListener(v -> {
|
||||||
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
|
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
@@ -61,10 +134,12 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
|||||||
}
|
}
|
||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
mClose.setOnClickListener(v -> dismiss());
|
|
||||||
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
||||||
if (model.getShowTime() > 0) {
|
contentLayout.addView(mImageView);
|
||||||
mClose.postDelayed(this::dismiss, model.getShowTime());
|
}
|
||||||
}
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,44 @@
|
|||||||
package com.yunbao.common.dialog;
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.ViewTreeObserver;
|
||||||
|
import android.view.WindowInsets;
|
||||||
|
import android.webkit.WebResourceRequest;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
||||||
|
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lzf.easyfloat.enums.ShowPattern;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.activity.WebViewActivity;
|
import com.yunbao.common.activity.WebViewActivity;
|
||||||
import com.yunbao.common.bean.OpenAdModel;
|
import com.yunbao.common.bean.OpenAdModel;
|
||||||
|
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.DpUtil;
|
import com.yunbao.common.utils.DpUtil;
|
||||||
|
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||||
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||||
private ImageView mImageView;
|
private ImageView mImageView;
|
||||||
|
private LinearLayout contentLayout;
|
||||||
private ImageView mClose;
|
private ImageView mClose;
|
||||||
private OpenAdModel model;
|
private OpenAdModel model;
|
||||||
private OnItemClickListener<OpenAdModel> mListener;
|
private OnItemClickListener<OpenAdModel> mListener;
|
||||||
@@ -38,7 +59,8 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildDialog(XPopup.Builder builder) {
|
public void buildDialog(XPopup.Builder builder) {
|
||||||
builder.hasShadowBg(false);
|
builder.hasShadowBg(true);
|
||||||
|
builder.shadowBgColor(Color.parseColor("#80000000"));
|
||||||
builder.animationDuration(0);
|
builder.animationDuration(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,11 +82,107 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate() {
|
protected void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
Log.e("-----弹窗-----", "onCreate: 创建弹窗" );
|
Log.e("-----弹窗-----", "onCreate: 创建弹窗");
|
||||||
mImageView = findViewById(R.id.img);
|
contentLayout = findViewById(R.id.content_layout);
|
||||||
mClose = findViewById(R.id.close);
|
mClose = findViewById(R.id.close);
|
||||||
findViewById(R.id.layout).setOnClickListener(v -> dismiss());
|
|
||||||
|
|
||||||
|
contentLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
|
boolean isShow = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGlobalLayout() {
|
||||||
|
if (isShow)
|
||||||
|
return;
|
||||||
|
isShow = true;
|
||||||
|
int width = contentLayout.getWidth() - DpUtil.dp2px(20);
|
||||||
|
int height = (int) (width * 1.5);
|
||||||
|
if (model.getModel() == OpenAdModel.MODEL_SQUARE) {
|
||||||
|
height = (int) (width * 1.2);
|
||||||
|
}
|
||||||
|
Log.i("-----弹窗-----", "高度:" + height + " 宽度:" + width + " 屏幕宽度: " + ScreenDimenUtil.getInstance().getScreenWdith());
|
||||||
|
/*DebugDialog.getInstance(new DebugDialog.DebugDialogRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run(DebugDialog dialog) {
|
||||||
|
dialog.setShowPattern(ShowPattern.ALL_TIME);
|
||||||
|
dialog.show();
|
||||||
|
int width = contentLayout.getWidth() - DpUtil.dp2px(10);
|
||||||
|
int height = (int) (width * 1.5);
|
||||||
|
if (model.getModel() == OpenAdModel.MODEL_SQUARE) {
|
||||||
|
height = (int) (width * 1.2);
|
||||||
|
}
|
||||||
|
Log.i("-----弹窗-----", "弹框debug高宽 高度:" + height + " 宽度:" + width);
|
||||||
|
dialog.setParams(model.getName() + "弹框高宽", "高度:" + height + " 宽度:" + width);
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
if (model.getPopupSort() == 1) {
|
||||||
|
setImage(model, width, height);
|
||||||
|
findViewById(R.id.layout).setOnClickListener(v -> dismiss());
|
||||||
|
} else {
|
||||||
|
setWeb(model, width, height);
|
||||||
|
}
|
||||||
|
mClose.setOnClickListener(v -> dismiss());
|
||||||
|
if (model.getShowTime() > 0) {
|
||||||
|
mClose.postDelayed(OpenAdCenterDialogPopup.this::dismiss, model.getShowTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWeb(OpenAdModel model, int width, int height) {
|
||||||
|
WebView mWebView = new WebView(mContext);
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width, height);
|
||||||
|
params.gravity = Gravity.CENTER;
|
||||||
|
mWebView.setLayoutParams(params);
|
||||||
|
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext((Activity) mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
|
||||||
|
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||||
|
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||||
|
mWebView.getSettings().setDomStorageEnabled(true);
|
||||||
|
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||||
|
// mWebView.getSettings().setAppCachePath(appCachePath);
|
||||||
|
mWebView.getSettings().setAllowFileAccess(true);
|
||||||
|
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||||
|
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||||
|
mWebView.setHorizontalScrollBarEnabled(false);
|
||||||
|
mWebView.setVerticalScrollBarEnabled(false);
|
||||||
|
mWebView.setWebViewClient(new WebViewClient() {
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
|
L.e("H5-------->" + url);
|
||||||
|
view.loadUrl(url);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPageFinished(WebView view, String url) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
String url = model.getUrl();
|
||||||
|
if (url.contains("?")) {
|
||||||
|
url += "&uid=" + IMLoginManager.get(mContext).getUserInfo().getId() + "&token=" + IMLoginManager.get(mContext).getUserInfo().getToken();
|
||||||
|
} else {
|
||||||
|
url += "?uid=" + IMLoginManager.get(mContext).getUserInfo().getId() + "&token=" + IMLoginManager.get(mContext).getUserInfo().getToken();
|
||||||
|
}
|
||||||
|
Log.i("-----弹窗-----", "setWeb: " + url);
|
||||||
|
mWebView.loadUrl(url);
|
||||||
|
contentLayout.addView(mWebView);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setImage(OpenAdModel model, int width, int height) {
|
||||||
|
mImageView = new ImageView(mContext);
|
||||||
|
mImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width, height);
|
||||||
|
params.gravity = Gravity.CENTER;
|
||||||
|
mImageView.setLayoutParams(params);
|
||||||
|
|
||||||
mImageView.setOnClickListener(v -> {
|
mImageView.setOnClickListener(v -> {
|
||||||
|
if ("home_page_banner_battle".equals(model.getOriginalUrl())) {
|
||||||
|
RouteUtil.forwardBattlePass();
|
||||||
|
dismiss();
|
||||||
|
return;
|
||||||
|
}
|
||||||
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
|
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.onItemClick(model, 1);
|
mListener.onItemClick(model, 1);
|
||||||
@@ -72,19 +190,12 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
|||||||
}
|
}
|
||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
mClose.setOnClickListener(v -> dismiss());
|
|
||||||
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
||||||
int width = ScreenDimenUtil.getInstance().getScreenWdith() - DpUtil.dp2px(40);
|
contentLayout.addView(mImageView);
|
||||||
int height = (int) (width * 1.4);
|
}
|
||||||
if (model.getModel() == OpenAdModel.MODEL_SQUARE) {
|
|
||||||
height = width;
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
}
|
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) mImageView.getLayoutParams();
|
|
||||||
params.width = width;
|
|
||||||
params.height = height;
|
|
||||||
mImageView.setLayoutParams(params);
|
|
||||||
if (model.getShowTime() > 0) {
|
|
||||||
mClose.postDelayed(this::dismiss, model.getShowTime());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.yunbao.common.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
public class SkitCheckInWasSuccessfulPopup extends CenterPopupView {
|
||||||
|
public SkitCheckInWasSuccessfulPopup(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getImplLayoutId() {
|
||||||
|
return R.layout.skit_check_in_was_successful_popup;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.icon_slice_368), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onViewClicks() {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.yunbao.common.dialog;
|
|||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.animation.LinearInterpolator;
|
import android.view.animation.LinearInterpolator;
|
||||||
@@ -275,6 +276,29 @@ public class SudGameListPopup extends BottomPopupView {
|
|||||||
.asCustom(new LiveSudGameHistoryPopup(getContext(), customSidebarChildModels)).show();
|
.asCustom(new LiveSudGameHistoryPopup(getContext(), customSidebarChildModels)).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (interactionID == 0) {
|
||||||
|
gameTitle.setTextColor(getDefColor());
|
||||||
|
} else {
|
||||||
|
gameTitle.setTextColor(getYellowColor());
|
||||||
|
}
|
||||||
|
if (mSill.equals("0,0,0")) {
|
||||||
|
sillTitle.setTextColor(getDefColor());
|
||||||
|
} else {
|
||||||
|
sillTitle.setTextColor(getYellowColor());
|
||||||
|
}
|
||||||
|
if ("0".equals(roomHolderType)) {
|
||||||
|
houseOwnerTitle.setTextColor(getDefColor());
|
||||||
|
} else {
|
||||||
|
houseOwnerTitle.setTextColor(getYellowColor());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getYellowColor() {
|
||||||
|
return Color.parseColor("#FF8D41");
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getDefColor() {
|
||||||
|
return Color.WHITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -293,6 +317,11 @@ public class SudGameListPopup extends BottomPopupView {
|
|||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onSudGameListEvent(SudGameListEvent event) {
|
public void onSudGameListEvent(SudGameListEvent event) {
|
||||||
interactionID = event.getInteractionID();
|
interactionID = event.getInteractionID();
|
||||||
|
if (interactionID == 0) {
|
||||||
|
gameTitle.setTextColor(getDefColor());
|
||||||
|
} else {
|
||||||
|
gameTitle.setTextColor(getYellowColor());
|
||||||
|
}
|
||||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||||
gameTitle.setText(event.getTitle());
|
gameTitle.setText(event.getTitle());
|
||||||
} else {
|
} else {
|
||||||
@@ -325,7 +354,11 @@ public class SudGameListPopup extends BottomPopupView {
|
|||||||
} else {
|
} else {
|
||||||
sillTitle.setText(mSillName.substring(0, mSillName.length() - 2));
|
sillTitle.setText(mSillName.substring(0, mSillName.length() - 2));
|
||||||
}
|
}
|
||||||
|
if (mSill.equals("0,0,0")) {
|
||||||
|
sillTitle.setTextColor(getDefColor());
|
||||||
|
} else {
|
||||||
|
sillTitle.setTextColor(getYellowColor());
|
||||||
|
}
|
||||||
|
|
||||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomSillArrow, "rotation", 90f, 0f);
|
ObjectAnimator animator = ObjectAnimator.ofFloat(roomSillArrow, "rotation", 90f, 0f);
|
||||||
animator.setDuration(500);
|
animator.setDuration(500);
|
||||||
@@ -344,6 +377,11 @@ public class SudGameListPopup extends BottomPopupView {
|
|||||||
animator.setInterpolator(new LinearInterpolator());
|
animator.setInterpolator(new LinearInterpolator());
|
||||||
animator.start();
|
animator.start();
|
||||||
mRefreshView.initData();
|
mRefreshView.initData();
|
||||||
|
if ("0".equals(roomHolderType)) {
|
||||||
|
houseOwnerTitle.setTextColor(getDefColor());
|
||||||
|
} else {
|
||||||
|
houseOwnerTitle.setTextColor(getYellowColor());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import com.yunbao.common.event.LiveSudGameHistoryEvent;
|
|||||||
import com.yunbao.common.event.RoomHolderTypeEvent;
|
import com.yunbao.common.event.RoomHolderTypeEvent;
|
||||||
import com.yunbao.common.event.SudGameListEvent;
|
import com.yunbao.common.event.SudGameListEvent;
|
||||||
import com.yunbao.common.event.SudGameListSillEvent;
|
import com.yunbao.common.event.SudGameListSillEvent;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
@@ -87,6 +88,11 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
|||||||
if (mType == 0 || mType == 4) {
|
if (mType == 0 || mType == 4) {
|
||||||
topSelect.setText(getContext().getString(R.string.interactive_game_room_all));
|
topSelect.setText(getContext().getString(R.string.interactive_game_room_all));
|
||||||
for (int i = 0; i < customSidebarChildModels.size(); i++) {
|
for (int i = 0; i < customSidebarChildModels.size(); i++) {
|
||||||
|
/* if (!IMLoginManager.get(getContext()).getUserInfo().anchorUserType()) {
|
||||||
|
if ("1490944230389182466".equals(customSidebarChildModels.get(i).getSrc())) {//友尽闯关
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
selectString.add(customSidebarChildModels.get(i).getTitle());
|
selectString.add(customSidebarChildModels.get(i).getTitle());
|
||||||
if (TextUtils.equals(String.valueOf(interactionID), customSidebarChildModels.get(i).getSrc())) {
|
if (TextUtils.equals(String.valueOf(interactionID), customSidebarChildModels.get(i).getSrc())) {
|
||||||
index = i;
|
index = i;
|
||||||
|
|||||||
@@ -0,0 +1,227 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class AllServerNotifyFFGGGDJANEvent extends BaseModel {
|
||||||
|
|
||||||
|
@SerializedName("_method_")
|
||||||
|
private String method;
|
||||||
|
@SerializedName("action")
|
||||||
|
private String action;
|
||||||
|
@SerializedName("msg_cn")
|
||||||
|
private String msgCn;
|
||||||
|
@SerializedName("msg_en")
|
||||||
|
private String msgEn;
|
||||||
|
@SerializedName("uid")
|
||||||
|
private String uid;
|
||||||
|
@SerializedName("liveuid")
|
||||||
|
private String liveuid;
|
||||||
|
@SerializedName("background_image")
|
||||||
|
private String backgroundImage;
|
||||||
|
@SerializedName("style")
|
||||||
|
private List<StyleDTO> style;
|
||||||
|
@SerializedName("jump_type")
|
||||||
|
private String jumpType;
|
||||||
|
@SerializedName("link")
|
||||||
|
private String link;
|
||||||
|
@SerializedName("button_image")
|
||||||
|
private String buttonImage;
|
||||||
|
@SerializedName("button_msg_cn")
|
||||||
|
private String buttonMsgCn;
|
||||||
|
@SerializedName("button_msg_en")
|
||||||
|
private String buttonMsgEn;
|
||||||
|
@SerializedName("button_style")
|
||||||
|
private List<ButtonStyleDTO> buttonStyle;
|
||||||
|
@SerializedName("h5_type")
|
||||||
|
private String h5Type;
|
||||||
|
|
||||||
|
public String getH5Type() {
|
||||||
|
return h5Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AllServerNotifyFFGGGDJANEvent setH5Type(String h5Type) {
|
||||||
|
this.h5Type = h5Type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMethod() {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMethod(String method) {
|
||||||
|
this.method = method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAction() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAction(String action) {
|
||||||
|
this.action = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsgCn() {
|
||||||
|
return msgCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsgCn(String msgCn) {
|
||||||
|
this.msgCn = msgCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsgEn() {
|
||||||
|
return msgEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsgEn(String msgEn) {
|
||||||
|
this.msgEn = msgEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveuid() {
|
||||||
|
return liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveuid(String liveuid) {
|
||||||
|
this.liveuid = liveuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBackgroundImage() {
|
||||||
|
return backgroundImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackgroundImage(String backgroundImage) {
|
||||||
|
this.backgroundImage = backgroundImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StyleDTO> getStyle() {
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStyle(List<StyleDTO> style) {
|
||||||
|
this.style = style;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJumpType() {
|
||||||
|
return jumpType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJumpType(String jumpType) {
|
||||||
|
this.jumpType = jumpType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLink() {
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLink(String link) {
|
||||||
|
this.link = link;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getButtonImage() {
|
||||||
|
return buttonImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setButtonImage(String buttonImage) {
|
||||||
|
this.buttonImage = buttonImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getButtonMsgCn() {
|
||||||
|
return buttonMsgCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setButtonMsgCn(String buttonMsgCn) {
|
||||||
|
this.buttonMsgCn = buttonMsgCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getButtonMsgEn() {
|
||||||
|
return buttonMsgEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setButtonMsgEn(String buttonMsgEn) {
|
||||||
|
this.buttonMsgEn = buttonMsgEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ButtonStyleDTO> getButtonStyle() {
|
||||||
|
return buttonStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setButtonStyle(List<ButtonStyleDTO> buttonStyle) {
|
||||||
|
this.buttonStyle = buttonStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class StyleDTO {
|
||||||
|
@SerializedName("str_cn")
|
||||||
|
private String strCn;
|
||||||
|
@SerializedName("str_en")
|
||||||
|
private String strEn;
|
||||||
|
@SerializedName("colour")
|
||||||
|
private String colour;
|
||||||
|
|
||||||
|
public String getStrCn() {
|
||||||
|
return strCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStrCn(String strCn) {
|
||||||
|
this.strCn = strCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStrEn() {
|
||||||
|
return strEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStrEn(String strEn) {
|
||||||
|
this.strEn = strEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColour() {
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColour(String colour) {
|
||||||
|
this.colour = colour;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ButtonStyleDTO {
|
||||||
|
@SerializedName("str_cn")
|
||||||
|
private String strCn;
|
||||||
|
@SerializedName("str_en")
|
||||||
|
private String strEn;
|
||||||
|
@SerializedName("colour")
|
||||||
|
private String colour;
|
||||||
|
|
||||||
|
public String getStrCn() {
|
||||||
|
return strCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStrCn(String strCn) {
|
||||||
|
this.strCn = strCn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStrEn() {
|
||||||
|
return strEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStrEn(String strEn) {
|
||||||
|
this.strEn = strEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColour() {
|
||||||
|
return colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColour(String colour) {
|
||||||
|
this.colour = colour;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
class DragonSendsMoneyEvent extends BaseModel {
|
||||||
|
}
|
||||||
@@ -115,6 +115,36 @@ public class SendBlindGiftEvent extends BaseModel {
|
|||||||
private String liveGiftNotify;
|
private String liveGiftNotify;
|
||||||
@SerializedName("userNiceName")
|
@SerializedName("userNiceName")
|
||||||
private String userNiceName;
|
private String userNiceName;
|
||||||
|
@SerializedName("special_gift")
|
||||||
|
private int specialGift;
|
||||||
|
@SerializedName("special_gift_name")
|
||||||
|
private String specialGiftName;
|
||||||
|
@SerializedName("special_gift_name_en")
|
||||||
|
private String specialGiftNameEn;
|
||||||
|
|
||||||
|
public int getSpecialGift() {
|
||||||
|
return specialGift;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpecialGift(int specialGift) {
|
||||||
|
this.specialGift = specialGift;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpecialGiftName() {
|
||||||
|
return specialGiftName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpecialGiftName(String specialGiftName) {
|
||||||
|
this.specialGiftName = specialGiftName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpecialGiftNameEn() {
|
||||||
|
return specialGiftNameEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpecialGiftNameEn(String specialGiftNameEn) {
|
||||||
|
this.specialGiftNameEn = specialGiftNameEn;
|
||||||
|
}
|
||||||
|
|
||||||
public String getUserNiceName() {
|
public String getUserNiceName() {
|
||||||
return userNiceName;
|
return userNiceName;
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
|
||||||
|
public class SendMoneyLongEndEvent extends BaseModel {
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
|
||||||
|
public class SubGameEvent {
|
||||||
|
int type;
|
||||||
|
HttpCallbackModel model;
|
||||||
|
String dataJson;
|
||||||
|
|
||||||
|
public SubGameEvent(int type, HttpCallbackModel model, String dataJson) {
|
||||||
|
this.type = type;
|
||||||
|
this.model = model;
|
||||||
|
this.dataJson = dataJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HttpCallbackModel getModel() {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModel(HttpCallbackModel model) {
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataJson() {
|
||||||
|
return dataJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SubGameEvent{" +
|
||||||
|
"type=" + type +
|
||||||
|
", model=" + model +
|
||||||
|
", dataJson='" + dataJson + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -53,6 +53,15 @@ public class SudGameSocketImEvent extends BaseModel {
|
|||||||
private String method;
|
private String method;
|
||||||
@SerializedName("equipment")
|
@SerializedName("equipment")
|
||||||
private String equipment;
|
private String equipment;
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAction() {
|
public String getAction() {
|
||||||
return action;
|
return action;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import java.util.Locale;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class CommonHttpUtil {
|
public class CommonHttpUtil {
|
||||||
|
public static final String GET_UPLOAD_QI_NIU_TOKEN = "getUploadQiNiuToken";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化
|
* 初始化
|
||||||
@@ -208,6 +208,10 @@ public class CommonHttpUtil {
|
|||||||
JSONArray levelArray = obj.getJSONArray("liveclass");
|
JSONArray levelArray = obj.getJSONArray("liveclass");
|
||||||
new LiveClassManager(context).UpDataLiveClass(levelArray.toJSONString());
|
new LiveClassManager(context).UpDataLiveClass(levelArray.toJSONString());
|
||||||
}
|
}
|
||||||
|
if (obj.containsKey("guard_type")) {
|
||||||
|
JSONArray levelArray = obj.getJSONArray("guard_type");
|
||||||
|
new NewLevelManager(context).upDataGuardLevel(levelArray.toJSONString());
|
||||||
|
}
|
||||||
if (obj.containsKey("apk_ver")) {
|
if (obj.containsKey("apk_ver")) {
|
||||||
APKManager.get().setApkVer(obj.getString("apk_ver"));
|
APKManager.get().setApkVer(obj.getString("apk_ver"));
|
||||||
}
|
}
|
||||||
@@ -446,6 +450,16 @@ public class CommonHttpUtil {
|
|||||||
public static void getUserBaseinfo(String touid, HttpCallback callback) {
|
public static void getUserBaseinfo(String touid, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO).params("touid", touid).execute(callback);
|
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO).params("touid", touid).execute(callback);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 上传文件 获取七牛云token的接口
|
||||||
|
*/
|
||||||
|
public static void getUploadQiNiuToken(HttpCallback callback, boolean isImg) {
|
||||||
|
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken2", "Pdluserhome.getQiNiuToken2")
|
||||||
|
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||||
|
.params("token", CommonAppConfig.getInstance().getToken())
|
||||||
|
.params("ext", isImg ? ".jpeg" : ".mp4")
|
||||||
|
.execute(callback);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// //埋点唯一性
|
// //埋点唯一性
|
||||||
// public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
// public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
||||||
|
|||||||
@@ -764,7 +764,7 @@ public class LiveHttpUtil {
|
|||||||
* @param file 封面图片文件
|
* @param file 封面图片文件
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public static void newcreateRoom(String title, int liveClassId, int type, int typeVal, File file, int clarityType, HttpCallback callback) {
|
public static void newcreateRoom(String title, int liveClassId, int type, int typeVal, File file, int clarityType,boolean isSw, HttpCallback callback) {
|
||||||
|
|
||||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.createRoom2", LiveHttpConsts.CREATE_ROOM)
|
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.createRoom2", LiveHttpConsts.CREATE_ROOM)
|
||||||
.params("title", title)
|
.params("title", title)
|
||||||
@@ -773,6 +773,7 @@ public class LiveHttpUtil {
|
|||||||
.params("landscape", "2")
|
.params("landscape", "2")
|
||||||
.params("class_type", "0")
|
.params("class_type", "0")
|
||||||
.params("type_val", typeVal)
|
.params("type_val", typeVal)
|
||||||
|
.params("is_shengwang",isSw?1:0)
|
||||||
.params("clarityType", clarityType);
|
.params("clarityType", clarityType);
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
request.params("file", file);
|
request.params("file", file);
|
||||||
@@ -817,6 +818,15 @@ public class LiveHttpUtil {
|
|||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取是否是声网开播
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
public static void getIsSw(HttpCallback callback) {
|
||||||
|
HttpClient.getInstance().get("Tx.setRtcFirm", "Tx.setRtcFirm")
|
||||||
|
.execute(callback);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 腾讯sdk 跟主播连麦时,获取主播的低延时流
|
* 腾讯sdk 跟主播连麦时,获取主播的低延时流
|
||||||
*/
|
*/
|
||||||
@@ -906,7 +916,11 @@ public class LiveHttpUtil {
|
|||||||
.params("anchorUid", anchor_id)
|
.params("anchorUid", anchor_id)
|
||||||
.execute(callback);
|
.execute(callback);
|
||||||
}
|
}
|
||||||
|
public static void getAnchorActiveImgStatus(String anchor_id, HttpCallback callback) {
|
||||||
|
HttpClient.getInstance().get("Live.getAnchorActiveImgStatus", LiveHttpConsts.GET_EVENT)
|
||||||
|
.params("anchorUid", anchor_id)
|
||||||
|
.execute(callback);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 重置活动
|
* 重置活动
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
|
import com.yunbao.common.bean.AvatarBean;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
import com.yunbao.common.bean.BattlePassPoints;
|
import com.yunbao.common.bean.BattlePassPoints;
|
||||||
import com.yunbao.common.bean.BattlePassTask;
|
import com.yunbao.common.bean.BattlePassTask;
|
||||||
@@ -11,6 +12,7 @@ import com.yunbao.common.bean.BattlePassUserInfoBean;
|
|||||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||||
import com.yunbao.common.bean.CheckLiveModel;
|
import com.yunbao.common.bean.CheckLiveModel;
|
||||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||||
|
import com.yunbao.common.bean.CheckUpgradesModel;
|
||||||
import com.yunbao.common.bean.ContributeModel;
|
import com.yunbao.common.bean.ContributeModel;
|
||||||
import com.yunbao.common.bean.CoolConfig;
|
import com.yunbao.common.bean.CoolConfig;
|
||||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
@@ -26,6 +28,8 @@ import com.yunbao.common.bean.GiftGuideModel;
|
|||||||
import com.yunbao.common.bean.GiftNamingInfoModel;
|
import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||||
import com.yunbao.common.bean.GiftWallGiftDetail;
|
import com.yunbao.common.bean.GiftWallGiftDetail;
|
||||||
import com.yunbao.common.bean.GiftWallModel;
|
import com.yunbao.common.bean.GiftWallModel;
|
||||||
|
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
|
||||||
|
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
|
||||||
import com.yunbao.common.bean.HourRank;
|
import com.yunbao.common.bean.HourRank;
|
||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
@@ -60,27 +64,33 @@ import com.yunbao.common.bean.RedPacketInfoModel;
|
|||||||
import com.yunbao.common.bean.RedPacketListBean;
|
import com.yunbao.common.bean.RedPacketListBean;
|
||||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||||
import com.yunbao.common.bean.SearchModel;
|
import com.yunbao.common.bean.SearchModel;
|
||||||
|
import com.yunbao.common.bean.SendMoneyLongModel;
|
||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.bean.SlideInBannerModel;
|
import com.yunbao.common.bean.SlideInBannerModel;
|
||||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||||
import com.yunbao.common.bean.SudGameUserModel;
|
import com.yunbao.common.bean.SudGameUserModel;
|
||||||
import com.yunbao.common.bean.SudRoomListModel;
|
import com.yunbao.common.bean.SudRoomListModel;
|
||||||
import com.yunbao.common.bean.SudgameCodeModel;
|
import com.yunbao.common.bean.SudgameCodeModel;
|
||||||
|
import com.yunbao.common.bean.SwTokenModel;
|
||||||
import com.yunbao.common.bean.UserAreaBean;
|
import com.yunbao.common.bean.UserAreaBean;
|
||||||
import com.yunbao.common.bean.UserAvatarSelectBean;
|
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||||
import com.yunbao.common.bean.VipModel;
|
import com.yunbao.common.bean.VipModel;
|
||||||
import com.yunbao.common.bean.WishListGiftConfModel;
|
import com.yunbao.common.bean.WishListGiftConfModel;
|
||||||
import com.yunbao.common.bean.WishListModel;
|
import com.yunbao.common.bean.WishListModel;
|
||||||
|
import com.yunbao.common.bean.sendMoneyLongListModel;
|
||||||
import com.yunbao.common.event.CheckCurrencyModel;
|
import com.yunbao.common.event.CheckCurrencyModel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Multipart;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Part;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
import retrofit2.http.QueryMap;
|
import retrofit2.http.QueryMap;
|
||||||
|
|
||||||
@@ -105,7 +115,8 @@ public interface PDLiveApi {
|
|||||||
@Field("user_pass") String passWord,
|
@Field("user_pass") String passWord,
|
||||||
@Field("uuid_Device") String uuidDevice,
|
@Field("uuid_Device") String uuidDevice,
|
||||||
@Field("pushid") String pushid,
|
@Field("pushid") String pushid,
|
||||||
@Field("lastlogindevice") String lastlogindevice
|
@Field("lastlogindevice") String lastlogindevice,
|
||||||
|
@Field("langue") String langue
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -205,7 +216,7 @@ public interface PDLiveApi {
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关注主播
|
* 关注主播···································································
|
||||||
*
|
*
|
||||||
* @param liveuid
|
* @param liveuid
|
||||||
* @return
|
* @return
|
||||||
@@ -1162,4 +1173,66 @@ public interface PDLiveApi {
|
|||||||
|
|
||||||
@GET("/api/public/?service=Sudgameserver.getRoomMicStatus")
|
@GET("/api/public/?service=Sudgameserver.getRoomMicStatus")
|
||||||
Observable<ResponseModel<RoomMicStatusModel>> getRoomMicStatus();
|
Observable<ResponseModel<RoomMicStatusModel>> getRoomMicStatus();
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Guard.getGuardUserInfo")
|
||||||
|
Observable<ResponseModel<GuardGetGuardUserInfoModel>> getGuardUserInfo(@Query("liveuid") String liveUid);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Guard.getGuardOpenInfo")
|
||||||
|
Observable<ResponseModel<GuardGetGuardOpenInfoModel>> getGuardOpenInfo(@Query("liveuid") String liveUid);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Guard.openGuard")
|
||||||
|
Observable<ResponseModel<Object>> openGuard(@Query("liveuid") String liveUid, @Query("guard_type") String guardType, @Query("price_key") String priceKey, @Query("stream") String stream);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Guard.sendMoneyLong")
|
||||||
|
Observable<ResponseModel<Object>> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Guard.sendMoneyLongList")
|
||||||
|
Observable<ResponseModel<List<sendMoneyLongListModel>>> sendMoneyLongList(@Query("liveuid") String liveUid);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Guard.participateMoneyLong")
|
||||||
|
Observable<ResponseModel<String>> participateMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Guard.endSendMoneyLong")
|
||||||
|
Observable<ResponseModel<SendMoneyLongModel>> endSendMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Guard.checkUpgrades")
|
||||||
|
Observable<ResponseModel<CheckUpgradesModel>> checkUpgrades(@Query("liveuid") String liveUid);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=Guard.getRewards")
|
||||||
|
Observable<ResponseModel<Object>> guardGetRewards(@Query("guard_level") String guardLevel, @Query("liveuid") String liveUid);
|
||||||
|
|
||||||
|
@Multipart
|
||||||
|
@POST("/api/public/?service=Pdlinfos.updateAvatar")
|
||||||
|
Observable<ResponseModel<AvatarBean>> updateFile(@Part MultipartBody.Part file, @Query("uid") String uid, @Query("token") String token);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=User.userFeedback")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> feedback(@Query("problem_description") String content, @Query("problem_image") String images, @Query("contact_information") String ci);
|
||||||
|
|
||||||
|
|
||||||
|
@GET("/api/public/?service=User.userFeedbackRestrict")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> checkFeedback();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param roomId 房间ID
|
||||||
|
* @param cmd 事件名称 生命值:addHeart 自动跳:hit
|
||||||
|
* @param value 价格
|
||||||
|
* @param gameId 游戏ID
|
||||||
|
* @param fromUid 付费用户uid
|
||||||
|
* @param toUid 目标用户uid
|
||||||
|
* @param payload 附加值
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("/api/public/?service=Sudgameserver.createOrder")
|
||||||
|
Observable<ResponseModel<List<BaseModel>>> createGameOrder(
|
||||||
|
@Query("room_id")String roomId,
|
||||||
|
@Query("cmd")String cmd,
|
||||||
|
@Query("value")String value,
|
||||||
|
@Query("mg_id")String gameId,
|
||||||
|
@Query("from_uid")String fromUid,
|
||||||
|
@Query("to_uid")String toUid,
|
||||||
|
@Query("payload")String payload
|
||||||
|
);
|
||||||
|
@GET("/api/public/?service=Tx.getShengwangToken")
|
||||||
|
Observable<ResponseModel<SwTokenModel>> getSwToken();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,12 @@ import android.content.Context;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
|
import com.yunbao.common.bean.AvatarBean;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
import com.yunbao.common.bean.BattlePassPoints;
|
import com.yunbao.common.bean.BattlePassPoints;
|
||||||
import com.yunbao.common.bean.BattlePassTask;
|
import com.yunbao.common.bean.BattlePassTask;
|
||||||
@@ -14,6 +17,7 @@ import com.yunbao.common.bean.BattlePassUserInfoBean;
|
|||||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||||
import com.yunbao.common.bean.CheckLiveModel;
|
import com.yunbao.common.bean.CheckLiveModel;
|
||||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||||
|
import com.yunbao.common.bean.CheckUpgradesModel;
|
||||||
import com.yunbao.common.bean.CoolConfig;
|
import com.yunbao.common.bean.CoolConfig;
|
||||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||||
@@ -27,6 +31,8 @@ import com.yunbao.common.bean.GiftGuideModel;
|
|||||||
import com.yunbao.common.bean.GiftNamingInfoModel;
|
import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||||
import com.yunbao.common.bean.GiftWallGiftDetail;
|
import com.yunbao.common.bean.GiftWallGiftDetail;
|
||||||
import com.yunbao.common.bean.GiftWallModel;
|
import com.yunbao.common.bean.GiftWallModel;
|
||||||
|
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
|
||||||
|
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
|
||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.bean.LinkMicUserBean;
|
import com.yunbao.common.bean.LinkMicUserBean;
|
||||||
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||||
@@ -57,16 +63,19 @@ import com.yunbao.common.bean.RedPacketGiftModel;
|
|||||||
import com.yunbao.common.bean.RedPacketInfoModel;
|
import com.yunbao.common.bean.RedPacketInfoModel;
|
||||||
import com.yunbao.common.bean.RedPacketListBean;
|
import com.yunbao.common.bean.RedPacketListBean;
|
||||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||||
|
import com.yunbao.common.bean.SendMoneyLongModel;
|
||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||||
import com.yunbao.common.bean.SudGameUserModel;
|
import com.yunbao.common.bean.SudGameUserModel;
|
||||||
import com.yunbao.common.bean.SudRoomListModel;
|
import com.yunbao.common.bean.SudRoomListModel;
|
||||||
import com.yunbao.common.bean.SudgameCodeModel;
|
import com.yunbao.common.bean.SudgameCodeModel;
|
||||||
|
import com.yunbao.common.bean.SwTokenModel;
|
||||||
import com.yunbao.common.bean.UserAreaBean;
|
import com.yunbao.common.bean.UserAreaBean;
|
||||||
import com.yunbao.common.bean.UserAvatarSelectBean;
|
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||||
import com.yunbao.common.bean.VipModel;
|
import com.yunbao.common.bean.VipModel;
|
||||||
import com.yunbao.common.bean.WishListGiftConfModel;
|
import com.yunbao.common.bean.WishListGiftConfModel;
|
||||||
import com.yunbao.common.bean.WishListModel;
|
import com.yunbao.common.bean.WishListModel;
|
||||||
|
import com.yunbao.common.bean.sendMoneyLongListModel;
|
||||||
import com.yunbao.common.event.CheckCurrencyModel;
|
import com.yunbao.common.event.CheckCurrencyModel;
|
||||||
import com.yunbao.common.http.API;
|
import com.yunbao.common.http.API;
|
||||||
import com.yunbao.common.http.ResponseModel;
|
import com.yunbao.common.http.ResponseModel;
|
||||||
@@ -74,6 +83,7 @@ import com.yunbao.common.http.base.CheckLiveCallBack;
|
|||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -83,6 +93,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
|||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import io.reactivex.functions.Consumer;
|
import io.reactivex.functions.Consumer;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2770,7 +2784,7 @@ public class LiveNetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addChatCount(String stream,HttpCallback<HttpCallbackModel> callback) {
|
public void addChatCount(String stream, HttpCallback<HttpCallbackModel> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.addChatCount(stream)
|
.addChatCount(stream)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@@ -2931,6 +2945,370 @@ public class LiveNetManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getGuardUserInfo(String liveUid, HttpCallback<GuardGetGuardUserInfoModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getGuardUserInfo(liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<GuardGetGuardUserInfoModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<GuardGetGuardUserInfoModel> guardGetGuardUserInfoModelResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(guardGetGuardUserInfoModelResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getGuardOpenInfo(String liveUid, HttpCallback<GuardGetGuardOpenInfoModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getGuardOpenInfo(liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<GuardGetGuardOpenInfoModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<GuardGetGuardOpenInfoModel> guardGetGuardOpenInfoModelResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(guardGetGuardOpenInfoModelResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void openGuard(String liveUid, String guardType, String priceKey, String stream, HttpCallback<String> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.openGuard(liveUid, guardType, priceKey, stream)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<Object> stringResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
if (stringResponseModel.getData().getCode() == 0) {
|
||||||
|
callback.onSuccess(stringResponseModel.getData().getMsg());
|
||||||
|
} else if (stringResponseModel.getData().getCode() == 1001) {
|
||||||
|
callback.onSuccess("22");
|
||||||
|
} else {
|
||||||
|
callback.onError(stringResponseModel.getData().getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendMoneyLongList(String liveUid, HttpCallback<List<sendMoneyLongListModel>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.sendMoneyLongList(liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<sendMoneyLongListModel>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<sendMoneyLongListModel>> stringResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(stringResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendMoneyLong(String liveUid, String goldNum, HttpCallback<String> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.sendMoneyLong(liveUid, goldNum)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<Object> stringResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(stringResponseModel.getData().getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void participateMoneyLong(String liveUid, String sendMoneyLongKey, HttpCallback<String> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.participateMoneyLong(liveUid, sendMoneyLongKey)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<String>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<String> stringResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(stringResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void endSendMoneyLong(String liveUid, String sendMoneyLongKey, HttpCallback<SendMoneyLongModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.endSendMoneyLong(liveUid, sendMoneyLongKey)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<SendMoneyLongModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<SendMoneyLongModel> stringResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(stringResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkUpgrades(String liveUid, HttpCallback<CheckUpgradesModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.checkUpgrades(liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<CheckUpgradesModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<CheckUpgradesModel> listResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void guardGetRewards(String guardLevel, String liveUid, HttpCallback<Object> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.guardGetRewards("0", liveUid)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<Object> listResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getSwToken( HttpCallback<SwTokenModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.getSwToken()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<SwTokenModel>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<SwTokenModel> listResponseModel) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateFile(File file, HttpCallback<AvatarBean> callback) {
|
||||||
|
MultipartBody.Part uploadFile = createUploadFile(file);
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.updateFile(uploadFile, CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<AvatarBean>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<AvatarBean> model) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(model.getData().getInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void feedback(
|
||||||
|
String content,
|
||||||
|
JSONArray images,
|
||||||
|
String ci
|
||||||
|
, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.feedback(content, images.toString(), ci)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
||||||
|
if (callback != null) {
|
||||||
|
HttpCallbackModel model = new HttpCallbackModel();
|
||||||
|
model.setCode(responseModel.getData().getCode());
|
||||||
|
model.setMsg(responseModel.getData().getMsg());
|
||||||
|
callback.onSuccess(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkFeedback(
|
||||||
|
HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.checkFeedback()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
||||||
|
if (callback != null) {
|
||||||
|
HttpCallbackModel model = new HttpCallbackModel();
|
||||||
|
model.setCode(responseModel.getData().getCode());
|
||||||
|
model.setMsg(responseModel.getData().getMsg());
|
||||||
|
callback.onSuccess(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createGameOrder(
|
||||||
|
String roomId,
|
||||||
|
String cmd,
|
||||||
|
String value,
|
||||||
|
String gameId,
|
||||||
|
String fromUid,
|
||||||
|
String toUid,
|
||||||
|
String roundId,
|
||||||
|
String payload
|
||||||
|
, HttpCallback<HttpCallbackModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.createGameOrder(roomId, cmd, value, gameId, fromUid, toUid,payload)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
||||||
|
if (callback != null) {
|
||||||
|
HttpCallbackModel model = new HttpCallbackModel();
|
||||||
|
model.setCode(responseModel.getData().getCode());
|
||||||
|
model.setMsg(responseModel.getData().getMsg());
|
||||||
|
callback.onSuccess(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
|
private MultipartBody.Part createUploadFile(File file) {
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
|
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 直播间取消网络请求
|
* 直播间取消网络请求
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.yunbao.common.http.API;
|
|||||||
import com.yunbao.common.http.ResponseData;
|
import com.yunbao.common.http.ResponseData;
|
||||||
import com.yunbao.common.http.ResponseModel;
|
import com.yunbao.common.http.ResponseModel;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -54,7 +55,7 @@ public class MainNetManager {
|
|||||||
* @param callback 网络请求回调
|
* @param callback 网络请求回调
|
||||||
*/
|
*/
|
||||||
public void login(String phoneNum, String pwd, String uuid, HttpCallback<IMLoginModel> callback) {
|
public void login(String phoneNum, String pwd, String uuid, HttpCallback<IMLoginModel> callback) {
|
||||||
API.get().pdLiveApi(mContext).loginByManager(phoneNum, pwd, uuid, "", "Android")
|
API.get().pdLiveApi(mContext).loginByManager(phoneNum, pwd, uuid, "", "Android", WordUtil.isNewZh()?"chinese":"english")
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Consumer<ResponseModel<IMLoginModel>>() {
|
.subscribe(new Consumer<ResponseModel<IMLoginModel>>() {
|
||||||
@@ -95,27 +96,27 @@ public class MainNetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 猜你喜欢
|
// * 猜你喜欢
|
||||||
*
|
// *
|
||||||
* @param num 请求数量
|
// * @param num 请求数量
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
public void anchorRecommend(String num, HttpCallback<AnchorRecommendModel> httpCallback) {
|
// public void anchorRecommend(String num, String is_shengwang,HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||||
API.get().pdLiveApi(mContext).anchorRecommend(num)
|
// API.get().pdLiveApi(mContext).anchorRecommend(num,is_shengwang)
|
||||||
.subscribeOn(Schedulers.io())
|
// .subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(anchorRecommendModelResponseModel -> {
|
// .subscribe(anchorRecommendModelResponseModel -> {
|
||||||
if (httpCallback != null) {
|
// if (httpCallback != null) {
|
||||||
AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo();
|
// AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo();
|
||||||
httpCallback.onSuccess(model);
|
// httpCallback.onSuccess(model);
|
||||||
}
|
// }
|
||||||
}, throwable -> {
|
// }, throwable -> {
|
||||||
if (httpCallback != null) {
|
// if (httpCallback != null) {
|
||||||
httpCallback.onError(throwable.getMessage());
|
// httpCallback.onError(throwable.getMessage());
|
||||||
}
|
// }
|
||||||
}).isDisposed();
|
// }).isDisposed();
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void anchorRecommend(Map<String, Object> map, HttpCallback<AnchorRecommendModel> httpCallback) {
|
public void anchorRecommend(Map<String, Object> map, HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||||
API.get().pdLiveApi(mContext).anchorRecommend(map)
|
API.get().pdLiveApi(mContext).anchorRecommend(map)
|
||||||
@@ -139,11 +140,12 @@ public class MainNetManager {
|
|||||||
* @param num 请求数量
|
* @param num 请求数量
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void anchorRecommendType(String num, HttpCallback<AnchorRecommendModel> httpCallback) {
|
public void anchorRecommendType(String num, String is_shengwang,HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("num", num);
|
map.put("num", num);
|
||||||
map.put("live_recommend", "slide");
|
map.put("live_recommend", "slide");
|
||||||
map.put("type", "1");
|
map.put("type", "1");
|
||||||
|
map.put(" is_shengwang", is_shengwang);
|
||||||
API.get().pdLiveApi(mContext).anchorRecommend(map)
|
API.get().pdLiveApi(mContext).anchorRecommend(map)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
|||||||
@@ -1,16 +1,62 @@
|
|||||||
package com.yunbao.common.interfaces;
|
package com.yunbao.common.interfaces;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.yunbao.common.CommonAppContext;
|
||||||
|
import com.yunbao.common.bean.AvatarBean;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.upload.UploadBean;
|
||||||
|
import com.yunbao.common.upload.UploadCallback;
|
||||||
|
import com.yunbao.common.upload.UploadQnImpl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/9/29.
|
* Created by cxf on 2018/9/29.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface ImageResultCallback {
|
public abstract class ImageResultCallback {
|
||||||
//跳转相机前执行
|
//跳转相机前执行
|
||||||
void beforeCamera();
|
public void beforeCamera() {
|
||||||
|
}
|
||||||
|
|
||||||
void onSuccess(File file);
|
public void onSuccess(File file) {
|
||||||
|
}
|
||||||
|
|
||||||
void onFailure();
|
public void onFailure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onSuccessToUrl(File file, OnItemClickListener<String> listener) {
|
||||||
|
LiveNetManager.get(CommonAppContext.getTopActivity())
|
||||||
|
.updateFile(file, new com.yunbao.common.http.base.HttpCallback<AvatarBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(AvatarBean data) {
|
||||||
|
listener.onItemClick(data.getAvatar(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
listener.onItemClick(error, -1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSuccessToQiNiuUrl(Context mContext, File file, OnItemClickListener<String> listener) {
|
||||||
|
UploadQnImpl mUploadStrategy = new UploadQnImpl(mContext);
|
||||||
|
List<UploadBean> beans = new ArrayList<>();
|
||||||
|
beans.add(new UploadBean(file, UploadBean.IMG));
|
||||||
|
mUploadStrategy.upload(beans, true, new UploadCallback() {
|
||||||
|
@Override
|
||||||
|
public void onFinish(List<UploadBean> list, boolean success) {
|
||||||
|
if (success) {
|
||||||
|
listener.onItemClick("https://downs.yaoulive.com/" + list.get(0).getRemoteAccessUrl(), 0);
|
||||||
|
} else {
|
||||||
|
listener.onItemClick(null, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ import androidx.annotation.NonNull;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lzf.easyfloat.EasyFloat;
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.event.DataUserInfoEvent;
|
import com.yunbao.common.event.DataUserInfoEvent;
|
||||||
@@ -54,6 +54,15 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
|
|
||||||
private final String KEY_LANGUAGE = "language";
|
private final String KEY_LANGUAGE = "language";
|
||||||
private final String KEY_GAME = "key_game";
|
private final String KEY_GAME = "key_game";
|
||||||
|
private final String GUARD_TYPE = "key_GUARD_TYPE";
|
||||||
|
|
||||||
|
public void setGuardType(int guardType) {
|
||||||
|
put(GUARD_TYPE, guardType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGuardType() {
|
||||||
|
return getInt(GUARD_TYPE, 0);
|
||||||
|
}
|
||||||
|
|
||||||
public void setRedPoint() {
|
public void setRedPoint() {
|
||||||
put("RedPoint", "1");
|
put("RedPoint", "1");
|
||||||
@@ -62,7 +71,24 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
public boolean getRedPoint() {
|
public boolean getRedPoint() {
|
||||||
return !TextUtils.isEmpty(getString("RedPoint")) || !TextUtils.equals(getString("RedPoint"), "1");
|
return !TextUtils.isEmpty(getString("RedPoint")) || !TextUtils.equals(getString("RedPoint"), "1");
|
||||||
}
|
}
|
||||||
public void setQuickGiftIfFirst() {
|
|
||||||
|
public void setGuardRedPoint() {
|
||||||
|
put("GuardRedPoint", "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getGuardRedPoint() {
|
||||||
|
String GuardRedPoint = getString("GuardRedPoint");
|
||||||
|
if (TextUtils.isEmpty(GuardRedPoint)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!TextUtils.equals(GuardRedPoint, "1")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuickGiftIfFirst() {
|
||||||
put("quick_gift_if_first", "1");
|
put("quick_gift_if_first", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,7 +537,8 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public void updateUserCoin(){
|
|
||||||
|
public void updateUserCoin() {
|
||||||
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
||||||
.execute(new HttpCallback() {
|
.execute(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -528,14 +555,15 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public void updateUserCoin(OnItemClickListener<JSONObject> listener){
|
|
||||||
|
public void updateUserCoin(OnItemClickListener<JSONObject> listener) {
|
||||||
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
||||||
.execute(new HttpCallback() {
|
.execute(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
JSONObject obj = JSONObject.parseObject(info[0]);
|
JSONObject obj = JSONObject.parseObject(info[0]);
|
||||||
listener.onItemClick(obj,0);
|
listener.onItemClick(obj, 0);
|
||||||
String golds = obj.getString("gold");
|
String golds = obj.getString("gold");
|
||||||
String coins = obj.getString("coin");
|
String coins = obj.getString("coin");
|
||||||
String yuanbaos = obj.getString("yuanbao");
|
String yuanbaos = obj.getString("yuanbao");
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.yunbao.common.bean.FansModel;
|
import com.yunbao.common.bean.FansModel;
|
||||||
|
import com.yunbao.common.bean.NewGuardLevelModel;
|
||||||
import com.yunbao.common.bean.NewLevelModel;
|
import com.yunbao.common.bean.NewLevelModel;
|
||||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||||
|
|
||||||
@@ -19,10 +20,12 @@ public class NewLevelManager extends BaseCacheManager {
|
|||||||
private final String KEY_ANCHOR_LEVEL = "keyAnchorLevel";
|
private final String KEY_ANCHOR_LEVEL = "keyAnchorLevel";
|
||||||
private final String KEY_LIVE_LEVEL = "keyLiveLevel";
|
private final String KEY_LIVE_LEVEL = "keyLiveLevel";
|
||||||
private final String KEY_FANS_LEVEL = "keyFansLevel";
|
private final String KEY_FANS_LEVEL = "keyFansLevel";
|
||||||
|
private final String KEY_GUARD_LEVEL = "keyGuardLevel";
|
||||||
|
|
||||||
private List<NewLevelModel> newLevelModels = new ArrayList<>();
|
private List<NewLevelModel> newLevelModels = new ArrayList<>();
|
||||||
private List<NewLevelModel> keyAnchorLevel = new ArrayList<>();
|
private List<NewLevelModel> keyAnchorLevel = new ArrayList<>();
|
||||||
private List<FansModel> fansModels = new ArrayList<>();
|
private List<FansModel> fansModels = new ArrayList<>();
|
||||||
|
private List<NewGuardLevelModel> newGuardLevelModels = new ArrayList<>();
|
||||||
|
|
||||||
public NewLevelManager(Context context) {
|
public NewLevelManager(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -62,6 +65,29 @@ public class NewLevelManager extends BaseCacheManager {
|
|||||||
return fansModel;
|
return fansModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void upDataGuardLevel(String json) {
|
||||||
|
newGuardLevelModels = new Gson().fromJson(json, new TypeToken<List<NewGuardLevelModel>>() {
|
||||||
|
}.getType());
|
||||||
|
put(KEY_GUARD_LEVEL, newGuardLevelModels);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NewGuardLevelModel> getGuardLevel() {
|
||||||
|
newGuardLevelModels = getList(KEY_GUARD_LEVEL, new TypeToken<List<NewGuardLevelModel>>() {
|
||||||
|
}.getType());
|
||||||
|
return newGuardLevelModels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NewGuardLevelModel getGuardModel(int type) {
|
||||||
|
getGuardLevel();
|
||||||
|
NewGuardLevelModel guardLevelModel = null;
|
||||||
|
for (NewGuardLevelModel model : newGuardLevelModels) {
|
||||||
|
if (model.getGuardType() == type) {
|
||||||
|
guardLevelModel = model;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return guardLevelModel;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取等级数据
|
* 获取等级数据
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,25 +1,34 @@
|
|||||||
package com.yunbao.common.manager;
|
package com.yunbao.common.manager;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.lzf.easyfloat.enums.ShowPattern;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.bean.OpenAdModel;
|
import com.yunbao.common.bean.OpenAdModel;
|
||||||
|
import com.yunbao.common.dialog.DebugDialog;
|
||||||
import com.yunbao.common.dialog.OpenAdBottomDialogPopup;
|
import com.yunbao.common.dialog.OpenAdBottomDialogPopup;
|
||||||
import com.yunbao.common.dialog.OpenAdCenterDialogPopup;
|
import com.yunbao.common.dialog.OpenAdCenterDialogPopup;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
import com.yunbao.common.utils.AppManager;
|
||||||
import com.yunbao.common.utils.SpUtil;
|
import com.yunbao.common.utils.SpUtil;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class OpenAdManager {
|
public class OpenAdManager {
|
||||||
public static final int TYPE_HOME = 1;
|
public static final int TYPE_HOME = 1;
|
||||||
@@ -28,19 +37,34 @@ public class OpenAdManager {
|
|||||||
private Map<Integer, Boolean> showMap;
|
private Map<Integer, Boolean> showMap;
|
||||||
private List<OpenAdModel> list = null;
|
private List<OpenAdModel> list = null;
|
||||||
private Handler handler = new Handler(Looper.getMainLooper());
|
private Handler handler = new Handler(Looper.getMainLooper());
|
||||||
private Map<Integer, AdRunnable> runnableMap = new HashMap<>();
|
private Map<Integer, AdRunnable> runnableMap = new LinkedHashMap<>();
|
||||||
|
private Map<AdRunnable, Integer> waitRunnableMap = new LinkedHashMap<>();//等待运行的弹窗
|
||||||
private int showType;
|
private int showType;
|
||||||
|
private WeakReference<AdRunnable> runNowRunnable;
|
||||||
|
private static final boolean IS_QUEUE_SHOW = true;//是否按队列显示弹窗,true就会等待上一个弹窗关闭后弹出,false就按原逻辑顺序直接弹出
|
||||||
|
|
||||||
private OpenAdManager() {
|
private OpenAdManager() {
|
||||||
showMap = new HashMap<>();
|
showMap = new HashMap<>();
|
||||||
init(false);
|
init(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset() {
|
public void close() {
|
||||||
dismiss();
|
dismiss();
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
runnableMap.clear();
|
runnableMap.clear();
|
||||||
showMap.clear();
|
showMap.clear();
|
||||||
list.clear();
|
list.clear();
|
||||||
|
waitRunnableMap.clear();
|
||||||
|
list = null;
|
||||||
|
runNowRunnable = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reset() {
|
||||||
|
Log.i(TAG, "reset: ");
|
||||||
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class MInstanceHolder {
|
private static final class MInstanceHolder {
|
||||||
@@ -55,13 +79,14 @@ public class OpenAdManager {
|
|||||||
if (list != null && list.isEmpty()) {
|
if (list != null && list.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Context context = CommonAppContext.getTopActivity();
|
Context context = AppManager.getInstance().getMainActivity();
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
context = CommonAppContext.sInstance;
|
context = CommonAppContext.sInstance;
|
||||||
}
|
}
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LiveNetManager.get(context).activityPopup(new HttpCallback<List<OpenAdModel>>() {
|
LiveNetManager.get(context).activityPopup(new HttpCallback<List<OpenAdModel>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<OpenAdModel> data) {
|
public void onSuccess(List<OpenAdModel> data) {
|
||||||
@@ -70,35 +95,64 @@ public class OpenAdManager {
|
|||||||
list = new ArrayList<>();
|
list = new ArrayList<>();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Collections.sort(data, new AdListComparator());
|
||||||
list = data;
|
list = data;
|
||||||
if (isShow) {
|
if (isShow) {
|
||||||
show(TYPE_HOME, false);
|
if (showType == 0) {
|
||||||
|
show(TYPE_HOME, false);
|
||||||
|
} else {
|
||||||
|
show(showType, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
System.err.println("弹框列表:" + error);
|
Log.e(TAG, "弹框列表:" + error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static long showTime=0;
|
private static long showTime = 0;
|
||||||
|
private OnItemClickListener<String> onItemClickListener=new OnItemClickListener<String>() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(String bean, int position) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public synchronized void show(int type, boolean isGuard) {
|
public synchronized void show(int type, boolean isGuard) {
|
||||||
|
showType = type;
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
init(true);
|
init(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(System.currentTimeMillis()-showTime<100){
|
Log.i(TAG, "show: 调用显示 " + type + " " + isGuard);
|
||||||
|
if (System.currentTimeMillis() - showTime < 100) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showTime=System.currentTimeMillis();
|
/*DebugDialog.getInstance(new DebugDialog.DebugDialogRunnable() {
|
||||||
showType = type;
|
@Override
|
||||||
|
public void run(DebugDialog dialog) {
|
||||||
|
dialog.setShowPattern(ShowPattern.ALL_TIME);
|
||||||
|
dialog.show();
|
||||||
|
onItemClickListener = new OnItemClickListener<String>() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(String bean, int position) {
|
||||||
|
dialog.setParams(bean, "剩余:" + position);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
showTime = System.currentTimeMillis();
|
||||||
|
waitRunnableMap.clear();
|
||||||
|
runnableMap.clear();
|
||||||
|
runNowRunnable = null;
|
||||||
for (OpenAdModel model : list) {
|
for (OpenAdModel model : list) {
|
||||||
if (model.getType() == type) {
|
if (model.getType() == type) {
|
||||||
if (type == OpenAdModel.TYPE_LIVE && !model.userIsPermission(isGuard)) {
|
/* if (type == OpenAdModel.TYPE_LIVE && !model.userIsPermission(isGuard)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}*/
|
||||||
if (model.getShowModel() == OpenAdModel.SHOW_ONE) {
|
if (model.getShowModel() == OpenAdModel.SHOW_ONE) {
|
||||||
if (SpUtil.getInstance().getBooleanValue("open_ad_popup_" + model.getId())) {
|
if (SpUtil.getInstance().getBooleanValue("open_ad_popup_" + model.getId())) {
|
||||||
continue;
|
continue;
|
||||||
@@ -122,13 +176,22 @@ public class OpenAdManager {
|
|||||||
|
|
||||||
if (!isShow(model)) {
|
if (!isShow(model)) {
|
||||||
Log.i(TAG, "show: " + model);
|
Log.i(TAG, "show: " + model);
|
||||||
handler.postDelayed(new AdRunnable(model), model.getDelayShowTime());
|
if (IS_QUEUE_SHOW) {
|
||||||
|
waitRunnableMap.put(new AdRunnable(model), model.getDelayShowTime());
|
||||||
|
} else {
|
||||||
|
handler.postDelayed(new AdRunnable(model), model.getDelayShowTime());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG, "notshow: " + model);
|
Log.i(TAG, "notshow: " + model);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Log.i(TAG, "show: 循环完毕,调用next");
|
||||||
|
if (IS_QUEUE_SHOW) {
|
||||||
|
onItemClickListener.onItemClick("接口返回需要展示的弹窗数:", waitRunnableMap.size());
|
||||||
|
next();
|
||||||
|
}
|
||||||
Log.i(TAG, "------------------------------");
|
Log.i(TAG, "------------------------------");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -144,6 +207,9 @@ public class OpenAdManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
runnableMap.clear();
|
runnableMap.clear();
|
||||||
|
if (runNowRunnable != null && runNowRunnable.get() != null) {
|
||||||
|
handler.removeCallbacks(runNowRunnable.get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized boolean isShow(OpenAdModel type) {
|
private synchronized boolean isShow(OpenAdModel type) {
|
||||||
@@ -153,11 +219,45 @@ public class OpenAdManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getNowType() {
|
||||||
|
Activity lastActivity = AppManager.getInstance().getLastActivity();
|
||||||
|
if (lastActivity == null) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (AppManager.getInstance().isLiveActivity()) {
|
||||||
|
return TYPE_LIVE;
|
||||||
|
} else if (AppManager.getInstance().isMainActivity()) {
|
||||||
|
return TYPE_HOME;
|
||||||
|
}
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void next() {
|
||||||
|
Log.i(TAG, "next: 剩余数" + waitRunnableMap.size());
|
||||||
|
if (waitRunnableMap.isEmpty()) return;
|
||||||
|
for (AdRunnable next : waitRunnableMap.keySet()) {
|
||||||
|
Log.i(TAG, "next: " + next.model);
|
||||||
|
if (next.model.getType() == getNowType()) {
|
||||||
|
Integer i = waitRunnableMap.get(next);
|
||||||
|
if (i == null) {
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
onItemClickListener.onItemClick("当前加载id:" + next.model.getId() + " " + next.model.getName() + " 延迟展示时间:" + i, (waitRunnableMap.size() - 1));
|
||||||
|
handler.postDelayed(next, i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private class AdRunnable implements Runnable {
|
private class AdRunnable implements Runnable {
|
||||||
OpenAdModel model;
|
OpenAdModel model;
|
||||||
|
AdRunnable runnable;
|
||||||
|
|
||||||
public AdRunnable(OpenAdModel model) {
|
public AdRunnable(OpenAdModel model) {
|
||||||
this.model = model;
|
this.model = model;
|
||||||
|
this.runnable = this;
|
||||||
|
runNowRunnable = new WeakReference<>(this);
|
||||||
runnableMap.put(model.getId(), this);
|
runnableMap.put(model.getId(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,36 +270,100 @@ public class OpenAdManager {
|
|||||||
Log.i(TAG, "run: " + model);
|
Log.i(TAG, "run: " + model);
|
||||||
if (model == null) {
|
if (model == null) {
|
||||||
ToastUtil.showDebug("model为空");
|
ToastUtil.showDebug("model为空");
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onItemClick("", -2);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!model.isInTime()) {
|
if (!model.isInTime()) {
|
||||||
ToastUtil.showDebug("不在展示时间内:" + model.getStartTime() + "|" + model.getEndTime());
|
ToastUtil.showDebug("不在展示时间内:" + model.getStartTime() + "|" + model.getEndTime());
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onItemClick("", -2);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isShow(model)) {
|
if (isShow(model)) {
|
||||||
ToastUtil.showDebug(model.getId() + "|model展示过了");
|
ToastUtil.showDebug(model.getId() + "|model展示过了");
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onItemClick("", -2);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (model.getType() != showType) {
|
if (model.getType() != showType) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onItemClick("", -2);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(isShow(model)){
|
if (isShow(model)) {
|
||||||
Log.i(TAG,"展示过:"+model);
|
Log.i(TAG, "展示过:" + model);
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onItemClick("", -2);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (model.getType() == OpenAdModel.TYPE_HOME && !AppManager.getInstance().isMainActivity()) {
|
||||||
|
Log.i(TAG, "首页类型弹窗,但当前不是首页");
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onItemClick("", -2);
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (model.getType() == TYPE_LIVE && !AppManager.getInstance().isLiveActivity()) {
|
||||||
|
Log.i(TAG, "直播类型弹窗,但当前不是直播");
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onItemClick("", -2);
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
showMap.put(model.getId(), true);
|
showMap.put(model.getId(), true);
|
||||||
if (model.getShowModel() == OpenAdModel.SHOW_DIY) {
|
if (model.getShowModel() == OpenAdModel.SHOW_DIY) {
|
||||||
String nextTime= String.valueOf(System.currentTimeMillis() + (Long.parseLong(model.getSection()) * 60 * 1000));
|
String nextTime = String.valueOf(System.currentTimeMillis() + (Long.parseLong(model.getSection()) * 60 * 1000));
|
||||||
SpUtil.setStringValue("open_ad_popup_time_" + model.getId(), nextTime);
|
SpUtil.setStringValue("open_ad_popup_time_" + model.getId(), nextTime);
|
||||||
showMap.remove(model.getId());
|
showMap.remove(model.getId());
|
||||||
}
|
}
|
||||||
if (model.getModel() == OpenAdModel.MODEL_BOTTOM) {
|
if (model.getModel() == OpenAdModel.MODEL_BOTTOM) {
|
||||||
new OpenAdBottomDialogPopup(CommonAppContext.getTopActivity(), model).setListener((bean, position) -> {
|
new OpenAdBottomDialogPopup(AppManager.getInstance().getLastActivity(), model).setListener((bean, position) -> {
|
||||||
|
Log.i(TAG, "run: 弹框回调:" + position + " id = " + model.getId());
|
||||||
|
if (IS_QUEUE_SHOW) {
|
||||||
|
removeList(bean);
|
||||||
|
if (position == 0) {
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
}
|
||||||
}).showDialog();
|
}).showDialog();
|
||||||
} else {
|
} else {
|
||||||
new OpenAdCenterDialogPopup(CommonAppContext.getTopActivity(), model).setListener((bean, position) -> {
|
new OpenAdCenterDialogPopup(AppManager.getInstance().getLastActivity(), model).setListener((bean, position) -> {
|
||||||
|
Log.i(TAG, "run: 弹框回调:" + position + " id = " + model.getId());
|
||||||
|
if (IS_QUEUE_SHOW) {
|
||||||
|
removeList(bean);
|
||||||
|
if (position == 0) {
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
}
|
||||||
}).showDialog();
|
}).showDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void removeList(OpenAdModel model) {
|
||||||
|
Log.i(TAG, "removeList: " + model);
|
||||||
|
for (AdRunnable next : waitRunnableMap.keySet()) {
|
||||||
|
if (next.model.getId() == model.getId()) {
|
||||||
|
waitRunnableMap.remove(next);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class AdListComparator implements Comparator<OpenAdModel> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compare(OpenAdModel openAdModel, OpenAdModel t1) {
|
||||||
|
return openAdModel.getSort() - t1.getSort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ public class RandomPkManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
//ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import io.rong.imlib.model.Conversation;
|
|||||||
import io.rong.imlib.model.Message;
|
import io.rong.imlib.model.Message;
|
||||||
import io.rong.message.TextMessage;
|
import io.rong.message.TextMessage;
|
||||||
|
|
||||||
public class GameMicManager {
|
public class GameRyMicManager {
|
||||||
MeetingCallback mMeetingCallback = null;
|
MeetingCallback mMeetingCallback = null;
|
||||||
private RCRTCRoom mRtcRoom = null;
|
private RCRTCRoom mRtcRoom = null;
|
||||||
private String mRoomID = "";
|
private String mRoomID = "";
|
||||||
@@ -367,7 +367,7 @@ public class GameMicManager {
|
|||||||
RCRTCEngine.getInstance().joinRoom("v" + roomId, roomConfig, new IRCRTCResultDataCallback<RCRTCRoom>() {
|
RCRTCEngine.getInstance().joinRoom("v" + roomId, roomConfig, new IRCRTCResultDataCallback<RCRTCRoom>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(final RCRTCRoom rcrtcRoom) {
|
public void onSuccess(final RCRTCRoom rcrtcRoom) {
|
||||||
GameMicManager.this.mRtcRoom = rcrtcRoom;
|
GameRyMicManager.this.mRtcRoom = rcrtcRoom;
|
||||||
// 注册房间回调
|
// 注册房间回调
|
||||||
rcrtcRoom.registerRoomListener(roomEventsListener);
|
rcrtcRoom.registerRoomListener(roomEventsListener);
|
||||||
try {
|
try {
|
||||||
@@ -447,12 +447,12 @@ public class GameMicManager {
|
|||||||
|
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
if (WordUtil.isNewZh()) {
|
if (WordUtil.isNewZh()) {
|
||||||
stringBuffer.append("歡迎 ").append(msgDTO.getUname()).append(" 進入房間");
|
stringBuffer.append("歡迎 ").append(msgDTO.getCt()).append(" 進入房間");
|
||||||
} else {
|
} else {
|
||||||
stringBuffer.append("Welcome ").append(msgDTO.getUname()).append(" to enter the room");
|
stringBuffer.append("Welcome ").append(msgDTO.getCt()).append(" to enter the room");
|
||||||
}
|
}
|
||||||
|
|
||||||
getView().insertItem(new SudGameChatImModel().setWelcomMessage(true).setNickname(msgDTO.getUname()).setTextMessage(stringBuffer.toString()));
|
getView().insertItem(new SudGameChatImModel().setWelcomMessage(true).setNickname(msgDTO.getCt()).setTextMessage(stringBuffer.toString()));
|
||||||
} else if (TextUtils.equals(msgDTO.getMethod(), "sudGameRoomVoiceList")) {
|
} else if (TextUtils.equals(msgDTO.getMethod(), "sudGameRoomVoiceList")) {
|
||||||
List<SudGameUserModel> personList = new Gson().fromJson(msgDTO.getCt(), new TypeToken<List<SudGameUserModel>>() {
|
List<SudGameUserModel> personList = new Gson().fromJson(msgDTO.getCt(), new TypeToken<List<SudGameUserModel>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
@@ -484,7 +484,7 @@ public class GameMicManager {
|
|||||||
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
|
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
|
||||||
TextMessage messageContent = TextMessage.obtain(new Gson().toJson(sudGameSocketImEvent));
|
TextMessage messageContent = TextMessage.obtain(new Gson().toJson(sudGameSocketImEvent));
|
||||||
Message message = Message.obtain("v" + mRoomID, conversationType, messageContent);
|
Message message = Message.obtain("v" + mRoomID, conversationType, messageContent);
|
||||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onAttached(Message message) {
|
public void onAttached(Message message) {
|
||||||
|
|
||||||
@@ -0,0 +1,565 @@
|
|||||||
|
package com.yunbao.common.manager.imrongcloud;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.yunbao.common.CommonAppContext;
|
||||||
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
|
import com.yunbao.common.bean.SudGameChatImModel;
|
||||||
|
import com.yunbao.common.bean.SudGameUserModel;
|
||||||
|
import com.yunbao.common.event.SudGameSocketImEvent;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCRemoteUser;
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCRoom;
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCRoomConfig;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCResultDataCallback;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCRoomEventsListener;
|
||||||
|
import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
|
||||||
|
import cn.rongcloud.rtc.base.RCRTCParamsType;
|
||||||
|
import cn.rongcloud.rtc.base.RCRTCRoomType;
|
||||||
|
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||||
|
import io.rong.imlib.IRongCallback;
|
||||||
|
import io.rong.imlib.IRongCoreCallback;
|
||||||
|
import io.rong.imlib.IRongCoreEnum;
|
||||||
|
import io.rong.imlib.RongIMClient;
|
||||||
|
import io.rong.imlib.chatroom.base.RongChatRoomClient;
|
||||||
|
import io.rong.imlib.model.Conversation;
|
||||||
|
import io.rong.imlib.model.Message;
|
||||||
|
import io.rong.message.TextMessage;
|
||||||
|
|
||||||
|
public class GameSwMicManager {
|
||||||
|
MeetingCallback mMeetingCallback = null;
|
||||||
|
private RCRTCRoom mRtcRoom = null;
|
||||||
|
private String mRoomID = "";
|
||||||
|
|
||||||
|
public void setmRoomID(String mRoomID) {
|
||||||
|
this.mRoomID = mRoomID;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final IRCRTCRoomEventsListener roomEventsListener = new IRCRTCRoomEventsListener() {
|
||||||
|
/**
|
||||||
|
* 房间内用户发布资源
|
||||||
|
*
|
||||||
|
* @param rcrtcRemoteUser 远端用户
|
||||||
|
* @param list 发布的资源
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onRemoteUserPublishResource(RCRTCRemoteUser rcrtcRemoteUser, final List<RCRTCInputStream> list) {
|
||||||
|
// subscribeAVStream();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRemoteUserMuteAudio(RCRTCRemoteUser rcrtcRemoteUser, RCRTCInputStream rcrtcInputStream, boolean b) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRemoteUserMuteVideo(RCRTCRemoteUser rcrtcRemoteUser, RCRTCInputStream rcrtcInputStream, boolean b) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRemoteUserUnpublishResource(RCRTCRemoteUser rcrtcRemoteUser, List<RCRTCInputStream> list) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户加入房间
|
||||||
|
*
|
||||||
|
* @param rcrtcRemoteUser 远端用户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onUserJoined(final RCRTCRemoteUser rcrtcRemoteUser) {
|
||||||
|
try {
|
||||||
|
getView().onUserJoined(rcrtcRemoteUser);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户离开房间
|
||||||
|
*
|
||||||
|
* @param rcrtcRemoteUser 远端用户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onUserLeft(RCRTCRemoteUser rcrtcRemoteUser) {
|
||||||
|
try {
|
||||||
|
getView().onUserLeft(rcrtcRemoteUser);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUserOffline(RCRTCRemoteUser rcrtcRemoteUser) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPublishLiveStreams(List<RCRTCInputStream> list) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUnpublishLiveStreams(List<RCRTCInputStream> list) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自己退出房间。 例如断网退出等
|
||||||
|
* @param i 状态码
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onLeaveRoom(int i) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected MeetingCallback getView() {
|
||||||
|
if (mMeetingCallback == null) {
|
||||||
|
throw new IllegalStateException("view is not attached");
|
||||||
|
} else {
|
||||||
|
return mMeetingCallback;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void attachView(MeetingCallback callback) {
|
||||||
|
mMeetingCallback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void detachView() {
|
||||||
|
mMeetingCallback = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主动订阅远端用户发布的流
|
||||||
|
* 视频流需要用户设置用于显示载体的videoview
|
||||||
|
*/
|
||||||
|
public void subscribeAVStream() {
|
||||||
|
if (mRtcRoom == null || mRtcRoom.getRemoteUsers() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final List<RCRTCInputStream> inputStreams = new ArrayList<>();
|
||||||
|
for (final RCRTCRemoteUser remoteUser : mRtcRoom.getRemoteUsers()) {
|
||||||
|
if (remoteUser.getStreams().size() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
inputStreams.addAll(remoteUser.getStreams());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputStreams.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mRtcRoom.getLocalUser().subscribeStreams(inputStreams, new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
getView().onSubscribeSuccess(inputStreams);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
try {
|
||||||
|
getView().onSubscribeFailed();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void refreshStreams(List<SudGameUserModel> personList) {
|
||||||
|
|
||||||
|
final List<RCRTCInputStream> inputStreams = new ArrayList<>();
|
||||||
|
if(mRtcRoom!=null){
|
||||||
|
for (SudGameUserModel sudGameUserModel : personList) {
|
||||||
|
List<RCRTCRemoteUser> rcrtcRemoteUsers = mRtcRoom.getRemoteUsers();
|
||||||
|
|
||||||
|
for (RCRTCRemoteUser rcrtcRemoteUser : rcrtcRemoteUsers) {
|
||||||
|
if (TextUtils.equals(rcrtcRemoteUser.getUserId(), String.valueOf(sudGameUserModel.getId()))) {
|
||||||
|
for (RCRTCInputStream rcrtcInputStream : rcrtcRemoteUser.getStreams()) {
|
||||||
|
rcrtcInputStream.mute(sudGameUserModel.getMicStatus() == 3);
|
||||||
|
}
|
||||||
|
inputStreams.addAll(rcrtcRemoteUser.getStreams());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inputStreams.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mRtcRoom.getLocalUser().subscribeStreams(inputStreams, new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
getView().onSubscribeSuccess(inputStreams);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
try {
|
||||||
|
getView().onSubscribeFailed();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refreshStreams(String userID, boolean mute, int position) {
|
||||||
|
|
||||||
|
final List<RCRTCInputStream> inputStreams = new ArrayList<>();
|
||||||
|
|
||||||
|
List<RCRTCRemoteUser> rcrtcRemoteUsers = mRtcRoom.getRemoteUsers();
|
||||||
|
|
||||||
|
for (RCRTCRemoteUser rcrtcRemoteUser : rcrtcRemoteUsers) {
|
||||||
|
if (TextUtils.equals(rcrtcRemoteUser.getUserId(), String.valueOf(userID))) {
|
||||||
|
for (RCRTCInputStream rcrtcInputStream : rcrtcRemoteUser.getStreams()) {
|
||||||
|
rcrtcInputStream.mute(mute);
|
||||||
|
}
|
||||||
|
inputStreams.addAll(rcrtcRemoteUser.getStreams());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inputStreams.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mRtcRoom.getLocalUser().subscribeStreams(inputStreams, new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
try {
|
||||||
|
getView().onSubscribeSuccess(userID, mute, position);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
try {
|
||||||
|
getView().onSubscribeFailed(userID);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unPublishStreams() {
|
||||||
|
if (mRtcRoom == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mRtcRoom.getLocalUser().unpublishStream(RCRTCEngine.getInstance().getDefaultAudioStream(), new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
try {
|
||||||
|
getView().onUnPublishStreamsSuccess();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
|
try {
|
||||||
|
getView().onUnPublishStreamsFailed();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布默认流
|
||||||
|
*/
|
||||||
|
public void publishDefaultAVStream() {
|
||||||
|
if (mRtcRoom == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mRtcRoom.getLocalUser().publishStream(RCRTCEngine.getInstance().getDefaultAudioStream(), new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
try {
|
||||||
|
getView().onPublishSuccess();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode rtcErrorCode) {
|
||||||
|
try {
|
||||||
|
getView().onPublishFailed();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置rtc sdk
|
||||||
|
*/
|
||||||
|
public void config(Context context) {
|
||||||
|
|
||||||
|
// RCRTCConfig.Builder configBuilder = RCRTCConfig.Builder.create();
|
||||||
|
// // 是否硬解码
|
||||||
|
// configBuilder.enableHardwareDecoder(true);
|
||||||
|
// // 是否硬编码
|
||||||
|
// configBuilder.enableHardwareEncoder(true);
|
||||||
|
//
|
||||||
|
// // init 需结合 uninit 使用,否则有些配置无法重新初始化
|
||||||
|
// RCRTCEngine.getInstance().unInit();
|
||||||
|
// RCRTCEngine.getInstance().init(context, configBuilder.build());
|
||||||
|
|
||||||
|
// RCRTCVideoStreamConfig.Builder videoConfigBuilder = RCRTCVideoStreamConfig.Builder.create();
|
||||||
|
// // 设置分辨率
|
||||||
|
// videoConfigBuilder.setVideoResolution(RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_720_1280);
|
||||||
|
// // 设置帧率
|
||||||
|
// videoConfigBuilder.setVideoFps(RCRTCParamsType.RCRTCVideoFps.Fps_30);
|
||||||
|
// /**
|
||||||
|
// * 设置最小码率,可根据分辨率RCRTCVideoResolution设置
|
||||||
|
// * {@link RCRTCParamsType.RCRTCVideoResolution)}
|
||||||
|
// */
|
||||||
|
// videoConfigBuilder.setMinRate(250);
|
||||||
|
// /**
|
||||||
|
// * 设置最大码率,可根据分辨率RCRTCVideoResolution设置
|
||||||
|
// * {@link RCRTCParamsType.RCRTCVideoResolution)}
|
||||||
|
// */
|
||||||
|
// videoConfigBuilder.setMaxRate(2200);
|
||||||
|
// RCRTCEngine.getInstance().getDefaultVideoStream().setVideoConfig(videoConfigBuilder.build());
|
||||||
|
//打开扬声器。
|
||||||
|
RCRTCEngine.getInstance().enableSpeaker(true);
|
||||||
|
// 启用耳返功能
|
||||||
|
RCRTCEngine.getInstance().getDefaultAudioStream().enableEarMonitoring(true);
|
||||||
|
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(false);
|
||||||
|
RCRTCEngine.getInstance().getDefaultAudioStream().setAudioQuality(RCRTCParamsType.AudioQuality.MUSIC_HIGH, RCRTCParamsType.AudioScenario.MUSIC_CHATROOM);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void joinRoom(String roomId, boolean imOff) {
|
||||||
|
mRoomID = roomId;
|
||||||
|
if (imOff) {
|
||||||
|
|
||||||
|
RCRTCRoomConfig roomConfig = RCRTCRoomConfig.Builder.create()
|
||||||
|
// 根据实际场景,选择音视频直播:LIVE_AUDIO_VIDEO 或音频直播:LIVE_AUDIO
|
||||||
|
.setRoomType(RCRTCRoomType.MEETING)
|
||||||
|
|
||||||
|
.build();
|
||||||
|
RCRTCEngine.getInstance().joinRoom("v" + roomId, roomConfig, new IRCRTCResultDataCallback<RCRTCRoom>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(final RCRTCRoom rcrtcRoom) {
|
||||||
|
GameSwMicManager.this.mRtcRoom = rcrtcRoom;
|
||||||
|
// 注册房间回调
|
||||||
|
rcrtcRoom.registerRoomListener(roomEventsListener);
|
||||||
|
try {
|
||||||
|
getView().onJoinRoomSuccess(rcrtcRoom);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode rtcErrorCode) {
|
||||||
|
try {
|
||||||
|
getView().onJoinRoomFailed(rtcErrorCode);
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
RongChatRoomClient.getInstance().joinChatRoom("v" + roomId, -1, new IRongCoreCallback.OperationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.i("tx", "加入成功");
|
||||||
|
enterRoom();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) {
|
||||||
|
Log.i("tx", "加入" + "失败" + coreErrorCode);
|
||||||
|
if (WordUtil.isNewZh()) {
|
||||||
|
ToastUtil.show("網絡不佳無法連接,請重新進入");
|
||||||
|
} else {
|
||||||
|
ToastUtil.show("The network is not connected, please re-enter");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void leaveRoom() {
|
||||||
|
RCRTCEngine.getInstance().leaveRoom(new IRCRTCResultCallback() {
|
||||||
|
@Override
|
||||||
|
public void onFailed(RTCErrorCode rtcErrorCode) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
RongChatRoomClient.getInstance().quitChatRoom("v" + mRoomID, new IRongCoreCallback.OperationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.i("tx", "退出成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) {
|
||||||
|
Log.i("tx", "退出" + "" + coreErrorCode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理游戏房Im消息
|
||||||
|
*/
|
||||||
|
public void processingMessage(SudGameSocketImEvent socketImModel) {
|
||||||
|
|
||||||
|
List<SudGameSocketImEvent.MsgDTO> msgDTOS = socketImModel.getMsg();
|
||||||
|
if (msgDTOS.isEmpty()) return;
|
||||||
|
SudGameSocketImEvent.MsgDTO msgDTO = msgDTOS.get(0);
|
||||||
|
|
||||||
|
|
||||||
|
//正常文字消息
|
||||||
|
if (TextUtils.equals(msgDTO.getMethod(), "SendMsg")) {
|
||||||
|
getView().insertItem(new SudGameChatImModel().setWelcomMessage(false).setNickname(msgDTO.getUname()).setTextMessage(msgDTO.getCt()));
|
||||||
|
} else if (TextUtils.equals(msgDTO.getMethod(), "welcomMessage")) {
|
||||||
|
// 欢迎(用户名)进入房间 Welcome (username) to the room
|
||||||
|
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
if (WordUtil.isNewZh()) {
|
||||||
|
stringBuffer.append("歡迎 ").append(msgDTO.getCt()).append(" 進入房間");
|
||||||
|
} else {
|
||||||
|
stringBuffer.append("Welcome ").append(msgDTO.getCt()).append(" to enter the room");
|
||||||
|
}
|
||||||
|
|
||||||
|
getView().insertItem(new SudGameChatImModel().setWelcomMessage(true).setNickname(msgDTO.getCt()).setTextMessage(stringBuffer.toString()));
|
||||||
|
} else if (TextUtils.equals(msgDTO.getMethod(), "sudGameRoomVoiceList")) {
|
||||||
|
List<SudGameUserModel> personList = new Gson().fromJson(msgDTO.getCt(), new TypeToken<List<SudGameUserModel>>() {
|
||||||
|
}.getType());
|
||||||
|
getView().refreshSudGameUserList(personList);
|
||||||
|
|
||||||
|
refreshStreams(personList);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendChatMessage(String textMessage, String method) {
|
||||||
|
IMLoginModel loginModel = IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getUserInfo();
|
||||||
|
SudGameSocketImEvent sudGameSocketImEvent = new SudGameSocketImEvent();
|
||||||
|
sudGameSocketImEvent.setRetcode("000000");
|
||||||
|
sudGameSocketImEvent.setRetmsg("ok");
|
||||||
|
|
||||||
|
SudGameSocketImEvent.MsgDTO msgDTO = new SudGameSocketImEvent.MsgDTO();
|
||||||
|
msgDTO.setAction("0")
|
||||||
|
.setCt(textMessage)
|
||||||
|
.setEquipment("app")
|
||||||
|
.setUid(String.valueOf(loginModel.getId()))
|
||||||
|
.setMethod(method)
|
||||||
|
.setUname(loginModel.getUserNicename())
|
||||||
|
.setRoomnum(mRoomID);
|
||||||
|
|
||||||
|
List<SudGameSocketImEvent.MsgDTO> msgDTOS = new ArrayList<>();
|
||||||
|
msgDTOS.add(msgDTO);
|
||||||
|
sudGameSocketImEvent.setMsg(msgDTOS);
|
||||||
|
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
|
||||||
|
TextMessage messageContent = TextMessage.obtain(new Gson().toJson(sudGameSocketImEvent));
|
||||||
|
Message message = Message.obtain("v" + mRoomID, conversationType, messageContent);
|
||||||
|
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||||
|
@Override
|
||||||
|
public void onAttached(Message message) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Message message) {
|
||||||
|
Log.i("tx", "发送成功");
|
||||||
|
String contentJson = ((TextMessage) message.getContent()).getContent();
|
||||||
|
Log.e("wewe", contentJson);
|
||||||
|
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
|
||||||
|
sudGameSocketImEvent.getMsg().get(0).setTime("11");
|
||||||
|
processingMessage(sudGameSocketImEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
|
||||||
|
Log.i("tx", "发送成功" + errorCode.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送聊天信息
|
||||||
|
*
|
||||||
|
* @param textMessage
|
||||||
|
*/
|
||||||
|
public void sendMessage(String textMessage) {
|
||||||
|
sendChatMessage(textMessage, "SendMsg");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进房间
|
||||||
|
*/
|
||||||
|
public void enterRoom() {
|
||||||
|
IMLoginModel loginModel = IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getUserInfo();
|
||||||
|
sendChatMessage(loginModel.getUserNicename(), "welcomMessage");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* activity相关回调
|
||||||
|
*/
|
||||||
|
public interface MeetingCallback {
|
||||||
|
void onJoinRoomSuccess(RCRTCRoom rcrtcRoom);
|
||||||
|
|
||||||
|
void onJoinRoomFailed(RTCErrorCode rtcErrorCode);
|
||||||
|
|
||||||
|
void onPublishSuccess();
|
||||||
|
|
||||||
|
|
||||||
|
void onPublishFailed();
|
||||||
|
|
||||||
|
void onUnPublishStreamsSuccess();
|
||||||
|
|
||||||
|
void onUnPublishStreamsFailed();
|
||||||
|
|
||||||
|
void onSubscribeSuccess(List<RCRTCInputStream> inputStreamList);
|
||||||
|
|
||||||
|
void onSubscribeFailed();
|
||||||
|
|
||||||
|
void onSubscribeSuccess(String userID, boolean mute, int position);
|
||||||
|
|
||||||
|
void onSubscribeFailed(String userID);
|
||||||
|
|
||||||
|
void onUserJoined(RCRTCRemoteUser rcrtcRemoteUser);
|
||||||
|
|
||||||
|
void onUserLeft(RCRTCRemoteUser rcrtcRemoteUser);
|
||||||
|
|
||||||
|
void insertItem(SudGameChatImModel sudGameChatImModel);
|
||||||
|
|
||||||
|
void refreshSudGameUserList(List<SudGameUserModel> personList);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,9 +15,14 @@ import com.bumptech.glide.request.RequestOptions;
|
|||||||
import com.iflytek.cloud.SpeechConstant;
|
import com.iflytek.cloud.SpeechConstant;
|
||||||
import com.iflytek.cloud.SpeechUtility;
|
import com.iflytek.cloud.SpeechUtility;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
|
import com.yunbao.common.dialog.DebugDialog;
|
||||||
import com.yunbao.common.event.RongIMConnectionStatusEvent;
|
import com.yunbao.common.event.RongIMConnectionStatusEvent;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.utils.AppManager;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@@ -25,6 +30,7 @@ import io.rong.imkit.GlideKitImageEngine;
|
|||||||
import io.rong.imkit.IMCenter;
|
import io.rong.imkit.IMCenter;
|
||||||
import io.rong.imkit.RongIM;
|
import io.rong.imkit.RongIM;
|
||||||
import io.rong.imkit.config.RongConfigCenter;
|
import io.rong.imkit.config.RongConfigCenter;
|
||||||
|
import io.rong.imlib.IRongCallback;
|
||||||
import io.rong.imlib.RongIMClient;
|
import io.rong.imlib.RongIMClient;
|
||||||
import io.rong.imlib.model.Conversation;
|
import io.rong.imlib.model.Conversation;
|
||||||
import io.rong.imlib.model.Message;
|
import io.rong.imlib.model.Message;
|
||||||
@@ -66,6 +72,7 @@ public class RongcloudIMManager {
|
|||||||
SpeechUtility.createUtility(application.getApplicationContext(), params);
|
SpeechUtility.createUtility(application.getApplicationContext(), params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static RongIMClient.OnReceiveMessageWrapperListener mListener;
|
private static RongIMClient.OnReceiveMessageWrapperListener mListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,12 +118,31 @@ public class RongcloudIMManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void connectIM(Context context) {
|
||||||
|
connectIM(context, new RongIMClient.ConnectCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(RongIMClient.ConnectionErrorCode e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus code) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 连接融云服务器
|
* 连接融云服务器
|
||||||
*
|
*
|
||||||
* @param context
|
* @param context
|
||||||
*/
|
*/
|
||||||
public static void connectIM(Context context) {
|
public static void connectIM(Context context, RongIMClient.ConnectCallback callback) {
|
||||||
MessageIMManager.get(context).addImRongCloudObserver();
|
MessageIMManager.get(context).addImRongCloudObserver();
|
||||||
MessageIMManager.get(context).getSystemMessages();
|
MessageIMManager.get(context).getSystemMessages();
|
||||||
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
||||||
@@ -128,6 +154,7 @@ public class RongcloudIMManager {
|
|||||||
RongIM.connect(IMToken, 0, new RongIMClient.ConnectCallback() {
|
RongIM.connect(IMToken, 0, new RongIMClient.ConnectCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String s) {
|
public void onSuccess(String s) {
|
||||||
|
callback.onSuccess(s);
|
||||||
//连接成功,如果 onDatabaseOpened() 时没有页面跳转,也可在此时进行跳转。
|
//连接成功,如果 onDatabaseOpened() 时没有页面跳转,也可在此时进行跳转。
|
||||||
Log.e(CLASSNAME, "onSuccess:" + s);
|
Log.e(CLASSNAME, "onSuccess:" + s);
|
||||||
isReady = true;
|
isReady = true;
|
||||||
@@ -137,6 +164,7 @@ public class RongcloudIMManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(RongIMClient.ConnectionErrorCode connectionErrorCode) {
|
public void onError(RongIMClient.ConnectionErrorCode connectionErrorCode) {
|
||||||
|
callback.onError(connectionErrorCode);
|
||||||
if (connectionErrorCode.equals(RongIMClient.ConnectionErrorCode.RC_CONN_TOKEN_EXPIRE)) {
|
if (connectionErrorCode.equals(RongIMClient.ConnectionErrorCode.RC_CONN_TOKEN_EXPIRE)) {
|
||||||
//从 APP 服务请求新 token,获取到新 token 后重新 connect()
|
//从 APP 服务请求新 token,获取到新 token 后重新 connect()
|
||||||
Log.e(CLASSNAME, "onError:(从 APP 服务请求新 token)" + RongIMClient.ConnectionErrorCode.RC_CONN_TOKEN_EXPIRE);
|
Log.e(CLASSNAME, "onError:(从 APP 服务请求新 token)" + RongIMClient.ConnectionErrorCode.RC_CONN_TOKEN_EXPIRE);
|
||||||
@@ -151,6 +179,7 @@ public class RongcloudIMManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus databaseOpenStatus) {
|
public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus databaseOpenStatus) {
|
||||||
|
callback.onDatabaseOpened(databaseOpenStatus);
|
||||||
if (RongIMClient.DatabaseOpenStatus.DATABASE_OPEN_SUCCESS.equals(databaseOpenStatus)) {
|
if (RongIMClient.DatabaseOpenStatus.DATABASE_OPEN_SUCCESS.equals(databaseOpenStatus)) {
|
||||||
//本地数据库打开,跳转到会话列表页面
|
//本地数据库打开,跳转到会话列表页面
|
||||||
Log.e(CLASSNAME, "onDatabaseOpened:(本地数据库打开)" + databaseOpenStatus);
|
Log.e(CLASSNAME, "onDatabaseOpened:(本地数据库打开)" + databaseOpenStatus);
|
||||||
@@ -224,4 +253,66 @@ public class RongcloudIMManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送消息失败重连次数,超过3就重新登录
|
||||||
|
*/
|
||||||
|
private static int reconnectIndex = 0;
|
||||||
|
|
||||||
|
public static void sendMessage(final Message message, final String pushContent, final String pushData, final IRongCallback.ISendMessageCallback callback) {
|
||||||
|
|
||||||
|
RongIMClient.getInstance().sendMessage(message, pushContent, pushData, new IRongCallback.ISendMessageCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAttached(Message message) {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onAttached(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Message message) {
|
||||||
|
reconnectIndex = 0;
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
|
||||||
|
if (reconnectIndex > 2) {
|
||||||
|
reconnectIndex = 0;
|
||||||
|
ToastUtil.show(WordUtil.getNewString(R.string.login_invalid));
|
||||||
|
EventBus.getDefault().post(new RongIMConnectionStatusEvent());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (errorCode.code == 33000) {
|
||||||
|
reconnectIndex++;
|
||||||
|
connectIM(AppManager.getInstance().getMainActivity(), new RongIMClient.ConnectCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String t) {
|
||||||
|
sendMessage(message, pushContent, pushData, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(RongIMClient.ConnectionErrorCode e) {
|
||||||
|
sendMessage(message, pushContent, pushData, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus code) {
|
||||||
|
if (RongIMClient.DatabaseOpenStatus.DATABASE_OPEN_ERROR.equals(code)) {
|
||||||
|
sendMessage(message, pushContent, pushData, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(message, errorCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import android.view.View;
|
|||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.yunbao.common.sud.decorator.SudFSMMGCache;
|
import com.yunbao.common.sud.decorator.SudFSMMGCache;
|
||||||
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
|
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
|
||||||
import com.yunbao.common.sud.decorator.SudFSMMGListener;
|
import com.yunbao.common.sud.decorator.SudFSMMGListener;
|
||||||
@@ -16,7 +17,10 @@ import com.yunbao.common.sud.decorator.SudFSTAPPDecorator;
|
|||||||
import com.yunbao.common.sud.model.GameConfigModel;
|
import com.yunbao.common.sud.model.GameConfigModel;
|
||||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||||
import com.yunbao.common.sud.state.MGStateResponse;
|
import com.yunbao.common.sud.state.MGStateResponse;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.SudJsonUtils;
|
import com.yunbao.common.utils.SudJsonUtils;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
import tech.sud.mgp.core.ISudFSMStateHandle;
|
import tech.sud.mgp.core.ISudFSMStateHandle;
|
||||||
import tech.sud.mgp.core.ISudFSTAPP;
|
import tech.sud.mgp.core.ISudFSTAPP;
|
||||||
@@ -142,7 +146,10 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
|||||||
|
|
||||||
// 给装饰类设置回调
|
// 给装饰类设置回调
|
||||||
sudFSMMGDecorator.setSudFSMMGListener(this);
|
sudFSMMGDecorator.setSudFSMMGListener(this);
|
||||||
|
sudFSMMGDecorator.setGameId(gameId);
|
||||||
|
sudFSMMGDecorator.setRoomId(gameRoomId);
|
||||||
|
sudFSMMGDecorator.setUserId(getUserId());
|
||||||
|
Log.i("游戏回调", code + " " + gameId + " " + gameRoomId + " ");
|
||||||
// 调用游戏sdk加载游戏
|
// 调用游戏sdk加载游戏
|
||||||
ISudFSTAPP iSudFSTAPP = SudMGP.loadMG(activity, getUserId(), gameRoomId, code, gameId, getLanguageCode(), sudFSMMGDecorator);
|
ISudFSTAPP iSudFSTAPP = SudMGP.loadMG(activity, getUserId(), gameRoomId, code, gameId, getLanguageCode(), sudFSMMGDecorator);
|
||||||
|
|
||||||
@@ -282,6 +289,28 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
|||||||
public void onGameLog(String str) {
|
public void onGameLog(String str) {
|
||||||
SudFSMMGListener.super.onGameLog(str);
|
SudFSMMGListener.super.onGameLog(str);
|
||||||
Log.e("onGameStarted", "游戏日志:" + str);
|
Log.e("onGameStarted", "游戏日志:" + str);
|
||||||
|
if (!StringUtil.isEmpty()) {
|
||||||
|
try {
|
||||||
|
JSONObject json = JSONObject.parseObject(str);
|
||||||
|
if ("error".equals(json.getString("level"))) {
|
||||||
|
String msg = json.getString("msg");
|
||||||
|
JSONObject error = JSONObject.parseObject(msg);
|
||||||
|
if (error.containsKey("msg")) {
|
||||||
|
int resultCode = error.getInteger("resultCode");
|
||||||
|
switch (resultCode) {
|
||||||
|
case 100503:
|
||||||
|
ToastUtil.show(WordUtil.isNewZh()?"有玩家未点击准备":":There are players who haven't clicked \"Ready\" yet.");
|
||||||
|
break;
|
||||||
|
case 100504:
|
||||||
|
ToastUtil.show(WordUtil.isNewZh()?"小于游戏最小开始人数":"The number of players is less than the minimum required to start the game.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ignore) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
/**
|
/**
|
||||||
* 游戏的语言代码
|
* 游戏的语言代码
|
||||||
*/
|
*/
|
||||||
public String languageCode = "zh-CN";
|
public String languageCode = "zh-TW";
|
||||||
|
|
||||||
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
@Override
|
@Override
|
||||||
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
||||||
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||||
languageCode = "zh-CN";
|
languageCode = "zh-TW";
|
||||||
}else {
|
}else {
|
||||||
languageCode = "en-US";
|
languageCode = "en-US";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ import tech.sud.mgp.core.ISudFSMStateHandle;
|
|||||||
*/
|
*/
|
||||||
public class SudFSMMGDecorator implements ISudFSMMG {
|
public class SudFSMMGDecorator implements ISudFSMMG {
|
||||||
|
|
||||||
|
private static final String TAG = "游戏回调";
|
||||||
|
private long gameId;
|
||||||
|
private String gameRoomId;
|
||||||
|
private String userId;
|
||||||
// 回调
|
// 回调
|
||||||
private SudFSMMGListener sudFSMMGListener;
|
private SudFSMMGListener sudFSMMGListener;
|
||||||
|
|
||||||
@@ -227,10 +231,10 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_GAME_STATE: // 10. 游戏状态
|
case SudMGPMGState.MG_COMMON_GAME_STATE: // 10. 游戏状态
|
||||||
Log.e("onGameStateChange", "mg_common_game_state:::::" + "dataJson:::::"+dataJson);
|
Log.e("onGameStateChange", "mg_common_game_state:::::" + "dataJson:::::" + dataJson);
|
||||||
SudMGPMGState.MGCommonGameState mgCommonGameState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameState.class);
|
SudMGPMGState.MGCommonGameState mgCommonGameState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameState.class);
|
||||||
sudFSMMGCache.onGameMGCommonGameState(mgCommonGameState);
|
sudFSMMGCache.onGameMGCommonGameState(mgCommonGameState);
|
||||||
if (mgCommonGameState.gameState==2){
|
if (mgCommonGameState.gameState == 2) {
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
|
||||||
}
|
}
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
@@ -354,6 +358,14 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_GAME_CREATE_ORDER: // 25. 创建订单
|
case SudMGPMGState.MG_COMMON_GAME_CREATE_ORDER: // 25. 创建订单
|
||||||
SudMGPMGState.MGCommonGameCreateOrder mgCommonGameCreateOrder = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameCreateOrder.class);
|
SudMGPMGState.MGCommonGameCreateOrder mgCommonGameCreateOrder = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameCreateOrder.class);
|
||||||
|
if (mgCommonGameCreateOrder != null) {
|
||||||
|
mgCommonGameCreateOrder.gameId = gameId;
|
||||||
|
mgCommonGameCreateOrder.gameRoomId = gameRoomId;
|
||||||
|
mgCommonGameCreateOrder.userId = userId;
|
||||||
|
mgCommonGameCreateOrder.dataJson = dataJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.i(TAG, "onGameStateChange: " + dataJson);
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
} else {
|
} else {
|
||||||
@@ -1021,4 +1033,15 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
return sudFSMMGCache;
|
return sudFSMMGCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setGameId(long gameId) {
|
||||||
|
this.gameId = gameId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomId(String gameRoomId) {
|
||||||
|
this.gameRoomId = gameRoomId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(String userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package com.yunbao.common.sud.decorator;
|
package com.yunbao.common.sud.decorator;
|
||||||
|
|
||||||
|
import com.yunbao.common.sud.decorator.game.JumpEvent;
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
||||||
|
|
||||||
@@ -271,7 +272,13 @@ public interface SudFSMMGListener {
|
|||||||
* mg_common_game_create_order
|
* mg_common_game_create_order
|
||||||
*/
|
*/
|
||||||
default void onGameMGCommonGameCreateOrder(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameCreateOrder model) {
|
default void onGameMGCommonGameCreateOrder(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameCreateOrder model) {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
if ("addHeart".equals(model.cmd)) {
|
||||||
|
JumpEvent.addHeart(model);
|
||||||
|
} else if ("hit".equals(model.cmd)) {
|
||||||
|
JumpEvent.hit(model);
|
||||||
|
} else {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.yunbao.common.sud.decorator.game;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.event.SubGameEvent;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
import com.yunbao.common.utils.AppManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
public class JumpEvent {
|
||||||
|
private static long clickTimer = 0;
|
||||||
|
|
||||||
|
public static void addHeart(SudMGPMGState.MGCommonGameCreateOrder order) {
|
||||||
|
createOrder(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void hit(SudMGPMGState.MGCommonGameCreateOrder order) {
|
||||||
|
createOrder(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized static void createOrder(SudMGPMGState.MGCommonGameCreateOrder order) {
|
||||||
|
if (System.currentTimeMillis() - clickTimer < 500) {
|
||||||
|
//TODO 防止重复点击
|
||||||
|
HttpCallbackModel _data=new HttpCallbackModel(1001,"");
|
||||||
|
Bus.get().post(new SubGameEvent(0, _data,order.dataJson));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
clickTimer = System.currentTimeMillis();
|
||||||
|
LiveNetManager.get(AppManager.getInstance().getLastActivity())
|
||||||
|
.createGameOrder(order.gameRoomId,
|
||||||
|
order.cmd,
|
||||||
|
order.value + "",
|
||||||
|
order.gameId + "",
|
||||||
|
order.fromUid,
|
||||||
|
order.toUid,
|
||||||
|
order.gameRoomId,
|
||||||
|
order.payload,
|
||||||
|
new HttpCallback<HttpCallbackModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
|
if (data.getCode() != 0) {
|
||||||
|
ToastUtil.show(data.getMsg());
|
||||||
|
Bus.get().post(new SubGameEvent(0, data,order.dataJson));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -496,6 +496,11 @@ public class SudMGPMGState implements Serializable {
|
|||||||
public String toUid; // 目标用户uid
|
public String toUid; // 目标用户uid
|
||||||
public long value; // 所属的游戏价值
|
public long value; // 所属的游戏价值
|
||||||
public String payload; // 扩展数据 json 字符串, 特殊可选
|
public String payload; // 扩展数据 json 字符串, 特殊可选
|
||||||
|
|
||||||
|
public long gameId;
|
||||||
|
public String gameRoomId;
|
||||||
|
public String userId;
|
||||||
|
public String dataJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
105
common/src/main/java/com/yunbao/common/upload/UploadBean.java
Normal file
105
common/src/main/java/com/yunbao/common/upload/UploadBean.java
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
package com.yunbao.common.upload;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2019/4/16.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class UploadBean {
|
||||||
|
|
||||||
|
public static final int IMG = 0;
|
||||||
|
public static final int VIDEO = 1;
|
||||||
|
public static final int VOICE = 2;
|
||||||
|
private File mOriginFile;//要被上传的源文件
|
||||||
|
private File mCompressFile;//压缩后的图片文件
|
||||||
|
private String mRemoteFileName;//上传成功后在云存储上的文件名字
|
||||||
|
private String mRemoteAccessUrl;//上传成功后在云存储上的访问地址
|
||||||
|
private boolean mSuccess;//是否上传成功了
|
||||||
|
private int mType;
|
||||||
|
private Object mTag;
|
||||||
|
|
||||||
|
public UploadBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public UploadBean(File originFile, int type) {
|
||||||
|
mOriginFile = originFile;
|
||||||
|
mType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getOriginFile() {
|
||||||
|
return mOriginFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginFile(File originFile) {
|
||||||
|
mOriginFile = originFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemoteFileName() {
|
||||||
|
return mRemoteFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemoteFileName(String remoteFileName) {
|
||||||
|
mRemoteFileName = remoteFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemoteAccessUrl() {
|
||||||
|
return mRemoteAccessUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemoteAccessUrl(String remoteAccessUrl) {
|
||||||
|
mRemoteAccessUrl = remoteAccessUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getCompressFile() {
|
||||||
|
return mCompressFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompressFile(File compressFile) {
|
||||||
|
mCompressFile = compressFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return mSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccess(boolean success) {
|
||||||
|
mSuccess = success;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setEmpty() {
|
||||||
|
mOriginFile = null;
|
||||||
|
mRemoteFileName = null;
|
||||||
|
mRemoteAccessUrl = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return mOriginFile == null && mRemoteFileName == null && mRemoteAccessUrl == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return mType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getTag() {
|
||||||
|
return mTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTag(Object tag) {
|
||||||
|
mTag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "UploadBean{" +
|
||||||
|
"mOriginFile=" + mOriginFile +
|
||||||
|
", mCompressFile=" + mCompressFile +
|
||||||
|
", mRemoteFileName='" + mRemoteFileName + '\'' +
|
||||||
|
", mRemoteAccessUrl='" + mRemoteAccessUrl + '\'' +
|
||||||
|
", mSuccess=" + mSuccess +
|
||||||
|
", mType=" + mType +
|
||||||
|
", mTag=" + mTag +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.yunbao.common.upload;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2019/4/16.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface UploadCallback {
|
||||||
|
void onFinish(List<UploadBean> list, boolean success);
|
||||||
|
}
|
||||||
224
common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java
Normal file
224
common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
package com.yunbao.common.upload;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.qiniu.android.common.ServiceAddress;
|
||||||
|
import com.qiniu.android.common.Zone;
|
||||||
|
import com.qiniu.android.http.ResponseInfo;
|
||||||
|
import com.qiniu.android.storage.Configuration;
|
||||||
|
import com.qiniu.android.storage.UpCompletionHandler;
|
||||||
|
import com.qiniu.android.storage.UploadManager;
|
||||||
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import top.zibin.luban.Luban;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2019/4/16.
|
||||||
|
* 七牛上传文件
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class UploadQnImpl implements UploadStrategy {
|
||||||
|
|
||||||
|
private static final String TAG = "UploadQnImpl";
|
||||||
|
private Context mContext;
|
||||||
|
private List<UploadBean> mList;
|
||||||
|
private int mIndex;
|
||||||
|
private boolean mNeedCompress;
|
||||||
|
private UploadCallback mUploadCallback;
|
||||||
|
private HttpCallback mGetUploadTokenCallback;
|
||||||
|
private String mToken;
|
||||||
|
private UploadManager mUploadManager;
|
||||||
|
private UpCompletionHandler mCompletionHandler;//上传回调
|
||||||
|
private Luban.Builder mLubanBuilder;
|
||||||
|
|
||||||
|
public UploadQnImpl(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
mCompletionHandler = new UpCompletionHandler() {
|
||||||
|
@Override
|
||||||
|
public void complete(String key, ResponseInfo info, JSONObject response) {
|
||||||
|
System.out.println("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
||||||
|
//L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
||||||
|
try {
|
||||||
|
assert response != null;
|
||||||
|
mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
|
||||||
|
} catch (JSONException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
if (mList == null || mList.size() == 0) {
|
||||||
|
if (mUploadCallback != null) {
|
||||||
|
mUploadCallback.onFinish(mList, false);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UploadBean uploadBean = mList.get(mIndex);
|
||||||
|
if (info.isOK()) {
|
||||||
|
uploadBean.setSuccess(true);
|
||||||
|
if (uploadBean.getType() == UploadBean.IMG && mNeedCompress) {
|
||||||
|
//上传完成后把 压缩后的图片 删掉
|
||||||
|
File compressedFile = uploadBean.getCompressFile();
|
||||||
|
if (compressedFile != null && compressedFile.exists()) {
|
||||||
|
File originFile = uploadBean.getOriginFile();
|
||||||
|
if (originFile != null && !compressedFile.getAbsolutePath().equals(originFile.getAbsolutePath())) {
|
||||||
|
compressedFile.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mIndex++;
|
||||||
|
if (mIndex < mList.size()) {
|
||||||
|
uploadNext();
|
||||||
|
} else {
|
||||||
|
if (mUploadCallback != null) {
|
||||||
|
mUploadCallback.onFinish(mList, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
upload(mList.get(mIndex));//上传失败后 重新上传
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback, boolean isImg) {
|
||||||
|
System.err.println("-------upload------>" + list.size());
|
||||||
|
if (callback == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (list == null || list.size() == 0) {
|
||||||
|
callback.onFinish(list, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
boolean hasFile = false;
|
||||||
|
for (UploadBean bean : list) {
|
||||||
|
if (bean.getOriginFile() != null) {
|
||||||
|
hasFile = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!hasFile) {
|
||||||
|
callback.onFinish(list, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mList = list;
|
||||||
|
mNeedCompress = needCompress;
|
||||||
|
mUploadCallback = callback;
|
||||||
|
mIndex = 0;
|
||||||
|
|
||||||
|
if (mGetUploadTokenCallback == null) {
|
||||||
|
mGetUploadTokenCallback = new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && info.length > 0) {
|
||||||
|
mToken = info[0];
|
||||||
|
System.err.println("-------上传的token------>" + mToken);
|
||||||
|
L.e(TAG, "-------上传的token------>" + mToken);
|
||||||
|
uploadNext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
CommonHttpUtil.getUploadQiNiuToken(mGetUploadTokenCallback, isImg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancelUpload() {
|
||||||
|
CommonHttpUtil.cancel(CommonHttpUtil.GET_UPLOAD_QI_NIU_TOKEN);
|
||||||
|
if (mList != null) {
|
||||||
|
mList.clear();
|
||||||
|
}
|
||||||
|
mUploadCallback = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void uploadNext() {
|
||||||
|
UploadBean bean = null;
|
||||||
|
while (mIndex < mList.size() && (bean = mList.get(mIndex)).getOriginFile() == null) {
|
||||||
|
mIndex++;
|
||||||
|
}
|
||||||
|
System.err.println("-------mIndex >= mList.size() mIndex------>" + mIndex);
|
||||||
|
if (mIndex >= mList.size()) {
|
||||||
|
System.err.println("-------mIndex >= mList.size()------>" + mList.size());
|
||||||
|
if (mUploadCallback != null) {
|
||||||
|
mUploadCallback.onFinish(mList, true);
|
||||||
|
}
|
||||||
|
System.err.println("-------mIndex >= mList.returnreturnreturnreturn------>" + mList.size());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (bean.getType() == UploadBean.IMG) {
|
||||||
|
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".jpg"));
|
||||||
|
} else if (bean.getType() == UploadBean.VIDEO) {
|
||||||
|
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".mp4"));
|
||||||
|
} else if (bean.getType() == UploadBean.VOICE) {
|
||||||
|
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".m4a"));
|
||||||
|
}
|
||||||
|
System.err.println("-------mIndex >= bean.getType() == UploadBean.IMG------>" + bean);
|
||||||
|
upload(bean);
|
||||||
|
/*if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
||||||
|
System.err.println("-------UploadBean.IMG && mNeedCompress------>" + bean + "UploadBean.IMG:" + UploadBean.IMG + "__mNeedCompress" + mNeedCompress);
|
||||||
|
if (mLubanBuilder == null) {
|
||||||
|
mLubanBuilder = Luban.with(mContext).ignoreBy(8)//8k以下不压缩
|
||||||
|
.setTargetDir(CommonAppConfig.INNER_PATH).setRenameListener(new OnRenameListener() {
|
||||||
|
@Override
|
||||||
|
public String rename(String filePath) {
|
||||||
|
return mList.get(mIndex).getRemoteFileName();
|
||||||
|
}
|
||||||
|
}).setCompressListener(new OnCompressListener() {
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(File file) {
|
||||||
|
UploadBean uploadBean = mList.get(mIndex);
|
||||||
|
uploadBean.setCompressFile(file);
|
||||||
|
upload(uploadBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
upload(mList.get(mIndex));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
mLubanBuilder.load(bean.getOriginFile()).launch();
|
||||||
|
} else {
|
||||||
|
System.err.println("-------bean.getType() == UploadBean.IMG && mNeedCompress else");
|
||||||
|
upload(bean);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
private void upload(UploadBean bean) {
|
||||||
|
System.err.println("-------upload(UploadBean bean)------>" + bean);
|
||||||
|
if (bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null) {
|
||||||
|
System.err.println("bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
|
||||||
|
if (mUploadManager == null) {
|
||||||
|
Zone zone = new Zone(new ServiceAddress("http://upload-z0.qiniup.com"), new ServiceAddress("http://up-z0.qiniup.com"));
|
||||||
|
Configuration configuration = new Configuration.Builder().zone(zone).build();
|
||||||
|
mUploadManager = new UploadManager(configuration);
|
||||||
|
}
|
||||||
|
File uploadFile = bean.getOriginFile();
|
||||||
|
if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
||||||
|
File compressedFile = bean.getCompressFile();
|
||||||
|
if (compressedFile != null && compressedFile.exists()) {
|
||||||
|
uploadFile = compressedFile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mUploadManager.put(uploadFile, bean.getRemoteFileName(), mToken, mCompletionHandler, null);
|
||||||
|
} else {
|
||||||
|
System.err.println("else bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
|
||||||
|
if (mUploadCallback != null) {
|
||||||
|
mUploadCallback.onFinish(mList, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.yunbao.common.upload;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by cxf on 2019/4/16.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface UploadStrategy {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行上传
|
||||||
|
*
|
||||||
|
* @param list 被上传的文件列表
|
||||||
|
* @param needCompress 是否需要压缩
|
||||||
|
* @param callback 上传回调
|
||||||
|
*/
|
||||||
|
void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback,boolean isImg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消上传
|
||||||
|
*/
|
||||||
|
void cancelUpload();
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user