Compare commits
182 Commits
master_融云升
...
gong_dev_g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1deb197af6 | ||
|
|
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 | ||
|
|
5922f4c08b |
@@ -1,14 +1,8 @@
|
|||||||
//apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
//apply plugin: 'img-optimizer'
|
apply plugin: 'img-optimizer'
|
||||||
//apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
//apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-parcelize'
|
||||||
plugins {
|
apply from: "../package_config.gradle"
|
||||||
id 'com.android.library'
|
|
||||||
id 'kotlin-android'
|
|
||||||
id 'kotlin-parcelize'
|
|
||||||
id 'img-optimizer'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "com.yunbao.faceunity"
|
namespace "com.yunbao.faceunity"
|
||||||
@@ -39,7 +33,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
@@ -57,9 +51,6 @@ android {
|
|||||||
sourceCompatibility JavaVersion.VERSION_18
|
sourceCompatibility JavaVersion.VERSION_18
|
||||||
targetCompatibility JavaVersion.VERSION_18
|
targetCompatibility JavaVersion.VERSION_18
|
||||||
}
|
}
|
||||||
buildFeatures {
|
|
||||||
buildConfig = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
flatDir {
|
flatDir {
|
||||||
@@ -67,15 +58,15 @@ repositories {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation rootProject.ext.dependencies["appcompat-androidx"]
|
api rootProject.ext.dependencies["appcompat-androidx"]
|
||||||
implementation rootProject.ext.dependencies["recyclerview-androidx"]
|
api rootProject.ext.dependencies["recyclerview-androidx"]
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
//common
|
//common
|
||||||
implementation project(path: ':common')
|
api project(path: ':common')
|
||||||
|
|
||||||
implementation 'com.faceunity:core:8.3.1'
|
api 'com.faceunity:core:8.7.0'
|
||||||
implementation 'com.faceunity:model:8.3.1'
|
api 'com.faceunity:model:8.7.0'
|
||||||
//implementation 'com.faceunity:nama:8.3.1' //底层库-标准版
|
//implementation 'com.faceunity:nama:8.3.1' //底层库-标准版
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
package com.yunbao.faceunity;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry;
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
|
||||||
assertEquals("com.yunbao.faceunity.test", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
>
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
@@ -10,9 +9,7 @@
|
|||||||
|
|
||||||
<application
|
<application
|
||||||
android:icon="@mipmap/ico_home_animoji"
|
android:icon="@mipmap/ico_home_animoji"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true">
|
||||||
tools:replace="allowBackup"
|
|
||||||
>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -96,11 +96,17 @@ public class FaceManager implements SensorEventListener {
|
|||||||
faceUnityView.setIFaceUnityInter(new FaceUnityView.IFaceUnityInter() {
|
faceUnityView.setIFaceUnityInter(new FaceUnityView.IFaceUnityInter() {
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
|
if(onMirrorChanged!=null){
|
||||||
|
onMirrorChanged.onChange(false);
|
||||||
|
}
|
||||||
pauseFace = true;
|
pauseFace = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
|
if(onMirrorChanged!=null){
|
||||||
|
onMirrorChanged.onChange(true);
|
||||||
|
}
|
||||||
pauseFace = false;
|
pauseFace = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -295,7 +301,18 @@ public class FaceManager implements SensorEventListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnMirrorChanged onMirrorChanged;
|
||||||
|
|
||||||
|
public void setOnMirrorChanged(OnMirrorChanged onMirrorChanged) {
|
||||||
|
this.onMirrorChanged = onMirrorChanged;
|
||||||
|
}
|
||||||
|
|
||||||
public interface FaceStatusChanged {
|
public interface FaceStatusChanged {
|
||||||
void onFaceChanged(int num);
|
void onFaceChanged(int num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface OnMirrorChanged{
|
||||||
|
void onChange(boolean falg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ public class FURenderer extends IFURenderer {
|
|||||||
|
|
||||||
|
|
||||||
/* 特效FURenderKit*/
|
/* 特效FURenderKit*/
|
||||||
private FURenderKit mFURenderKit;
|
public FURenderKit mFURenderKit;
|
||||||
|
|
||||||
/* AI道具*/
|
/* AI道具*/
|
||||||
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor.bundle";
|
||||||
public static String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
public static String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
||||||
|
|
||||||
/* GL 线程 ID */
|
/* GL 线程 ID */
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class FaceUnityConfig {
|
|||||||
|
|
||||||
/************************** 算法Model ******************************/
|
/************************** 算法Model ******************************/
|
||||||
// 人脸识别
|
// 人脸识别
|
||||||
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor.bundle";
|
||||||
// 手势
|
// 手势
|
||||||
public static String BUNDLE_AI_HAND = "model" + File.separator + "ai_hand_processor.bundle";
|
public static String BUNDLE_AI_HAND = "model" + File.separator + "ai_hand_processor.bundle";
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import com.google.gson.JsonObject;
|
|||||||
import com.yunbao.faceunity.entity.net.FineStickerEntity;
|
import com.yunbao.faceunity.entity.net.FineStickerEntity;
|
||||||
import com.yunbao.faceunity.utils.FaceUnityData;
|
import com.yunbao.faceunity.utils.FaceUnityData;
|
||||||
import com.yunbao.faceunity.utils.FileUtils;
|
import com.yunbao.faceunity.utils.FileUtils;
|
||||||
import com.yunbao.faceunity.utils.ZipUtils;
|
import com.yunbao.common.utils.ZipUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
apply from: "../package_config.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "com.samsung.android.sdk.iap.lib"
|
namespace "com.samsung.android.sdk.iap.lib"
|
||||||
compileSdk rootProject.ext.android.compileSdkVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
|
|||||||
@@ -1,31 +1,29 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:versionCode="601000004"
|
android:versionCode="601000004"
|
||||||
android:versionName="6.1.0">
|
android:versionName="6.1.0">
|
||||||
<!-- version code [Major/Minor/Bug fix release/Build number ] : x xx xxx xxx -->
|
<!-- version code [Major/Minor/Bug fix release/Build number ] : x xx xxx xxx -->
|
||||||
|
|
||||||
<application
|
<application>
|
||||||
android:allowBackup="true"
|
|
||||||
tools:replace="allowBackup">
|
|
||||||
<!-- IAP 라이브러리 내 Activity 선언 시작-->
|
<!-- IAP 라이브러리 내 Activity 선언 시작-->
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.samsung.android.sdk.iap.lib2.activity.DialogActivity"
|
android:name="com.samsung.android.sdk.iap.lib.activity.DialogActivity"
|
||||||
android:theme="@style/Theme.Empty"
|
android:theme="@style/Theme.Empty"
|
||||||
android:configChanges="orientation|screenSize"/>
|
android:configChanges="orientation|screenSize"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.samsung.android.sdk.iap.lib2.activity.CheckPackageActivity"
|
android:name="com.samsung.android.sdk.iap.lib.activity.CheckPackageActivity"
|
||||||
android:theme="@style/Theme.Empty"
|
android:theme="@style/Theme.Empty"
|
||||||
android:configChanges="orientation|screenSize"/>
|
android:configChanges="orientation|screenSize"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.samsung.android.sdk.iap.lib2.activity.AccountActivity"
|
android:name="com.samsung.android.sdk.iap.lib.activity.AccountActivity"
|
||||||
android:theme="@style/Theme.Transparent"
|
android:theme="@style/Theme.Transparent"
|
||||||
android:configChanges="orientation|screenSize"/>
|
android:configChanges="orientation|screenSize"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.samsung.android.sdk.iap.lib2.activity.PaymentActivity"
|
android:name="com.samsung.android.sdk.iap.lib.activity.PaymentActivity"
|
||||||
android:theme="@style/Theme.Empty"
|
android:theme="@style/Theme.Empty"
|
||||||
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|locale|uiMode|fontScale|density"/>
|
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|locale|uiMode|fontScale|density"/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.activity;
|
package com.samsung.android.sdk.iap.lib.activity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperUtil;
|
import com.samsung.android.sdk.iap.lib.helper.HelperUtil;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-03-06.
|
* Created by sangbum7.kim on 2018-03-06.
|
||||||
@@ -16,11 +16,12 @@ import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
|||||||
public class AccountActivity extends Activity {
|
public class AccountActivity extends Activity {
|
||||||
private static final String TAG = AccountActivity.class.getSimpleName();
|
private static final String TAG = AccountActivity.class.getSimpleName();
|
||||||
|
|
||||||
com.samsung.android.sdk.iap.lib2.helper.IapHelper mIapHelper = null;
|
IapHelper mIapHelper = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
mIapHelper = IapHelper.getInstance(this);
|
mIapHelper = IapHelper.getInstance(this);
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
// 1. If IAP package is installed and valid, start SamsungAccount
|
// 1. If IAP package is installed and valid, start SamsungAccount
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.activity;
|
package com.samsung.android.sdk.iap.lib.activity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -8,25 +8,25 @@ import android.util.Log;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.dialog.BaseDialogFragment;
|
||||||
import com.samsung.android.sdk.iap.lib2.dialog.BaseDialogFragment;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperUtil;
|
import com.samsung.android.sdk.iap.lib.helper.HelperUtil;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.PurchaseVo;
|
import com.samsung.android.sdk.iap.lib.vo.PurchaseVo;
|
||||||
|
|
||||||
|
|
||||||
public abstract class BaseActivity extends Activity {
|
public abstract class BaseActivity extends Activity {
|
||||||
private static final String TAG = BaseActivity.class.getSimpleName();
|
private static final String TAG = BaseActivity.class.getSimpleName();
|
||||||
|
|
||||||
protected com.samsung.android.sdk.iap.lib2.vo.ErrorVo mErrorVo = new com.samsung.android.sdk.iap.lib2.vo.ErrorVo();
|
protected ErrorVo mErrorVo = new ErrorVo();
|
||||||
private Dialog mProgressDialog = null;
|
private Dialog mProgressDialog = null;
|
||||||
protected com.samsung.android.sdk.iap.lib2.vo.PurchaseVo mPurchaseVo = null;
|
protected PurchaseVo mPurchaseVo = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper Class between IAPService and 3rd Party Application
|
* Helper Class between IAPService and 3rd Party Application
|
||||||
*/
|
*/
|
||||||
com.samsung.android.sdk.iap.lib2.helper.IapHelper mIapHelper = null;
|
IapHelper mIapHelper = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag value to show successful pop-up. Error pop-up appears whenever it fails or not.
|
* Flag value to show successful pop-up. Error pop-up appears whenever it fails or not.
|
||||||
@@ -64,15 +64,15 @@ public abstract class BaseActivity extends Activity {
|
|||||||
public boolean checkAppsPackage(Activity _activity) {
|
public boolean checkAppsPackage(Activity _activity) {
|
||||||
// 1. If Galaxy Store is installed
|
// 1. If Galaxy Store is installed
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
if (com.samsung.android.sdk.iap.lib2.helper.HelperUtil.isInstalledAppsPackage(this)) {
|
if (HelperUtil.isInstalledAppsPackage(this)) {
|
||||||
// 1) If Galaxy Store is enabled
|
// 1) If Galaxy Store is enabled
|
||||||
// ================================================================
|
// ================================================================
|
||||||
if (!com.samsung.android.sdk.iap.lib2.helper.HelperUtil.isEnabledAppsPackage(this)) {
|
if (!HelperUtil.isEnabledAppsPackage(this)) {
|
||||||
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showEnableGalaxyStoreDialog(_activity);
|
HelperUtil.showEnableGalaxyStoreDialog(_activity);
|
||||||
// ================================================================
|
// ================================================================
|
||||||
// 2) If Galaxy Store is valid
|
// 2) If Galaxy Store is valid
|
||||||
// ================================================================
|
// ================================================================
|
||||||
} else if (com.samsung.android.sdk.iap.lib2.helper.HelperUtil.isValidAppsPackage(this)) {
|
} else if (HelperUtil.isValidAppsPackage(this)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// Set error to notify result to third-party application
|
// Set error to notify result to third-party application
|
||||||
@@ -84,7 +84,7 @@ public abstract class BaseActivity extends Activity {
|
|||||||
R.string.dream_ph_body_contact_p1sscustomer_servicep2ss_for_more_information_n_nerror_code_c_p3ss),
|
R.string.dream_ph_body_contact_p1sscustomer_servicep2ss_for_more_information_n_nerror_code_c_p3ss),
|
||||||
"", "", ERROR_ISSUER_IAP_CLIENT + ERROR_CODE_INVALID_GALAXY_STORE);
|
"", "", ERROR_ISSUER_IAP_CLIENT + ERROR_CODE_INVALID_GALAXY_STORE);
|
||||||
mErrorVo.setError(HelperDefine.IAP_PAYMENT_IS_CANCELED, errorString);
|
mErrorVo.setError(HelperDefine.IAP_PAYMENT_IS_CANCELED, errorString);
|
||||||
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showInvalidGalaxyStoreDialog(this);
|
HelperUtil.showInvalidGalaxyStoreDialog(this);
|
||||||
}
|
}
|
||||||
// ================================================================
|
// ================================================================
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ public abstract class BaseActivity extends Activity {
|
|||||||
// 2. If Galaxy Store is not installed
|
// 2. If Galaxy Store is not installed
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
} else {
|
} else {
|
||||||
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.installAppsPackage(this);
|
HelperUtil.installAppsPackage(this);
|
||||||
}
|
}
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
return false;
|
return false;
|
||||||
@@ -161,12 +161,12 @@ public abstract class BaseActivity extends Activity {
|
|||||||
else {
|
else {
|
||||||
Log.e(TAG, "finishPurchase: " + mErrorVo.dump());
|
Log.e(TAG, "finishPurchase: " + mErrorVo.dump());
|
||||||
if (mShowErrorDialog) {
|
if (mShowErrorDialog) {
|
||||||
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showIapErrorDialog(
|
HelperUtil.showIapErrorDialog(
|
||||||
this,
|
this,
|
||||||
getString(R.string.dream_ph_pheader_couldnt_complete_purchase),
|
getString(R.string.dream_ph_pheader_couldnt_complete_purchase),
|
||||||
mErrorVo.getErrorString(),
|
mErrorVo.getErrorString(),
|
||||||
mErrorVo.getErrorDetailsString(),
|
mErrorVo.getErrorDetailsString(),
|
||||||
new com.samsung.android.sdk.iap.lib2.dialog.BaseDialogFragment.OnClickListener() {
|
new BaseDialogFragment.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick() {
|
public void onClick() {
|
||||||
finish();
|
finish();
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.activity;
|
package com.samsung.android.sdk.iap.lib.activity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperUtil;
|
import com.samsung.android.sdk.iap.lib.helper.HelperUtil;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-03-07.
|
* Created by sangbum7.kim on 2018-03-07.
|
||||||
@@ -27,12 +27,12 @@ public class CheckPackageActivity extends Activity {
|
|||||||
int DialogType = extras.getInt("DialogType");
|
int DialogType = extras.getInt("DialogType");
|
||||||
switch (DialogType) {
|
switch (DialogType) {
|
||||||
case HelperDefine.DIALOG_TYPE_INVALID_PACKAGE: {
|
case HelperDefine.DIALOG_TYPE_INVALID_PACKAGE: {
|
||||||
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showInvalidGalaxyStoreDialog(this);
|
HelperUtil.showInvalidGalaxyStoreDialog(this);
|
||||||
mFinishFlag = false;
|
mFinishFlag = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HelperDefine.DIALOG_TYPE_DISABLE_APPLICATION: {
|
case HelperDefine.DIALOG_TYPE_DISABLE_APPLICATION: {
|
||||||
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showEnableGalaxyStoreDialog(this);
|
HelperUtil.showEnableGalaxyStoreDialog(this);
|
||||||
mFinishFlag = false;
|
mFinishFlag = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1,12 +1,16 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.activity;
|
package com.samsung.android.sdk.iap.lib.activity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.dialog.BaseDialogFragment;
|
import com.samsung.android.sdk.iap.lib.dialog.BaseDialogFragment;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperUtil;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
|
import com.samsung.android.sdk.iap.lib.helper.HelperUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-03-05.
|
* Created by sangbum7.kim on 2018-03-05.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.activity;
|
package com.samsung.android.sdk.iap.lib.activity;
|
||||||
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -9,9 +9,9 @@ import android.util.Log;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperListenerManager;
|
import com.samsung.android.sdk.iap.lib.helper.HelperListenerManager;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnPaymentListener;
|
import com.samsung.android.sdk.iap.lib.listener.OnPaymentListener;
|
||||||
|
|
||||||
public class PaymentActivity extends BaseActivity {
|
public class PaymentActivity extends BaseActivity {
|
||||||
private static final String TAG = PaymentActivity.class.getSimpleName();
|
private static final String TAG = PaymentActivity.class.getSimpleName();
|
||||||
@@ -56,7 +56,7 @@ public class PaymentActivity extends BaseActivity {
|
|||||||
super.preDestory();
|
super.preDestory();
|
||||||
if (isFinishing()) {
|
if (isFinishing()) {
|
||||||
OnPaymentListener onPaymentListener =
|
OnPaymentListener onPaymentListener =
|
||||||
com.samsung.android.sdk.iap.lib2.helper.HelperListenerManager.getInstance().getOnPaymentListener();
|
HelperListenerManager.getInstance().getOnPaymentListener();
|
||||||
HelperListenerManager.getInstance().setOnPaymentListener(null);
|
HelperListenerManager.getInstance().setOnPaymentListener(null);
|
||||||
if (null != onPaymentListener) {
|
if (null != onPaymentListener) {
|
||||||
onPaymentListener.onPayment(mErrorVo, mPurchaseVo);
|
onPaymentListener.onPayment(mErrorVo, mPurchaseVo);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.dialog;
|
package com.samsung.android.sdk.iap.lib.dialog;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -8,6 +8,7 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.helper;
|
package com.samsung.android.sdk.iap.lib.helper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2017-07-17.
|
* Created by sangbum7.kim on 2017-07-17.
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.helper;
|
package com.samsung.android.sdk.iap.lib.helper;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnConsumePurchasedItemsListener;
|
import com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnGetOwnedListListener;
|
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnGetProductsDetailsListener;
|
import com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnPaymentListener;
|
import com.samsung.android.sdk.iap.lib.listener.OnConsumePurchasedItemsListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.task.ConsumePurchasedItemsTask;
|
import com.samsung.android.sdk.iap.lib.listener.OnGetOwnedListListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask;
|
import com.samsung.android.sdk.iap.lib.listener.OnGetProductsDetailsListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask;
|
import com.samsung.android.sdk.iap.lib.listener.OnPaymentListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2017-08-29.
|
* Created by sangbum7.kim on 2017-08-29.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.helper;
|
package com.samsung.android.sdk.iap.lib.helper;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@@ -14,9 +14,9 @@ import android.text.Html;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.activity.BaseActivity;
|
import com.samsung.android.sdk.iap.lib.activity.BaseActivity;
|
||||||
import com.samsung.android.sdk.iap.lib2.dialog.BaseDialogFragment;
|
import com.samsung.android.sdk.iap.lib.dialog.BaseDialogFragment;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2017-08-17.
|
* Created by sangbum7.kim on 2017-08-17.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.helper;
|
package com.samsung.android.sdk.iap.lib.helper;
|
||||||
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -12,20 +12,21 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.activity.CheckPackageActivity;
|
import com.samsung.android.sdk.iap.lib.activity.CheckPackageActivity;
|
||||||
import com.samsung.android.sdk.iap.lib2.activity.PaymentActivity;
|
import com.samsung.android.sdk.iap.lib.activity.PaymentActivity;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnConsumePurchasedItemsListener;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnGetOwnedListListener;
|
import com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnGetProductsDetailsListener;
|
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnPaymentListener;
|
import com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask;
|
||||||
import com.samsung.android.sdk.iap.lib2.service.BaseService;
|
import com.samsung.android.sdk.iap.lib.listener.OnConsumePurchasedItemsListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.service.ConsumePurchasedItems;
|
import com.samsung.android.sdk.iap.lib.listener.OnGetOwnedListListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.service.OwnedProduct;
|
import com.samsung.android.sdk.iap.lib.listener.OnGetProductsDetailsListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.service.ProductsDetails;
|
import com.samsung.android.sdk.iap.lib.listener.OnPaymentListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib.service.BaseService;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.task.ConsumePurchasedItemsTask;
|
import com.samsung.android.sdk.iap.lib.service.ConsumePurchasedItems;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask;
|
import com.samsung.android.sdk.iap.lib.service.OwnedProduct;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask;
|
import com.samsung.android.sdk.iap.lib.service.ProductsDetails;
|
||||||
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -33,7 +34,6 @@ public class IapHelper extends HelperDefine {
|
|||||||
private static final String TAG = IapHelper.class.getSimpleName();
|
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.
|
* Please double-check this mode before release.
|
||||||
*/
|
*/
|
||||||
private int mMode = HelperDefine.OperationMode.OPERATION_MODE_PRODUCTION.getValue();
|
private int mMode = HelperDefine.OperationMode.OPERATION_MODE_PRODUCTION.getValue();
|
||||||
@@ -46,9 +46,9 @@ public class IapHelper extends HelperDefine {
|
|||||||
|
|
||||||
// AsyncTask for API
|
// AsyncTask for API
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
private com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask mGetProductsDetailsTask = null;
|
private com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask mGetProductsDetailsTask = null;
|
||||||
private com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask mGetOwnedListTask = null;
|
private com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask mGetOwnedListTask = null;
|
||||||
private com.samsung.android.sdk.iap.lib2.helper.task.ConsumePurchasedItemsTask mConsumePurchasedItemsTask = null;
|
private com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask mConsumePurchasedItemsTask = null;
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
private ArrayList<BaseService> mServiceQueue = new ArrayList<BaseService>();
|
private ArrayList<BaseService> mServiceQueue = new ArrayList<BaseService>();
|
||||||
@@ -267,7 +267,7 @@ public class IapHelper extends HelperDefine {
|
|||||||
if (mIapConnector == null || mContext == null) {
|
if (mIapConnector == null || mContext == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
mGetProductsDetailsTask = new com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask(_baseService,
|
mGetProductsDetailsTask = new com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask(_baseService,
|
||||||
mIapConnector,
|
mIapConnector,
|
||||||
mContext,
|
mContext,
|
||||||
_productIDs,
|
_productIDs,
|
||||||
@@ -344,7 +344,7 @@ public class IapHelper extends HelperDefine {
|
|||||||
if (mIapConnector == null || mContext == null) {
|
if (mIapConnector == null || mContext == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
mGetOwnedListTask = new com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask(_baseService,
|
mGetOwnedListTask = new com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask(_baseService,
|
||||||
mIapConnector,
|
mIapConnector,
|
||||||
mContext,
|
mContext,
|
||||||
_productType,
|
_productType,
|
||||||
@@ -417,7 +417,7 @@ public class IapHelper extends HelperDefine {
|
|||||||
mConsumePurchasedItemsTask.cancel(true);
|
mConsumePurchasedItemsTask.cancel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
mConsumePurchasedItemsTask = new com.samsung.android.sdk.iap.lib2.helper.task.ConsumePurchasedItemsTask(_baseService,
|
mConsumePurchasedItemsTask = new com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask(_baseService,
|
||||||
mIapConnector,
|
mIapConnector,
|
||||||
mContext,
|
mContext,
|
||||||
_purchaseIds,
|
_purchaseIds,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.helper.task;
|
package com.samsung.android.sdk.iap.lib.helper.task;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
@@ -6,8 +6,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.service.BaseService;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib.service.BaseService;
|
||||||
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2017-09-01.
|
* Created by sangbum7.kim on 2017-09-01.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.helper.task;
|
package com.samsung.android.sdk.iap.lib.helper.task;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -6,9 +6,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.service.ConsumePurchasedItems;
|
import com.samsung.android.sdk.iap.lib.service.ConsumePurchasedItems;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ConsumeVo;
|
import com.samsung.android.sdk.iap.lib.vo.ConsumeVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.helper.task;
|
package com.samsung.android.sdk.iap.lib.helper.task;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -6,9 +6,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.service.OwnedProduct;
|
import com.samsung.android.sdk.iap.lib.service.OwnedProduct;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.OwnedProductVo;
|
import com.samsung.android.sdk.iap.lib.vo.OwnedProductVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.helper.task;
|
package com.samsung.android.sdk.iap.lib.helper.task;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -6,9 +6,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.service.ProductsDetails;
|
import com.samsung.android.sdk.iap.lib.service.ProductsDetails;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ProductVo;
|
import com.samsung.android.sdk.iap.lib.vo.ProductVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.listener;
|
package com.samsung.android.sdk.iap.lib.listener;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask;
|
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ConsumeVo;
|
import com.samsung.android.sdk.iap.lib.vo.ConsumeVo;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback Interface used with {@link com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask}
|
* Callback Interface used with {@link GetOwnedListTask}
|
||||||
*/
|
*/
|
||||||
public interface OnConsumePurchasedItemsListener {
|
public interface OnConsumePurchasedItemsListener {
|
||||||
/**
|
/**
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.samsung.android.sdk.iap.lib.listener;
|
||||||
|
|
||||||
|
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
|
||||||
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
|
import com.samsung.android.sdk.iap.lib.vo.OwnedProductVo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback Interface used with {@link GetOwnedListTask}
|
||||||
|
*/
|
||||||
|
public interface OnGetOwnedListListener {
|
||||||
|
/**
|
||||||
|
* Callback method to be invoked when {@link GetOwnedListTask} has been finished.
|
||||||
|
*
|
||||||
|
* @param _errorVO
|
||||||
|
* @param _ownedList
|
||||||
|
*/
|
||||||
|
void onGetOwnedProducts(ErrorVo _errorVO, ArrayList<OwnedProductVo> _ownedList);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.samsung.android.sdk.iap.lib.listener;
|
||||||
|
|
||||||
|
import com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask;
|
||||||
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
|
import com.samsung.android.sdk.iap.lib.vo.ProductVo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback Interface used with {@link GetProductsDetailsTask}
|
||||||
|
*/
|
||||||
|
public interface OnGetProductsDetailsListener {
|
||||||
|
/**
|
||||||
|
* Callback method to be invoked when {@link GetProductsDetailsTask} has been finished.
|
||||||
|
*
|
||||||
|
* @param _errorVO
|
||||||
|
* @param _productList
|
||||||
|
*/
|
||||||
|
void onGetProducts(ErrorVo _errorVO, ArrayList<ProductVo> _productList);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.listener;
|
package com.samsung.android.sdk.iap.lib.listener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback Interface to be invoked when bind to IAPService has been finished.
|
* Callback Interface to be invoked when bind to IAPService has been finished.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.listener;
|
package com.samsung.android.sdk.iap.lib.listener;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.PurchaseVo;
|
import com.samsung.android.sdk.iap.lib.vo.PurchaseVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback Interface to be invoked when payment has been finished.
|
* Callback Interface to be invoked when payment has been finished.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.listener;
|
package com.samsung.android.sdk.iap.lib.listener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-02-28.
|
* Created by sangbum7.kim on 2018-02-28.
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.service;
|
package com.samsung.android.sdk.iap.lib.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.activity.AccountActivity;
|
||||||
import com.samsung.android.sdk.iap.lib2.activity.AccountActivity;
|
import com.samsung.android.sdk.iap.lib.activity.DialogActivity;
|
||||||
import com.samsung.android.sdk.iap.lib2.activity.DialogActivity;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-02-28.
|
* Created by sangbum7.kim on 2018-02-28.
|
||||||
@@ -18,8 +18,8 @@ import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
|||||||
public abstract class BaseService {
|
public abstract class BaseService {
|
||||||
private static final String TAG = BaseService.class.getSimpleName();
|
private static final String TAG = BaseService.class.getSimpleName();
|
||||||
|
|
||||||
protected com.samsung.android.sdk.iap.lib2.vo.ErrorVo mErrorVo = new com.samsung.android.sdk.iap.lib2.vo.ErrorVo();
|
protected ErrorVo mErrorVo = new ErrorVo();
|
||||||
protected com.samsung.android.sdk.iap.lib2.helper.IapHelper mIapHelper = null;
|
protected IapHelper mIapHelper = null;
|
||||||
protected Context mContext = null;
|
protected Context mContext = null;
|
||||||
|
|
||||||
public BaseService(IapHelper _iapHelper, Context _context) {
|
public BaseService(IapHelper _iapHelper, Context _context) {
|
||||||
@@ -28,7 +28,7 @@ public abstract class BaseService {
|
|||||||
mErrorVo.setError(HelperDefine.IAP_ERROR_INITIALIZATION, mContext.getString(R.string.mids_sapps_pop_unknown_error_occurred));
|
mErrorVo.setError(HelperDefine.IAP_ERROR_INITIALIZATION, mContext.getString(R.string.mids_sapps_pop_unknown_error_occurred));
|
||||||
}
|
}
|
||||||
|
|
||||||
public com.samsung.android.sdk.iap.lib2.vo.ErrorVo getErrorVo() {
|
public ErrorVo getErrorVo() {
|
||||||
return mErrorVo;
|
return mErrorVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.service;
|
package com.samsung.android.sdk.iap.lib.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnConsumePurchasedItemsListener;
|
import com.samsung.android.sdk.iap.lib.listener.OnConsumePurchasedItemsListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ConsumeVo;
|
import com.samsung.android.sdk.iap.lib.vo.ConsumeVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -18,9 +18,9 @@ import java.util.ArrayList;
|
|||||||
public class ConsumePurchasedItems extends BaseService {
|
public class ConsumePurchasedItems extends BaseService {
|
||||||
private static final String TAG = ConsumePurchasedItems.class.getSimpleName();
|
private static final String TAG = ConsumePurchasedItems.class.getSimpleName();
|
||||||
|
|
||||||
private com.samsung.android.sdk.iap.lib2.listener.OnConsumePurchasedItemsListener mOnConsumePurchasedItemsListener = null;
|
private OnConsumePurchasedItemsListener mOnConsumePurchasedItemsListener = null;
|
||||||
private static String mPurchaseIds = "";
|
private static String mPurchaseIds = "";
|
||||||
protected ArrayList<com.samsung.android.sdk.iap.lib2.vo.ConsumeVo> mConsumeList = null;
|
protected ArrayList<ConsumeVo> mConsumeList = null;
|
||||||
|
|
||||||
public ConsumePurchasedItems(IapHelper _iapHelper, Context _context, OnConsumePurchasedItemsListener _onConsumePurchasedItemsListener) {
|
public ConsumePurchasedItems(IapHelper _iapHelper, Context _context, OnConsumePurchasedItemsListener _onConsumePurchasedItemsListener) {
|
||||||
super(_iapHelper, _context);
|
super(_iapHelper, _context);
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.service;
|
package com.samsung.android.sdk.iap.lib.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnGetOwnedListListener;
|
import com.samsung.android.sdk.iap.lib.listener.OnGetOwnedListListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.OwnedProductVo;
|
import com.samsung.android.sdk.iap.lib.vo.OwnedProductVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -18,9 +18,9 @@ import java.util.ArrayList;
|
|||||||
public class OwnedProduct extends BaseService {
|
public class OwnedProduct extends BaseService {
|
||||||
private static final String TAG = OwnedProduct.class.getSimpleName();
|
private static final String TAG = OwnedProduct.class.getSimpleName();
|
||||||
|
|
||||||
private com.samsung.android.sdk.iap.lib2.listener.OnGetOwnedListListener mOnGetOwnedListListener = null;
|
private OnGetOwnedListListener mOnGetOwnedListListener = null;
|
||||||
private static String mProductType = "";
|
private static String mProductType = "";
|
||||||
protected ArrayList<com.samsung.android.sdk.iap.lib2.vo.OwnedProductVo> mOwnedList = null;
|
protected ArrayList<OwnedProductVo> mOwnedList = null;
|
||||||
|
|
||||||
public OwnedProduct(IapHelper _iapHelper, Context _context, OnGetOwnedListListener _onGetOwnedListListener) {
|
public OwnedProduct(IapHelper _iapHelper, Context _context, OnGetOwnedListListener _onGetOwnedListListener) {
|
||||||
super(_iapHelper, _context);
|
super(_iapHelper, _context);
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.service;
|
package com.samsung.android.sdk.iap.lib.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib2.listener.OnGetProductsDetailsListener;
|
import com.samsung.android.sdk.iap.lib.listener.OnGetProductsDetailsListener;
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ProductVo;
|
import com.samsung.android.sdk.iap.lib.vo.ProductVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -18,9 +18,9 @@ import java.util.ArrayList;
|
|||||||
public class ProductsDetails extends BaseService {
|
public class ProductsDetails extends BaseService {
|
||||||
private static final String TAG = ProductsDetails.class.getSimpleName();
|
private static final String TAG = ProductsDetails.class.getSimpleName();
|
||||||
|
|
||||||
private com.samsung.android.sdk.iap.lib2.listener.OnGetProductsDetailsListener mOnGetProductsDetailsListener = null;
|
private OnGetProductsDetailsListener mOnGetProductsDetailsListener = null;
|
||||||
private static String mProductIds = "";
|
private static String mProductIds = "";
|
||||||
protected ArrayList<com.samsung.android.sdk.iap.lib2.vo.ProductVo> mProductsDetails = null;
|
protected ArrayList<ProductVo> mProductsDetails = null;
|
||||||
|
|
||||||
public ProductsDetails(IapHelper _iapHelper, Context _context, OnGetProductsDetailsListener _onGetProductsDetailsListener) {
|
public ProductsDetails(IapHelper _iapHelper, Context _context, OnGetProductsDetailsListener _onGetProductsDetailsListener) {
|
||||||
super(_iapHelper, _context);
|
super(_iapHelper, _context);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.vo;
|
package com.samsung.android.sdk.iap.lib.vo;
|
||||||
|
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.vo;
|
package com.samsung.android.sdk.iap.lib.vo;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.vo;
|
package com.samsung.android.sdk.iap.lib.vo;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
||||||
|
|
||||||
public class ErrorVo {
|
public class ErrorVo {
|
||||||
private int mErrorCode = HelperDefine.IAP_PAYMENT_IS_CANCELED;
|
private int mErrorCode = HelperDefine.IAP_PAYMENT_IS_CANCELED;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.vo;
|
package com.samsung.android.sdk.iap.lib.vo;
|
||||||
|
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.vo;
|
package com.samsung.android.sdk.iap.lib.vo;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.vo;
|
package com.samsung.android.sdk.iap.lib.vo;
|
||||||
|
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.listener;
|
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask;
|
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.OwnedProductVo;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback Interface used with {@link com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask}
|
|
||||||
*/
|
|
||||||
public interface OnGetOwnedListListener {
|
|
||||||
/**
|
|
||||||
* Callback method to be invoked when {@link GetOwnedListTask} has been finished.
|
|
||||||
*
|
|
||||||
* @param _errorVO
|
|
||||||
* @param _ownedList
|
|
||||||
*/
|
|
||||||
void onGetOwnedProducts(ErrorVo _errorVO, ArrayList<OwnedProductVo> _ownedList);
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.samsung.android.sdk.iap.lib2.listener;
|
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask;
|
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
|
||||||
import com.samsung.android.sdk.iap.lib2.vo.ProductVo;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback Interface used with {@link com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask}
|
|
||||||
*/
|
|
||||||
public interface OnGetProductsDetailsListener {
|
|
||||||
/**
|
|
||||||
* Callback method to be invoked when {@link GetProductsDetailsTask} has been finished.
|
|
||||||
*
|
|
||||||
* @param _errorVO
|
|
||||||
* @param _productList
|
|
||||||
*/
|
|
||||||
void onGetProducts(ErrorVo _errorVO, ArrayList<ProductVo> _productList);
|
|
||||||
}
|
|
||||||
@@ -1,18 +1,13 @@
|
|||||||
//apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
//apply plugin: 'img-optimizer'
|
apply plugin: 'img-optimizer'
|
||||||
//apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
//apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-parcelize'
|
||||||
plugins {
|
apply from: "../package_config.gradle"
|
||||||
id 'com.android.library'
|
|
||||||
id 'kotlin-android'
|
|
||||||
id 'kotlin-parcelize'
|
|
||||||
id 'img-optimizer'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "com.pdlive.shayu"
|
namespace "com.pdlive.shayu"
|
||||||
compileSdk rootProject.ext.android.compileSdkVersion
|
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||||
|
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -39,7 +34,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
@@ -54,11 +49,8 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_18
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_18
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
|
||||||
buildFeatures {
|
|
||||||
buildConfig = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
>
|
|
||||||
|
|
||||||
<queries>
|
<queries>
|
||||||
<package android:name="com.pdlive.shayu"/>
|
<package android:name="com.pdlive.shayu"/>
|
||||||
@@ -19,7 +18,7 @@
|
|||||||
tools:ignore="ExportedContentProvider" />
|
tools:ignore="ExportedContentProvider" />
|
||||||
|
|
||||||
</queries>
|
</queries>
|
||||||
<application>
|
<application android:allowBackup="true">
|
||||||
<activity
|
<activity
|
||||||
android:name="com.facebook.FacebookActivity"
|
android:name="com.facebook.FacebookActivity"
|
||||||
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
|
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
148
app/build.gradle
148
app/build.gradle
@@ -3,34 +3,10 @@ apply plugin: 'img-optimizer'
|
|||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'com.alibaba.arouter'
|
apply plugin: 'com.alibaba.arouter'
|
||||||
|
apply from: "../package_config.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "com.pandoralive.shayu"
|
namespace "myname.pdlive.shayu"
|
||||||
dexOptions {
|
|
||||||
jumboMode = true
|
|
||||||
}
|
|
||||||
/* 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'
|
|
||||||
]))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
compileSdk rootProject.ext.android.compileSdkVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
@@ -107,30 +83,48 @@ android {
|
|||||||
buildFeatures {
|
buildFeatures {
|
||||||
buildConfig = true
|
buildConfig = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
println "清空build文件夹";
|
println "清空build文件夹";
|
||||||
for (final def project in rootProject.getAllprojects()) {
|
for (final def project in rootProject.getAllprojects()) {
|
||||||
delete project.buildDir
|
def name = variant.name.replace('Debug', '').replace('Release', '').toLowerCase()
|
||||||
println project.buildDir
|
//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()
|
String variantName = variant.name.capitalize()
|
||||||
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
||||||
processManifestTask.doLast { pm ->
|
processManifestTask.doLast { pm ->
|
||||||
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
|
String manifestPath = "build/intermediates/bundle_manifest/google_onlineRelease/bundle-manifest/AndroidManifest.xml"
|
||||||
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
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) {
|
if (file(manifestPath).exists() && isGooglePlay) {
|
||||||
def manifestContent = file(manifestPath).getText()
|
def manifestContent = file(manifestPath).getText()
|
||||||
|
println "移除权限"
|
||||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||||
|
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
||||||
file(manifestPath).write(manifestContent)
|
file(manifestPath).write(manifestContent)
|
||||||
} else {
|
} else {
|
||||||
print "not Exists = " + manifestPath
|
print "not Exists = " + manifestPath
|
||||||
}
|
}
|
||||||
|
manifestPath = "build/intermediates/merged_manifests/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 {
|
variant.mergeAssetsProvider.configure {
|
||||||
doLast {
|
doLast {
|
||||||
delete(fileTree(dir: outputDir, includes: ['model/ai_bgseg_green.bundle',
|
delete(fileTree(dir: outputDir, includes: ['model/ai_bgseg_green.bundle',
|
||||||
'model/ai_face_processor.bundle',
|
//'model/ai_face_processor.bundle',
|
||||||
//'model/ai_face_processor_lite.bundle',
|
//'model/ai_face_processor_lite.bundle',
|
||||||
'model/ai_hairseg.bundle',
|
'model/ai_hairseg.bundle',
|
||||||
'model/ai_hand_processor.bundle',
|
'model/ai_hand_processor.bundle',
|
||||||
@@ -157,33 +151,64 @@ android {
|
|||||||
]))
|
]))
|
||||||
println "isPluginModel = " + rootProject.ext.manifestPlaceholders.isPluginModel
|
println "isPluginModel = " + rootProject.ext.manifestPlaceholders.isPluginModel
|
||||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||||
delete(fileTree(dir: outputDir, includes: ['model/ai_face_processor_lite.bundle',
|
delete(fileTree(dir: outputDir, includes: ['model/ai_face_processor.bundle',
|
||||||
'graphics/face_beautification.bundle']))
|
'graphics/face_beautification.bundle']))
|
||||||
} else {
|
} else {
|
||||||
println "不删除bundle"
|
println "不删除bundle"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
variant.outputs.all {
|
variant.assemble.doLast { vt ->
|
||||||
def isGoogle = "链接"
|
def channel = ''
|
||||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 1) {
|
def server = ''
|
||||||
isGoogle = "谷歌"
|
if (variant.name.contains('huawei')) {
|
||||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
channel = "华为"
|
||||||
isGoogle = "Huawei"
|
} else if (variant.name.contains('samsung')) {
|
||||||
}else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) {
|
channel = "三星"
|
||||||
isGoogle = "Samsung"
|
} else if (variant.name.contains('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}.apk"
|
||||||
|
variant.outputs.forEach { fe ->
|
||||||
|
copy {
|
||||||
|
from fe.outputFile
|
||||||
|
into file("${project.rootDir}\\outputs\\apk\\")
|
||||||
|
rename { fn ->
|
||||||
|
fileName
|
||||||
}
|
}
|
||||||
def isPlugin = "完整"
|
|
||||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
|
||||||
isPlugin = "插件"
|
|
||||||
}
|
}
|
||||||
def isTest = "测试服"
|
|
||||||
if (rootProject.ext.manifestPlaceholders.serverHost == "https://napi.yaoulive.com") {
|
|
||||||
isTest = "正式服"
|
|
||||||
}
|
}
|
||||||
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 {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -223,8 +248,17 @@ android {
|
|||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
ndk {
|
ndk {
|
||||||
// TODO: 谷歌商城需要兼容两个平台
|
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"
|
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||||
|
println("打包ndk其他")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
annotationProcessorOptions {
|
annotationProcessorOptions {
|
||||||
@@ -280,17 +314,3 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 链接包需要注释掉 否正无法更新 谷歌包需要打开
|
|
||||||
/*
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|||||||
20
app/proguard-rules.pro
vendored
20
app/proguard-rules.pro
vendored
@@ -190,6 +190,8 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
|||||||
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl*
|
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl*
|
||||||
|
|
||||||
#--------ARouter
|
#--------ARouter
|
||||||
|
|
||||||
|
-keep public class com.alibaba.android.arouter.**{*;}
|
||||||
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
||||||
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
||||||
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
||||||
@@ -278,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.settings.model.** {*;}
|
||||||
-keep class tech.sud.mgp.hello.ui.main.nft.model.** {*;}
|
-keep class tech.sud.mgp.hello.ui.main.nft.model.** {*;}
|
||||||
-keep class tech.sud.mgp.hello.common.event.model.** {*;}
|
-keep class tech.sud.mgp.hello.common.event.model.** {*;}
|
||||||
|
-keep class tech.sud.mgp.**{*;}
|
||||||
|
|
||||||
|
-keep class bitter.jnibridge.** { *; }
|
||||||
|
-keep class com.google.androidgamesdk.** { *; }
|
||||||
|
-keep class com.unity3d.** { *; }
|
||||||
|
-keep class do.do.do.** { *; }
|
||||||
|
-keep class do.if.do.** { *; }
|
||||||
|
-keep class for.do.** { *; }
|
||||||
|
-keep class if.do.do.do.** { *; }
|
||||||
|
-keep class org.fmod.** { *; }
|
||||||
|
-keep class tech.sud.** { *; }
|
||||||
|
-keep class tech.unity3d.** { *; }
|
||||||
|
|
||||||
-keep class com.yunbao.common.sud.** {*;}
|
-keep class com.yunbao.common.sud.** {*;}
|
||||||
|
|
||||||
@@ -295,3 +309,9 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
|||||||
|
|
||||||
-keep class com.shayu.lib_google.**{*;}
|
-keep class com.shayu.lib_google.**{*;}
|
||||||
-keep class com.shayu.lib_huawei.**{*;}
|
-keep class com.shayu.lib_huawei.**{*;}
|
||||||
|
|
||||||
|
-keep class io.agora.**{*;}
|
||||||
|
|
||||||
|
-keep class com.qiniu.**{*;}
|
||||||
|
-keep class com.qiniu.**{public <init>();}
|
||||||
|
-ignorewarnings
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
>
|
|
||||||
|
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.CALL_PHONE"
|
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.MANAGE_EXTERNAL_STORAGE" />-->
|
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||||
|
|
||||||
|
<!-- 声网新增 -->
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||||
|
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
|
||||||
|
|
||||||
<queries>
|
<queries>
|
||||||
<package android:name="com.twitter.android" />
|
<package android:name="com.twitter.android" />
|
||||||
<package android:name="jp.naver.line.android" />
|
<package android:name="jp.naver.line.android" />
|
||||||
@@ -157,6 +161,12 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="firebase_crashlytics_collection_enabled"
|
android:name="firebase_crashlytics_collection_enabled"
|
||||||
android:value="${isUploadLog}" />
|
android:value="${isUploadLog}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="BUILD_TIME"
|
||||||
|
android:value="${buildTime}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="SW_RELEASE_MODEL"
|
||||||
|
android:value="${swReleaseModel}" />
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.openinstall.APP_KEY"
|
android:name="com.openinstall.APP_KEY"
|
||||||
android:value="smvslm" />
|
android:value="smvslm" />
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ import com.blankj.utilcode.util.Utils;
|
|||||||
import com.facebook.appevents.AppEventsLogger;
|
import com.facebook.appevents.AppEventsLogger;
|
||||||
import com.fm.openinstall.OpenInstall;
|
import com.fm.openinstall.OpenInstall;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.shayu.phonelive.utils.LogUtils;
|
import com.yunbao.common.utils.LogUtils;
|
||||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||||
import com.tencent.imsdk.v2.V2TIMManager;
|
import com.tencent.imsdk.v2.V2TIMManager;
|
||||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||||
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.yunbao.common.manager.OpenAdManager;
|
||||||
import com.umeng.commonsdk.UMConfigure;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.BuildConfig;
|
import com.yunbao.common.BuildConfig;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
@@ -51,9 +51,11 @@ import com.yunbao.common.utils.L;
|
|||||||
import com.yunbao.common.utils.SpUtil;
|
import com.yunbao.common.utils.SpUtil;
|
||||||
import com.yunbao.live.socket.SocketReceiveBean;
|
import com.yunbao.live.socket.SocketReceiveBean;
|
||||||
import com.yunbao.live.socket.SocketRyClient;
|
import com.yunbao.live.socket.SocketRyClient;
|
||||||
|
import com.yunbao.live.socket.SocketSwClient;
|
||||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||||
import com.yunbao.live.views.PortraitLiveManager;
|
import com.yunbao.live.views.PortraitLiveManager;
|
||||||
import com.yunbao.live.views.RecommendLiveRoomProvider;
|
import com.yunbao.live.views.RecommendLiveRoomProvider;
|
||||||
|
import com.yunbao.main.activity.LoginActivity;
|
||||||
import com.yunbao.main.activity.MsgSettActivity;
|
import com.yunbao.main.activity.MsgSettActivity;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@@ -63,6 +65,7 @@ import java.io.IOException;
|
|||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.rong.imkit.config.RongConfigCenter;
|
import io.rong.imkit.config.RongConfigCenter;
|
||||||
@@ -108,27 +111,31 @@ public class AppContext extends CommonAppContext {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityDestroyed(@NonNull Activity activity) {
|
public void onActivityDestroyed(@NonNull Activity activity) {
|
||||||
|
AppManager.getInstance().removeActivity(activity);
|
||||||
for (WeakReference<Activity> reference : activities) {
|
for (WeakReference<Activity> reference : activities) {
|
||||||
if (reference.get() == activity) {
|
if (reference.get() == activity) {
|
||||||
activities.remove(reference);
|
activities.remove(reference);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AppManager.getInstance().removeActivity(activity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||||
activities.add(new WeakReference<>(activity));
|
activities.add(new WeakReference<>(activity));
|
||||||
|
if (activity instanceof LoginActivity) {
|
||||||
|
AppManager.getInstance().clear();
|
||||||
|
}
|
||||||
CrashSaveBean.getInstance().setActivitySize(activities);
|
CrashSaveBean.getInstance().setActivitySize(activities);
|
||||||
AppManager.getInstance().addActivity(activity);
|
AppManager.getInstance().addActivity(activity);
|
||||||
|
OpenAdManager.getInstance().dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityStarted(@NonNull Activity activity) {
|
public void onActivityStarted(@NonNull Activity activity) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -142,6 +149,7 @@ public class AppContext extends CommonAppContext {
|
|||||||
registerError();
|
registerError();
|
||||||
registerFirebaseCrash();
|
registerFirebaseCrash();
|
||||||
LogUtils.start(this);
|
LogUtils.start(this);
|
||||||
|
//DebugDialog.getInstance().setParams("初始化","启动");
|
||||||
sInstance = this;
|
sInstance = this;
|
||||||
L.setDeBug(BuildConfig.DEBUG);
|
L.setDeBug(BuildConfig.DEBUG);
|
||||||
AppEventsLogger.activateApp(this);
|
AppEventsLogger.activateApp(this);
|
||||||
@@ -164,20 +172,20 @@ public class AppContext extends CommonAppContext {
|
|||||||
OpenInstall.init(this);
|
OpenInstall.init(this);
|
||||||
}
|
}
|
||||||
//设置LOG开关,默认为false
|
//设置LOG开关,默认为false
|
||||||
UMConfigure.setLogEnabled(true);
|
//UMConfigure.setLogEnabled(true);
|
||||||
|
|
||||||
|
|
||||||
//友盟正式初始化
|
//友盟正式初始化
|
||||||
UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
//UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
||||||
|
|
||||||
//集成umeng-crash-vx.x.x.aar,则需要关闭原有统计SDK异常捕获功能
|
//集成umeng-crash-vx.x.x.aar,则需要关闭原有统计SDK异常捕获功能
|
||||||
MobclickAgent.setCatchUncaughtExceptions(false);
|
MobclickAgent.setCatchUncaughtExceptions(false);
|
||||||
//PushSDK初始化(如使用推送SDK,必须调用此方法)
|
//PushSDK初始化(如使用推送SDK,必须调用此方法)
|
||||||
|
|
||||||
//统计SDK是否支持采集在子进程中打点的自定义事件,默认不支持
|
//统计SDK是否支持采集在子进程中打点的自定义事件,默认不支持
|
||||||
UMConfigure.setProcessEvent(true);//支持多进程打点
|
//UMConfigure.setProcessEvent(true);//支持多进程打点
|
||||||
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
//MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
||||||
UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
//UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
||||||
|
|
||||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||||
//初始化 AndroidUtilCode
|
//初始化 AndroidUtilCode
|
||||||
@@ -198,7 +206,7 @@ public class AppContext extends CommonAppContext {
|
|||||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onReceived(io.rong.imlib.model.Message message, int i, boolean b, boolean b1) {
|
public boolean onReceived(io.rong.imlib.model.Message message, int i, boolean b, boolean b1) {
|
||||||
Log.e("wewe", message.getConversationType() + "112121");
|
Log.e("wewe", message.getConversationType() + "112121 " + message.getContent());
|
||||||
MessageIMManager.get(sInstance).getSystemForRongcloud(message);
|
MessageIMManager.get(sInstance).getSystemForRongcloud(message);
|
||||||
//融云直播间聊天
|
//融云直播间聊天
|
||||||
Message msg = Message.obtain();
|
Message msg = Message.obtain();
|
||||||
@@ -209,6 +217,31 @@ public class AppContext extends CommonAppContext {
|
|||||||
if (content.getContent().contains("_method_")) {
|
if (content.getContent().contains("_method_")) {
|
||||||
msg.obj = content.getContent();
|
msg.obj = content.getContent();
|
||||||
//观众页面
|
//观众页面
|
||||||
|
|
||||||
|
String time = String.valueOf(new Date().getTime());
|
||||||
|
//声网
|
||||||
|
if (SocketSwClient.mSocketHandler != null && (TextUtils.equals("__system__", message.getTargetId()) || ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
||||||
|
SocketSwClient.mSocketHandler.sendMessage(msg);
|
||||||
|
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
||||||
|
SocketReceiveBean received = JSON.parseObject(content.getContent(), SocketReceiveBean.class);
|
||||||
|
JSONObject map = received.getMsg().getJSONObject(0);
|
||||||
|
sendStartAnchorLive(map);
|
||||||
|
} else if (message.getTargetId().contains("v")) {
|
||||||
|
/*String contentJson = ((TextMessage) message.getContent()).getContent();
|
||||||
|
Log.e("wewe", contentJson);
|
||||||
|
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
|
||||||
|
if (sudGameSocketImEvent.getMsg().isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sudGameSocketImEvent.getMsg().get(0).setTime(time);
|
||||||
|
Bus.get().post(sudGameSocketImEvent);*/
|
||||||
|
}
|
||||||
|
//主播页面
|
||||||
|
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketSwClient.mSocketHandler != null) {
|
||||||
|
SocketSwClient.mSocketHandler.sendMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
//融云
|
||||||
if (SocketRyClient.mSocketHandler != null && (TextUtils.equals("__system__", message.getTargetId()) || ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
if (SocketRyClient.mSocketHandler != null && (TextUtils.equals("__system__", message.getTargetId()) || ("g" + PortraitLiveManager.liveID).contains(message.getTargetId()))) {
|
||||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||||
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
||||||
@@ -219,13 +252,16 @@ public class AppContext extends CommonAppContext {
|
|||||||
String contentJson = ((TextMessage) message.getContent()).getContent();
|
String contentJson = ((TextMessage) message.getContent()).getContent();
|
||||||
Log.e("wewe", contentJson);
|
Log.e("wewe", contentJson);
|
||||||
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
|
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
|
||||||
|
if (sudGameSocketImEvent.getMsg().isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sudGameSocketImEvent.getMsg().get(0).setTime(time);
|
||||||
Bus.get().post(sudGameSocketImEvent);
|
Bus.get().post(sudGameSocketImEvent);
|
||||||
}
|
}
|
||||||
//主播页面
|
//主播页面
|
||||||
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketRyClient.mSocketHandler != null) {
|
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketRyClient.mSocketHandler != null) {
|
||||||
SocketRyClient.mSocketHandler.sendMessage(msg);
|
SocketRyClient.mSocketHandler.sendMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
||||||
EventBus.getDefault().post(message);
|
EventBus.getDefault().post(message);
|
||||||
}
|
}
|
||||||
@@ -274,6 +310,7 @@ public class AppContext extends CommonAppContext {
|
|||||||
|
|
||||||
});
|
});
|
||||||
configSPApp();
|
configSPApp();
|
||||||
|
|
||||||
//初始化美颜SDK
|
//初始化美颜SDK
|
||||||
// FaceManager.initFaceUnity(this);
|
// FaceManager.initFaceUnity(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import androidx.core.app.NotificationManagerCompat;
|
|||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.pandoralive.shayu.R;
|
|
||||||
import com.shayu.phonelive.AppContext;
|
import com.shayu.phonelive.AppContext;
|
||||||
import com.tencent.rtmp.ITXLivePlayListener;
|
import com.tencent.rtmp.ITXLivePlayListener;
|
||||||
import com.tencent.rtmp.TXLiveBase;
|
import com.tencent.rtmp.TXLiveBase;
|
||||||
@@ -73,6 +72,8 @@ import java.io.File;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import myname.pdlive.shayu.R;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/9/17.
|
* Created by cxf on 2018/9/17.
|
||||||
@@ -80,9 +81,9 @@ import java.util.List;
|
|||||||
@Route(path = RouteUtil.PATH_LAUNCHER)
|
@Route(path = RouteUtil.PATH_LAUNCHER)
|
||||||
public class LauncherActivity extends AppCompatActivity implements View.OnClickListener {
|
public class LauncherActivity extends AppCompatActivity implements View.OnClickListener {
|
||||||
|
|
||||||
private static final String TAG = "LauncherActivity";
|
private final String TAG = "LauncherActivity";
|
||||||
private static final int WHAT_GET_CONFIG = 0;
|
private final int WHAT_GET_CONFIG = 0;
|
||||||
private static final int WHAT_COUNT_DOWN = 1;
|
private final int WHAT_COUNT_DOWN = 1;
|
||||||
protected Context mContext;
|
protected Context mContext;
|
||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
private ViewGroup mRoot;
|
private ViewGroup mRoot;
|
||||||
@@ -113,6 +114,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
|||||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||||
@@ -144,7 +146,11 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
|
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
|
||||||
|
try {
|
||||||
LogUtil.uploadErrorLog(AppContext.sInstance);
|
LogUtil.uploadErrorLog(AppContext.sInstance);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
SpUtil.getInstance().setBooleanValue("NOTIFICATION", NotificationManagerCompat.from(this).areNotificationsEnabled());
|
SpUtil.getInstance().setBooleanValue("NOTIFICATION", NotificationManagerCompat.from(this).areNotificationsEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import com.bumptech.glide.request.target.SimpleTarget;
|
|||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
import com.bumptech.glide.request.transition.Transition;
|
import com.bumptech.glide.request.transition.Transition;
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.pandoralive.shayu.R;
|
|
||||||
import com.shayu.phonelive.AppContext;
|
import com.shayu.phonelive.AppContext;
|
||||||
import com.shayu.phonelive.activity.LauncherActivity;
|
import com.shayu.phonelive.activity.LauncherActivity;
|
||||||
import com.yunbao.common.bean.NotificationMsgBean;
|
import com.yunbao.common.bean.NotificationMsgBean;
|
||||||
@@ -52,6 +51,7 @@ import io.rong.imlib.ConnectChangeReceiver;
|
|||||||
import io.rong.push.PushType;
|
import io.rong.push.PushType;
|
||||||
import io.rong.push.notification.PushMessageReceiver;
|
import io.rong.push.notification.PushMessageReceiver;
|
||||||
import io.rong.push.notification.PushNotificationMessage;
|
import io.rong.push.notification.PushNotificationMessage;
|
||||||
|
import myname.pdlive.shayu.R;
|
||||||
|
|
||||||
public class CustomMessageReceiver extends PushMessageReceiver {
|
public class CustomMessageReceiver extends PushMessageReceiver {
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ apply plugin: 'img-optimizer'
|
|||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk rootProject.ext.android.compileSdkVersion
|
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||||
targetSdk rootProject.ext.android.buildToolsVersion
|
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -31,7 +31,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a","arm64-v8a"
|
abiFilters "armeabi-v7a","arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@@ -42,8 +42,8 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_18
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_18
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.yunbao.baidu"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ apply plugin: 'img-optimizer'
|
|||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk rootProject.ext.android.compileSdkVersion
|
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||||
targetSdk rootProject.ext.android.buildToolsVersion
|
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -31,7 +31,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a","arm64-v8a"
|
abiFilters "armeabi-v7a","arm64-v8a","x86","x86_64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
@@ -45,8 +45,8 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_18
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_18
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
/>
|
package="com.yunbao.beauty"/>
|
||||||
|
|||||||
14
build.gradle
14
build.gradle
@@ -1,7 +1,7 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
apply from: "config.gradle"
|
apply from: "config.gradle"
|
||||||
apply from: "dependencies.gradle"
|
apply from: "dependencies.gradle"
|
||||||
|
apply from: "config.gradle"
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.8.22'
|
ext.kotlin_version = '1.8.22'
|
||||||
@@ -22,7 +22,7 @@ buildscript {
|
|||||||
classpath 'com.android.tools.build:gradle:8.3.1'
|
classpath 'com.android.tools.build:gradle:8.3.1'
|
||||||
//一键压缩png工具
|
//一键压缩png工具
|
||||||
classpath 'com.chenenyu:img-optimizer:1.3.0'
|
classpath 'com.chenenyu:img-optimizer:1.3.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.google.gms:google-services:4.3.3'
|
classpath 'com.google.gms:google-services:4.3.3'
|
||||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
||||||
classpath "com.github.jadepeakpoet.ARouter:arouter-register:1.0.3"
|
classpath "com.github.jadepeakpoet.ARouter:arouter-register:1.0.3"
|
||||||
@@ -50,7 +50,13 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
/*task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
|
}*/
|
||||||
|
ext {
|
||||||
|
IS_PUBLISH_LOCAL=true
|
||||||
|
LIB_VERSION="1.0.6"
|
||||||
|
AGORA_RTC_SDK= 'io.agora.rtc:agora-special-full:4.2.6.12'
|
||||||
|
// AGORA_RTC_SDK= "${rootProject.rootDir.absolutePath}/sdk"
|
||||||
|
// AGORA_RTC_SDK="io.agora.rtc:full-sdk:4.2.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
apply plugin: 'img-optimizer'
|
apply plugin: 'img-optimizer'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
apply from: "../package_config.gradle"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "com.yunbao.common"
|
namespace "com.yunbao.common"
|
||||||
compileSdk rootProject.ext.android.compileSdkVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
|
publishNonDefault true
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||||
@@ -13,10 +15,21 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
|
// abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||||
|
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 0) {
|
||||||
|
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
||||||
|
} else {
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
javaCompileOptions {
|
||||||
|
annotationProcessorOptions {
|
||||||
|
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -67,7 +80,9 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
api files('libs/jcc-bate-0.7.3.jar')
|
api files('libs/jcc-bate-0.7.3.jar')
|
||||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||||
@@ -161,14 +176,14 @@ dependencies {
|
|||||||
//腾讯im
|
//腾讯im
|
||||||
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
||||||
api 'com.google.code.gson:gson:2.8.8'
|
api 'com.google.code.gson:gson:2.8.8'
|
||||||
api 'cn.rongcloud.sdk:rtc_lib:5.6.9' // 音视频通话基础能力库
|
api 'cn.rongcloud.sdk:rtc_lib:5.7.0' // 音视频通话基础能力库
|
||||||
//此处以集成 5.1.2 版本为例
|
//此处以集成 5.1.2 版本为例
|
||||||
api 'cn.rongcloud.sdk:im_lib:5.6.10'
|
api 'cn.rongcloud.sdk:im_lib:5.7.0'
|
||||||
|
|
||||||
//此处以集成 5.1.2 版本为例
|
//此处以集成 5.1.2 版本为例
|
||||||
api 'cn.rongcloud.sdk:im_kit:5.6.10' // 即时通讯 UI 基础组件
|
api 'cn.rongcloud.sdk:im_kit:5.7.0' // 即时通讯 UI 基础组件
|
||||||
//融云小视频模块
|
//融云小视频模块
|
||||||
api 'cn.rongcloud.sdk:sight:5.6.10'
|
api 'cn.rongcloud.sdk:sight:5.7.0'
|
||||||
api 'com.facebook.android:facebook-android-sdk:15.2.0'
|
api 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||||
implementation 'com.facebook.android:facebook-android-sdk:15.2.0'
|
implementation 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||||
|
|
||||||
@@ -203,9 +218,7 @@ dependencies {
|
|||||||
//自定义圆角图片
|
//自定义圆角图片
|
||||||
api 'com.makeramen:roundedimageview:2.3.0'
|
api 'com.makeramen:roundedimageview:2.3.0'
|
||||||
// 友盟统计SDK
|
// 友盟统计SDK
|
||||||
api 'com.umeng.umsdk:common:9.6.3'// 必选
|
// api(name: 'umeng-common-9.6.8+000', ext: 'aar')
|
||||||
api 'com.umeng.umsdk:asms:1.8.0'// 必选
|
|
||||||
api 'com.umeng.umsdk:uyumao:1.1.2'
|
|
||||||
//高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。
|
//高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。
|
||||||
// 标准版本SudMGP SDK
|
// 标准版本SudMGP SDK
|
||||||
api 'tech.sud.mgp:SudMGP:1.3.3.1158'
|
api 'tech.sud.mgp:SudMGP:1.3.3.1158'
|
||||||
@@ -224,10 +237,27 @@ dependencies {
|
|||||||
//samsung插件包
|
//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.FlyJingFish:GradientTextView:1.2.4'
|
||||||
//轮播 一屏显示多个
|
//轮播 一屏显示多个
|
||||||
api 'com.github.xiaohaibin:XBanner:androidx_v1.2.6'
|
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"]
|
||||||
}
|
}
|
||||||
|
|||||||
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
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
-keep class com.qiniu.**{*;}
|
||||||
|
-keep class com.qiniu.**{public <init>();}
|
||||||
|
-ignorewarnings
|
||||||
@@ -1,14 +1,10 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||||
|
|
||||||
<application
|
<application android:allowBackup="true">
|
||||||
android:allowBackup="true"
|
|
||||||
tools:replace="allowBackup"
|
|
||||||
>
|
|
||||||
|
|
||||||
<!-- <meta-data-->
|
<!-- <meta-data-->
|
||||||
<!-- android:name="com.google.ar.core"-->
|
<!-- android:name="com.google.ar.core"-->
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ public class CommonAppConfig {
|
|||||||
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
||||||
//是否为插件包模式
|
//是否为插件包模式
|
||||||
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
||||||
|
public static final String BUILD_TIME = getMetaDataString("BUILD_TIME");
|
||||||
|
public static final boolean IS_SW_RELEASE = getMetaDataBoolean("SW_RELEASE_MODEL");
|
||||||
|
|
||||||
//外部sd卡
|
//外部sd卡
|
||||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||||
@@ -76,7 +78,30 @@ public class CommonAppConfig {
|
|||||||
public static boolean isGetNewWrap = false;//是否获取到新的包裹礼物
|
public static boolean isGetNewWrap = false;//是否获取到新的包裹礼物
|
||||||
public static int alert_time = 1;
|
public static int alert_time = 1;
|
||||||
public static int alert_end_time = 1;
|
public static int alert_end_time = 1;
|
||||||
|
public static String SWToken = ""; //声网Token
|
||||||
|
public static final String SWChannelPrefix = "g";
|
||||||
|
//测试服
|
||||||
|
public static final String SWAPPId_debug = "4cf0376582d742ac8a96778b25b1079e";
|
||||||
|
//正式服
|
||||||
|
public static final String SWAPPId = "d4a5879524d74c20a7bdd667b0f2ca21";
|
||||||
|
|
||||||
|
public static String getSwAppId() {
|
||||||
|
if (IS_SW_RELEASE) {
|
||||||
|
return SWAPPId;
|
||||||
|
} else {
|
||||||
|
return SWAPPId_debug;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取通道
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getChannelName() {
|
||||||
|
return SWChannelPrefix + getInstance().getUid();
|
||||||
|
}
|
||||||
|
|
||||||
private CommonAppConfig() {
|
private CommonAppConfig() {
|
||||||
|
|
||||||
@@ -119,8 +144,7 @@ public class CommonAppConfig {
|
|||||||
|
|
||||||
public String getUid() {
|
public String getUid() {
|
||||||
if (TextUtils.isEmpty(mUid)) {
|
if (TextUtils.isEmpty(mUid)) {
|
||||||
String[] uidAndToken = SpUtil.getInstance()
|
String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||||
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
|
||||||
if (uidAndToken != null) {
|
if (uidAndToken != null) {
|
||||||
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
||||||
mUid = uidAndToken[0];
|
mUid = uidAndToken[0];
|
||||||
@@ -311,9 +335,7 @@ public class CommonAppConfig {
|
|||||||
mUid = null;
|
mUid = null;
|
||||||
mToken = null;
|
mToken = null;
|
||||||
mLoginIM = false;
|
mLoginIM = false;
|
||||||
SpUtil.getInstance().removeValue(
|
SpUtil.getInstance().removeValue(SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN);
|
||||||
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -349,12 +371,7 @@ public class CommonAppConfig {
|
|||||||
mProvince = null;
|
mProvince = null;
|
||||||
mCity = null;
|
mCity = null;
|
||||||
mDistrict = null;
|
mDistrict = null;
|
||||||
SpUtil.getInstance().removeValue(
|
SpUtil.getInstance().removeValue(SpUtil.LOCATION_LNG, SpUtil.LOCATION_LAT, SpUtil.LOCATION_PROVINCE, SpUtil.LOCATION_CITY, SpUtil.LOCATION_DISTRICT);
|
||||||
SpUtil.LOCATION_LNG,
|
|
||||||
SpUtil.LOCATION_LAT,
|
|
||||||
SpUtil.LOCATION_PROVINCE,
|
|
||||||
SpUtil.LOCATION_CITY,
|
|
||||||
SpUtil.LOCATION_DISTRICT);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -202,6 +202,8 @@ public class Constants {
|
|||||||
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
||||||
public static final String Lucky100Check = "Lucky100Check";//幸运天使
|
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_CONN = 0;
|
||||||
public static final int SOCKET_WHAT_DISCONN = 2;
|
public static final int SOCKET_WHAT_DISCONN = 2;
|
||||||
public static final int SOCKET_WHAT_BROADCAST = 1;
|
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 String LIVE_PK_RANDOM_START="RankingStartRandomPK";
|
||||||
public static final int LIVE_SDK_KSY = 0;//金山推流
|
public static final int LIVE_SDK_KSY = 0;//金山推流
|
||||||
public static final int LIVE_SDK_TX = 1;//腾讯推流
|
public static final int LIVE_SDK_TX = 1;//腾讯推流
|
||||||
|
public static final int LIVE_SDK_SW = 2;//声网
|
||||||
|
|
||||||
|
public static final String LIVE_SDK_IS_SW = "liveSdkIsSw"; //是否是聲網
|
||||||
|
|
||||||
public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦
|
public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦
|
||||||
public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦
|
public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦
|
||||||
|
|
||||||
|
public static final String SOCKET_LIVE_ANCHOR_PK_DIALOG="GuildCompetitionNotice";//公会赛弹窗
|
||||||
|
|
||||||
//视频举报获取位置
|
//视频举报获取位置
|
||||||
public static int xIndex = 0;
|
public static int xIndex = 0;
|
||||||
public static int yindex = 0;
|
public static int yindex = 0;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class HtmlConfig {
|
|||||||
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";
|
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";
|
||||||
|
|
||||||
//在线商城
|
//在线商城
|
||||||
public static final String SHOP = CommonAppConfig.HOST + "/h5/shoppingMall.html";
|
public static final String SHOP = CommonAppConfig.HOST + "/h5/shop/index.html";
|
||||||
|
|
||||||
//社区
|
//社区
|
||||||
public static final String ENCOURAGE = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ";
|
public static final String ENCOURAGE = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ";
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.content.Intent;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.Typeface;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
@@ -24,13 +25,12 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.interfaces.LifeCycleListener;
|
import com.yunbao.common.interfaces.LifeCycleListener;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.ClickUtil;
|
import com.yunbao.common.utils.ClickUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -59,7 +59,6 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
create();
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
isFullWindow = getIntent().getBooleanExtra("isFull", false);
|
isFullWindow = getIntent().getBooleanExtra("isFull", false);
|
||||||
@@ -68,6 +67,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
create();
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
mTag = this.getClass().getSimpleName();
|
mTag = this.getClass().getSimpleName();
|
||||||
setStatusBar();
|
setStatusBar();
|
||||||
@@ -92,6 +92,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
protected void main() {
|
protected void main() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void create() {
|
protected void create() {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -107,6 +108,17 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setTitleBold(boolean bold) {
|
||||||
|
TextView titleView = (TextView) findViewById(R.id.titleView);
|
||||||
|
if (titleView != null) {
|
||||||
|
if (bold) {
|
||||||
|
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
|
} else {
|
||||||
|
titleView.setTypeface(Typeface.DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void backClick(View v) {
|
public void backClick(View v) {
|
||||||
if (v.getId() == R.id.btn_back) {
|
if (v.getId() == R.id.btn_back) {
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@@ -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) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
Window window = getWindow();
|
Window window = getWindow();
|
||||||
@@ -382,6 +394,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isKefu(String url) {
|
public boolean isKefu(String url) {
|
||||||
if (url.contains("kefu")) {
|
if (url.contains("kefu")) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.content.ClipData;
|
|||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@@ -12,6 +13,7 @@ import android.provider.MediaStore;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.webkit.ValueCallback;
|
import android.webkit.ValueCallback;
|
||||||
import android.webkit.WebChromeClient;
|
import android.webkit.WebChromeClient;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
@@ -29,6 +31,7 @@ import com.lxj.xpopup.XPopup;
|
|||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
|
import com.yunbao.common.HtmlConfig;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
import com.yunbao.common.bean.LiveBean;
|
||||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||||
@@ -81,6 +84,15 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
return R.layout.activity_webview;
|
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
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
String url = getIntent().getStringExtra(Constants.URL);
|
String url = getIntent().getStringExtra(Constants.URL);
|
||||||
@@ -100,7 +112,6 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
||||||
v_spacing = (View) findViewById(R.id.v_spacing);
|
v_spacing = (View) findViewById(R.id.v_spacing);
|
||||||
mWebView = findViewById(R.id.webView);
|
mWebView = findViewById(R.id.webView);
|
||||||
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
params.topMargin = DpUtil.dp2px(1);
|
params.topMargin = DpUtil.dp2px(1);
|
||||||
// mWebView.setLayoutParams(params);
|
// mWebView.setLayoutParams(params);
|
||||||
@@ -136,11 +147,17 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
if (url.contains("for")) {
|
if (url.contains("for")) {
|
||||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(url.startsWith(HtmlConfig.SHOP)){
|
||||||
|
//商店页不做动态变换
|
||||||
|
return;
|
||||||
|
}
|
||||||
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
||||||
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
||||||
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
||||||
if (!navigationGestureEnabled(mContext)) {
|
if (!navigationGestureEnabled(mContext)) {
|
||||||
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
// view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -194,6 +211,8 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
mWebView.getSettings().setAllowFileAccess(true);
|
mWebView.getSettings().setAllowFileAccess(true);
|
||||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||||
|
mWebView.setHorizontalScrollBarEnabled(false);
|
||||||
|
mWebView.setVerticalScrollBarEnabled(false);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
@@ -213,6 +232,9 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
ft_title.setVisibility(View.VISIBLE);
|
ft_title.setVisibility(View.VISIBLE);
|
||||||
v_spacing.setVisibility(View.GONE);
|
v_spacing.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
if(!StringUtil.isEmpty(url)&&url.startsWith(HtmlConfig.SHOP)){
|
||||||
|
ft_title.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -424,7 +446,7 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) {
|
||||||
if (liveBean == null) {
|
if (liveBean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -440,7 +462,7 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||||
} else {
|
} else {
|
||||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk),isSw);
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 RIGHTS_INTERESTS = 4;
|
||||||
private final int RECOMMEND = 5;
|
private final int RECOMMEND = 5;
|
||||||
private String liveId;
|
private String liveId;
|
||||||
|
private boolean mIs_shengwang;
|
||||||
|
|
||||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||||
|
|
||||||
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
||||||
|
|
||||||
public CustomDrawerPopupAdapter(Context mContext) {
|
public CustomDrawerPopupAdapter(Context mContext,boolean mIs_shengwang) {
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
|
this.mIs_shengwang = mIs_shengwang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -114,6 +117,7 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
|||||||
map.put("num", "9");
|
map.put("num", "9");
|
||||||
map.put("live_recommend", "sidebar");
|
map.put("live_recommend", "sidebar");
|
||||||
map.put("refresh", "1");
|
map.put("refresh", "1");
|
||||||
|
map.put(" is_shengwang", mIs_shengwang?"1":"0");
|
||||||
//推荐位
|
//推荐位
|
||||||
MainNetManager.get((Activity) mContext)
|
MainNetManager.get((Activity) mContext)
|
||||||
.anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
.anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
public class DebugDialogAdapter extends RecyclerView.Adapter<DebugDialogAdapter.DebugViewHolder> {
|
||||||
|
HashMap<String, View> paramMap = new HashMap<>();
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public DebugDialogAdapter(Context mContext) {
|
||||||
|
this.mContext = mContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParamMap(HashMap<String, View> paramMap) {
|
||||||
|
Log.i("debug弹窗", "setParamMap: 添加值到view " + paramMap.size());
|
||||||
|
this.paramMap = paramMap;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public DebugViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
Log.i("debug弹窗", "onCreateViewHolder: 创建适配器");
|
||||||
|
return new DebugViewHolder(new LinearLayout(mContext));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull DebugViewHolder holder, int position) {
|
||||||
|
List<String> list = new ArrayList<>(paramMap.keySet());
|
||||||
|
Log.i("debug弹窗", "onBindViewHolder: 添加值到view " + list.size() + "|" + paramMap.size());
|
||||||
|
holder.setData(list.get(position), paramMap.get(list.get(position)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
Log.i("debug弹窗", "getItemCount: " + paramMap.size());
|
||||||
|
return paramMap.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DebugViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
public DebugViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(String msg, View view) {
|
||||||
|
Log.i("debug弹窗", "setData: 添加值到view " + view + "|" + msg + "|" + ((LinearLayout) itemView).indexOfChild(view));
|
||||||
|
if (view instanceof TextView && StringUtil.isEmpty(((TextView) view).getText().toString())) {
|
||||||
|
((TextView) view).setText(msg);
|
||||||
|
}
|
||||||
|
int indexOfChild = ((LinearLayout) itemView).indexOfChild(view);
|
||||||
|
if (indexOfChild != -1) {
|
||||||
|
if (((LinearLayout) itemView).getChildAt(indexOfChild) instanceof TextView) {
|
||||||
|
((TextView) ((LinearLayout) itemView).getChildAt(indexOfChild)).setText(msg);
|
||||||
|
} else {
|
||||||
|
((LinearLayout) itemView).removeViewAt(indexOfChild);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (view.getParent() != null) {
|
||||||
|
((ViewGroup) view.getParent()).removeView(view);
|
||||||
|
}
|
||||||
|
((LinearLayout) itemView).addView(view);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,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.bean.CustomSidebarChildModel;
|
||||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.SpUtil;
|
||||||
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 侧边栏游戏列表适配器,改游戏列表数量在这里改
|
||||||
|
*/
|
||||||
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private boolean rigts;
|
private boolean rigts;
|
||||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||||
|
private List<CustomSidebarChildModel> srcChild = new ArrayList<>();
|
||||||
|
|
||||||
public InteractionGamesAdapter(Context mContext, boolean rigts) {
|
public InteractionGamesAdapter(Context mContext, boolean rigts) {
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
@@ -32,7 +37,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
@Override
|
@Override
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
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);
|
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
|
@Override
|
||||||
@@ -46,7 +51,10 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
||||||
if (activityID != 0) {
|
if (activityID != 0) {
|
||||||
Bus.get().post(new CustomDrawerPopupEvent()
|
Bus.get().post(new CustomDrawerPopupEvent()
|
||||||
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(child));
|
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild));
|
||||||
|
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) {
|
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||||
child.clear();
|
child.clear();
|
||||||
|
srcChild.clear();
|
||||||
if (mChild.size() > 8) {
|
if (mChild.size() > 8) {
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
child.add(mChild.get(i));
|
child.add(mChild.get(i));
|
||||||
@@ -68,6 +77,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
} else {
|
} else {
|
||||||
child.addAll(mChild);
|
child.addAll(mChild);
|
||||||
}
|
}
|
||||||
|
srcChild.addAll(mChild);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,16 @@ public class LiveNewRoleFunGamesAdapter extends RecyclerView.Adapter {
|
|||||||
@Override
|
@Override
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
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);
|
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
|
@Override
|
||||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
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;
|
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
|
||||||
childViewHolder.setData(child.get(position), rigts);
|
childViewHolder.setData(child.get(position), rigts);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
|
||||||
import com.yunbao.common.event.LiveNewRoleEvent;
|
import com.yunbao.common.event.LiveNewRoleEvent;
|
||||||
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
|
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
|
||||||
import com.yunbao.common.utils.Bus;
|
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.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -34,14 +34,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
@Override
|
@Override
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
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);
|
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
|
@Override
|
||||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
|
InteractionGamesChildBottomViewHolder childViewHolder = (InteractionGamesChildBottomViewHolder) holder;
|
||||||
childViewHolder.setData(child.get(position), rigts);
|
childViewHolder.setData(child.get(position), rigts);
|
||||||
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
|
childViewHolder.setItemViewClicks(new InteractionGamesChildBottomViewHolder.InteractionGamesCallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
|
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
|
||||||
|
|
||||||
@@ -52,6 +52,9 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
.setInteractionID(activityID)
|
.setInteractionID(activityID)
|
||||||
.setChild(child)
|
.setChild(child)
|
||||||
.setInteraction(true));
|
.setInteraction(true));
|
||||||
|
if(model.getSudGameIsNew().equals("1")){
|
||||||
|
SpUtil.getInstance().setLiveGameId(model.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -60,20 +63,23 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
return child.size();
|
return child.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||||
|
|
||||||
child.clear();
|
child.clear();
|
||||||
if (mChild.size() > 8) {
|
/* if (mChild.size() > 8) {
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
child.add(mChild.get(i));
|
child.add(mChild.get(i));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
child.addAll(mChild);
|
child.addAll(mChild);
|
||||||
}
|
}*/
|
||||||
|
child.addAll(mChild);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,13 +39,14 @@ public class LiveNewRolerPopupAdapter extends RecyclerView.Adapter {
|
|||||||
switch (viewType) {
|
switch (viewType) {
|
||||||
case FUN_GAMES:
|
case FUN_GAMES:
|
||||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_new_roler_fun_games_view, parent, false);
|
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:
|
case RIGHTS_INTERESTS:
|
||||||
|
//特权
|
||||||
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_roler_ights_interests, parent, false);
|
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:
|
default:
|
||||||
View gamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_interaction_games_view, parent, false);
|
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
|
@Override
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
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);
|
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
|
@Override
|
||||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
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;
|
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
|
||||||
childViewHolder.setData(child.get(position), rigts);
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机器人助手IM消息
|
* 机器人助手IM消息
|
||||||
@@ -21,6 +24,9 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
//标签图片
|
//标签图片
|
||||||
@SerializedName("icon")
|
@SerializedName("icon")
|
||||||
private String icon;
|
private String icon;
|
||||||
|
@SerializedName("icon_en")
|
||||||
|
@JSONField(name = "icon_en")
|
||||||
|
private String iconEn;
|
||||||
//气泡背景
|
//气泡背景
|
||||||
@SerializedName("system_bubble")
|
@SerializedName("system_bubble")
|
||||||
private String systemBubble;
|
private String systemBubble;
|
||||||
@@ -47,6 +53,16 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getIconEn() {
|
||||||
|
return iconEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AiAutomaticSpeechModel setIconEn(String iconEn) {
|
||||||
|
this.iconEn = iconEn;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public AiAutomaticSpeechModel setContent(String content) {
|
public AiAutomaticSpeechModel setContent(String content) {
|
||||||
this.content = content;
|
this.content = content;
|
||||||
return this;
|
return this;
|
||||||
@@ -62,6 +78,9 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getIcon() {
|
public String getIcon() {
|
||||||
|
if (!WordUtil.isNewZh() && !StringUtil.isEmpty(iconEn)) {
|
||||||
|
return iconEn;
|
||||||
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ public class AnchorRecommendModel extends BaseModel {
|
|||||||
|
|
||||||
@SerializedName("live_battle_pass_show_status")
|
@SerializedName("live_battle_pass_show_status")
|
||||||
private int showWarOrder = 0;//是否显示首页戰令
|
private int showWarOrder = 0;//是否显示首页戰令
|
||||||
|
@SerializedName("live_battle_pass_image_cn")
|
||||||
|
private String battlePassImageCn;
|
||||||
|
@SerializedName("live_battle_pass_image_en")
|
||||||
|
private String battlePassImageEn;
|
||||||
//是否支持换一批0=不支持 1=支持
|
//是否支持换一批0=不支持 1=支持
|
||||||
|
|
||||||
@SerializedName("up_show")
|
@SerializedName("up_show")
|
||||||
@@ -58,6 +62,22 @@ public class AnchorRecommendModel extends BaseModel {
|
|||||||
return listShow;
|
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) {
|
public AnchorRecommendModel setListShow(int listShow) {
|
||||||
this.listShow = listShow;
|
this.listShow = listShow;
|
||||||
return this;
|
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;
|
private String typeMsg;
|
||||||
@SerializedName("live_sdk")
|
@SerializedName("live_sdk")
|
||||||
private String liveSdk;
|
private String liveSdk;
|
||||||
|
@SerializedName("is_shengwang")
|
||||||
|
private String isShengwang;
|
||||||
|
|
||||||
|
public String getIsShengwang() {
|
||||||
|
return isShengwang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsShengwang(String isShengwang) {
|
||||||
|
this.isShengwang = isShengwang;
|
||||||
|
}
|
||||||
|
|
||||||
public static CheckLiveModel objectFromData(String str) {
|
public static CheckLiveModel objectFromData(String str) {
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.yunbao.common.bean;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -59,6 +60,9 @@ public class ConfigBean extends BaseModel {
|
|||||||
private String txPlayUgcLicenceUrl;//腾讯短视频鉴权
|
private String txPlayUgcLicenceUrl;//腾讯短视频鉴权
|
||||||
private String txVideoUgcKey;
|
private String txVideoUgcKey;
|
||||||
private String google_isup;
|
private String google_isup;
|
||||||
|
|
||||||
|
private String sud_game_speech;
|
||||||
|
|
||||||
@SerializedName("is_return_user")//是否需要弹窗(0否,1是)
|
@SerializedName("is_return_user")//是否需要弹窗(0否,1是)
|
||||||
private String isReturnUser="";
|
private String isReturnUser="";
|
||||||
@SerializedName("popup_img_url")//弹窗图片地址
|
@SerializedName("popup_img_url")//弹窗图片地址
|
||||||
@@ -182,6 +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")
|
@JSONField(name = "apk_ver")
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return version;
|
return version;
|
||||||
|
|||||||
@@ -114,6 +114,17 @@ public class EnterRoomInfoModel extends BaseModel {
|
|||||||
@SerializedName("gift_wall_lighten_total")
|
@SerializedName("gift_wall_lighten_total")
|
||||||
private String giftWallLightenTotal;
|
private String giftWallLightenTotal;
|
||||||
|
|
||||||
|
@SerializedName("connection_info")
|
||||||
|
private LivePkMicModel connectionInfo;
|
||||||
|
|
||||||
|
public LivePkMicModel getConnectionInfo() {
|
||||||
|
return connectionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConnectionInfo(LivePkMicModel connectionInfo) {
|
||||||
|
this.connectionInfo = connectionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
public String getGiftWallLightenNumber() {
|
public String getGiftWallLightenNumber() {
|
||||||
return giftWallLightenNumber;
|
return giftWallLightenNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public class EnterRoomNewModel extends BaseModel {
|
|||||||
private SudGameDateModel sudGameDateModel;
|
private SudGameDateModel sudGameDateModel;
|
||||||
@SerializedName("quick_gift_remaining_quantity")
|
@SerializedName("quick_gift_remaining_quantity")
|
||||||
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
||||||
|
|
||||||
@SerializedName("if_viewing_duration_complete")
|
@SerializedName("if_viewing_duration_complete")
|
||||||
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
||||||
@SerializedName("sendMoneyLongStatus")
|
@SerializedName("sendMoneyLongStatus")
|
||||||
|
|||||||
@@ -22,6 +22,30 @@ public class GuardPriceModel extends BaseModel {
|
|||||||
private String discount;
|
private String discount;
|
||||||
@SerializedName("price_key")
|
@SerializedName("price_key")
|
||||||
private int priceKey;
|
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() {
|
public String getOpeningTime() {
|
||||||
return openingTime;
|
return openingTime;
|
||||||
|
|||||||
@@ -7,12 +7,21 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class LiveBattlePassRewardsBean extends BaseModel{
|
public class LiveBattlePassRewardsBean extends BaseModel{
|
||||||
private int level;
|
private int level;
|
||||||
|
private int is_received;
|
||||||
private List<BattlePassType> live_battle_pass_type;
|
private List<BattlePassType> live_battle_pass_type;
|
||||||
private Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards;
|
private Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards;
|
||||||
|
|
||||||
public LiveBattlePassRewardsBean() {
|
public LiveBattlePassRewardsBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIs_received() {
|
||||||
|
return is_received;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_received(int is_received) {
|
||||||
|
this.is_received = is_received;
|
||||||
|
}
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@ package com.yunbao.common.bean;
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
@@ -22,6 +21,8 @@ public class OpenAdModel extends BaseModel {
|
|||||||
public static final int SHOW_ONE = 3;//3. 仅弹出一次;
|
public static final int SHOW_ONE = 3;//3. 仅弹出一次;
|
||||||
@SerializedName("id")
|
@SerializedName("id")
|
||||||
private int id;
|
private int id;
|
||||||
|
@SerializedName("popup_name")
|
||||||
|
private String name;
|
||||||
@SerializedName("popup_location")
|
@SerializedName("popup_location")
|
||||||
private int type = TYPE_HOME;
|
private int type = TYPE_HOME;
|
||||||
@SerializedName("activity_url")
|
@SerializedName("activity_url")
|
||||||
@@ -35,16 +36,19 @@ public class OpenAdModel extends BaseModel {
|
|||||||
@SerializedName("popup_model")
|
@SerializedName("popup_model")
|
||||||
private int model = MODEL_SQUARE;
|
private int model = MODEL_SQUARE;
|
||||||
@SerializedName("start_show_time")
|
@SerializedName("start_show_time")
|
||||||
private String startTime;//活动开始时间
|
private String startTime;//活动开始时间 1
|
||||||
@SerializedName("end_show_time")
|
@SerializedName("end_show_time")
|
||||||
private String endTime;//活动结束时间
|
private String endTime;//活动结束时间 5
|
||||||
@SerializedName("popup_permission")
|
@SerializedName("popup_permission")
|
||||||
private int permission;
|
private int permission;
|
||||||
@SerializedName("popup_frequency")
|
@SerializedName("popup_frequency")
|
||||||
private int showModel = SHOW_DEF;//显示模式,1:杀死程序后弹出 2:指定时间内(本机时间) 3:1. 仅弹出一次
|
private int showModel = SHOW_DEF;//显示模式,1:杀死程序后弹出 2:指定时间内(本机时间) 3:1. 仅弹出一次
|
||||||
@SerializedName("popup_frequency_time")
|
@SerializedName("popup_frequency_time")
|
||||||
private String section = "0";// SHOW_DEF = 2
|
private String section = "0";// SHOW_DEF = 2 1
|
||||||
|
@SerializedName("popup_sort")
|
||||||
|
private int popupSort = 1;//弹框类型 1.图片 2.H5
|
||||||
|
@SerializedName("sort")
|
||||||
|
private int sort = 0;
|
||||||
|
|
||||||
public OpenAdModel() {
|
public OpenAdModel() {
|
||||||
}
|
}
|
||||||
@@ -66,6 +70,30 @@ public class OpenAdModel extends BaseModel {
|
|||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPopupSort() {
|
||||||
|
return popupSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSort(int sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPopupSort(int popupSort) {
|
||||||
|
this.popupSort = popupSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
public int getShowModel() {
|
public int getShowModel() {
|
||||||
return showModel;
|
return showModel;
|
||||||
}
|
}
|
||||||
@@ -91,11 +119,12 @@ public class OpenAdModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
if (!url.startsWith("http://") || !url.startsWith("https://")) {
|
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||||
url = CommonAppConfig.HOST + url;
|
url = CommonAppConfig.HOST + (url.startsWith("/") ? url : "/" + url);
|
||||||
}
|
}
|
||||||
return url + "?t=" + System.currentTimeMillis() / 1000;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOriginalUrl() {
|
public String getOriginalUrl() {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
@@ -198,6 +227,7 @@ public class OpenAdModel extends BaseModel {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return "OpenAdModel{" +
|
return "OpenAdModel{" +
|
||||||
"id=" + id +
|
"id=" + id +
|
||||||
|
", name='" + name + '\'' +
|
||||||
", type=" + type +
|
", type=" + type +
|
||||||
", url='" + url + '\'' +
|
", url='" + url + '\'' +
|
||||||
", imageUrl='" + imageUrl + '\'' +
|
", imageUrl='" + imageUrl + '\'' +
|
||||||
@@ -206,7 +236,10 @@ public class OpenAdModel extends BaseModel {
|
|||||||
", model=" + model +
|
", model=" + model +
|
||||||
", startTime='" + startTime + '\'' +
|
", startTime='" + startTime + '\'' +
|
||||||
", endTime='" + endTime + '\'' +
|
", endTime='" + endTime + '\'' +
|
||||||
", permission='" + permission + '\'' +
|
", permission=" + permission +
|
||||||
|
", showModel=" + showModel +
|
||||||
|
", section='" + section + '\'' +
|
||||||
|
", sort=" + popupSort +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,4 +56,15 @@ public class PrankGiftBean extends BaseModel{
|
|||||||
public void setGiftId(String giftId) {
|
public void setGiftId(String giftId) {
|
||||||
this.giftId = 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
|
//超级红包ID
|
||||||
@SerializedName("super_jackpot_id")
|
@SerializedName("super_jackpot_id")
|
||||||
private String superJackpotId;
|
private String superJackpotId;
|
||||||
|
@SerializedName("red_packet_type")
|
||||||
|
private int redPacketType;// 1.普通红包 2.特殊红包
|
||||||
|
|
||||||
|
public int getRedPacketType() {
|
||||||
|
return redPacketType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRedPacketType(int redPacketType) {
|
||||||
|
this.redPacketType = redPacketType;
|
||||||
|
}
|
||||||
|
|
||||||
public String getSuperJackpotId() {
|
public String getSuperJackpotId() {
|
||||||
return superJackpotId;
|
return superJackpotId;
|
||||||
|
|||||||
@@ -0,0 +1,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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -67,7 +67,6 @@ public class UserBean implements Parcelable {
|
|||||||
//随机天梯排位赛PK img,仅在主播PK时使用
|
//随机天梯排位赛PK img,仅在主播PK时使用
|
||||||
private String mRankPkImgUrl;
|
private String mRankPkImgUrl;
|
||||||
//是否填写完整资料
|
//是否填写完整资料
|
||||||
@SerializedName("user_info_complete")
|
|
||||||
private int user_info_complete;
|
private int user_info_complete;
|
||||||
//粉丝团等级
|
//粉丝团等级
|
||||||
private int fansLevel;
|
private int fansLevel;
|
||||||
@@ -110,14 +109,6 @@ public class UserBean implements Parcelable {
|
|||||||
return user_info_complete;
|
return user_info_complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUser_info_complete() {
|
|
||||||
return user_info_complete;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUser_info_complete(int user_info_complete) {
|
|
||||||
this.user_info_complete = user_info_complete;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserBean seUserInfoComplete(int userInfoComplete) {
|
public UserBean seUserInfoComplete(int userInfoComplete) {
|
||||||
this.user_info_complete = userInfoComplete;
|
this.user_info_complete = userInfoComplete;
|
||||||
return this;
|
return this;
|
||||||
@@ -874,11 +865,20 @@ public class UserBean implements Parcelable {
|
|||||||
private String medal;
|
private String medal;
|
||||||
private String bubble;
|
private String bubble;
|
||||||
private String medal_new;
|
private String medal_new;
|
||||||
|
private String medal_new_en;
|
||||||
|
|
||||||
public String getMedal_new() {
|
public String getMedal_new() {
|
||||||
return medal_new;
|
return medal_new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMedal_new_en() {
|
||||||
|
return medal_new_en;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMedal_new_en(String medal_new_en) {
|
||||||
|
this.medal_new_en = medal_new_en;
|
||||||
|
}
|
||||||
|
|
||||||
public void setMedal_new(String medal_new) {
|
public void setMedal_new(String medal_new) {
|
||||||
this.medal_new = medal_new;
|
this.medal_new = medal_new;
|
||||||
}
|
}
|
||||||
@@ -907,6 +907,66 @@ public class UserBean implements Parcelable {
|
|||||||
this.bubble = bubble;
|
this.bubble = bubble;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "UserBean{" +
|
||||||
|
"id='" + id + '\'' +
|
||||||
|
", userNiceName='" + userNiceName + '\'' +
|
||||||
|
", avatar='" + avatar + '\'' +
|
||||||
|
", avatarThumb='" + avatarThumb + '\'' +
|
||||||
|
", sex=" + sex +
|
||||||
|
", signature='" + signature + '\'' +
|
||||||
|
", coin='" + coin + '\'' +
|
||||||
|
", gold='" + gold + '\'' +
|
||||||
|
", votes='" + votes + '\'' +
|
||||||
|
", consumption='" + consumption + '\'' +
|
||||||
|
", votestotal='" + votestotal + '\'' +
|
||||||
|
", province='" + province + '\'' +
|
||||||
|
", city='" + city + '\'' +
|
||||||
|
", location='" + location + '\'' +
|
||||||
|
", birthday='" + birthday + '\'' +
|
||||||
|
", level=" + level +
|
||||||
|
", levelAnchor=" + levelAnchor +
|
||||||
|
", lives=" + lives +
|
||||||
|
", follows=" + follows +
|
||||||
|
", fans=" + fans +
|
||||||
|
", vip=" + vip +
|
||||||
|
", liang=" + liang +
|
||||||
|
", car=" + car +
|
||||||
|
", medal_level=" + medal_level +
|
||||||
|
", medal_name='" + medal_name + '\'' +
|
||||||
|
", Dress=" + Dress +
|
||||||
|
", noble_id='" + noble_id + '\'' +
|
||||||
|
", yuanbao='" + yuanbao + '\'' +
|
||||||
|
", noble_name='" + noble_name + '\'' +
|
||||||
|
", islive='" + islive + '\'' +
|
||||||
|
", medal_no_display_src='" + medal_no_display_src + '\'' +
|
||||||
|
", hot_num='" + hot_num + '\'' +
|
||||||
|
", goodnum='" + goodnum + '\'' +
|
||||||
|
", fans_pic='" + fans_pic + '\'' +
|
||||||
|
", gifticon='" + gifticon + '\'' +
|
||||||
|
", department_name='" + department_name + '\'' +
|
||||||
|
", token_rong='" + token_rong + '\'' +
|
||||||
|
", noble_end_time='" + noble_end_time + '\'' +
|
||||||
|
", slide='" + slide + '\'' +
|
||||||
|
", users_type='" + users_type + '\'' +
|
||||||
|
", is_bind='" + is_bind + '\'' +
|
||||||
|
", mobile='" + mobile + '\'' +
|
||||||
|
", front_task='" + front_task + '\'' +
|
||||||
|
", is_admin='" + is_admin + '\'' +
|
||||||
|
", praise=" + praise +
|
||||||
|
", isHide=" + isHide +
|
||||||
|
", randomPk=" + randomPk +
|
||||||
|
", mRankPkImgUrl='" + mRankPkImgUrl + '\'' +
|
||||||
|
", user_info_complete=" + user_info_complete +
|
||||||
|
", fansLevel=" + fansLevel +
|
||||||
|
", typeMic=" + typeMic +
|
||||||
|
", isMicList=" + isMicList +
|
||||||
|
", isRequest=" + isRequest +
|
||||||
|
", fansEnterRoomUrl='" + fansEnterRoomUrl + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,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 void buildDialog(XPopup.Builder builder);
|
||||||
public abstract int bindLayoutId();
|
public abstract int bindLayoutId();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onShow() {
|
||||||
|
super.onShow();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getImplLayoutId() {
|
protected int getImplLayoutId() {
|
||||||
return bindLayoutId();
|
return bindLayoutId();
|
||||||
@@ -36,4 +41,24 @@ public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
|
|||||||
buildDialog(builder);
|
buildDialog(builder);
|
||||||
builder.asCustom(this).show();
|
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 androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.lxj.xpopup.core.CenterPopupView;
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.CoolConfig;
|
import com.yunbao.common.bean.CoolConfig;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.google.gson.Gson;
|
|||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.lxj.xpopup.core.BottomPopupView;
|
import com.lxj.xpopup.core.BottomPopupView;
|
||||||
import com.lxj.xpopup.enums.PopupPosition;
|
import com.lxj.xpopup.enums.PopupPosition;
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||||
@@ -45,6 +46,9 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 半屏创建游戏房间
|
||||||
|
*/
|
||||||
public class CreateSudGamePopup extends BottomPopupView {
|
public class CreateSudGamePopup extends BottomPopupView {
|
||||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||||
private TextView createGameType, selectCurrencyType;
|
private TextView createGameType, selectCurrencyType;
|
||||||
@@ -150,8 +154,6 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
.asCustom(new SudGameListSelectPopup(getContext(), 4, customSidebarChildModels, interactionID))
|
.asCustom(new SudGameListSelectPopup(getContext(), 4, customSidebarChildModels, interactionID))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.room_back),
|
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.room_back),
|
||||||
@@ -279,7 +281,11 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
public void onSuccess(CreateSudRoomModel data) {
|
public void onSuccess(CreateSudRoomModel data) {
|
||||||
if (isHome) {
|
if (isHome) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(data));
|
if(CommonAppConfig.getInstance().getConfig().isSw()){
|
||||||
|
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data),true,isHome);
|
||||||
|
}else{
|
||||||
|
RouteUtil.forwardRySudGameActivity(new Gson().toJson(data),true,isHome);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||||
|
|
||||||
@@ -312,6 +318,15 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
animator.setDuration(animDuration);
|
animator.setDuration(animDuration);
|
||||||
animator.setInterpolator(new LinearInterpolator());
|
animator.setInterpolator(new LinearInterpolator());
|
||||||
animator.start();
|
animator.start();
|
||||||
|
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));
|
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
||||||
builder.hasShadowBg(false)
|
builder.hasShadowBg(false)
|
||||||
.isDestroyOnDismiss(true)
|
.isDestroyOnDismiss(true)
|
||||||
@@ -326,6 +341,27 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
.show();
|
.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,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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user