Compare commits
250 Commits
master_6.6
...
gong_dev_a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3b4fe3d03 | ||
|
|
1f66204031 | ||
|
|
3a12d848e1 | ||
|
|
cf245b0df8 | ||
|
|
0ea92c00a2 | ||
|
|
a0f3f246a6 | ||
|
|
a11d7f07e9 | ||
|
|
90bc70ebf7 | ||
|
|
4618c0a4f1 | ||
|
|
15a52aaa62 | ||
|
|
6d6010d023 | ||
|
|
94156e2984 | ||
|
|
769f527565 | ||
|
|
3dcc801331 | ||
|
|
963fe2c110 | ||
|
|
9dd3619049 | ||
|
|
96b80a460b | ||
|
|
a68bee94a9 | ||
|
|
40a2843696 | ||
| 2cefd50ac3 | |||
|
|
833b58d311 | ||
|
|
f14fb4612b | ||
| 3510a565f2 | |||
| e0669e98cf | |||
|
|
8f82c7c785 | ||
|
|
2eea1f1b75 | ||
| f1a1aae787 | |||
|
|
b68c7f1c46 | ||
|
|
dd7eb2326a | ||
| 3f1fe93f3d | |||
|
|
8c9cf4e3a8 | ||
| 0451f518d5 | |||
| a154f480f6 | |||
|
|
29badbf725 | ||
|
|
e89f22329f | ||
|
|
81e08d41af | ||
| d89b356395 | |||
| 4d2985456d | |||
| 48e3ff46ab | |||
|
|
6dd3e02c1d | ||
| d8e9cc2189 | |||
|
|
0310628ba3 | ||
| 2f54fdab12 | |||
|
|
a3228f48c2 | ||
|
|
35c83a255a | ||
|
|
0aeb2d32c2 | ||
|
|
313320473f | ||
|
|
2b86927b5b | ||
|
|
bf3ebfedbd | ||
|
|
1a2db91ceb | ||
|
|
9fa4924278 | ||
|
|
3318fa761c | ||
| a7421ba1a6 | |||
|
|
40a081caa6 | ||
|
|
1485173227 | ||
|
|
d5b60523a5 | ||
|
|
309d04653e | ||
|
|
45ae3b1624 | ||
|
|
e874c2ee16 | ||
|
|
002f0ad654 | ||
|
|
bb49472817 | ||
|
|
05e4ff89d7 | ||
| 020b5c1025 | |||
|
|
2cf10cc35a | ||
|
|
4c53c990e9 | ||
|
|
cd8b58a0ec | ||
| b41bd3b89b | |||
|
|
d66f098692 | ||
|
|
f131fcf546 | ||
|
|
eeb1cc008a | ||
| 6eba9558e1 | |||
|
|
0425b56106 | ||
|
|
c5de062171 | ||
|
|
f82dbccaa5 | ||
| 07d6b959d5 | |||
| 5ae55f87fa | |||
|
|
f59e5e527a | ||
| d70c3a8b27 | |||
|
|
c20147bf8f | ||
|
|
45743e3070 | ||
|
|
b8b43c1ef2 | ||
| 73847c46a3 | |||
|
|
b7c53a3b21 | ||
| c91947ce71 | |||
|
|
62e50ae310 | ||
|
|
5baea0f156 | ||
|
|
419e3a7ab5 | ||
|
|
66822139ba | ||
|
|
5a924d9fea | ||
| cb0772c9e3 | |||
|
|
9c9eb34756 | ||
|
|
1b57d8bc8f | ||
| edc738d80b | |||
| b5417f90b4 | |||
|
|
4bd1e4bc91 | ||
|
|
cb2729433e | ||
|
|
985e626cb5 | ||
|
|
efce2ad93c | ||
|
|
6132338c6c | ||
|
|
8c89fc1de1 | ||
|
|
a061637492 | ||
| 98095e07ee | |||
| 9764b3370e | |||
|
|
bbb5a12899 | ||
|
|
680780145c | ||
|
|
19c270ad22 | ||
|
|
ce9336737f | ||
| 0396e2d06d | |||
|
|
39cf76439f | ||
|
|
11c9a53028 | ||
|
|
c4d378daba | ||
|
|
efa698ebfa | ||
|
|
6496440e5d | ||
|
|
d3de01666c | ||
| 9621d8a6d8 | |||
| 07f97fefdb | |||
| 186b9d61ee | |||
| b7c0f5d3ec | |||
| 949c0ab759 | |||
|
|
278801b77a | ||
| 5f3ebb4235 | |||
| ab24348f72 | |||
| 022806d9da | |||
|
|
b0c5d44d1c | ||
|
|
d9b1149832 | ||
|
|
9711b1f8d4 | ||
|
|
0252963b2e | ||
|
|
ff8e75768e | ||
| c92e8dd8bc | |||
|
|
01dfb81a46 | ||
|
|
0afee3543e | ||
| 8d5990c25b | |||
|
|
d5f78cc83a | ||
|
|
cf48be7d15 | ||
| 225929c891 | |||
| bc63a3e601 | |||
| c33975fe67 | |||
| c033340aad | |||
| 24170d55e2 | |||
|
|
26a71ff825 | ||
| e36fbdc6b8 | |||
|
|
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 | |||
| ae9ef1f8a1 | |||
|
|
8184cf6c7f |
@@ -1,12 +1,12 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'img-optimizer'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply from: "../package_config.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
namespace "com.yunbao.faceunity"
|
||||
compileSdk rootProject.ext.android.compileSdkVersion
|
||||
packagingOptions {
|
||||
pickFirst "lib/armeabi/libyuvutils.so"
|
||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||
@@ -33,7 +33,7 @@ android {
|
||||
versionName rootProject.ext.android.versionName
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||
}
|
||||
}
|
||||
aaptOptions {
|
||||
@@ -48,8 +48,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_18
|
||||
targetCompatibility JavaVersion.VERSION_18
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
@@ -58,15 +58,15 @@ repositories {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies["appcompat-androidx"]
|
||||
implementation rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
api rootProject.ext.dependencies["appcompat-androidx"]
|
||||
api rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
//common
|
||||
implementation project(path: ':common')
|
||||
api project(path: ':common')
|
||||
|
||||
implementation 'com.faceunity:core:8.3.1'
|
||||
implementation 'com.faceunity:model:8.3.1'
|
||||
api 'com.faceunity:core:8.7.0'
|
||||
api 'com.faceunity:model:8.7.0'
|
||||
//implementation 'com.faceunity:nama:8.3.1' //底层库-标准版
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.yunbao.faceunity;
|
||||
|
||||
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 org.junit.Test;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.yunbao.faceunity"
|
||||
>
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
@@ -96,11 +96,17 @@ public class FaceManager implements SensorEventListener {
|
||||
faceUnityView.setIFaceUnityInter(new FaceUnityView.IFaceUnityInter() {
|
||||
@Override
|
||||
public void onPause() {
|
||||
if(onMirrorChanged!=null){
|
||||
onMirrorChanged.onChange(false);
|
||||
}
|
||||
pauseFace = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
if(onMirrorChanged!=null){
|
||||
onMirrorChanged.onChange(true);
|
||||
}
|
||||
pauseFace = false;
|
||||
}
|
||||
});
|
||||
@@ -295,7 +301,18 @@ public class FaceManager implements SensorEventListener {
|
||||
|
||||
}
|
||||
|
||||
OnMirrorChanged onMirrorChanged;
|
||||
|
||||
public void setOnMirrorChanged(OnMirrorChanged onMirrorChanged) {
|
||||
this.onMirrorChanged = onMirrorChanged;
|
||||
}
|
||||
|
||||
public interface FaceStatusChanged {
|
||||
void onFaceChanged(int num);
|
||||
}
|
||||
|
||||
|
||||
public interface OnMirrorChanged{
|
||||
void onChange(boolean falg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,10 +52,10 @@ public class FURenderer extends IFURenderer {
|
||||
|
||||
|
||||
/* 特效FURenderKit*/
|
||||
private FURenderKit mFURenderKit;
|
||||
public FURenderKit mFURenderKit;
|
||||
|
||||
/* 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";
|
||||
|
||||
/* GL 线程 ID */
|
||||
|
||||
@@ -15,7 +15,7 @@ public class FaceUnityConfig {
|
||||
|
||||
/************************** 算法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";
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.google.gson.JsonObject;
|
||||
import com.yunbao.faceunity.entity.net.FineStickerEntity;
|
||||
import com.yunbao.faceunity.utils.FaceUnityData;
|
||||
import com.yunbao.faceunity.utils.FileUtils;
|
||||
import com.yunbao.faceunity.utils.ZipUtils;
|
||||
import com.yunbao.common.utils.ZipUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply from: "../package_config.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
namespace "com.samsung.android.sdk.iap.lib"
|
||||
compileSdk rootProject.ext.android.compileSdkVersion
|
||||
defaultConfig {
|
||||
minSdkVersion minSdkVersion
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
versionCode versionCode
|
||||
versionName versionName
|
||||
targetSdkVersion targetSdkVersion
|
||||
versionCode rootProject.ext.android.versionCode
|
||||
versionName rootProject.ext.android.versionName
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@@ -18,7 +20,15 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'libs', '../libs'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
}
|
||||
BIN
IAP6Helper/libs/samsung-iap-6.1.1.aar
Normal file
BIN
IAP6Helper/libs/samsung-iap-6.1.1.aar
Normal file
Binary file not shown.
@@ -1,6 +1,5 @@
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.samsung.android.sdk.iap.lib"
|
||||
android:versionCode="601000004"
|
||||
android:versionName="6.1.0">
|
||||
<!-- version code [Major/Minor/Bug fix release/Build number ] : x xx xxx xxx -->
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.samsung.android.iap.IAPConnector;
|
||||
import com.samsung.android.sdk.iap.lib.R;
|
||||
import com.samsung.android.sdk.iap.lib.activity.CheckPackageActivity;
|
||||
import com.samsung.android.sdk.iap.lib.activity.PaymentActivity;
|
||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||
import com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask;
|
||||
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
|
||||
import com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask;
|
||||
@@ -33,7 +34,6 @@ public class IapHelper extends HelperDefine {
|
||||
private static final String TAG = IapHelper.class.getSimpleName();
|
||||
|
||||
/**
|
||||
* When you release a application, this Mode must be set to {@link HelperDefine.OperationMode.OPERATION_MODE_PRODUCTION}
|
||||
* Please double-check this mode before release.
|
||||
*/
|
||||
private int mMode = HelperDefine.OperationMode.OPERATION_MODE_PRODUCTION.getValue();
|
||||
@@ -46,9 +46,9 @@ public class IapHelper extends HelperDefine {
|
||||
|
||||
// AsyncTask for API
|
||||
// ========================================================================
|
||||
private GetProductsDetailsTask mGetProductsDetailsTask = null;
|
||||
private GetOwnedListTask mGetOwnedListTask = null;
|
||||
private ConsumePurchasedItemsTask mConsumePurchasedItemsTask = null;
|
||||
private com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask mGetProductsDetailsTask = null;
|
||||
private com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask mGetOwnedListTask = null;
|
||||
private com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask mConsumePurchasedItemsTask = null;
|
||||
// ========================================================================
|
||||
|
||||
private ArrayList<BaseService> mServiceQueue = new ArrayList<BaseService>();
|
||||
@@ -267,7 +267,7 @@ public class IapHelper extends HelperDefine {
|
||||
if (mIapConnector == null || mContext == null) {
|
||||
return false;
|
||||
} else {
|
||||
mGetProductsDetailsTask = new GetProductsDetailsTask(_baseService,
|
||||
mGetProductsDetailsTask = new com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask(_baseService,
|
||||
mIapConnector,
|
||||
mContext,
|
||||
_productIDs,
|
||||
@@ -344,7 +344,7 @@ public class IapHelper extends HelperDefine {
|
||||
if (mIapConnector == null || mContext == null) {
|
||||
return false;
|
||||
} else {
|
||||
mGetOwnedListTask = new GetOwnedListTask(_baseService,
|
||||
mGetOwnedListTask = new com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask(_baseService,
|
||||
mIapConnector,
|
||||
mContext,
|
||||
_productType,
|
||||
@@ -417,7 +417,7 @@ public class IapHelper extends HelperDefine {
|
||||
mConsumePurchasedItemsTask.cancel(true);
|
||||
}
|
||||
|
||||
mConsumePurchasedItemsTask = new ConsumePurchasedItemsTask(_baseService,
|
||||
mConsumePurchasedItemsTask = new com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask(_baseService,
|
||||
mIapConnector,
|
||||
mContext,
|
||||
_purchaseIds,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'img-optimizer'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply from: "../package_config.gradle"
|
||||
|
||||
android {
|
||||
namespace "com.pdlive.shayu"
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
packagingOptions {
|
||||
@@ -33,7 +34,7 @@ android {
|
||||
versionName rootProject.ext.android.versionName
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||
}
|
||||
}
|
||||
aaptOptions {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.pdlive.shayu">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<queries>
|
||||
<package android:name="com.pdlive.shayu"/>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
260
app/build.gradle
260
app/build.gradle
@@ -3,39 +3,11 @@ apply plugin: 'img-optimizer'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
apply from: "../package_config.gradle"
|
||||
|
||||
android {
|
||||
dexOptions {
|
||||
jumboMode = true
|
||||
}
|
||||
project.tasks.getByName("tasks").doFirst {
|
||||
|
||||
}
|
||||
/* applicationVariants.all { variant ->
|
||||
variant.mergeAssetsProvider.configure {
|
||||
doLast {
|
||||
delete(fileTree(dir: outputDir, includes: [
|
||||
'model/ai_bgseg_green.bundle',
|
||||
'model/ai_face_processor.bundle',
|
||||
'model/ai_face_processor_lite.bundle',
|
||||
'model/ai_hairseg.bundle',
|
||||
'model/ai_hand_processor.bundle',
|
||||
'model/ai_human_processor.bundle',
|
||||
'model/ai_human_processor_gpu.bundle',
|
||||
'model/ai_human_processor_mb_fast.bundle',
|
||||
'graphics/body_slim.bundle',
|
||||
'graphics/controller_cpp.bundle',
|
||||
'graphics/face_beautification.bundle',
|
||||
'graphics/face_makeup.bundle',
|
||||
'graphics/fuzzytoonfilter.bundle',
|
||||
'graphics/fxaa.bundle',
|
||||
'graphics/tongue.bundle'
|
||||
]))
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
namespace "myname.pdlive.shayu"
|
||||
compileSdk rootProject.ext.android.compileSdkVersion
|
||||
packagingOptions {
|
||||
pickFirst "lib/armeabi/libyuvutils.so"
|
||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||
@@ -103,35 +75,149 @@ android {
|
||||
exclude 'lib/arm64-v8a/libfuai.so'
|
||||
}
|
||||
|
||||
//声网 rtc
|
||||
exclude 'lib/arm64-v8a/libagora_ai_echo_cancellation_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_ai_noise_suppression_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_audio_beauty_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_clear_vision_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_content_inspect_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_face_capture_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_face_detection_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_lip_sync_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_screen_capture_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_segmentation_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_spatial_audio_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_video_av1_decoder_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_video_decoder_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_video_encoder_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora_video_quality_analyzer_extension.so'
|
||||
exclude 'lib/arm64-v8a/libagora-core.so'
|
||||
exclude 'lib/arm64-v8a/libagora-fdkaac.so'
|
||||
exclude 'lib/arm64-v8a/libagora-ffmpeg.so'
|
||||
exclude 'lib/arm64-v8a/libagora-rtc-sdk.so'
|
||||
exclude 'lib/arm64-v8a/libagora-soundtouch.so'
|
||||
exclude 'lib/arm64-v8a/libvideo_dec.so'
|
||||
exclude 'lib/arm64-v8a/libvideo_enc.so'
|
||||
|
||||
exclude 'lib/armeabi-v7a/libagora_ai_echo_cancellation_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_ai_noise_suppression_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_audio_beauty_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_clear_vision_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_content_inspect_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_face_capture_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_face_detection_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_lip_sync_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_screen_capture_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_segmentation_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_spatial_audio_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_video_av1_decoder_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_video_decoder_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_video_encoder_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora_video_quality_analyzer_extension.so'
|
||||
exclude 'lib/armeabi-v7a/libagora-core.so'
|
||||
exclude 'lib/armeabi-v7a/libagora-fdkaac.so'
|
||||
exclude 'lib/armeabi-v7a/libagora-ffmpeg.so'
|
||||
exclude 'lib/armeabi-v7a/libagora-rtc-sdk.so'
|
||||
exclude 'lib/armeabi-v7a/libagora-soundtouch.so'
|
||||
exclude 'lib/armeabi-v7a/libvideo_dec.so'
|
||||
exclude 'lib/armeabi-v7a/libvideo_enc.so'
|
||||
|
||||
exclude 'lib/x86/libagora_ai_echo_cancellation_extension.so'
|
||||
exclude 'lib/x86/libagora_ai_noise_suppression_extension.so'
|
||||
exclude 'lib/x86/libagora_audio_beauty_extension.so'
|
||||
exclude 'lib/x86/libagora_clear_vision_extension.so'
|
||||
exclude 'lib/x86/libagora_content_inspect_extension.so'
|
||||
exclude 'lib/x86/libagora_face_capture_extension.so'
|
||||
exclude 'lib/x86/libagora_face_detection_extension.so'
|
||||
exclude 'lib/x86/libagora_lip_sync_extension.so'
|
||||
exclude 'lib/x86/libagora_screen_capture_extension.so'
|
||||
exclude 'lib/x86/libagora_segmentation_extension.so'
|
||||
exclude 'lib/x86/libagora_spatial_audio_extension.so'
|
||||
exclude 'lib/x86/libagora_video_av1_decoder_extension.so'
|
||||
exclude 'lib/x86/libagora_video_decoder_extension.so'
|
||||
exclude 'lib/x86/libagora_video_encoder_extension.so'
|
||||
exclude 'lib/x86/libagora_video_quality_analyzer_extension.so'
|
||||
exclude 'lib/x86/libagora-core.so'
|
||||
exclude 'lib/x86/libagora-fdkaac.so'
|
||||
exclude 'lib/x86/libagora-ffmpeg.so'
|
||||
exclude 'lib/x86/libagora-rtc-sdk.so'
|
||||
exclude 'lib/x86/libagora-soundtouch.so'
|
||||
exclude 'lib/x86/libvideo_dec.so'
|
||||
exclude 'lib/x86/libvideo_enc.so'
|
||||
|
||||
exclude 'lib/x86_64/libagora_ai_echo_cancellation_extension.so'
|
||||
exclude 'lib/x86_64/libagora_ai_noise_suppression_extension.so'
|
||||
exclude 'lib/x86_64/libagora_audio_beauty_extension.so'
|
||||
exclude 'lib/x86_64/libagora_clear_vision_extension.so'
|
||||
exclude 'lib/x86_64/libagora_content_inspect_extension.so'
|
||||
exclude 'lib/x86_64/libagora_face_capture_extension.so'
|
||||
exclude 'lib/x86_64/libagora_face_detection_extension.so'
|
||||
exclude 'lib/x86_64/libagora_lip_sync_extension.so'
|
||||
exclude 'lib/x86_64/libagora_screen_capture_extension.so'
|
||||
exclude 'lib/x86_64/libagora_segmentation_extension.so'
|
||||
exclude 'lib/x86_64/libagora_spatial_audio_extension.so'
|
||||
exclude 'lib/x86_64/libagora_video_av1_decoder_extension.so'
|
||||
exclude 'lib/x86_64/libagora_video_decoder_extension.so'
|
||||
exclude 'lib/x86_64/libagora_video_encoder_extension.so'
|
||||
exclude 'lib/x86_64/libagora_video_quality_analyzer_extension.so'
|
||||
exclude 'lib/x86_64/libagora-core.so'
|
||||
exclude 'lib/x86_64/libagora-fdkaac.so'
|
||||
exclude 'lib/x86_64/libagora-ffmpeg.so'
|
||||
exclude 'lib/x86_64/libagora-rtc-sdk.so'
|
||||
exclude 'lib/x86_64/libagora-soundtouch.so'
|
||||
exclude 'lib/x86_64/libvideo_dec.so'
|
||||
exclude 'lib/x86_64/libvideo_enc.so'
|
||||
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_18
|
||||
targetCompatibility JavaVersion.VERSION_18
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
println "清空build文件夹";
|
||||
for (final def project in rootProject.getAllprojects()) {
|
||||
delete project.buildDir
|
||||
println project.buildDir
|
||||
def name = variant.name.replace('Debug', '').replace('Release', '').toLowerCase()
|
||||
//delete project.buildDir
|
||||
delete project.rootDir.absolutePath+File.separator+"app"+File.separator+name
|
||||
//println project.buildDir
|
||||
}
|
||||
//delete project.rootDir.absolutePath + File.separator + "outputs"
|
||||
String variantName = variant.name.capitalize()
|
||||
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
||||
processManifestTask.doLast { pm ->
|
||||
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
|
||||
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
||||
String manifestPath = "build/intermediates/bundle_manifest/google_onlineRelease/bundle-manifest/AndroidManifest.xml"
|
||||
def isGooglePlay = variant.name.contains("google")
|
||||
println "谷歌版本:" + isGooglePlay
|
||||
println "文件存在" + file(manifestPath).exists()
|
||||
println "" + (isGooglePlay != 0)
|
||||
println "" + (file(manifestPath).exists() && isGooglePlay)
|
||||
if (file(manifestPath).exists() && isGooglePlay) {
|
||||
def manifestContent = file(manifestPath).getText()
|
||||
|
||||
println "移除权限"
|
||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
||||
file(manifestPath).write(manifestContent)
|
||||
} else {
|
||||
print "not Exists = " + manifestPath
|
||||
}
|
||||
manifestPath = "build/intermediates/merged_manifests/google_onlineRelease/processReleaseManifest/AndroidManifest.xml"
|
||||
if (file(manifestPath).exists() && isGooglePlay) {
|
||||
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 {
|
||||
doLast {
|
||||
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_hairseg.bundle',
|
||||
'model/ai_hand_processor.bundle',
|
||||
@@ -158,33 +244,64 @@ android {
|
||||
]))
|
||||
println "isPluginModel = " + 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']))
|
||||
} else {
|
||||
println "不删除bundle"
|
||||
}
|
||||
}
|
||||
}
|
||||
variant.outputs.all {
|
||||
def isGoogle = "链接"
|
||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 1) {
|
||||
isGoogle = "谷歌"
|
||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
||||
isGoogle = "Huawei"
|
||||
}else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) {
|
||||
isGoogle = "Samsung"
|
||||
variant.assemble.doLast { vt ->
|
||||
def channel = ''
|
||||
def server = ''
|
||||
if (variant.name.contains('huawei')) {
|
||||
channel = "华为"
|
||||
} else if (variant.name.contains('samsung')) {
|
||||
channel = "三星"
|
||||
} else if (variant.name.contains('google')) {
|
||||
channel = "谷歌"
|
||||
} else {
|
||||
channel = "链接"
|
||||
}
|
||||
def isPlugin = "完整"
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
isPlugin = "插件"
|
||||
if (variant.name.contains('online')) {
|
||||
server = '正式服'
|
||||
} else {
|
||||
server = '测试服'
|
||||
}
|
||||
def isTest = "测试服"
|
||||
if (rootProject.ext.manifestPlaceholders.serverHost == "https://napi.yaoulive.com") {
|
||||
isTest = "正式服"
|
||||
def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.apk"
|
||||
variant.outputs.forEach { fe ->
|
||||
copy {
|
||||
from fe.outputFile
|
||||
into file("${project.rootDir}\\outputs\\apk\\")
|
||||
rename { fn ->
|
||||
fileName
|
||||
}
|
||||
}
|
||||
}
|
||||
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
||||
|
||||
}
|
||||
tasks.named("sign${variant.name.capitalize()}Bundle", com.android.build.gradle.internal.tasks.FinalizeBundleTask) {
|
||||
File file = finalBundleFile.asFile.get()
|
||||
def channel = ''
|
||||
def server = ''
|
||||
if (variant.name.startsWith('huawei')) {
|
||||
channel = "华为"
|
||||
} else if (variant.name.startsWith('samsung')) {
|
||||
channel = "三星"
|
||||
} else if (variant.name.startsWith('google')) {
|
||||
channel = "谷歌"
|
||||
} else {
|
||||
channel = "链接"
|
||||
}
|
||||
if (variant.name.contains('online')) {
|
||||
server = '正式服'
|
||||
} else {
|
||||
server = '测试服'
|
||||
}
|
||||
def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.aab"
|
||||
File finalFile = new File("${project.rootDir}\\outputs\\aab", fileName)
|
||||
finalBundleFile.set(finalFile)
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -224,8 +341,17 @@ android {
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
multiDexEnabled true
|
||||
ndk {
|
||||
// TODO: 谷歌商城需要兼容两个平台
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
Gradle gradle = getGradle()
|
||||
String tskReqStr = gradle.getStartParameter().getTaskRequests().args.toString()
|
||||
println("处理ndk 版本 = " + tskReqStr)
|
||||
def isLink = tskReqStr.contains("Link")
|
||||
if (isLink) {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
||||
println("打包ndk 链接")
|
||||
} else {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
println("打包ndk其他")
|
||||
}
|
||||
}
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
@@ -255,7 +381,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'libs', '../libs'
|
||||
@@ -273,6 +398,7 @@ dependencies {
|
||||
api project(':main')
|
||||
//短视频
|
||||
api project(':video')
|
||||
implementation project(path: ':lib_so')
|
||||
|
||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||
|
||||
@@ -280,18 +406,4 @@ dependencies {
|
||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
|
||||
|
||||
|
||||
}
|
||||
// 链接包需要注释掉 否正无法更新 谷歌包需要打开
|
||||
/*
|
||||
project.afterEvaluate {
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
output.processResources.doFirst { pm->
|
||||
String manifestPath = output.processResources.manifestFile;
|
||||
def manifestContent = file(manifestPath).getText()
|
||||
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
||||
file(manifestPath).write(manifestContent)
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
25
app/proguard-rules.pro
vendored
25
app/proguard-rules.pro
vendored
@@ -190,13 +190,18 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl*
|
||||
|
||||
#--------ARouter
|
||||
|
||||
-keep public class com.alibaba.android.arouter.**{*;}
|
||||
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
||||
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
||||
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
||||
|
||||
# If you use the byType method to obtain Service, add the following rules to protect the interface:
|
||||
# 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口
|
||||
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现
|
||||
-keep class * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
# If single-type injection is used, that is, no interface is defined to implement IProvider, the following rules need to be added to protect the implementation
|
||||
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
@@ -275,6 +280,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.nft.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.** {*;}
|
||||
|
||||
@@ -292,3 +309,9 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
|
||||
-keep class com.shayu.lib_google.**{*;}
|
||||
-keep class com.shayu.lib_huawei.**{*;}
|
||||
|
||||
-keep class io.agora.**{*;}
|
||||
|
||||
-keep class com.qiniu.**{*;}
|
||||
-keep class com.qiniu.**{public <init>();}
|
||||
-ignorewarnings
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="myname.pdlive.shayu">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.CALL_PHONE"
|
||||
@@ -89,6 +88,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.ACCESS_NOTIFICATION_POLICY" />
|
||||
|
||||
<!-- 声网新增 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
|
||||
|
||||
<queries>
|
||||
<package android:name="com.twitter.android" />
|
||||
<package android:name="jp.naver.line.android" />
|
||||
@@ -157,6 +161,12 @@
|
||||
<meta-data
|
||||
android:name="firebase_crashlytics_collection_enabled"
|
||||
android:value="${isUploadLog}" />
|
||||
<meta-data
|
||||
android:name="BUILD_TIME"
|
||||
android:value="${buildTime}" />
|
||||
<meta-data
|
||||
android:name="SW_RELEASE_MODEL"
|
||||
android:value="${swReleaseModel}" />
|
||||
<meta-data
|
||||
android:name="com.openinstall.APP_KEY"
|
||||
android:value="smvslm" />
|
||||
|
||||
@@ -25,13 +25,11 @@ import com.blankj.utilcode.util.Utils;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.fm.openinstall.OpenInstall;
|
||||
import com.google.gson.Gson;
|
||||
import com.shayu.phonelive.utils.LogUtils;
|
||||
import com.pdlive.lib_so.DynamicSoLauncher;
|
||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
@@ -39,6 +37,7 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AnchorStartLiveBean;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.event.SudGameSocketImEvent;
|
||||
import com.yunbao.common.manager.OpenAdManager;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
@@ -48,12 +47,17 @@ import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.GoogleUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LoadSoUtil;
|
||||
import com.yunbao.common.utils.LogUtils;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.live.socket.SocketReceiveBean;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.socket.SocketSwClient;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
import com.yunbao.live.views.PortraitLiveManager;
|
||||
import com.yunbao.live.views.RecommendLiveRoomProvider;
|
||||
import com.yunbao.main.activity.LoginActivity;
|
||||
import com.yunbao.main.activity.MsgSettActivity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -63,6 +67,7 @@ import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
@@ -108,27 +113,31 @@ public class AppContext extends CommonAppContext {
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(@NonNull Activity activity) {
|
||||
AppManager.getInstance().removeActivity(activity);
|
||||
for (WeakReference<Activity> reference : activities) {
|
||||
if (reference.get() == activity) {
|
||||
activities.remove(reference);
|
||||
return;
|
||||
}
|
||||
}
|
||||
AppManager.getInstance().removeActivity(activity);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
activities.add(new WeakReference<>(activity));
|
||||
if (activity instanceof LoginActivity) {
|
||||
AppManager.getInstance().clear();
|
||||
}
|
||||
CrashSaveBean.getInstance().setActivitySize(activities);
|
||||
AppManager.getInstance().addActivity(activity);
|
||||
OpenAdManager.getInstance().dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(@NonNull Activity activity) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,11 +146,23 @@ public class AppContext extends CommonAppContext {
|
||||
if (!isMainProcess()) {
|
||||
return;
|
||||
}
|
||||
//如果第三方的SDK自己不支持动态加载so文件时,需要自己主动加载so
|
||||
String path = LoadSoUtil.so_path + "/";
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
file.mkdir();
|
||||
}
|
||||
// 在合适的时候将自定义路径插入so检索路径 需要使用者自己负责在这个路径上有写入权限
|
||||
DynamicSoLauncher.INSTANCE.initDynamicSoConfig(this, path, s -> {
|
||||
// 处理一些自定义逻辑
|
||||
return true;
|
||||
});
|
||||
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
|
||||
//注册全局异常捕获
|
||||
registerError();
|
||||
registerFirebaseCrash();
|
||||
LogUtils.start(this);
|
||||
//DebugDialog.getInstance().setParams("初始化","启动");
|
||||
sInstance = this;
|
||||
L.setDeBug(BuildConfig.DEBUG);
|
||||
AppEventsLogger.activateApp(this);
|
||||
@@ -164,20 +185,20 @@ public class AppContext extends CommonAppContext {
|
||||
OpenInstall.init(this);
|
||||
}
|
||||
//设置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异常捕获功能
|
||||
MobclickAgent.setCatchUncaughtExceptions(false);
|
||||
//PushSDK初始化(如使用推送SDK,必须调用此方法)
|
||||
|
||||
//统计SDK是否支持采集在子进程中打点的自定义事件,默认不支持
|
||||
UMConfigure.setProcessEvent(true);//支持多进程打点
|
||||
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
||||
UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
||||
//UMConfigure.setProcessEvent(true);//支持多进程打点
|
||||
//MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
||||
//UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
||||
|
||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||
//初始化 AndroidUtilCode
|
||||
@@ -198,7 +219,7 @@ public class AppContext extends CommonAppContext {
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
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);
|
||||
//融云直播间聊天
|
||||
Message msg = Message.obtain();
|
||||
@@ -209,6 +230,31 @@ public class AppContext extends CommonAppContext {
|
||||
if (content.getContent().contains("_method_")) {
|
||||
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()))) {
|
||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
||||
@@ -219,13 +265,16 @@ public class AppContext extends CommonAppContext {
|
||||
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) && SocketRyClient.mSocketHandler != null) {
|
||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||
}
|
||||
|
||||
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
||||
EventBus.getDefault().post(message);
|
||||
}
|
||||
@@ -274,6 +323,7 @@ public class AppContext extends CommonAppContext {
|
||||
|
||||
});
|
||||
configSPApp();
|
||||
|
||||
//初始化美颜SDK
|
||||
// FaceManager.initFaceUnity(this);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.shayu.phonelive.activity;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
@@ -22,7 +21,6 @@ import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
|
||||
@@ -50,14 +48,12 @@ import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.DownloadUtil;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LogUtil;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.views.LauncherAdViewHolder;
|
||||
import com.yunbao.main.activity.EntryActivity;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
@@ -74,6 +70,7 @@ import java.util.List;
|
||||
|
||||
import myname.pdlive.shayu.R;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/17.
|
||||
*/
|
||||
@@ -113,6 +110,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||
@@ -144,7 +142,11 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
}
|
||||
};
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -229,7 +231,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
} else {
|
||||
checkUidAndToken();
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
@@ -586,4 +588,5 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
this.finish();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ android {
|
||||
versionName rootProject.ext.android.versionName
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a","arm64-v8a"
|
||||
abiFilters "armeabi-v7a","arm64-v8a","x86","x86_64"
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
|
||||
@@ -31,7 +31,7 @@ android {
|
||||
versionName rootProject.ext.android.versionName
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a","arm64-v8a"
|
||||
abiFilters "armeabi-v7a","arm64-v8a","x86","x86_64"
|
||||
}
|
||||
}
|
||||
aaptOptions {
|
||||
|
||||
27
build.gradle
27
build.gradle
@@ -1,30 +1,31 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
apply from: "config.gradle"
|
||||
apply from: "dependencies.gradle"
|
||||
|
||||
apply from: "config.gradle"
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.6.20'
|
||||
ext.kotlin_version = '1.8.22'
|
||||
repositories {
|
||||
maven { url "https://mvn.mob.com/android" }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url 'https://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url 'https://repo1.maven.org/maven2/' }//埋点
|
||||
maven {url 'https://developer.huawei.com/repo/'}
|
||||
maven { url "https://jitpack.io" }
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.0.2'
|
||||
classpath 'com.android.tools.build:gradle:8.3.1'
|
||||
//一键压缩png工具
|
||||
classpath 'com.chenenyu:img-optimizer:1.3.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.3.3'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
||||
classpath "com.alibaba:arouter-register:1.0.2"
|
||||
classpath "com.github.jadepeakpoet.ARouter:arouter-register:1.0.3"
|
||||
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
|
||||
}
|
||||
|
||||
@@ -40,16 +41,22 @@ allprojects {
|
||||
maven { url "https://mvn.mob.com/android" }
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'http://developer.huawei.com/repo'}//华为库
|
||||
maven { url 'https://developer.huawei.com/repo'}//华为库
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url 'https://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://repo1.maven.org/maven2/' }//埋点
|
||||
google() // Google's Maven repository
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
/*task clean(type: Delete) {
|
||||
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.14'
|
||||
// AGORA_RTC_SDK= "${rootProject.rootDir.absolutePath}/sdk"
|
||||
// AGORA_RTC_SDK="io.agora.rtc:full-sdk:4.2.6"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'img-optimizer'
|
||||
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "../package_config.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
namespace "com.yunbao.common"
|
||||
compileSdk rootProject.ext.android.compileSdkVersion
|
||||
publishNonDefault true
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
@@ -13,7 +15,18 @@ android {
|
||||
versionName rootProject.ext.android.versionName
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
// abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 0) {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
||||
} else {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
}
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +66,11 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_18
|
||||
targetCompatibility JavaVersion.VERSION_18
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
@@ -64,7 +80,10 @@ repositories {
|
||||
}
|
||||
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation project(':lib_so')
|
||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
api files('libs/jcc-bate-0.7.3.jar')
|
||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||
@@ -158,14 +177,14 @@ dependencies {
|
||||
//腾讯im
|
||||
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
||||
api 'com.google.code.gson:gson:2.8.8'
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.0' // 音视频通话基础能力库
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.7.0' // 音视频通话基础能力库
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.2.0.2'
|
||||
api 'cn.rongcloud.sdk:im_lib:5.7.0'
|
||||
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_kit:5.2.5.4' // 即时通讯 UI 基础组件
|
||||
api 'cn.rongcloud.sdk:im_kit:5.7.0' // 即时通讯 UI 基础组件
|
||||
//融云小视频模块
|
||||
api 'cn.rongcloud.sdk:sight:5.2.5.4'
|
||||
api 'cn.rongcloud.sdk:sight:5.7.0'
|
||||
api 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||
implementation 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||
|
||||
@@ -200,9 +219,7 @@ dependencies {
|
||||
//自定义圆角图片
|
||||
api 'com.makeramen:roundedimageview:2.3.0'
|
||||
// 友盟统计SDK
|
||||
api 'com.umeng.umsdk:common:9.6.3'// 必选
|
||||
api 'com.umeng.umsdk:asms:1.8.0'// 必选
|
||||
api 'com.umeng.umsdk:uyumao:1.1.2'
|
||||
// api(name: 'umeng-common-9.6.8+000', ext: 'aar')
|
||||
//高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。
|
||||
// 标准版本SudMGP SDK
|
||||
api 'tech.sud.mgp:SudMGP:1.3.3.1158'
|
||||
@@ -219,7 +236,29 @@ dependencies {
|
||||
api project(':lib_google')
|
||||
|
||||
//samsung插件包
|
||||
api project(':IAP6Helper')
|
||||
//api project(':IAP6Helper')
|
||||
|
||||
//時間選擇器
|
||||
api 'com.contrarywind:Android-PickerView:4.1.9'
|
||||
|
||||
//瀑布流
|
||||
api 'com.wuxiaolong.pullloadmorerecyclerview:library:1.1.2'
|
||||
//时间选择器
|
||||
api 'com.contrarywind:Android-PickerView:4.1.9'
|
||||
//UI框架
|
||||
api 'com.github.xuexiangjys:XUI:1.1.6'
|
||||
api 'com.github.xuexiangjys.XUtil:xutil-core:2.0.0'
|
||||
|
||||
//ExoPlayer,腾讯的播放器不支持无缝切换
|
||||
api 'com.google.android.exoplayer:exoplayer:2.18.2'
|
||||
api 'com.google.android.exoplayer:exoplayer-core:2.18.2@aar'
|
||||
//文字渐变色
|
||||
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'
|
||||
api 'com.xj.marqueeView:marqueeView:0.1.20'
|
||||
|
||||
api rootProject.ext.dependencies["blank-utilcode"]
|
||||
}
|
||||
|
||||
BIN
common/libs/samsung-iap-6.1.1.aar
Normal file
BIN
common/libs/samsung-iap-6.1.1.aar
Normal file
Binary file not shown.
3
common/proguard-rules.pro
vendored
3
common/proguard-rules.pro
vendored
@@ -23,3 +23,6 @@
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
-keep class com.qiniu.**{*;}
|
||||
-keep class com.qiniu.**{public <init>();}
|
||||
-ignorewarnings
|
||||
@@ -1,5 +1,4 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.yunbao.common">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||
|
||||
@@ -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_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卡
|
||||
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 int alert_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() {
|
||||
|
||||
@@ -119,8 +144,7 @@ public class CommonAppConfig {
|
||||
|
||||
public String getUid() {
|
||||
if (TextUtils.isEmpty(mUid)) {
|
||||
String[] uidAndToken = SpUtil.getInstance()
|
||||
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||
String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||
if (uidAndToken != null) {
|
||||
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
||||
mUid = uidAndToken[0];
|
||||
@@ -311,9 +335,7 @@ public class CommonAppConfig {
|
||||
mUid = null;
|
||||
mToken = null;
|
||||
mLoginIM = false;
|
||||
SpUtil.getInstance().removeValue(
|
||||
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
|
||||
);
|
||||
SpUtil.getInstance().removeValue(SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN);
|
||||
}
|
||||
|
||||
|
||||
@@ -349,12 +371,7 @@ public class CommonAppConfig {
|
||||
mProvince = null;
|
||||
mCity = null;
|
||||
mDistrict = null;
|
||||
SpUtil.getInstance().removeValue(
|
||||
SpUtil.LOCATION_LNG,
|
||||
SpUtil.LOCATION_LAT,
|
||||
SpUtil.LOCATION_PROVINCE,
|
||||
SpUtil.LOCATION_CITY,
|
||||
SpUtil.LOCATION_DISTRICT);
|
||||
SpUtil.getInstance().removeValue(SpUtil.LOCATION_LNG, SpUtil.LOCATION_LAT, SpUtil.LOCATION_PROVINCE, SpUtil.LOCATION_CITY, SpUtil.LOCATION_DISTRICT);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -202,6 +202,8 @@ public class Constants {
|
||||
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
||||
public static final String Lucky100Check = "Lucky100Check";//幸运天使
|
||||
|
||||
public static final String PrankSendData = "PrankSendData";//整蛊进度
|
||||
|
||||
public static final int SOCKET_WHAT_CONN = 0;
|
||||
public static final int SOCKET_WHAT_DISCONN = 2;
|
||||
public static final int SOCKET_WHAT_BROADCAST = 1;
|
||||
@@ -267,11 +269,15 @@ public class Constants {
|
||||
public static final String LIVE_PK_RANDOM_START="RankingStartRandomPK";
|
||||
public static final int LIVE_SDK_KSY = 0;//金山推流
|
||||
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_ANCHOR = 1;//主播与主播连麦
|
||||
|
||||
public static final String SOCKET_LIVE_ANCHOR_PK_DIALOG="GuildCompetitionNotice";//公会赛弹窗
|
||||
|
||||
//视频举报获取位置
|
||||
public static int xIndex = 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 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";
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
@@ -24,13 +25,12 @@ import android.widget.TextView;
|
||||
import androidx.annotation.Nullable;
|
||||
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.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.LifeCycleListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -59,7 +59,6 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
create();
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
isFullWindow = getIntent().getBooleanExtra("isFull", false);
|
||||
@@ -68,6 +67,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
}
|
||||
}
|
||||
create();
|
||||
super.onCreate(savedInstanceState);
|
||||
mTag = this.getClass().getSimpleName();
|
||||
setStatusBar();
|
||||
@@ -92,7 +92,8 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
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) {
|
||||
if (v.getId() == R.id.btn_back) {
|
||||
onBackPressed();
|
||||
@@ -121,7 +133,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
/**
|
||||
* 设置透明状态栏
|
||||
*/
|
||||
private void setStatusBar() {
|
||||
public void setStatusBar() {
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
Window window = getWindow();
|
||||
@@ -181,14 +193,14 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
//友盟统计
|
||||
// MobclickAgent.onResume(this);
|
||||
MobclickAgent.onPageStart(this.mTag);
|
||||
Log.e("MobclickAgent","MobclickAgent:_onResume_"+this.mTag);
|
||||
Log.e("MobclickAgent", "MobclickAgent:_onResume_" + this.mTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
MobclickAgent.onPageEnd(this.mTag);
|
||||
Log.e("MobclickAgent","MobclickAgent:_onPause_"+this.mTag);
|
||||
Log.e("MobclickAgent", "MobclickAgent:_onPause_" + this.mTag);
|
||||
if (mLifeCycleListeners != null) {
|
||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||
listener.onPause();
|
||||
@@ -382,11 +394,12 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
break;
|
||||
}
|
||||
}
|
||||
public boolean isKefu(String url){
|
||||
if(url.contains("kefu")){
|
||||
|
||||
public boolean isKefu(String url) {
|
||||
if (url.contains("kefu")) {
|
||||
return true;
|
||||
}
|
||||
if(url.contains("https://newkf.yaoulive.com/")){
|
||||
if (url.contains("https://newkf.yaoulive.com/")) {
|
||||
return true;
|
||||
}
|
||||
return url.startsWith("https://kefu.yaoulive.com");
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
@@ -12,6 +13,7 @@ import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
@@ -29,6 +31,7 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
@@ -81,6 +84,15 @@ public class WebViewActivity extends AbsActivity {
|
||||
return R.layout.activity_webview;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setStatusBar() {
|
||||
getWindow().setStatusBarColor(Color.parseColor("#FFFFFF"));
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
String url = getIntent().getStringExtra(Constants.URL);
|
||||
@@ -100,7 +112,6 @@ public class WebViewActivity extends AbsActivity {
|
||||
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
||||
v_spacing = (View) findViewById(R.id.v_spacing);
|
||||
mWebView = findViewById(R.id.webView);
|
||||
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
params.topMargin = DpUtil.dp2px(1);
|
||||
// mWebView.setLayoutParams(params);
|
||||
@@ -136,11 +147,17 @@ public class WebViewActivity extends AbsActivity {
|
||||
if (url.contains("for")) {
|
||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||
}
|
||||
|
||||
|
||||
if(url.startsWith(HtmlConfig.SHOP)){
|
||||
//商店页不做动态变换
|
||||
return;
|
||||
}
|
||||
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
||||
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
||||
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
||||
if (!navigationGestureEnabled(mContext)) {
|
||||
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||
// view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -194,6 +211,8 @@ public class WebViewActivity extends AbsActivity {
|
||||
mWebView.getSettings().setAllowFileAccess(true);
|
||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||
mWebView.setHorizontalScrollBarEnabled(false);
|
||||
mWebView.setVerticalScrollBarEnabled(false);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
@@ -213,6 +232,9 @@ public class WebViewActivity extends AbsActivity {
|
||||
ft_title.setVisibility(View.VISIBLE);
|
||||
v_spacing.setVisibility(View.GONE);
|
||||
}
|
||||
if(!StringUtil.isEmpty(url)&&url.startsWith(HtmlConfig.SHOP)){
|
||||
ft_title.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -424,7 +446,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@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) {
|
||||
return;
|
||||
}
|
||||
@@ -440,7 +462,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk),isSw);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BaseAdapter<T> extends RecyclerView.Adapter<BaseAdapter.BaseViewHolder> {
|
||||
public Context context;
|
||||
public List<T> data;
|
||||
|
||||
public BaseAdapter(Context context, List<T> data) {
|
||||
this.context = context;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(getItemLayoutId(), parent, false);
|
||||
return new BaseViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(BaseAdapter.BaseViewHolder holder, int position) {
|
||||
T t = data.get(position);
|
||||
convert(holder, t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data == null ? 0 : data.size();
|
||||
}
|
||||
|
||||
public abstract void convert(BaseViewHolder holder, T item);
|
||||
|
||||
public abstract int getItemLayoutId();
|
||||
|
||||
class BaseViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private HashMap<Integer,View> views;
|
||||
|
||||
public BaseViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
views = new HashMap<>();
|
||||
if (onItemClickListener != null){
|
||||
itemView.setOnClickListener(v ->onItemClickListener.onItemClick(getAdapterPosition()) );
|
||||
}
|
||||
}
|
||||
|
||||
public View getView(int id) {
|
||||
View view = views.get(id);
|
||||
if (view == null) {
|
||||
view = itemView.findViewById(id);
|
||||
views.put(id, view);
|
||||
if (onItemClickListener != null){
|
||||
view.setOnClickListener(v -> {
|
||||
onItemClickListener.onItemChildClick(v, getAdapterPosition());
|
||||
});
|
||||
}
|
||||
}
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
||||
private OnItemClickListener onItemClickListener;
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener onItemClickListener){
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
public interface OnItemClickListener{
|
||||
default void onItemClick(int position){}
|
||||
|
||||
default void onItemChildClick(View view,int position){}
|
||||
}
|
||||
}
|
||||
@@ -40,12 +40,15 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
private final int RIGHTS_INTERESTS = 4;
|
||||
private final int RECOMMEND = 5;
|
||||
private String liveId;
|
||||
private boolean mIs_shengwang;
|
||||
|
||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
|
||||
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
||||
|
||||
public CustomDrawerPopupAdapter(Context mContext) {
|
||||
public CustomDrawerPopupAdapter(Context mContext,boolean mIs_shengwang) {
|
||||
this.mContext = mContext;
|
||||
this.mIs_shengwang = mIs_shengwang;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +117,7 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
map.put("num", "9");
|
||||
map.put("live_recommend", "sidebar");
|
||||
map.put("refresh", "1");
|
||||
map.put(" is_shengwang", mIs_shengwang?"1":"0");
|
||||
//推荐位
|
||||
MainNetManager.get((Activity) mContext)
|
||||
.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);
|
||||
}
|
||||
}
|
||||
@@ -13,15 +13,20 @@ import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 侧边栏游戏列表适配器,改游戏列表数量在这里改
|
||||
*/
|
||||
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
private List<CustomSidebarChildModel> srcChild = new ArrayList<>();
|
||||
|
||||
public InteractionGamesAdapter(Context mContext, boolean rigts) {
|
||||
this.mContext = mContext;
|
||||
@@ -32,7 +37,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false);
|
||||
return new InteractionGamesChildViewHolder(runGamesView);
|
||||
return new InteractionGamesChildViewHolder(runGamesView,mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,7 +51,10 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
||||
if (activityID != 0) {
|
||||
Bus.get().post(new CustomDrawerPopupEvent()
|
||||
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(child));
|
||||
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild));
|
||||
if(model.getSudGameIsNew().equals("1")){
|
||||
SpUtil.getInstance().setLiveGameId(model.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +69,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
srcChild.clear();
|
||||
if (mChild.size() > 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
child.add(mChild.get(i));
|
||||
@@ -68,6 +77,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
} else {
|
||||
child.addAll(mChild);
|
||||
}
|
||||
srcChild.addAll(mChild);
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -31,11 +31,16 @@ public class LiveNewRoleFunGamesAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view, parent, false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,showRed);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,showRed,mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
|
||||
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
holder.itemView.setLayoutParams(layoutParams);
|
||||
|
||||
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.event.LiveNewRoleEvent;
|
||||
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.views.InteractionGamesChildBottomViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -34,14 +34,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false);
|
||||
return new InteractionGamesChildViewHolder(runGamesView);
|
||||
return new InteractionGamesChildBottomViewHolder(runGamesView,mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
|
||||
InteractionGamesChildBottomViewHolder childViewHolder = (InteractionGamesChildBottomViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
|
||||
childViewHolder.setItemViewClicks(new InteractionGamesChildBottomViewHolder.InteractionGamesCallBack() {
|
||||
@Override
|
||||
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
|
||||
|
||||
@@ -52,6 +52,9 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
.setInteractionID(activityID)
|
||||
.setChild(child)
|
||||
.setInteraction(true));
|
||||
if(model.getSudGameIsNew().equals("1")){
|
||||
SpUtil.getInstance().setLiveGameId(model.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,20 +63,23 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
|
||||
child.clear();
|
||||
if (mChild.size() > 8) {
|
||||
/* if (mChild.size() > 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
child.add(mChild.get(i));
|
||||
}
|
||||
} else {
|
||||
child.addAll(mChild);
|
||||
}
|
||||
}*/
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,13 +39,14 @@ public class LiveNewRolerPopupAdapter extends RecyclerView.Adapter {
|
||||
switch (viewType) {
|
||||
case FUN_GAMES:
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_new_roler_fun_games_view, parent, false);
|
||||
return new LiveNewRoleFunGamesViewHolder(runGamesView);
|
||||
return new LiveNewRoleFunGamesViewHolder(runGamesView,mContext);
|
||||
case RIGHTS_INTERESTS:
|
||||
//特权
|
||||
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_roler_ights_interests, parent, false);
|
||||
return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed);
|
||||
return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed,mContext);
|
||||
default:
|
||||
View gamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_interaction_games_view, parent, false);
|
||||
return new LiveNewRoleInteractionGamesViewHolder(gamesView);
|
||||
return new LiveNewRoleInteractionGamesViewHolder(gamesView,mContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,15 @@ public class NewRoleFunGamesAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view2, parent, false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,false,mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
|
||||
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
holder.itemView.setLayoutParams(layoutParams);
|
||||
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SudGameAdapter extends BaseAdapter<SudSettleBean> {
|
||||
public SudGameAdapter(Context context, List<SudSettleBean> data) {
|
||||
super(context, data);
|
||||
}
|
||||
|
||||
private AppCompatImageView sub_rank_image;
|
||||
private RoundedImageView sub_head;
|
||||
private AppCompatTextView sub_rank_text,sub_name,sub_score;
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void convert(BaseAdapter<SudSettleBean>.BaseViewHolder holder, SudSettleBean item) {
|
||||
sub_rank_image = (AppCompatImageView) holder.getView(R.id.sub_rank_image);
|
||||
sub_rank_text = (AppCompatTextView) holder.getView(R.id.sub_rank_text);
|
||||
sub_head = (RoundedImageView) holder.getView(R.id.sub_head);
|
||||
sub_name = (AppCompatTextView) holder.getView(R.id.sub_name);
|
||||
sub_score = (AppCompatTextView) holder.getView(R.id.sub_score);
|
||||
|
||||
switch (item.getRank()){
|
||||
case 1:
|
||||
sub_rank_text.setVisibility(View.GONE);
|
||||
sub_rank_image.setVisibility(View.VISIBLE);
|
||||
sub_rank_image.setImageResource(R.mipmap.sub_1);
|
||||
break;
|
||||
case 2:
|
||||
sub_rank_text.setVisibility(View.GONE);
|
||||
sub_rank_image.setVisibility(View.VISIBLE);
|
||||
sub_rank_image.setImageResource(R.mipmap.sub_2);
|
||||
break;
|
||||
case 3:
|
||||
sub_rank_text.setVisibility(View.GONE);
|
||||
sub_rank_image.setVisibility(View.VISIBLE);
|
||||
sub_rank_image.setImageResource(R.mipmap.sub_3);
|
||||
break;
|
||||
default:
|
||||
sub_rank_text.setVisibility(View.VISIBLE);
|
||||
sub_rank_image.setVisibility(View.GONE);
|
||||
sub_rank_text.setText(String.valueOf(item.getRank()));
|
||||
break;
|
||||
}
|
||||
|
||||
ImgLoader.display(context, item.getAvatar_url(),sub_head);
|
||||
sub_name.setText(item.getNick_name());
|
||||
if (item.getWin_num()>0){
|
||||
sub_score.setText("+"+item.getWin_num());
|
||||
}else {
|
||||
sub_score.setText(String.valueOf(item.getWin_num()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemLayoutId() {
|
||||
return R.layout.view_sub_rank;
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,6 @@ public class SudTitleSelectAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
/**
|
||||
* 机器人助手IM消息
|
||||
@@ -21,6 +24,9 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
||||
//标签图片
|
||||
@SerializedName("icon")
|
||||
private String icon;
|
||||
@SerializedName("icon_en")
|
||||
@JSONField(name = "icon_en")
|
||||
private String iconEn;
|
||||
//气泡背景
|
||||
@SerializedName("system_bubble")
|
||||
private String systemBubble;
|
||||
@@ -35,7 +41,7 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
||||
}
|
||||
|
||||
public String getAiName() {
|
||||
return aiName+":";
|
||||
return aiName + ":";
|
||||
}
|
||||
|
||||
public AiAutomaticSpeechModel setAiName(String aiName) {
|
||||
@@ -47,6 +53,16 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
public String getIconEn() {
|
||||
return iconEn;
|
||||
}
|
||||
|
||||
public AiAutomaticSpeechModel setIconEn(String iconEn) {
|
||||
this.iconEn = iconEn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AiAutomaticSpeechModel setContent(String content) {
|
||||
this.content = content;
|
||||
return this;
|
||||
@@ -62,6 +78,9 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
if (!WordUtil.isNewZh() && !StringUtil.isEmpty(iconEn)) {
|
||||
return iconEn;
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ public class AnchorRecommendModel extends BaseModel {
|
||||
|
||||
@SerializedName("live_battle_pass_show_status")
|
||||
private int showWarOrder = 0;//是否显示首页戰令
|
||||
@SerializedName("live_battle_pass_image_cn")
|
||||
private String battlePassImageCn;
|
||||
@SerializedName("live_battle_pass_image_en")
|
||||
private String battlePassImageEn;
|
||||
//是否支持换一批0=不支持 1=支持
|
||||
|
||||
@SerializedName("up_show")
|
||||
@@ -58,6 +62,22 @@ public class AnchorRecommendModel extends BaseModel {
|
||||
return listShow;
|
||||
}
|
||||
|
||||
public String getBattlePassImageCn() {
|
||||
return battlePassImageCn;
|
||||
}
|
||||
|
||||
public void setBattlePassImageCn(String battlePassImageCn) {
|
||||
this.battlePassImageCn = battlePassImageCn;
|
||||
}
|
||||
|
||||
public String getBattlePassImageEn() {
|
||||
return battlePassImageEn;
|
||||
}
|
||||
|
||||
public void setBattlePassImageEn(String battlePassImageEn) {
|
||||
this.battlePassImageEn = battlePassImageEn;
|
||||
}
|
||||
|
||||
public AnchorRecommendModel setListShow(int listShow) {
|
||||
this.listShow = listShow;
|
||||
return this;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,16 @@ public class CheckLiveModel extends BaseModel {
|
||||
private String typeMsg;
|
||||
@SerializedName("live_sdk")
|
||||
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) {
|
||||
|
||||
|
||||
@@ -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,7 @@ package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -59,6 +60,9 @@ public class ConfigBean extends BaseModel {
|
||||
private String txPlayUgcLicenceUrl;//腾讯短视频鉴权
|
||||
private String txVideoUgcKey;
|
||||
private String google_isup;
|
||||
|
||||
private String sud_game_speech;
|
||||
|
||||
@SerializedName("is_return_user")//是否需要弹窗(0否,1是)
|
||||
private String isReturnUser="";
|
||||
@SerializedName("popup_img_url")//弹窗图片地址
|
||||
@@ -182,6 +186,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")
|
||||
public String getVersion() {
|
||||
return version;
|
||||
|
||||
@@ -114,6 +114,17 @@ public class EnterRoomInfoModel extends BaseModel {
|
||||
@SerializedName("gift_wall_lighten_total")
|
||||
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() {
|
||||
return giftWallLightenNumber;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,20 @@ public class EnterRoomNewModel extends BaseModel {
|
||||
private SudGameDateModel sudGameDateModel;
|
||||
@SerializedName("quick_gift_remaining_quantity")
|
||||
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
||||
|
||||
@SerializedName("if_viewing_duration_complete")
|
||||
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() {
|
||||
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;
|
||||
@SerializedName("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() {
|
||||
return type;
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
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;
|
||||
@SerializedName("coupon_discount")
|
||||
private String couponDiscount;
|
||||
@SerializedName("coupon_discount_en")
|
||||
private String couponDiscountEn;
|
||||
@SerializedName("coupon_discount_price")
|
||||
private String couponDiscountPrice;
|
||||
@SerializedName("coupon_id")
|
||||
private String couponId;
|
||||
|
||||
public String getCouponDiscount() {
|
||||
return couponDiscount;
|
||||
}
|
||||
|
||||
public String getCouponId() {
|
||||
return couponId;
|
||||
}
|
||||
|
||||
public String getCouponDiscountEn() {
|
||||
return couponDiscountEn;
|
||||
}
|
||||
|
||||
public String getCouponDiscountPrice() {
|
||||
return couponDiscountPrice;
|
||||
}
|
||||
|
||||
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{
|
||||
private int level;
|
||||
private int is_received;
|
||||
private List<BattlePassType> live_battle_pass_type;
|
||||
private Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards;
|
||||
|
||||
public LiveBattlePassRewardsBean() {
|
||||
}
|
||||
|
||||
public int getIs_received() {
|
||||
return is_received;
|
||||
}
|
||||
|
||||
public void setIs_received(int is_received) {
|
||||
this.is_received = is_received;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,18 @@ public class LiveBean implements Parcelable {
|
||||
private int redPacketStatus;
|
||||
@SerializedName("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跳转到直播间时需要根据携带参数判断是否弹出新人特惠对话框
|
||||
|
||||
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.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.text.ParseException;
|
||||
@@ -22,6 +21,8 @@ public class OpenAdModel extends BaseModel {
|
||||
public static final int SHOW_ONE = 3;//3. 仅弹出一次;
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("popup_name")
|
||||
private String name;
|
||||
@SerializedName("popup_location")
|
||||
private int type = TYPE_HOME;
|
||||
@SerializedName("activity_url")
|
||||
@@ -35,24 +36,27 @@ public class OpenAdModel extends BaseModel {
|
||||
@SerializedName("popup_model")
|
||||
private int model = MODEL_SQUARE;
|
||||
@SerializedName("start_show_time")
|
||||
private String startTime;//活动开始时间
|
||||
private String startTime;//活动开始时间 1
|
||||
@SerializedName("end_show_time")
|
||||
private String endTime;//活动结束时间
|
||||
private String endTime;//活动结束时间 5
|
||||
@SerializedName("popup_permission")
|
||||
private int permission;
|
||||
@SerializedName("popup_frequency")
|
||||
private int showModel = SHOW_DEF;//显示模式,1:杀死程序后弹出 2:指定时间内(本机时间) 3:1. 仅弹出一次
|
||||
@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 static OpenAdModel createTestData() {
|
||||
OpenAdModel model = new OpenAdModel();
|
||||
model.id=3;
|
||||
model.type=1;
|
||||
model.id = 3;
|
||||
model.type = 1;
|
||||
model.url = "/h5/GuildTournament/20230821/rank.html";
|
||||
model.imageUrl = "https://ceshi.yaoulive.com/data/upload/20230913/1694589490.png";
|
||||
model.showTime = 10;
|
||||
@@ -66,6 +70,30 @@ public class OpenAdModel extends BaseModel {
|
||||
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() {
|
||||
return showModel;
|
||||
}
|
||||
@@ -91,10 +119,14 @@ public class OpenAdModel extends BaseModel {
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
if (!url.startsWith("http://") || !url.startsWith("https://")) {
|
||||
url = CommonAppConfig.HOST + url;
|
||||
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||
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) {
|
||||
@@ -195,6 +227,7 @@ public class OpenAdModel extends BaseModel {
|
||||
public String toString() {
|
||||
return "OpenAdModel{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", type=" + type +
|
||||
", url='" + url + '\'' +
|
||||
", imageUrl='" + imageUrl + '\'' +
|
||||
@@ -203,7 +236,10 @@ public class OpenAdModel extends BaseModel {
|
||||
", model=" + model +
|
||||
", startTime='" + startTime + '\'' +
|
||||
", endTime='" + endTime + '\'' +
|
||||
", permission='" + permission + '\'' +
|
||||
", permission=" + permission +
|
||||
", showModel=" + showModel +
|
||||
", section='" + section + '\'' +
|
||||
", sort=" + popupSort +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,4 +56,15 @@ public class PrankGiftBean extends BaseModel{
|
||||
public void setGiftId(String giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PrankGiftBean{" +
|
||||
"title='" + title + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", icon='" + icon + '\'' +
|
||||
", num=" + num +
|
||||
", giftId='" + giftId + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PrankGiftResultBean extends BaseModel{
|
||||
private List<PrankGiftBean> prank_list;
|
||||
private String status;
|
||||
private String prank_type;
|
||||
|
||||
public List<PrankGiftBean> getPrank_list() {
|
||||
return prank_list;
|
||||
}
|
||||
|
||||
public void setPrank_list(List<PrankGiftBean> prank_list) {
|
||||
this.prank_list = prank_list;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getPrank_type() {
|
||||
return prank_type;
|
||||
}
|
||||
|
||||
public void setPrank_type(String prank_type) {
|
||||
this.prank_type = prank_type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PrankProgressBean extends BaseModel {
|
||||
private int status;//整蛊状态 0.关闭 1.开启
|
||||
private int prank_turntable_status;// 转盘整蛊状态 0=关闭 1=开启
|
||||
private int prank_type;// 整蛊类型 1.礼物整蛊 2.连击整蛊
|
||||
private List<PrankList> prank_list;// 整蛊进度
|
||||
private List<PrankList> completed_list;// 待完成的整蛊
|
||||
|
||||
public PrankProgressBean(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static class PrankList{
|
||||
private int gift_id;// 礼物ID
|
||||
private int gift_num;// 整蛊需要的礼物数量
|
||||
private String prank_content; // 整蛊内容
|
||||
private int send_num; // 用户已赠送的礼物数量
|
||||
private int completed_num;// 待完成的整蛊次数
|
||||
private String gift_name;// 礼物名称
|
||||
private String gift_icon; // 礼物图片链接
|
||||
|
||||
private String gift_name_en;
|
||||
|
||||
private int continuous_click_num;
|
||||
|
||||
public int getContinuous_click_num() {
|
||||
return continuous_click_num;
|
||||
}
|
||||
|
||||
public void setContinuous_click_num(int continuous_click_num) {
|
||||
this.continuous_click_num = continuous_click_num;
|
||||
}
|
||||
|
||||
public String getGift_name_en() {
|
||||
return gift_name_en;
|
||||
}
|
||||
|
||||
public void setGift_name_en(String gift_name_en) {
|
||||
this.gift_name_en = gift_name_en;
|
||||
}
|
||||
|
||||
public int getGift_id() {
|
||||
return gift_id;
|
||||
}
|
||||
|
||||
public void setGift_id(int gift_id) {
|
||||
this.gift_id = gift_id;
|
||||
}
|
||||
|
||||
public int getGift_num() {
|
||||
return gift_num;
|
||||
}
|
||||
|
||||
public void setGift_num(int gift_num) {
|
||||
this.gift_num = gift_num;
|
||||
}
|
||||
|
||||
public String getPrank_content() {
|
||||
return prank_content;
|
||||
}
|
||||
|
||||
public void setPrank_content(String prank_content) {
|
||||
this.prank_content = prank_content;
|
||||
}
|
||||
|
||||
public int getSend_num() {
|
||||
return send_num;
|
||||
}
|
||||
|
||||
public void setSend_num(int send_num) {
|
||||
this.send_num = send_num;
|
||||
}
|
||||
|
||||
public int getCompleted_num() {
|
||||
return completed_num;
|
||||
}
|
||||
|
||||
public void setCompleted_num(int completed_num) {
|
||||
this.completed_num = completed_num;
|
||||
}
|
||||
|
||||
public String getGift_name() {
|
||||
return gift_name;
|
||||
}
|
||||
|
||||
public void setGift_name(String gift_name) {
|
||||
this.gift_name = gift_name;
|
||||
}
|
||||
|
||||
public String getGift_icon() {
|
||||
return gift_icon;
|
||||
}
|
||||
|
||||
public void setGift_icon(String gift_icon) {
|
||||
this.gift_icon = gift_icon;
|
||||
}
|
||||
|
||||
//计算完成度
|
||||
public double getCompletionRate() {
|
||||
if (gift_num == 0) return 0; // Avoid division by zero
|
||||
return (double) send_num / gift_num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PrankList{" +
|
||||
"gift_id=" + gift_id +
|
||||
", gift_num=" + gift_num +
|
||||
", prank_content='" + prank_content + '\'' +
|
||||
", send_num=" + send_num +
|
||||
", completed_num=" + completed_num +
|
||||
", gift_name='" + gift_name + '\'' +
|
||||
", gift_icon='" + gift_icon + '\'' +
|
||||
", gift_name_en='" + gift_name_en + '\'' +
|
||||
", continuous_click_num=" + continuous_click_num +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getPrank_type() {
|
||||
return prank_type;
|
||||
}
|
||||
|
||||
public void setPrank_type(int prank_type) {
|
||||
this.prank_type = prank_type;
|
||||
}
|
||||
|
||||
public List<PrankList> getPrank_list() {
|
||||
return prank_list;
|
||||
}
|
||||
|
||||
public void setPrank_list(List<PrankList> prank_list) {
|
||||
this.prank_list = prank_list;
|
||||
}
|
||||
|
||||
public List<PrankList> getCompleted_list() {
|
||||
return completed_list;
|
||||
}
|
||||
|
||||
public void setCompleted_list(List<PrankList> completed_list) {
|
||||
this.completed_list = completed_list;
|
||||
}
|
||||
|
||||
public int getPrank_turntable_status() {
|
||||
return prank_turntable_status;
|
||||
}
|
||||
|
||||
public void setPrank_turntable_status(int prank_turntable_status) {
|
||||
this.prank_turntable_status = prank_turntable_status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PrankProgressBean{" +
|
||||
"status=" + status +
|
||||
", prank_turntable_status=" + prank_turntable_status +
|
||||
", prank_type=" + prank_type +
|
||||
", prank_list=" + prank_list +
|
||||
", completed_list=" + completed_list +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
16
common/src/main/java/com/yunbao/common/bean/QiniuLog.java
Normal file
16
common/src/main/java/com/yunbao/common/bean/QiniuLog.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
public class QiniuLog extends BaseModel{
|
||||
@JSONField(name = "log_type")
|
||||
private int log_type;
|
||||
|
||||
public int getLog_type() {
|
||||
return log_type;
|
||||
}
|
||||
|
||||
public void setLog_type(int log_type) {
|
||||
this.log_type = log_type;
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,16 @@ public class RedPacketInfoModel extends BaseModel {
|
||||
//超级红包ID
|
||||
@SerializedName("super_jackpot_id")
|
||||
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() {
|
||||
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,60 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class SudGameInfoBean {
|
||||
private String uid;//玩家id
|
||||
private String nick_name;//玩家昵称
|
||||
private String avatar_url;//玩家头像
|
||||
private String gender;//玩家性别
|
||||
private int is_ai;//是否是ai
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getNick_name() {
|
||||
return nick_name;
|
||||
}
|
||||
|
||||
public void setNick_name(String nick_name) {
|
||||
this.nick_name = nick_name;
|
||||
}
|
||||
|
||||
public String getAvatar_url() {
|
||||
return avatar_url;
|
||||
}
|
||||
|
||||
public void setAvatar_url(String avatar_url) {
|
||||
this.avatar_url = avatar_url;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public int getIs_ai() {
|
||||
return is_ai;
|
||||
}
|
||||
|
||||
public void setIs_ai(int is_ai) {
|
||||
this.is_ai = is_ai;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SudGameInfoBean{" +
|
||||
"uid=" + uid +
|
||||
", nick_name='" + nick_name + '\'' +
|
||||
", avatar_url='" + avatar_url + '\'' +
|
||||
", gender='" + gender + '\'' +
|
||||
", is_ai=" + is_ai +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class SudGameScoreBean extends BaseModel{
|
||||
private int golden_bean_remaining_balance;//
|
||||
private int room_sill;//房间的金豆门槛
|
||||
private int room_ticket;//收取的门票费
|
||||
private int room_win_num;//赢家获得的金豆
|
||||
private int game_mode;//1.双人对战 2.多人游戏
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SudGameScoreBean{" +
|
||||
"golden_bean_remaining_balance=" + golden_bean_remaining_balance +
|
||||
", room_sill=" + room_sill +
|
||||
", room_ticket=" + room_ticket +
|
||||
", room_win_num=" + room_win_num +
|
||||
", game_mode=" + game_mode +
|
||||
'}';
|
||||
}
|
||||
|
||||
public int getGame_mode() {
|
||||
return game_mode;
|
||||
}
|
||||
|
||||
public void setGame_mode(int game_mode) {
|
||||
this.game_mode = game_mode;
|
||||
}
|
||||
|
||||
public int getGolden_bean_remaining_balance() {
|
||||
return golden_bean_remaining_balance;
|
||||
}
|
||||
|
||||
public void setGolden_bean_remaining_balance(int golden_bean_remaining_balance) {
|
||||
this.golden_bean_remaining_balance = golden_bean_remaining_balance;
|
||||
}
|
||||
|
||||
public int getRoom_sill() {
|
||||
return room_sill;
|
||||
}
|
||||
|
||||
public void setRoom_sill(int room_sill) {
|
||||
this.room_sill = room_sill;
|
||||
}
|
||||
|
||||
public int getRoom_ticket() {
|
||||
return room_ticket;
|
||||
}
|
||||
|
||||
public void setRoom_ticket(int room_ticket) {
|
||||
this.room_ticket = room_ticket;
|
||||
}
|
||||
|
||||
public int getRoom_win_num() {
|
||||
return room_win_num;
|
||||
}
|
||||
|
||||
public void setRoom_win_num(int room_win_num) {
|
||||
this.room_win_num = room_win_num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SudSettleBean {
|
||||
private String uid;//玩家id
|
||||
private String nick_name;//玩家昵称
|
||||
private String avatar_url;//玩家头像
|
||||
private int rank;//玩家排名
|
||||
private int win_num;//赢得或者失去的金豆
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getNick_name() {
|
||||
return nick_name;
|
||||
}
|
||||
|
||||
public void setNick_name(String nick_name) {
|
||||
this.nick_name = nick_name;
|
||||
}
|
||||
|
||||
public String getAvatar_url() {
|
||||
return avatar_url;
|
||||
}
|
||||
|
||||
public void setAvatar_url(String avatar_url) {
|
||||
this.avatar_url = avatar_url;
|
||||
}
|
||||
|
||||
public int getRank() {
|
||||
return rank;
|
||||
}
|
||||
|
||||
public void setRank(int rank) {
|
||||
this.rank = rank;
|
||||
}
|
||||
|
||||
public int getWin_num() {
|
||||
return win_num;
|
||||
}
|
||||
|
||||
public void setWin_num(int win_num) {
|
||||
this.win_num = win_num;
|
||||
}
|
||||
|
||||
|
||||
public SudSettleBean(String uid, String nick_name, String avatar_url, int rank, int win_num) {
|
||||
this.uid = uid;
|
||||
this.nick_name = nick_name;
|
||||
this.avatar_url = avatar_url;
|
||||
this.rank = rank;
|
||||
this.win_num = win_num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SudSettleBean{" +
|
||||
"uid='" + uid + '\'' +
|
||||
", nick_name='" + nick_name + '\'' +
|
||||
", avatar_url='" + avatar_url + '\'' +
|
||||
", rank=" + rank +
|
||||
", win_num=" + win_num +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -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 bubble;
|
||||
private String medal_new;
|
||||
private String medal_new_en;
|
||||
|
||||
public String getMedal_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) {
|
||||
this.medal_new = medal_new;
|
||||
}
|
||||
@@ -898,6 +907,66 @@ public class UserBean implements Parcelable {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.yunbao.common.custom;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import com.stx.xhb.androidx.transformers.BasePageTransformer;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
|
||||
public class LiveGuardScalePageTransformer extends BasePageTransformer {
|
||||
/**
|
||||
* author: xiaohaibin.
|
||||
* time: 2018/10/9
|
||||
* mail:xhb_199409@163.com
|
||||
* github:https://github.com/xiaohaibin
|
||||
* describe: 适用于一屏显示多个模式
|
||||
*/
|
||||
private float mMinScale = 0.85f;
|
||||
private float mMinAlpha = 1f;
|
||||
|
||||
public LiveGuardScalePageTransformer() {
|
||||
}
|
||||
|
||||
public LiveGuardScalePageTransformer(float minAlpha, float minScale) {
|
||||
setMinAlpha(minAlpha);
|
||||
setMinScale(minScale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleInvisiblePage(View view, float position) {
|
||||
ViewCompat.setAlpha(view, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleLeftPage(View view, float position) {
|
||||
float scale = Math.max(mMinScale, 1 + position);
|
||||
float vertMargin = view.getHeight() * (1 - scale) / 2;
|
||||
float horzMargin = view.getWidth() * (1 - scale) / 2;
|
||||
view.setTranslationX(horzMargin - vertMargin / 2);
|
||||
view.setScaleX(scale);
|
||||
view.setScaleY( scale);
|
||||
view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleRightPage(View view, float position) {
|
||||
float scale = Math.max(mMinScale, 1 - position);
|
||||
float vertMargin = view.getHeight() * (1 - scale) / 2;
|
||||
float horzMargin = view.getWidth() * (1 - scale) / 2;
|
||||
view.setTranslationX( -horzMargin + vertMargin / 2);
|
||||
view.setScaleX( scale);
|
||||
|
||||
view.setScaleY( scale);
|
||||
view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
}
|
||||
|
||||
public void setMinAlpha(float minAlpha) {
|
||||
if (minAlpha >= 0.6f && minAlpha <= 1.0f) {
|
||||
mMinAlpha = minAlpha;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMinScale(float minScale) {
|
||||
if (minScale >= 0.6f && minScale <= 1.0f) {
|
||||
mMinScale = minScale;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,11 @@ public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
|
||||
public abstract void buildDialog(XPopup.Builder builder);
|
||||
public abstract int bindLayoutId();
|
||||
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return bindLayoutId();
|
||||
@@ -36,4 +41,24 @@ public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
|
||||
buildDialog(builder);
|
||||
builder.asCustom(this).show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Dismiss监听
|
||||
*/
|
||||
private OnDismissListener onDismissListener;
|
||||
public interface OnDismissListener{
|
||||
void onDismiss();
|
||||
}
|
||||
|
||||
public void setOnDismissListener(OnDismissListener onDismissListener) {
|
||||
this.onDismissListener = onDismissListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
if (onDismissListener != null){
|
||||
onDismissListener.onDismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
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.bean.CoolConfig;
|
||||
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.core.BottomPopupView;
|
||||
import com.lxj.xpopup.enums.PopupPosition;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
@@ -45,6 +46,9 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* 半屏创建游戏房间
|
||||
*/
|
||||
public class CreateSudGamePopup extends BottomPopupView {
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
private TextView createGameType, selectCurrencyType;
|
||||
@@ -150,8 +154,6 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 4, customSidebarChildModels, interactionID))
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.room_back),
|
||||
@@ -279,7 +281,11 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (isHome) {
|
||||
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 {
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||
|
||||
@@ -312,20 +318,50 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
animator.setDuration(animDuration);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
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();
|
||||
if (hasMoveUp) {
|
||||
InputMethodManager imm = getSystemService(getContext(), InputMethodManager.class);
|
||||
if (imm != null) {
|
||||
imm.hideSoftInputFromWindow(roomName.getWindowToken(), 0);
|
||||
imm.hideSoftInputFromWindow(gameSill.getWindowToken(), 0);
|
||||
}
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
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();
|
||||
}
|
||||
}, 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,80 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class GuardBuyCouponTipsDialog {
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param coin 钻石
|
||||
* @param content 购买类型名称
|
||||
* @param simpleCallback
|
||||
*/
|
||||
public static void showBuyOrRenewDialog(Context context, String coupon, String coin, String content,
|
||||
DialogUitl.SimpleCallback3 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_coupon_tips);
|
||||
dialog.setCancelable(true);
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
TextView btn_confirm = dialog.findViewById(R.id.btn_confirm);
|
||||
TextView content2 = dialog.findViewById(R.id.content2);
|
||||
|
||||
Spanned tips;
|
||||
if (WordUtil.isNewZh()) {
|
||||
tips = Html.fromHtml("<font color='#FFE0BF'>您有一張</font>"
|
||||
+ "<font color='#FF9937'>" + content + "優惠券</font><br>"
|
||||
+ "<font color='#FFE0BF'>開通/續費" + content + "(1個月)時,</font><br><font color='#FFE0BF'>可享</font>"
|
||||
+ "<strong><font color='#FF9937'>" + coupon + "折</font></strong>"
|
||||
+ "<font color='#FFE0BF'>優惠 (折後:</font>"
|
||||
+ "<font color='#FF9937'>" + coin + "鑽</font>)<br>"
|
||||
+ "<font color='#FFE0BF'>是否使用優惠券?</font>");
|
||||
} else {
|
||||
tips = Html.fromHtml("<font color='#FFE0BF'>You have a </font>"
|
||||
+ "<font color='#FF9937'>" + content + " coupon</font>"
|
||||
+ "<font color='#FFE0BF'> When activating/renewing " + content + "(1 month), you can enjoy a</font>"
|
||||
+ "<strong><font color='#FF9937'> " + coupon + "% </font></strong>"
|
||||
+ "<font color='#FFE0BF'>discount (After folding:</font>"
|
||||
+ "<font color='#FF9937'>" + coin + " diamonds</font>"
|
||||
+ "<font color='#FFE0BF'>)Do you want to use coupons?</font>");
|
||||
}
|
||||
content2.setText(tips);
|
||||
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.findViewById(R.id.btn_cancel1).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
simpleCallback.onCancel();
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
btn_confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
simpleCallback.onConfirmClick(dialog);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,44 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class GuardBuyTipsNewDialog {
|
||||
/**
|
||||
* @param context
|
||||
*/
|
||||
public static void showBuyOrRenewDialog(Context context) {
|
||||
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);
|
||||
btn_confirm.setText(WordUtil.isNewZh() ? "確認" : "Confirm");
|
||||
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
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;
|
||||
|
||||
//游戏弹窗
|
||||
public class LiveNewRolePopup extends BottomPopupView {
|
||||
private boolean showRed = false;
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -9,12 +13,21 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
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 {
|
||||
private ImageView mImageView;
|
||||
private ImageView mClose;
|
||||
private LinearLayout contentLayout;
|
||||
private OpenAdModel model;
|
||||
private OnItemClickListener<OpenAdModel> mListener;
|
||||
|
||||
@@ -27,6 +40,11 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.animationDuration(0);
|
||||
builder.hasShadowBg(true);
|
||||
if(model.getPopupSort()==2){
|
||||
builder.dismissOnTouchOutside(false);
|
||||
builder.dismissOnBackPressed(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,8 +69,63 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
mImageView = findViewById(R.id.img);
|
||||
contentLayout = findViewById(R.id.content_layout);
|
||||
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 -> {
|
||||
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
|
||||
if (mListener != null) {
|
||||
@@ -61,10 +134,12 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
mClose.setOnClickListener(v -> dismiss());
|
||||
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
||||
if (model.getShowTime() > 0) {
|
||||
mClose.postDelayed(this::dismiss, model.getShowTime());
|
||||
}
|
||||
contentLayout.addView(mImageView);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,44 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
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.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lzf.easyfloat.enums.ShowPattern;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
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.RouteUtil;
|
||||
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 {
|
||||
private ImageView mImageView;
|
||||
private LinearLayout contentLayout;
|
||||
private ImageView mClose;
|
||||
private OpenAdModel model;
|
||||
private OnItemClickListener<OpenAdModel> mListener;
|
||||
@@ -38,7 +59,8 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.hasShadowBg(false);
|
||||
builder.hasShadowBg(true);
|
||||
builder.shadowBgColor(Color.parseColor("#80000000"));
|
||||
builder.animationDuration(0);
|
||||
}
|
||||
|
||||
@@ -60,11 +82,107 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e("-----弹窗-----", "onCreate: 创建弹窗" );
|
||||
mImageView = findViewById(R.id.img);
|
||||
Log.e("-----弹窗-----", "onCreate: 创建弹窗");
|
||||
contentLayout = findViewById(R.id.content_layout);
|
||||
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 -> {
|
||||
if ("home_page_banner_battle".equals(model.getOriginalUrl())) {
|
||||
RouteUtil.forwardBattlePass();
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
|
||||
if (mListener != null) {
|
||||
mListener.onItemClick(model, 1);
|
||||
@@ -72,19 +190,12 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
mClose.setOnClickListener(v -> dismiss());
|
||||
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
||||
int width = ScreenDimenUtil.getInstance().getScreenWdith() - DpUtil.dp2px(40);
|
||||
int height = (int) (width * 1.4);
|
||||
if (model.getModel() == OpenAdModel.MODEL_SQUARE) {
|
||||
height = width;
|
||||
}
|
||||
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());
|
||||
}
|
||||
contentLayout.addView(mImageView);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -16,6 +19,7 @@ import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
@@ -26,18 +30,19 @@ import java.math.BigDecimal;
|
||||
* 战令等级 经验
|
||||
*/
|
||||
public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
private TextView orderLevel, orderLevelDiamond, balanceDiamond, current, expText;
|
||||
private TextView orderLevelDiamond, balanceDiamond, current, expText;
|
||||
private int currentExperience, totalExperience;//当前经验,全部经验
|
||||
private String buyExp = "100", currentLevel, balance;
|
||||
private String buyExp = "1", currentLevel, balance;
|
||||
private ProgressBar progressBar;
|
||||
private OrderLevelCallback orderLevelCallback;
|
||||
private long maxExp;
|
||||
private BattlePassUserInfoBean userInfoBean;
|
||||
private Context mContext;
|
||||
private EditText orderLevel;
|
||||
|
||||
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean,
|
||||
int mCurrentExperience, int mTotalExperience,
|
||||
String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
|
||||
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean, int mCurrentExperience, int mTotalExperience, String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
this.userInfoBean = userInfoBean;
|
||||
currentExperience = mCurrentExperience;
|
||||
totalExperience = mTotalExperience;
|
||||
@@ -67,15 +72,15 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
progressBar.setProgress(currentExperience);
|
||||
expText.setText(String.format("%s/%s", userInfoBean.getBattlePassExp(), userInfoBean.getNextLevelExp()));
|
||||
current.setText(String.format("Lv%s", currentLevel));
|
||||
balanceDiamond.setText(balance);
|
||||
balanceDiamond.setText((WordUtil.isNewZh() ? "剩餘:" : "Balance:") + balance);
|
||||
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
float exp = new BigDecimal(buyExp).floatValue();
|
||||
if (exp > 100) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("100"));
|
||||
if (exp > 1) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("1"));
|
||||
buyExp = String.valueOf(buyExpBigDecimal.intValue());
|
||||
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
|
||||
orderLevelDiamond.setText("00 = " + buyExp + "00");
|
||||
orderLevel.setText(buyExp);
|
||||
}
|
||||
}
|
||||
@@ -84,15 +89,14 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
float exp = new BigDecimal(buyExp).floatValue();
|
||||
if (exp < maxExp && exp < 10000) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("100"));
|
||||
if (exp < maxExp && (exp + 1) < 10000) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("1"));
|
||||
buyExp = String.valueOf(buyExpBigDecimal.intValue());
|
||||
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
|
||||
orderLevelDiamond.setText("00 = " + buyExp + "00");
|
||||
orderLevel.setText(buyExp);
|
||||
} else if (exp >= maxExp) {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "经验已滿" : "Experience full");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "經驗超出,僅需" + maxExp + "經驗可達滿级" : "Exp exceeds.Only " + maxExp + " exp is needed to reach the max level.");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.war_order_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@@ -101,40 +105,62 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
orderLevel.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
buyExp = charSequence.toString();
|
||||
orderLevelDiamond.setText("00 = " + charSequence.toString() + "00");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.buying_experience), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext())
|
||||
.buyingExperiencePoint(buyExp, new HttpCallback<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> data) {
|
||||
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
|
||||
}
|
||||
dialog.dismiss();
|
||||
if(StringUtil.isEmpty(orderLevel.getText().toString())||"0".equals(orderLevel.getText().toString())){
|
||||
ToastUtil.show(WordUtil.isNewZh()?"输入数字不可为0":"The input number cannot be 0");
|
||||
return;
|
||||
}
|
||||
if (Integer.parseInt(orderLevel.getText().toString()+"00") <= maxExp) {
|
||||
LiveNetManager.get(getContext()).buyingExperiencePoint(buyExp + "00", new HttpCallback<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> data) {
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(102, error);
|
||||
}
|
||||
dialog.dismiss();
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(102, error);
|
||||
}
|
||||
});
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "經驗超出,僅需" + maxExp + "經驗可達滿级" : "Exp exceeds.Only " + maxExp + " exp is needed to reach the max level.");
|
||||
}
|
||||
}
|
||||
});
|
||||
IMLoginManager.get(getContext()).updateUserCoin(new OnItemClickListener<JSONObject>() {
|
||||
@Override
|
||||
public void onItemClick(JSONObject bean, int position) {
|
||||
if (bean != null) {
|
||||
balance = bean.getString("coin");
|
||||
balanceDiamond.setText((WordUtil.isNewZh() ? "剩餘:" : "Balance:") + balance);
|
||||
}
|
||||
}
|
||||
});
|
||||
IMLoginManager.get(getContext())
|
||||
.updateUserCoin(new OnItemClickListener<JSONObject>() {
|
||||
@Override
|
||||
public void onItemClick(JSONObject bean, int position) {
|
||||
if (bean != null) {
|
||||
balance = bean.getString("coin");
|
||||
balanceDiamond.setText(balance);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface OrderLevelCallback {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双人小游戏结算弹窗
|
||||
*/
|
||||
public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
public SudGameDoubleDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_sub_double;
|
||||
}
|
||||
|
||||
private AppCompatImageView sub_win_hat,sub_leave,sub_again,sub_title;
|
||||
private RoundedImageView sub_win_head,sub_loss_head;
|
||||
private AppCompatTextView sub_win_name,sub_win_score,sub_loss_name,sub_loss_score,sub_time;
|
||||
private CountDownTimer countDownTimer;
|
||||
private List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||
private boolean containMe;
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.dismissOnTouchOutside(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
sub_title = findViewById(R.id.sub_title);//弹窗标题
|
||||
sub_win_hat = findViewById(R.id.sub_win_hat);//胜利皇冠(平局隐藏)
|
||||
sub_leave = findViewById(R.id.sub_leave);//离开按钮
|
||||
sub_again = findViewById(R.id.sub_again);//再来一局按钮
|
||||
sub_win_head = findViewById(R.id.sub_win_head);//胜利方头像
|
||||
sub_loss_head = findViewById(R.id.sub_loss_head);//失败方头像
|
||||
sub_win_name = findViewById(R.id.sub_win_name);//胜利方昵称
|
||||
sub_win_score = findViewById(R.id.sub_win_score);//胜利方分数
|
||||
sub_loss_name = findViewById(R.id.sub_loss_name);//失败方昵称
|
||||
sub_loss_score = findViewById(R.id.sub_loss_score);//失败方分数
|
||||
sub_time = findViewById(R.id.sub_time);//关闭倒计时
|
||||
|
||||
|
||||
initData();
|
||||
|
||||
if (WordUtil.isNewZh()){
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_zh);
|
||||
}else {
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_en);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_en);
|
||||
}
|
||||
|
||||
sub_leave.setOnClickListener(v-> destroyDialog());
|
||||
sub_again.setOnClickListener(v-> {
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
destroyDialog();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void initData() {
|
||||
if (settleBeans.size() == 2){
|
||||
sortByWinNum(settleBeans);
|
||||
SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名
|
||||
SudSettleBean sudSettleBean2 = settleBeans.get(1); // 第二名
|
||||
checkMe(sudSettleBean1.getUid(),sudSettleBean2.getUid());//判断这场对局是不是包含自己
|
||||
|
||||
// 检查是否是当前用户
|
||||
boolean isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid());
|
||||
boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num();
|
||||
boolean isZh = WordUtil.isNewZh();
|
||||
|
||||
if (containMe) {
|
||||
// 当前用户在游戏中
|
||||
SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2;
|
||||
SudSettleBean lossBean = isFirstMe ? sudSettleBean2 : sudSettleBean1;
|
||||
|
||||
ImgLoader.display(mContext, winBean.getAvatar_url(), sub_win_head);
|
||||
ImgLoader.display(mContext, lossBean.getAvatar_url(), sub_loss_head);
|
||||
sub_win_name.setText(winBean.getNick_name());
|
||||
sub_loss_name.setText(lossBean.getNick_name());
|
||||
|
||||
sub_win_score.setText(winBean.getWin_num() > 0 ? "+" + winBean.getWin_num() : String.valueOf(winBean.getWin_num()));
|
||||
sub_loss_score.setText(String.valueOf(lossBean.getWin_num()));
|
||||
|
||||
if (isDraw) {
|
||||
// 平局
|
||||
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
|
||||
sub_win_hat.setVisibility(View.GONE);
|
||||
} else {
|
||||
// 胜利或失败
|
||||
sub_title.setImageResource(isZh ? (isFirstMe ? R.mipmap.sub_win_zh : R.mipmap.sub_loss_zh) : (isFirstMe ? R.mipmap.sub_win_en : R.mipmap.sub_loss_en));
|
||||
sub_win_hat.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
// 当前用户不在游戏中
|
||||
ImgLoader.display(mContext, sudSettleBean1.getAvatar_url(), sub_win_head);
|
||||
ImgLoader.display(mContext, sudSettleBean2.getAvatar_url(), sub_loss_head);
|
||||
sub_win_name.setText(sudSettleBean1.getNick_name());
|
||||
sub_loss_name.setText(sudSettleBean2.getNick_name());
|
||||
|
||||
sub_win_score.setText(sudSettleBean1.getWin_num() > 0 ? "+" + sudSettleBean1.getWin_num() : String.valueOf(sudSettleBean1.getWin_num()));
|
||||
sub_loss_score.setText(String.valueOf(sudSettleBean2.getWin_num()));
|
||||
|
||||
if (isDraw) {
|
||||
// 平局
|
||||
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
|
||||
sub_win_hat.setVisibility(View.GONE);
|
||||
} else {
|
||||
// 非当前用户的胜利
|
||||
sub_title.setImageResource(isZh ? R.mipmap.sub_win_zh : R.mipmap.sub_win_en);
|
||||
sub_win_hat.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkMe(String id1,String id2){
|
||||
containMe = CommonAppConfig.getInstance().getUid().equals(id1) || CommonAppConfig.getInstance().getUid().equals(id2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
//关闭倒计时
|
||||
countDownTimer = new CountDownTimer(10000, 1000){
|
||||
|
||||
@Override
|
||||
public void onTick(long l) {
|
||||
sub_time.setText(String.valueOf((l+500)/1000));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
destroyDialog();
|
||||
}
|
||||
}.start();
|
||||
initData();
|
||||
}
|
||||
|
||||
public void setSudSettleList(List<SudSettleBean> data){
|
||||
settleBeans.clear();
|
||||
settleBeans.addAll(data);
|
||||
LogUtils.e("yqw=====>"+settleBeans);
|
||||
}
|
||||
|
||||
private void sortByWinNum(List<SudSettleBean> list){
|
||||
// 按照胜利数排序 settleBeans 列表
|
||||
Collections.sort(list, (bean1, bean2) -> {
|
||||
return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序
|
||||
});
|
||||
}
|
||||
|
||||
private void destroyDialog(){
|
||||
dismiss();
|
||||
countDownTimer.cancel();
|
||||
countDownTimer = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import com.yunbao.common.event.LiveSudGameHistoryEvent;
|
||||
import com.yunbao.common.event.RoomHolderTypeEvent;
|
||||
import com.yunbao.common.event.SudGameListEvent;
|
||||
import com.yunbao.common.event.SudGameListSillEvent;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
@@ -87,6 +88,11 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
if (mType == 0 || mType == 4) {
|
||||
topSelect.setText(getContext().getString(R.string.interactive_game_room_all));
|
||||
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());
|
||||
if (TextUtils.equals(String.valueOf(interactionID), customSidebarChildModels.get(i).getSrc())) {
|
||||
index = i;
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.SudGameAdapter;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 多人小游戏弹窗
|
||||
*/
|
||||
public class SudGameMultipleDialog extends AbsDialogCenterPopupWindow{
|
||||
public SudGameMultipleDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_sub_multiple;
|
||||
}
|
||||
|
||||
private RecyclerView sub_recycle_rank;
|
||||
private AppCompatImageView sub_leave,sub_again,sub_title;
|
||||
private AppCompatTextView sub_time;
|
||||
private CountDownTimer countDownTimer;
|
||||
private SudGameAdapter sudGameAdapter;
|
||||
private final List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.dismissOnTouchOutside(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
sub_recycle_rank = findViewById(R.id.sub_recycle_rank);//分数排名
|
||||
sub_leave = findViewById(R.id.sub_leave);//离开按钮
|
||||
sub_again = findViewById(R.id.sub_again);//再来一局按钮
|
||||
sub_title = findViewById(R.id.sub_title);//弹窗标题
|
||||
sub_time = findViewById(R.id.sub_time);//关闭倒计时
|
||||
|
||||
if (WordUtil.isNewZh()){
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_zh);
|
||||
sub_title.setImageResource(R.mipmap.sub_over_zh);
|
||||
}else {
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_en);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_en);
|
||||
sub_title.setImageResource(R.mipmap.sub_over_en);
|
||||
}
|
||||
|
||||
sub_leave.setOnClickListener(v-> destroyDialog());
|
||||
sub_again.setOnClickListener(v-> {
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
destroyDialog();
|
||||
});
|
||||
|
||||
//设置排名数据
|
||||
sudGameAdapter = new SudGameAdapter(mContext,settleBeans);
|
||||
sub_recycle_rank.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
sub_recycle_rank.setAdapter(sudGameAdapter);
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
//关闭倒计时
|
||||
countDownTimer = new CountDownTimer(10000, 1000){
|
||||
|
||||
@Override
|
||||
public void onTick(long l) {
|
||||
sub_time.setText(String.valueOf((l+500)/1000));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
destroyDialog();
|
||||
}
|
||||
}.start();
|
||||
sudGameAdapter.notifyDataSetChanged();
|
||||
// limitItem();
|
||||
}
|
||||
|
||||
public void setSudSettleList(List<SudSettleBean> data){
|
||||
settleBeans.clear();
|
||||
settleBeans.addAll(data);
|
||||
}
|
||||
|
||||
//设置最多显示的高度
|
||||
private void limitItem(){
|
||||
sub_recycle_rank.post(() -> {
|
||||
View itemView = sub_recycle_rank.getChildAt(0);
|
||||
if (itemView != null){
|
||||
int height = (int) (itemView.getHeight()*3.5);
|
||||
ViewGroup.LayoutParams layoutParams = sub_recycle_rank.getLayoutParams();
|
||||
layoutParams.height = height;
|
||||
sub_recycle_rank.setLayoutParams(layoutParams);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void destroyDialog(){
|
||||
dismiss();
|
||||
countDownTimer.cancel();
|
||||
countDownTimer = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class SudLoadDialog extends AbsDialogCenterPopupWindow{
|
||||
public SudLoadDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
private LinearLayoutCompat sud_load_bg;
|
||||
private AppCompatImageView sud_load,sud_load_skip,sud_load_again;
|
||||
private ProgressBar sud_load_bar_double,sud_load_bar_multiple;
|
||||
private int isDouble = 0;//游戏模式 1:双人对战 2:多人游戏
|
||||
private int clickStatus = 0;//0:什么都不点击 1:点击跳过 2:点击再来一局
|
||||
|
||||
public int getClickStatus() {
|
||||
return clickStatus;
|
||||
}
|
||||
|
||||
public void setClickStatus(int clickStatus) {
|
||||
this.clickStatus = clickStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.dismissOnTouchOutside(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_sud_load;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
sud_load_bg = findViewById(R.id.sud_load_bg);
|
||||
sud_load = findViewById(R.id.sud_load);
|
||||
sud_load_skip = findViewById(R.id.sud_load_skip);
|
||||
sud_load_again = findViewById(R.id.sud_load_again);
|
||||
sud_load_bar_double = findViewById(R.id.sud_load_bar_double);
|
||||
sud_load_bar_multiple = findViewById(R.id.sud_load_bar_multiple);
|
||||
|
||||
if (WordUtil.isNewZh()){
|
||||
sud_load.setImageResource(R.mipmap.sud_load_zh);
|
||||
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_zh);
|
||||
sud_load_again.setImageResource(R.mipmap.sub_again_zh);
|
||||
}else {
|
||||
sud_load.setImageResource(R.mipmap.sud_load_en);
|
||||
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_en);
|
||||
sud_load_again.setImageResource(R.mipmap.sub_again_en);
|
||||
}
|
||||
|
||||
sud_load_skip.setOnClickListener(v->{
|
||||
clickStatus = 1;
|
||||
dismiss();
|
||||
});
|
||||
|
||||
sud_load_again.setOnClickListener(v->{
|
||||
clickStatus = 2;
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
if (isDouble == 1){
|
||||
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_double));
|
||||
sud_load_bar_double.setVisibility(View.VISIBLE);
|
||||
sud_load_bar_multiple.setVisibility(View.GONE);
|
||||
}else {
|
||||
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_multiple));
|
||||
sud_load_bar_double.setVisibility(View.GONE);
|
||||
sud_load_bar_multiple.setVisibility(View.VISIBLE);
|
||||
}
|
||||
// new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
// if (this.isShow()){
|
||||
// dismiss();
|
||||
// }
|
||||
// },10000);
|
||||
}
|
||||
|
||||
public void setDouble(int isDouble){
|
||||
this.isDouble = isDouble;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user