Compare commits
102 Commits
有聊合并PD
...
dev_6.6.4_
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a5e581978 | |||
| 8a7b65955c | |||
|
|
3445ee2a56 | ||
| cf2274195f | |||
|
|
aad607ace8 | ||
| 17506f6cbf | |||
|
|
418073f07e | ||
|
|
319295de57 | ||
| 30bdf83724 | |||
| fbb801bf62 | |||
|
|
44601c74b4 | ||
| 2808e41288 | |||
| 05aea2448f | |||
| 34986d6897 | |||
| 924afce81e | |||
| 48dcfd4a04 | |||
|
|
163ab1c80d | ||
| e06f944def | |||
|
|
a5d546d1d1 | ||
| 1304ec6cde | |||
|
|
f46d14ce28 | ||
| e2005582fe | |||
| a56a5849fe | |||
|
|
1495bfee99 | ||
| 19eecd7022 | |||
|
|
d415efde35 | ||
| 61ee585ae9 | |||
|
|
7b103aaf7c | ||
|
|
9eba98f709 | ||
| dea3264577 | |||
|
|
42cfcce1dc | ||
|
|
ac78268a85 | ||
| d001712067 | |||
|
|
dc28a3d81e | ||
| 728dec9d97 | |||
|
|
215a2f8927 | ||
| 58ace7d613 | |||
|
|
3982afb0d3 | ||
|
|
280920d5f0 | ||
|
|
e353638ec1 | ||
|
|
65a3a64d7d | ||
| b10312118b | |||
|
|
419b5d08b4 | ||
|
|
b146f93029 | ||
|
|
ef34a6cf4f | ||
| cdf3c4e411 | |||
|
|
d0b7b065b2 | ||
| 53e6cb5a70 | |||
|
|
5895fa8d71 | ||
|
|
48886374d5 | ||
|
|
32d0fe497d | ||
|
|
6347473d0c | ||
| 6df819f3b1 | |||
| 39fbe90e8b | |||
|
|
3396ca63d0 | ||
| 8c5ae3b61a | |||
|
|
484891cfe7 | ||
|
|
5c00e065d2 | ||
|
|
2857bb09a2 | ||
|
|
79c1c01003 | ||
| a2864187ed | |||
| ef76b2c7e4 | |||
|
|
05e7c4ffdd | ||
|
|
b4b1efe730 | ||
| 0c7ae4e4f7 | |||
|
|
b35d5d242e | ||
| b8264997f4 | |||
|
|
2ab1b31a94 | ||
|
|
9dba41c22f | ||
|
|
f1645cf72c | ||
|
|
cd35b9e40f | ||
|
|
33bce43737 | ||
|
|
1f8025599b | ||
|
|
7c44f09803 | ||
|
|
0b89ac21e8 | ||
|
|
238181deca | ||
|
|
71a7b47d42 | ||
|
|
59446d2518 | ||
|
|
8a8a7a8326 | ||
|
|
089b1881f1 | ||
|
|
7b1f3ddd79 | ||
|
|
56ae033523 | ||
|
|
f772a64507 | ||
|
|
8c75317ddc | ||
|
|
256c19a09e | ||
|
|
82c1d15ca5 | ||
|
|
aff5a178a0 | ||
|
|
04b1764f7b | ||
|
|
076f7130c8 | ||
|
|
b7842d5ac9 | ||
|
|
eb5aebda51 | ||
|
|
6990bd13ed | ||
|
|
c18af48fbb | ||
|
|
68e6f5df1b | ||
|
|
dc46ffc5b6 | ||
|
|
c58a5a9a55 | ||
|
|
e2ee742091 | ||
|
|
bcc86a899c | ||
|
|
b60031d2d0 | ||
|
|
54aa5fee67 | ||
|
|
816fd21fbc | ||
|
|
92e6b563e4 |
@@ -34,14 +34,14 @@ public class ShareBuilder {
|
||||
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
|
||||
anchorId,
|
||||
shareUid,
|
||||
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0"
|
||||
) ;
|
||||
CommonAppConfig.IS_GOOGLE_PLAY
|
||||
);
|
||||
}
|
||||
|
||||
public static String createInviteLink(String shareUid) {
|
||||
return String.format("https://www.pdlive.com/public/app/download/index.html?user_id=%s&isGoogle=%s",
|
||||
shareUid,
|
||||
CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0"
|
||||
CommonAppConfig.IS_GOOGLE_PLAY
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
public InvitePopDialog setUrl(String data) {
|
||||
this.url = data + "&isGoogle=" + (CommonAppConfig.IS_GOOGLE_PLAY ? "1" : "0");
|
||||
this.url = data + "&isGoogle=" + CommonAppConfig.IS_GOOGLE_PLAY;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,21 +26,21 @@
|
||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
||||
},
|
||||
"client":{
|
||||
"cp_id":"30086000612391734",
|
||||
"product_id":"99536292102564216",
|
||||
"client_id":"964994320723627840",
|
||||
"client_secret":"6D5FE29D85B967D3A66BDCD473641E4C7B5524F7F4935CA0EF4A842730C3402D",
|
||||
"project_id":"99536292102564216",
|
||||
"app_id":"106936673",
|
||||
"api_key":"DAEDADYGta/0O4ZSdrnug52NgC67/w/RIyTq9A8LyAY0+mp6g6XeJDbxugpluFPLAhaqjaMs5c0PLnRx14UzWbPPADgi1EqihbWLoA==",
|
||||
"cp_id":"30852000032486141",
|
||||
"product_id":"388421841221767494",
|
||||
"client_id":"1283893262452580800",
|
||||
"client_secret":"17BC070420691D35650C694230D6348075CB549F7BBA94EDD49FA9E61A9E5434",
|
||||
"project_id":"388421841221767494",
|
||||
"app_id":"109612651",
|
||||
"api_key":"DAEDAAlBbTFuTuyQWQsyYBZLuyjALH9Y9BNFkVZl1GhI0tRaa6HF1LgzXWy2MZiSFrmpbn1aAvcvzP6aKZtR6MVikS8V4SbBlYUPfQ==",
|
||||
"package_name":"com.pdlive.shayu"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_id":"106936673",
|
||||
"client_id":"109612651",
|
||||
"client_type":1
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"106936673",
|
||||
"app_id":"109612651",
|
||||
"package_name":"com.pdlive.shayu"
|
||||
},
|
||||
"service":{
|
||||
@@ -53,6 +53,10 @@
|
||||
"resource_id":"p1",
|
||||
"channel_id":""
|
||||
},
|
||||
"edukit":{
|
||||
"edu_url":"edukit.cloud.huawei.com.cn",
|
||||
"dh_url":"edukit.cloud.huawei.com.cn"
|
||||
},
|
||||
"search":{
|
||||
"url":"https://search-drcn.cloud.huawei.com"
|
||||
},
|
||||
@@ -77,15 +81,15 @@
|
||||
{
|
||||
"package_name":"com.pdlive.shayu",
|
||||
"client":{
|
||||
"app_id":"106936673"
|
||||
"app_id":"109612651"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"com.pdlive.shayu",
|
||||
"app_id":"106936673"
|
||||
"app_id":"109612651"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_type":1,
|
||||
"client_id":"106936673"
|
||||
"client_id":"109612651"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -130,58 +130,57 @@ android {
|
||||
}
|
||||
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',
|
||||
//旧美颜
|
||||
'model-all.zip',
|
||||
'filterData.zip',
|
||||
'KSYResource/*',
|
||||
'Resources/*',
|
||||
'Asset/*',
|
||||
'image_effect_shaders/*',
|
||||
'internal/*'
|
||||
//美颜基础组件
|
||||
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',
|
||||
//旧美颜
|
||||
'model-all.zip',
|
||||
'filterData.zip',
|
||||
'KSYResource/*',
|
||||
'Resources/*',
|
||||
'Asset/*',
|
||||
'image_effect_shaders/*',
|
||||
'internal/*'
|
||||
//美颜基础组件
|
||||
|
||||
]))
|
||||
println "isPluginModel = " + rootProject.ext.manifestPlaceholders.isPluginModel
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
delete(fileTree(dir: outputDir, includes: [
|
||||
'model/ai_face_processor_lite.bundle',
|
||||
'graphics/face_beautification.bundle'
|
||||
]))
|
||||
delete(fileTree(dir: outputDir, includes: ['model/ai_face_processor_lite.bundle',
|
||||
'graphics/face_beautification.bundle']))
|
||||
} else {
|
||||
println "不删除bundle"
|
||||
}
|
||||
}
|
||||
}
|
||||
variant.outputs.all {
|
||||
def isGoogle = "link"
|
||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay) {
|
||||
isGoogle = "Google"
|
||||
def isGoogle = "链接"
|
||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 1) {
|
||||
isGoogle = "谷歌"
|
||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
||||
isGoogle = "Huawei"
|
||||
}
|
||||
def isPlugin = "all"
|
||||
def isPlugin = "完整"
|
||||
if (rootProject.ext.manifestPlaceholders.isPluginModel) {
|
||||
isPlugin = "plugin"
|
||||
isPlugin = "插件"
|
||||
}
|
||||
def isTest = "测试服"
|
||||
if (rootProject.ext.manifestPlaceholders.serverHost == "https://napi.yaoulive.com") {
|
||||
isTest = "正式服"
|
||||
}
|
||||
outputFileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
||||
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
||||
|
||||
}
|
||||
}
|
||||
@@ -231,7 +230,6 @@ android {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
@@ -266,8 +264,8 @@ dependencies {
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:30.5.0')
|
||||
implementation 'com.google.firebase:firebase-crashlytics'
|
||||
//implementation platform('com.google.firebase:firebase-bom:30.5.0')
|
||||
//implementation 'com.google.firebase:firebase-crashlytics'
|
||||
|
||||
//直播
|
||||
api project(':main')
|
||||
|
||||
15
app/proguard-rules.pro
vendored
15
app/proguard-rules.pro
vendored
@@ -277,3 +277,18 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
||||
-keep class tech.sud.mgp.hello.common.event.model.** {*;}
|
||||
|
||||
-keep class com.yunbao.common.sud.** {*;}
|
||||
|
||||
|
||||
|
||||
-ignorewarnings
|
||||
-keepattributes *Annotation*
|
||||
-keepattributes Exceptions
|
||||
-keepattributes InnerClasses
|
||||
-keepattributes Signature
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
-keep class com.huawei.hianalytics.**{*;}
|
||||
-keep class com.huawei.updatesdk.**{*;}
|
||||
-keep class com.huawei.hms.**{*;}
|
||||
|
||||
-keep class com.shayu.lib_google.**{*;}
|
||||
-keep class com.shayu.lib_huawei.**{*;}
|
||||
|
||||
@@ -194,12 +194,13 @@
|
||||
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.appid"-->
|
||||
<!-- android:value="106936673"/>-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.cpid"-->
|
||||
<!-- android:value="30086000612391734"/>-->
|
||||
|
||||
<meta-data
|
||||
android:name="com.huawei.hms.client.appid"
|
||||
android:value="109612651" />
|
||||
<meta-data
|
||||
android:name="com.huawei.hms.client.cpid"
|
||||
android:value="30852000032486141" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -6,7 +6,6 @@ import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.net.http.HttpResponseCache;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@@ -24,9 +23,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.Utils;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.fm.openinstall.OpenInstall;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.shayu.phonelive.utils.LogUtils;
|
||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
@@ -46,9 +42,9 @@ import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.GoogleUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.socket.SocketReceiveBean;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
@@ -62,7 +58,6 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
@@ -145,7 +140,6 @@ public class AppContext extends CommonAppContext {
|
||||
sInstance = this;
|
||||
L.setDeBug(BuildConfig.DEBUG);
|
||||
AppEventsLogger.activateApp(this);
|
||||
FirebaseAnalytics.getInstance(this);
|
||||
|
||||
File httpCacheDir = new File(getCacheDir(), "https");
|
||||
try {
|
||||
@@ -160,7 +154,6 @@ public class AppContext extends CommonAppContext {
|
||||
}
|
||||
ARouter.init(this);
|
||||
|
||||
|
||||
//初始化 邀请码库
|
||||
if (isMainProcess()) {
|
||||
OpenInstall.init(this);
|
||||
@@ -170,8 +163,7 @@ public class AppContext extends CommonAppContext {
|
||||
|
||||
|
||||
//友盟正式初始化
|
||||
UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE,
|
||||
"64e40ee55488fe7b3afa2c96");
|
||||
UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
||||
|
||||
//集成umeng-crash-vx.x.x.aar,则需要关闭原有统计SDK异常捕获功能
|
||||
MobclickAgent.setCatchUncaughtExceptions(false);
|
||||
@@ -212,9 +204,7 @@ public class AppContext extends CommonAppContext {
|
||||
if (content.getContent().contains("_method_")) {
|
||||
msg.obj = content.getContent();
|
||||
//观众页面
|
||||
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);
|
||||
} else if (content.getContent().contains("LivePK_anchorStartLiveNotify")) {//开播通知
|
||||
SocketReceiveBean received = JSON.parseObject(content.getContent(), SocketReceiveBean.class);
|
||||
@@ -313,40 +303,37 @@ public class AppContext extends CommonAppContext {
|
||||
* 注册全局异常捕获,有需要时可以在onCreate调用
|
||||
*/
|
||||
private void registerError() {
|
||||
NeverCrashUtils.getInstance()
|
||||
.setDebugMode(BuildConfig.DEBUG)
|
||||
.setMainCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
AppManager.runDebugCode(() -> {
|
||||
//闪退后finish所有Activity并且杀死进程
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
if (activity != null && activity.get() != null) {
|
||||
activity.get().finish();
|
||||
}
|
||||
}
|
||||
Process.killProcess(Process.myPid());
|
||||
System.exit(0);
|
||||
setFirebaseCrashData();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
throw new RuntimeException(e);
|
||||
}, 100);
|
||||
});
|
||||
NeverCrashUtils.getInstance().setDebugMode(BuildConfig.DEBUG).setMainCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
AppManager.runDebugCode(() -> {
|
||||
//闪退后finish所有Activity并且杀死进程
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
if (activity != null && activity.get() != null) {
|
||||
activity.get().finish();
|
||||
}
|
||||
}
|
||||
Process.killProcess(Process.myPid());
|
||||
System.exit(0);
|
||||
setFirebaseCrashData();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
throw new RuntimeException(e);
|
||||
}, 100);
|
||||
});
|
||||
|
||||
})
|
||||
.setUncaughtCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
})
|
||||
.register(this);
|
||||
}).setUncaughtCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
}).register(this);
|
||||
}
|
||||
|
||||
public void registerFirebaseCrash() {
|
||||
if (!CommonAppConfig.IS_UPLOAD_ERROR_LOG) {
|
||||
return;
|
||||
}
|
||||
FirebaseAnalytics.getInstance(this);
|
||||
FirebaseApp.initializeApp(this);
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
GoogleUtils.newInstance(this).initializeApp(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -355,21 +342,5 @@ public class AppContext extends CommonAppContext {
|
||||
return;
|
||||
}
|
||||
String uid = CommonAppConfig.getInstance().getUid();
|
||||
FirebaseCrashlytics.getInstance().setUserId(CommonAppConfig.getInstance().getUid());
|
||||
if (uid != null && !uid.isEmpty()) {
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("uid", uid);
|
||||
} else {
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("uid", "uid is null");
|
||||
}
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("userData", SpUtil.getInstance().getStringValue(SpUtil.USER_INFO));
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("isGoogle", CommonAppConfig.IS_GOOGLE_PLAY);
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("PhoneName", Build.BRAND);
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("Phone", Build.MODEL);
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("CPU", Arrays.toString(Build.SUPPORTED_ABIS));
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("RunTime", (System.currentTimeMillis() - CrashSaveBean.getInstance().getStartTime()));
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("enterRoom", CrashSaveBean.getInstance().getEnterRoom());
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("slidingRoom", CrashSaveBean.getInstance().getSlidingRoom());
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("playSvga", CrashSaveBean.getInstance().getPlaySvga());
|
||||
FirebaseCrashlytics.getInstance().setCustomKey("ActivitySize", CrashSaveBean.getInstance().getActivitySize());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
@@ -108,7 +107,6 @@ public class NeverCrashUtils {
|
||||
}
|
||||
e.printStackTrace();
|
||||
AppContext.setFirebaseCrashData();
|
||||
FirebaseCrashlytics.getInstance().recordException(e);
|
||||
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||
|
||||
@@ -41,6 +41,7 @@ import com.yunbao.common.bean.NotificationMsgBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
|
||||
import org.json.JSONException;
|
||||
@@ -92,7 +93,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
if (AppContext.activityWeakReference != null) {
|
||||
Activity activity = AppContext.activityWeakReference.get();
|
||||
if (activity != null) {
|
||||
DialogUitl.showSimpleDialog(activity, "应用需要通知权限", new DialogUitl.SimpleCallback() {
|
||||
DialogUitl.showSimpleDialog(activity, WordUtil.isNewZh()?"应用需要通知权限":"Application requires notification permission", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent intent = new Intent();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
package com.shayu.phonelive.utils;
|
||||
|
||||
import android.app.Notification;
|
||||
@@ -108,3 +109,4 @@ public class MyNotificationService extends FirebaseMessagingService {
|
||||
// }
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ buildscript {
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||
maven { url 'https://repo1.maven.org/maven2/' }//埋点
|
||||
maven {url 'https://developer.huawei.com/repo/'}
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -24,6 +25,7 @@ buildscript {
|
||||
classpath 'com.google.gms:google-services:4.3.3'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
||||
classpath "com.alibaba:arouter-register:1.0.2"
|
||||
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -146,7 +146,11 @@ dependencies {
|
||||
|
||||
//谷歌支付
|
||||
//谷歌内购
|
||||
api 'com.android.billingclient:billing:5.0.0'
|
||||
//api 'com.android.billingclient:billing:5.0.0'
|
||||
|
||||
//api 'com.google.firebase:firebase-messaging:23.0.6'
|
||||
//api 'com.google.firebase:firebase-analytics:21.1.0'
|
||||
|
||||
api 'com.squareup.picasso:picasso:2.5.2'
|
||||
api "com.immomo.cosmos.mediax:beautyutils:2.2.1_01071700"
|
||||
api files('libs/liteavsdk.jar')
|
||||
@@ -180,15 +184,14 @@ dependencies {
|
||||
api 'com.jakewharton.rxbinding3:rxbinding:3.1.0'
|
||||
//loading样式库
|
||||
api 'com.wang.avi:library:2.1.3'
|
||||
api 'com.google.firebase:firebase-messaging:23.0.6'
|
||||
api 'com.google.firebase:firebase-analytics:21.1.0'
|
||||
|
||||
// api 'com.huawei.hms:push:4.0.2.300'
|
||||
implementation 'com.github.tajchert:WaitingDots:0.6.1'
|
||||
//悬浮窗
|
||||
api 'com.github.princekin-f:EasyFloat:2.0.4'
|
||||
api files('libs/Msc.jar')
|
||||
|
||||
api 'com.github.li-xiaojun:XPopup:2.9.1'
|
||||
api 'com.github.li-xiaojun:XPopup:2.10.0'
|
||||
|
||||
api 'com.github.shenbengit:PagerGridLayoutManager:1.1.7'
|
||||
//选择器
|
||||
@@ -206,4 +209,11 @@ dependencies {
|
||||
|
||||
// 多语言语音识别扩展库(可选)
|
||||
api 'tech.sud.mgp:SudASR:1.3.3.1158'
|
||||
|
||||
//华为支付插件包
|
||||
//api project(':lib_huawei')
|
||||
|
||||
//google插件包
|
||||
api project(':lib_google')
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.FansMedalBean;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.UserItemBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -29,12 +28,11 @@ import java.util.Map;
|
||||
/**
|
||||
* Created by cxf on 2017/8/4.
|
||||
*/
|
||||
|
||||
public class CommonAppConfig {
|
||||
//域名
|
||||
public static final String HOST = getMetaDataString("SERVER_HOST");
|
||||
//是否使用谷歌支付
|
||||
public static final boolean IS_GOOGLE_PLAY = getMetaDataBoolean("IS_GOOGLE_PLAY");
|
||||
public static final int IS_GOOGLE_PLAY = getMetaDataInt("IS_GOOGLE_PLAY");
|
||||
//是否开启上报错误日志功能
|
||||
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
||||
//是否为插件包模式
|
||||
@@ -109,8 +107,6 @@ public class CommonAppConfig {
|
||||
private boolean mLaunched;//App是否启动了
|
||||
private String mJPushAppKey;//极光推送的AppKey
|
||||
private List<UserItemBean> mUserItemList;//个人中心功能列表
|
||||
private SparseArray<LevelBean> mLevelMap;
|
||||
private SparseArray<LevelBean> mAnchorLevelMap;
|
||||
private SparseArray<FansMedalBean> mAnchorFansMedalMap;
|
||||
private String mGiftListJson;
|
||||
private String mWrapListJson;
|
||||
@@ -470,6 +466,18 @@ public class CommonAppConfig {
|
||||
}
|
||||
|
||||
|
||||
private static int getMetaDataInt(String key) {
|
||||
int res = 0;
|
||||
try {
|
||||
ApplicationInfo appInfo = CommonAppContext.sInstance.getPackageManager().getApplicationInfo(CommonAppContext.sInstance.getPackageName(), PackageManager.GET_META_DATA);
|
||||
res = appInfo.metaData.getInt(key);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 个人中心功能列表
|
||||
*/
|
||||
@@ -509,46 +517,6 @@ public class CommonAppConfig {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存用户等级信息
|
||||
*/
|
||||
public void setLevel(String levelJson) {
|
||||
if (TextUtils.isEmpty(levelJson)) {
|
||||
return;
|
||||
}
|
||||
List<LevelBean> list = JSON.parseArray(levelJson, LevelBean.class);
|
||||
if (list == null || list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
if (mLevelMap == null) {
|
||||
mLevelMap = new SparseArray<>();
|
||||
}
|
||||
mLevelMap.clear();
|
||||
for (LevelBean bean : list) {
|
||||
mLevelMap.put(bean.getLevel(), bean);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存主播等级信息
|
||||
*/
|
||||
public void setAnchorLevel(String anchorLevelJson) {
|
||||
if (TextUtils.isEmpty(anchorLevelJson)) {
|
||||
return;
|
||||
}
|
||||
List<LevelBean> list = JSON.parseArray(anchorLevelJson, LevelBean.class);
|
||||
if (list == null || list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
if (mAnchorLevelMap == null) {
|
||||
mAnchorLevelMap = new SparseArray<>();
|
||||
}
|
||||
mAnchorLevelMap.clear();
|
||||
for (LevelBean bean : list) {
|
||||
mAnchorLevelMap.put(bean.getLevel(), bean);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存主播粉丝徽章信息
|
||||
*/
|
||||
@@ -587,40 +555,6 @@ public class CommonAppConfig {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户等级
|
||||
*/
|
||||
public LevelBean getLevel(int level) {
|
||||
if (mLevelMap == null) {
|
||||
String configString = SpUtil.getInstance().getStringValue(SpUtil.CONFIG);
|
||||
if (!TextUtils.isEmpty(configString)) {
|
||||
JSONObject obj = JSON.parseObject(configString);
|
||||
setLevel(obj.getString("level"));
|
||||
}
|
||||
}
|
||||
if (mLevelMap == null || mLevelMap.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return mLevelMap.get(level);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主播等级
|
||||
*/
|
||||
public LevelBean getAnchorLevel(int level) {
|
||||
if (mAnchorLevelMap == null) {
|
||||
String configString = SpUtil.getInstance().getStringValue(SpUtil.CONFIG);
|
||||
if (!TextUtils.isEmpty(configString)) {
|
||||
JSONObject obj = JSON.parseObject(configString);
|
||||
setAnchorLevel(obj.getString("levelanchor"));
|
||||
}
|
||||
}
|
||||
if (mAnchorLevelMap == null || mAnchorLevelMap.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return mAnchorLevelMap.get(level);
|
||||
}
|
||||
|
||||
public String getGiftListJson() {
|
||||
return mGiftListJson;
|
||||
}
|
||||
|
||||
@@ -55,9 +55,11 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
// RongPushClient.setPushConfig(config); //将推送相关配置设置到 SDK
|
||||
//设置新加坡融云服务器 有时候国内收不到推送是因为这个
|
||||
RongIMClient.setServerInfo("navsg01.cn.ronghub.com", null);
|
||||
//谷歌推送
|
||||
PushConfig gconfig = new PushConfig.Builder().enableFCM(true).build();
|
||||
RongPushClient.setPushConfig(gconfig);
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
//谷歌推送
|
||||
PushConfig gconfig = new PushConfig.Builder().enableFCM(true).build();
|
||||
RongPushClient.setPushConfig(gconfig);
|
||||
}
|
||||
//初始化友盟统计
|
||||
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||
FacebookSdk.sdkInitialize(getApplicationContext());
|
||||
|
||||
@@ -263,6 +263,8 @@ public class Constants {
|
||||
|
||||
public static final String LIVE_SDK = "liveSdk";
|
||||
public static final String LIVE_KSY_CONFIG = "liveKsyConfig";
|
||||
|
||||
public static final String LIVE_PK_RANDOM_START="RankingStartRandomPK";
|
||||
public static final int LIVE_SDK_KSY = 0;//金山推流
|
||||
public static final int LIVE_SDK_TX = 1;//腾讯推流
|
||||
|
||||
|
||||
@@ -8,10 +8,13 @@ import android.widget.TextView;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@@ -22,11 +25,13 @@ import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryPopup;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -39,7 +44,6 @@ public class SudGameActivity extends AbsActivity {
|
||||
private CreateSudRoomModel mCreateSudRoomModel;
|
||||
private TextView gameTitle, roomName, roomNumber;
|
||||
private RoundedImageView mAvatar;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_sud_game;
|
||||
@@ -50,8 +54,28 @@ public class SudGameActivity extends AbsActivity {
|
||||
Bus.getOn(this);
|
||||
super.main();
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
private void initDate() {
|
||||
LiveNetManager.get(mContext)
|
||||
.getCustomSidebarInfo("1", new HttpCallback<List<CustomSidebarInfoModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<CustomSidebarInfoModel> data) {
|
||||
for (CustomSidebarInfoModel datum : data) {
|
||||
if (datum.getType().equals("6")) {
|
||||
customSidebarChildModels = datum.getChild();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
Bus.getOff(this);
|
||||
@@ -82,6 +106,15 @@ public class SudGameActivity extends AbsActivity {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_history), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.asCustom(new LiveSudGameHistoryPopup(mContext, customSidebarChildModels)).show();
|
||||
}
|
||||
});
|
||||
gameViewModel.gameViewLiveData.observe(this, new Observer<View>() {
|
||||
@Override
|
||||
public void onChanged(View view) {
|
||||
@@ -97,10 +130,12 @@ public class SudGameActivity extends AbsActivity {
|
||||
GameConfigModel gameConfigModel = gameViewModel.getGameConfigModel();
|
||||
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
||||
|
||||
gameConfigModel.ui.lobby_players.custom = true;
|
||||
gameConfigModel.ui.join_btn.custom = true;
|
||||
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.game_settle_again_btn.custom = true;
|
||||
gameConfigModel.ui.start_btn.custom = true;
|
||||
|
||||
// SudMGP平台64bit游戏ID
|
||||
gameViewModel.switchGame((Activity) mContext, mLiveUid, mInteractionID);
|
||||
@@ -118,32 +153,60 @@ public class SudGameActivity extends AbsActivity {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
|
||||
if (event.getResults().size() > 0) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
} else {
|
||||
LiveNetManager.get(mContext).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getGoldenBeanRemainingBalance() == 1) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||
} else {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("金豆不够 ");
|
||||
}else {
|
||||
ToastUtil.show("Insufficient money ");
|
||||
switch (event.getSudMGPMGState()) {
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
||||
LiveNetManager.get(mContext).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getGoldenBeanRemainingBalance() == 1) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||
} else {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
} else {
|
||||
ToastUtil.show("Shortage of money");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("金豆不够 ");
|
||||
}else {
|
||||
ToastUtil.show("Insufficient money ");
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
} else {
|
||||
ToastUtil.show("Shortage of money");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
|
||||
LiveNetManager.get(mContext).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
|
||||
mCreateSudRoomModel.getSudGameRoomId(), new
|
||||
HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getStatus()==1){
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfPlaying(true);
|
||||
}else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_STATE:
|
||||
LiveNetManager.get(mContext).deductMoney( mCreateSudRoomModel.getSudGameRoomId());
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GameRecordModel;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryViewHolder;
|
||||
|
||||
public class LiveSudGameHistoryAdapter extends RefreshAdapter<GameRecordModel> {
|
||||
|
||||
public LiveSudGameHistoryAdapter(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new LiveSudGameHistoryViewHolder(mInflater.inflate(R.layout.item_live_sud_game_history, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
LiveSudGameHistoryViewHolder sudGameListViewHolder = (LiveSudGameHistoryViewHolder) holder;
|
||||
sudGameListViewHolder.setData(mList.get(position));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class BattlePassPoints extends BaseModel{
|
||||
private int id;
|
||||
private int type;
|
||||
@SerializedName("rewards_name")
|
||||
private String rewardsName;
|
||||
@SerializedName("rewards_id")
|
||||
private int rewardsId;
|
||||
@SerializedName("image_url")
|
||||
private String imageUrl;
|
||||
@SerializedName("points_threshold")
|
||||
private String pointsThreshold;
|
||||
@SerializedName("points_threshold_text")
|
||||
private String pointsThresholdText;
|
||||
@SerializedName("rewards_value")
|
||||
private String rewardsValue;
|
||||
@SerializedName("battle_pass_level")
|
||||
private int battlePassLevel;
|
||||
@SerializedName("exchange_quantity")
|
||||
private int exchangeQuantity;
|
||||
@SerializedName("live_battle_pass_type_id")
|
||||
private int liveBattlePassTypeId;
|
||||
private String description;
|
||||
@SerializedName("restrict_time")
|
||||
private int restrictTime;
|
||||
private int sort;
|
||||
@SerializedName("exchange_status")
|
||||
private int exchangeStatus;
|
||||
@SerializedName("user_quinty_count")
|
||||
private int userQuintyCount;
|
||||
@SerializedName("exchange_status_remark")
|
||||
private String exchangeMark;
|
||||
|
||||
public BattlePassPoints() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getRewardsName() {
|
||||
return rewardsName;
|
||||
}
|
||||
|
||||
public void setRewardsName(String rewardsName) {
|
||||
this.rewardsName = rewardsName;
|
||||
}
|
||||
|
||||
public int getRewardsId() {
|
||||
return rewardsId;
|
||||
}
|
||||
|
||||
public void setRewardsId(int rewardsId) {
|
||||
this.rewardsId = rewardsId;
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getPointsThreshold() {
|
||||
return pointsThreshold;
|
||||
}
|
||||
|
||||
public void setPointsThreshold(String pointsThreshold) {
|
||||
this.pointsThreshold = pointsThreshold;
|
||||
}
|
||||
|
||||
public String getRewardsValue() {
|
||||
return rewardsValue;
|
||||
}
|
||||
|
||||
public void setRewardsValue(String rewardsValue) {
|
||||
this.rewardsValue = rewardsValue;
|
||||
}
|
||||
|
||||
public int getBattlePassLevel() {
|
||||
return battlePassLevel;
|
||||
}
|
||||
|
||||
public void setBattlePassLevel(int battlePassLevel) {
|
||||
this.battlePassLevel = battlePassLevel;
|
||||
}
|
||||
|
||||
public int getExchangeQuantity() {
|
||||
return exchangeQuantity;
|
||||
}
|
||||
|
||||
public void setExchangeQuantity(int exchangeQuantity) {
|
||||
this.exchangeQuantity = exchangeQuantity;
|
||||
}
|
||||
|
||||
public int getLiveBattlePassTypeId() {
|
||||
return liveBattlePassTypeId;
|
||||
}
|
||||
|
||||
public void setLiveBattlePassTypeId(int liveBattlePassTypeId) {
|
||||
this.liveBattlePassTypeId = liveBattlePassTypeId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getRestrictTime() {
|
||||
return restrictTime;
|
||||
}
|
||||
|
||||
public void setRestrictTime(int restrictTime) {
|
||||
this.restrictTime = restrictTime;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public int getExchangeStatus() {
|
||||
return exchangeStatus;
|
||||
}
|
||||
|
||||
public void setExchangeStatus(int exchangeStatus) {
|
||||
this.exchangeStatus = exchangeStatus;
|
||||
}
|
||||
|
||||
public int getUserQuintyCount() {
|
||||
return userQuintyCount;
|
||||
}
|
||||
|
||||
public void setUserQuintyCount(int userQuintyCount) {
|
||||
this.userQuintyCount = userQuintyCount;
|
||||
}
|
||||
|
||||
public String getExchangeMark() {
|
||||
return exchangeMark;
|
||||
}
|
||||
|
||||
public void setExchangeMark(String exchangeMark) {
|
||||
this.exchangeMark = exchangeMark;
|
||||
}
|
||||
|
||||
public String getPointsThresholdText() {
|
||||
return pointsThresholdText;
|
||||
}
|
||||
|
||||
public void setPointsThresholdText(String pointsThresholdText) {
|
||||
this.pointsThresholdText = pointsThresholdText;
|
||||
}
|
||||
}
|
||||
157
common/src/main/java/com/yunbao/common/bean/BattlePassTask.java
Normal file
157
common/src/main/java/com/yunbao/common/bean/BattlePassTask.java
Normal file
@@ -0,0 +1,157 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassTask extends BaseModel {
|
||||
private List<Task> daily;// 每日任务
|
||||
private List<Task> season;// 每期任务
|
||||
|
||||
public BattlePassTask() {
|
||||
}
|
||||
|
||||
public List<Task> getDaily() {
|
||||
return daily;
|
||||
}
|
||||
|
||||
public void setDaily(List<Task> daily) {
|
||||
this.daily = daily;
|
||||
}
|
||||
|
||||
public List<Task> getSeason() {
|
||||
return season;
|
||||
}
|
||||
|
||||
public void setSeason(List<Task> season) {
|
||||
this.season = season;
|
||||
}
|
||||
|
||||
public static class Task {
|
||||
private int id;// 任务ID
|
||||
private String type;// 任务类型
|
||||
@SerializedName("task_success")
|
||||
private int taskSuccess;// 任务可以重复的次数
|
||||
@SerializedName("name_en")
|
||||
private String nameEn;// 任务名称英文
|
||||
@SerializedName("remark_en")
|
||||
private String remarkEn;// 任务备注英文
|
||||
private String name;// 任务名称中文
|
||||
private String remark; // 任务备注中文
|
||||
@SerializedName("image_path")
|
||||
private String imagePath;// 图标path
|
||||
@SerializedName("user_task_success")
|
||||
private int userTaskSuccess;// 用户完成的任务次数
|
||||
@SerializedName("received_task")
|
||||
private int receivedTask;// 用户已经领取的任务数量
|
||||
@SerializedName("not_received_task")
|
||||
private int notReceivedTask; // 用户未领取的任务数量
|
||||
public boolean isBuy(){
|
||||
return taskSuccess==0;
|
||||
}
|
||||
public String getNameText(){
|
||||
return WordUtil.isNewZh()?name:nameEn;
|
||||
}
|
||||
public String getRemarkText(){
|
||||
return WordUtil.isNewZh()?remark:remarkEn;
|
||||
}
|
||||
|
||||
public Task() {
|
||||
}
|
||||
|
||||
public Task(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getTaskSuccess() {
|
||||
return taskSuccess;
|
||||
}
|
||||
|
||||
public void setTaskSuccess(int taskSuccess) {
|
||||
this.taskSuccess = taskSuccess;
|
||||
}
|
||||
|
||||
public String getNameEn() {
|
||||
return nameEn;
|
||||
}
|
||||
|
||||
public void setNameEn(String nameEn) {
|
||||
this.nameEn = nameEn;
|
||||
}
|
||||
|
||||
public String getRemarkEn() {
|
||||
return remarkEn;
|
||||
}
|
||||
|
||||
public void setRemarkEn(String remarkEn) {
|
||||
this.remarkEn = remarkEn;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getImagePath() {
|
||||
return imagePath;
|
||||
}
|
||||
|
||||
public void setImagePath(String imagePath) {
|
||||
this.imagePath = imagePath;
|
||||
}
|
||||
|
||||
public int getUserTaskSuccess() {
|
||||
return userTaskSuccess;
|
||||
}
|
||||
|
||||
public void setUserTaskSuccess(int userTaskSuccess) {
|
||||
this.userTaskSuccess = userTaskSuccess;
|
||||
}
|
||||
|
||||
public int getReceivedTask() {
|
||||
return receivedTask;
|
||||
}
|
||||
|
||||
public void setReceivedTask(int receivedTask) {
|
||||
this.receivedTask = receivedTask;
|
||||
}
|
||||
|
||||
public int getNotReceivedTask() {
|
||||
return notReceivedTask;
|
||||
}
|
||||
|
||||
public void setNotReceivedTask(int notReceivedTask) {
|
||||
this.notReceivedTask = notReceivedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassUserInfoBean extends BaseModel{
|
||||
private String uid;
|
||||
private int points;
|
||||
@SerializedName("battle_pass_exp")
|
||||
private int battlePassExp;
|
||||
@SerializedName("battle_pass_user_records_1")
|
||||
private int battlePassUserRecords1;
|
||||
@SerializedName("battle_pass_user_records_2")
|
||||
private int battlePassUserRecords2;
|
||||
@SerializedName("battle_pass_user_records_3")
|
||||
private int battlePassUserRecords3;
|
||||
private int level;
|
||||
@SerializedName("last_level_exp")
|
||||
private int lastLevelExp;
|
||||
@SerializedName("next_level_exp")
|
||||
private int nextLevelExp;
|
||||
private String id;
|
||||
@SerializedName("battle_pass_name")
|
||||
private String battlePassName;
|
||||
@SerializedName("start_time")
|
||||
private String startTime;
|
||||
@SerializedName("end_time")
|
||||
private String endTime;
|
||||
@SerializedName("battle_pass_status")
|
||||
private boolean battlePassStatus;
|
||||
@SerializedName("max_level_exp")
|
||||
private long maxLevelExp;
|
||||
@SerializedName("max_level")
|
||||
private int maxLevel;
|
||||
|
||||
private List<LiveBattlePassRewardsBean.BattlePassType> live_battle_pass_type;
|
||||
|
||||
public BattlePassUserInfoBean() {
|
||||
}
|
||||
public List<LiveBattlePassRewardsBean.BattlePassType> getLive_battle_pass_type() {
|
||||
return live_battle_pass_type;
|
||||
}
|
||||
|
||||
public void setLive_battle_pass_type(List<LiveBattlePassRewardsBean.BattlePassType> live_battle_pass_type) {
|
||||
this.live_battle_pass_type = live_battle_pass_type;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
public void setPoints(int points) {
|
||||
this.points = points;
|
||||
}
|
||||
|
||||
public int getBattlePassExp() {
|
||||
return battlePassExp;
|
||||
}
|
||||
|
||||
public void setBattlePassExp(int battlePassExp) {
|
||||
this.battlePassExp = battlePassExp;
|
||||
}
|
||||
|
||||
public int getBattlePassUserRecords1() {
|
||||
return battlePassUserRecords1;
|
||||
}
|
||||
|
||||
public void setBattlePassUserRecords1(int battlePassUserRecords1) {
|
||||
this.battlePassUserRecords1 = battlePassUserRecords1;
|
||||
}
|
||||
|
||||
public int getBattlePassUserRecords2() {
|
||||
return battlePassUserRecords2;
|
||||
}
|
||||
|
||||
public void setBattlePassUserRecords2(int battlePassUserRecords2) {
|
||||
this.battlePassUserRecords2 = battlePassUserRecords2;
|
||||
}
|
||||
|
||||
public int getBattlePassUserRecords3() {
|
||||
return battlePassUserRecords3;
|
||||
}
|
||||
|
||||
public void setBattlePassUserRecords3(int battlePassUserRecords3) {
|
||||
this.battlePassUserRecords3 = battlePassUserRecords3;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getLastLevelExp() {
|
||||
return lastLevelExp;
|
||||
}
|
||||
|
||||
public void setLastLevelExp(int lastLevelExp) {
|
||||
this.lastLevelExp = lastLevelExp;
|
||||
}
|
||||
|
||||
public int getNextLevelExp() {
|
||||
return nextLevelExp;
|
||||
}
|
||||
|
||||
public void setNextLevelExp(int nextLevelExp) {
|
||||
this.nextLevelExp = nextLevelExp;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBattlePassName() {
|
||||
return battlePassName;
|
||||
}
|
||||
|
||||
public void setBattlePassName(String battlePassName) {
|
||||
this.battlePassName = battlePassName;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public boolean isBattlePassStatus() {
|
||||
return battlePassStatus;
|
||||
}
|
||||
|
||||
public void setBattlePassStatus(boolean battlePassStatus) {
|
||||
this.battlePassStatus = battlePassStatus;
|
||||
}
|
||||
|
||||
public long getMaxLevelExp() {
|
||||
return maxLevelExp;
|
||||
}
|
||||
|
||||
public void setMaxLevelExp(long maxLevelExp) {
|
||||
this.maxLevelExp = maxLevelExp;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return maxLevel;
|
||||
}
|
||||
|
||||
public void setMaxLevel(int maxLevel) {
|
||||
this.maxLevel = maxLevel;
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,38 @@ package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class CheckRemainingBalance extends BaseModel{
|
||||
public class CheckRemainingBalance extends BaseModel {
|
||||
|
||||
@SerializedName("golden_bean_remaining_balance")
|
||||
private int goldenBeanRemainingBalance;
|
||||
@SerializedName("golden_bean_remaining_balance")
|
||||
private int goldenBeanRemainingBalance;
|
||||
@SerializedName("status")
|
||||
private int status;
|
||||
@SerializedName("deduct_money_key")
|
||||
private String deductMoneyKey;
|
||||
|
||||
public int getGoldenBeanRemainingBalance() {
|
||||
return goldenBeanRemainingBalance;
|
||||
}
|
||||
public String getDeductMoneyKey() {
|
||||
return deductMoneyKey;
|
||||
}
|
||||
|
||||
public void setGoldenBeanRemainingBalance(int goldenBeanRemainingBalance) {
|
||||
this.goldenBeanRemainingBalance = goldenBeanRemainingBalance;
|
||||
}
|
||||
public CheckRemainingBalance setDeductMoneyKey(String deductMoneyKey) {
|
||||
this.deductMoneyKey = deductMoneyKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public CheckRemainingBalance setStatus(int status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getGoldenBeanRemainingBalance() {
|
||||
return goldenBeanRemainingBalance;
|
||||
}
|
||||
|
||||
public void setGoldenBeanRemainingBalance(int goldenBeanRemainingBalance) {
|
||||
this.goldenBeanRemainingBalance = goldenBeanRemainingBalance;
|
||||
}
|
||||
}
|
||||
|
||||
24
common/src/main/java/com/yunbao/common/bean/CoolConfig.java
Normal file
24
common/src/main/java/com/yunbao/common/bean/CoolConfig.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class CoolConfig extends BaseModel {
|
||||
private int rate=1;
|
||||
private String ticketCount="0" ;
|
||||
|
||||
public String getTicketCount() {
|
||||
return ticketCount;
|
||||
}
|
||||
|
||||
public CoolConfig setTicketCount(String ticketCount) {
|
||||
this.ticketCount = ticketCount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getRate() {
|
||||
return rate;
|
||||
}
|
||||
|
||||
public CoolConfig setRate(int rate) {
|
||||
this.rate = rate;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,28 @@ public class EnterRoomNewModel extends BaseModel {
|
||||
private String sudGameRoomName;
|
||||
@SerializedName("sud_gameDate")
|
||||
private SudGameDateModel sudGameDateModel;
|
||||
@SerializedName("quick_gift_remaining_quantity")
|
||||
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
||||
@SerializedName("if_viewing_duration_complete")
|
||||
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
||||
|
||||
public int getQuickGiftRemainingQuantity() {
|
||||
return quickGiftRemainingQuantity;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setQuickGiftRemainingQuantity(int quickGiftRemainingQuantity) {
|
||||
this.quickGiftRemainingQuantity = quickGiftRemainingQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIfViewingDurationComplete() {
|
||||
return ifViewingDurationComplete;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setIfViewingDurationComplete(int ifViewingDurationComplete) {
|
||||
this.ifViewingDurationComplete = ifViewingDurationComplete;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SudGameDateModel getSudGameDateModel() {
|
||||
return sudGameDateModel;
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GameRecordModel extends BaseModel{
|
||||
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("title")
|
||||
private String title;
|
||||
@SerializedName("currency_type")
|
||||
private int currencyType;
|
||||
@SerializedName("settlement")
|
||||
private int settlement;
|
||||
@SerializedName("game_end_time")
|
||||
private String gameEndTime;
|
||||
@SerializedName("user_name")
|
||||
private List<String> userName;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public int getCurrencyType() {
|
||||
return currencyType;
|
||||
}
|
||||
|
||||
public void setCurrencyType(int currencyType) {
|
||||
this.currencyType = currencyType;
|
||||
}
|
||||
|
||||
public int getSettlement() {
|
||||
return settlement;
|
||||
}
|
||||
|
||||
public void setSettlement(int settlement) {
|
||||
this.settlement = settlement;
|
||||
}
|
||||
|
||||
public String getGameEndTime() {
|
||||
return gameEndTime;
|
||||
}
|
||||
|
||||
public void setGameEndTime(String gameEndTime) {
|
||||
this.gameEndTime = gameEndTime;
|
||||
}
|
||||
|
||||
public List<String> getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(List<String> userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
}
|
||||
@@ -204,7 +204,7 @@ public class IMLoginModel extends BaseModel {
|
||||
@SerializedName("votes")
|
||||
private String votes;
|
||||
@SerializedName("yuanbao")
|
||||
private long yuanbao;
|
||||
private String yuanbao;
|
||||
@SerializedName("list")
|
||||
private List<List<ListModel>> list;
|
||||
@SerializedName("slide")
|
||||
@@ -825,11 +825,11 @@ public class IMLoginModel extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getYuanbao() {
|
||||
public String getYuanbao() {
|
||||
return yuanbao;
|
||||
}
|
||||
|
||||
public IMLoginModel setYuanbao(long yuanbao) {
|
||||
public IMLoginModel setYuanbao(String yuanbao) {
|
||||
this.yuanbao = yuanbao;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class LiveBattlePassRewardsBean extends BaseModel{
|
||||
private int level;
|
||||
private List<BattlePassType> live_battle_pass_type;
|
||||
private Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards;
|
||||
|
||||
public LiveBattlePassRewardsBean() {
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public List<BattlePassType> getLive_battle_pass_type() {
|
||||
return live_battle_pass_type;
|
||||
}
|
||||
|
||||
public void setLive_battle_pass_type(List<BattlePassType> live_battle_pass_type) {
|
||||
this.live_battle_pass_type = live_battle_pass_type;
|
||||
}
|
||||
|
||||
public Map<Integer,Map<Integer,LiveBattlePassReward>> getLive_battle_pass_rewards() {
|
||||
return live_battle_pass_rewards;
|
||||
}
|
||||
|
||||
public void setLive_battle_pass_rewards(Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards) {
|
||||
this.live_battle_pass_rewards = live_battle_pass_rewards;
|
||||
}
|
||||
|
||||
public static class BattlePassType extends BaseModel{
|
||||
private int id;
|
||||
private String battle_pass_name;
|
||||
private int sort;
|
||||
private int diamond_value;
|
||||
private int lock;
|
||||
|
||||
public BattlePassType() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBattle_pass_name() {
|
||||
return battle_pass_name;
|
||||
}
|
||||
|
||||
public void setBattle_pass_name(String battle_pass_name) {
|
||||
this.battle_pass_name = battle_pass_name;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public int getDiamond_value() {
|
||||
return diamond_value;
|
||||
}
|
||||
|
||||
public void setDiamond_value(int diamond_value) {
|
||||
this.diamond_value = diamond_value;
|
||||
}
|
||||
|
||||
public int getLock() {
|
||||
return lock;
|
||||
}
|
||||
|
||||
public void setLock(int lock) {
|
||||
this.lock = lock;
|
||||
}
|
||||
}
|
||||
public static class LiveBattlePassReward extends BaseModel{
|
||||
private int id;
|
||||
@SerializedName("live_battle_pass_level")
|
||||
private int liveBattlePassLevel;
|
||||
@SerializedName("live_battle_pass_type_id")
|
||||
private int liveBattlePassTypeId;
|
||||
@SerializedName("reward_name")
|
||||
private String rewardName;
|
||||
@SerializedName("image_url")
|
||||
private String imageUrl;
|
||||
private int lock;
|
||||
private int received;
|
||||
|
||||
public LiveBattlePassReward() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getLiveBattlePassLevel() {
|
||||
return liveBattlePassLevel;
|
||||
}
|
||||
|
||||
public void setLiveBattlePassLevel(int liveBattlePassLevel) {
|
||||
this.liveBattlePassLevel = liveBattlePassLevel;
|
||||
}
|
||||
|
||||
public int getLiveBattlePassTypeId() {
|
||||
return liveBattlePassTypeId;
|
||||
}
|
||||
|
||||
public void setLiveBattlePassTypeId(int liveBattlePassTypeId) {
|
||||
this.liveBattlePassTypeId = liveBattlePassTypeId;
|
||||
}
|
||||
|
||||
public String getRewardName() {
|
||||
return rewardName;
|
||||
}
|
||||
|
||||
public void setRewardName(String rewardName) {
|
||||
this.rewardName = rewardName;
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public int getLock() {
|
||||
return lock;
|
||||
}
|
||||
|
||||
public void setLock(int lock) {
|
||||
this.lock = lock;
|
||||
}
|
||||
|
||||
public int getReceived() {
|
||||
return received;
|
||||
}
|
||||
|
||||
public void setReceived(int received) {
|
||||
this.received = received;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class NativeCallbackModel extends BaseModel{
|
||||
private String uid ;
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public NativeCallbackModel setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -17,14 +17,17 @@ public class OpenAdModel extends BaseModel {
|
||||
public static final int MODEL_SQUARE = 1;//正方形
|
||||
public static final int MODEL_RECTANGLE = 2;//长方形
|
||||
public static final int MODEL_BOTTOM = 3;//底部
|
||||
public static final int SHOW_DEF = 1;//1. 杀死程序后弹出;
|
||||
public static final int SHOW_DIY = 2;//2. 自定义时间:自上次弹出弹窗后,00:00小时(范围:00:01小时-48:00小时)后再弹出(到时间后也需满足触发条件再弹出);
|
||||
public static final int SHOW_ONE = 3;//3. 仅弹出一次;
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("popup_location")
|
||||
private int type = TYPE_HOME;
|
||||
@SerializedName("activity_url")
|
||||
private String url;
|
||||
private String url;//点击跳转url
|
||||
@SerializedName("image_url")
|
||||
private String imageUrl;
|
||||
private String imageUrl;//图片url
|
||||
@SerializedName("display_time")
|
||||
private int showTime; //持续展示时间
|
||||
@SerializedName("delay_show_time")
|
||||
@@ -37,11 +40,48 @@ public class OpenAdModel extends BaseModel {
|
||||
private String endTime;//活动结束时间
|
||||
@SerializedName("popup_permission")
|
||||
private int permission;
|
||||
@SerializedName("popup_frequency")
|
||||
private int showModel = SHOW_DEF;//显示模式,1:杀死程序后弹出 2:指定时间内(本机时间) 3:1. 仅弹出一次
|
||||
@SerializedName("popup_frequency_time")
|
||||
private String section = "0";// SHOW_DEF = 2
|
||||
|
||||
|
||||
public OpenAdModel() {
|
||||
}
|
||||
|
||||
public static OpenAdModel createTestData() {
|
||||
OpenAdModel model = new OpenAdModel();
|
||||
model.id=3;
|
||||
model.type=1;
|
||||
model.url = "/h5/GuildTournament/20230821/rank.html";
|
||||
model.imageUrl = "https://ceshi.yaoulive.com/data/upload/20230913/1694589490.png";
|
||||
model.showTime = 10;
|
||||
model.delayShowTime = 0;
|
||||
model.model = MODEL_SQUARE;
|
||||
model.startTime = "2019-01-01 00:00:00";
|
||||
model.endTime = "2029-01-01 00:00:00";
|
||||
model.permission = 4;
|
||||
model.showModel = SHOW_DIY;
|
||||
model.section = "5";
|
||||
return model;
|
||||
}
|
||||
|
||||
public int getShowModel() {
|
||||
return showModel;
|
||||
}
|
||||
|
||||
public void setShowModel(int showModel) {
|
||||
this.showModel = showModel;
|
||||
}
|
||||
|
||||
public String getSection() {
|
||||
return section;
|
||||
}
|
||||
|
||||
public void setSection(String section) {
|
||||
this.section = section;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class QuickGiftSendGiftModel extends BaseModel {
|
||||
@SerializedName("quick_gift_remaining_quantity")
|
||||
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
||||
@SerializedName("if_viewing_duration_complete")
|
||||
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
||||
@SerializedName("if_hidden_egg")
|
||||
private int ifHiddenEgg = 1;//1.未解锁 2.已解锁过奖励 3.当前请求解锁了奖励
|
||||
|
||||
public int getIfHiddenEgg() {
|
||||
return ifHiddenEgg;
|
||||
}
|
||||
|
||||
public QuickGiftSendGiftModel setIfHiddenEgg(int ifHiddenEgg) {
|
||||
this.ifHiddenEgg = ifHiddenEgg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getQuickGiftRemainingQuantity() {
|
||||
return quickGiftRemainingQuantity;
|
||||
}
|
||||
|
||||
public QuickGiftSendGiftModel setQuickGiftRemainingQuantity(int quickGiftRemainingQuantity) {
|
||||
this.quickGiftRemainingQuantity = quickGiftRemainingQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIfViewingDurationComplete() {
|
||||
return ifViewingDurationComplete;
|
||||
}
|
||||
|
||||
public QuickGiftSendGiftModel setIfViewingDurationComplete(int ifViewingDurationComplete) {
|
||||
this.ifViewingDurationComplete = ifViewingDurationComplete;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,17 @@ public class SudRoomListModel extends BaseModel {
|
||||
private String sex;
|
||||
@SerializedName("sud_game_icon")
|
||||
private String sudgameicon;
|
||||
@SerializedName("currency_type")
|
||||
private String currencyType;
|
||||
|
||||
public String getCurrencyType() {
|
||||
return currencyType;
|
||||
}
|
||||
|
||||
public SudRoomListModel setCurrencyType(String currencyType) {
|
||||
this.currencyType = currencyType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudgameicon() {
|
||||
return sudgameicon;
|
||||
@@ -200,9 +211,9 @@ public class SudRoomListModel extends BaseModel {
|
||||
}
|
||||
|
||||
public String getTotal() {
|
||||
if (TextUtils.isEmpty(obTotal)&&TextUtils.isEmpty(playerTotal)){
|
||||
if (TextUtils.isEmpty(obTotal) && TextUtils.isEmpty(playerTotal)) {
|
||||
return "0";
|
||||
}else {
|
||||
} else {
|
||||
int obT = Integer.parseInt(obTotal);
|
||||
int playerO = Integer.parseInt(playerTotal);
|
||||
return String.valueOf(obT + playerO);
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.ImageSpan;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class ActivateEliteBattleOrderPopupWindow extends CenterPopupView {
|
||||
private boolean elites;//是否精英战令
|
||||
private String spendMoney;//花费钱
|
||||
private View buttonWarOrder;
|
||||
private LiberalBattlePassPopupWindow.LiberalBattlePassCallback mPassCallback;
|
||||
private String mBattlePassTypeId;
|
||||
|
||||
public ActivateEliteBattleOrderPopupWindow(@NonNull Context context, String mSpendMoney,
|
||||
boolean elites,
|
||||
LiberalBattlePassPopupWindow.LiberalBattlePassCallback passCallback
|
||||
, String battlePassTypeId) {
|
||||
super(context);
|
||||
this.elites = elites;
|
||||
spendMoney = mSpendMoney;
|
||||
mPassCallback=passCallback;
|
||||
mBattlePassTypeId = battlePassTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.activate_elite_battle_order_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
buttonWarOrder = findViewById(R.id.button_war_order);
|
||||
if (elites) {
|
||||
findViewById(R.id.gift_overvalue).setVisibility(VISIBLE);
|
||||
findViewById(R.id.gift_overvalue3).setVisibility(GONE);
|
||||
findViewById(R.id.enjoy_image).setVisibility(GONE);
|
||||
findViewById(R.id.elites_image).setVisibility(VISIBLE);
|
||||
findViewById(R.id.gift_overvalue).setVisibility(VISIBLE);
|
||||
((TextView)findViewById(R.id.gift3_text)).setText(WordUtil.getNewString(R.string.unlock_more_gifts));
|
||||
} else {
|
||||
findViewById(R.id.gift_overvalue).setVisibility(GONE);
|
||||
findViewById(R.id.gift_overvalue3).setVisibility(VISIBLE);
|
||||
findViewById(R.id.enjoy_image).setVisibility(VISIBLE);
|
||||
findViewById(R.id.elites_image).setVisibility(GONE);
|
||||
findViewById(R.id.gift_overvalue).setVisibility(GONE);
|
||||
((TextView)findViewById(R.id.gift3_text)).setText(WordUtil.getNewString(R.string.unlock_more_gifts2));
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.war_order_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
//中文按钮文字
|
||||
|
||||
((TextView)findViewById(R.id.button_war_order_text)).setText(spendMoney);
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(buttonWarOrder, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
|
||||
.asCustom(new LiberalBattlePassPopupWindow(getContext(), spendMoney, elites,mPassCallback,mBattlePassTypeId))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
/**
|
||||
* 活动结束
|
||||
*/
|
||||
public class ActivityEndPopupWindow extends CenterPopupView {
|
||||
public ActivityEndPopupWindow(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.activity_end_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.confirm), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class CinemaTicketPopupWindow extends CenterPopupView {
|
||||
private CoolConfig mCoolConfig;
|
||||
private TextView cinemaTicket, ticketsPlusMinus, quantityNeed;
|
||||
private int ticket = 1;
|
||||
private CinemaTicketPopupWindowCallBack mCinemaTicketPopupWindowCallBack;
|
||||
|
||||
public CinemaTicketPopupWindow(@NonNull Context context, CoolConfig coolConfig, CinemaTicketPopupWindowCallBack cinemaTicketPopupWindowCallBack) {
|
||||
super(context);
|
||||
mCoolConfig = coolConfig;
|
||||
mCinemaTicketPopupWindowCallBack = cinemaTicketPopupWindowCallBack;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.cinema_ticket_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
cinemaTicket = findViewById(R.id.cinema_ticket);
|
||||
ticketsPlusMinus = findViewById(R.id.tickets_plus_minus);
|
||||
quantityNeed = findViewById(R.id.quantity_need);
|
||||
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
|
||||
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (ticket > 1) {
|
||||
ticket = ticket - 1;
|
||||
|
||||
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
|
||||
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
findViewById(R.id.add).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ticket = ticket + 1;
|
||||
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
|
||||
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_exchange), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext())
|
||||
.buyTicket(String.valueOf(ticket), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
|
||||
|
||||
if (mCinemaTicketPopupWindowCallBack != null) {
|
||||
mCinemaTicketPopupWindowCallBack.onCallBack(data);
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface CinemaTicketPopupWindowCallBack {
|
||||
void onCallBack(String data);
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,16 @@ package com.yunbao.common.dialog;
|
||||
|
||||
import static androidx.core.content.ContextCompat.getSystemService;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -20,7 +24,9 @@ import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.SudGameActivity;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
import com.yunbao.common.event.CreateSudGameEvent;
|
||||
import com.yunbao.common.event.CurrencyTypeEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@@ -28,7 +34,7 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.LiveSudGamePopup;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -37,15 +43,21 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
public class CreateSudGamePopup extends BottomPopupView {
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
private TextView createGameType;
|
||||
private TextView createGameType, selectCurrencyType;
|
||||
private EditText roomName, gameSill;
|
||||
private long interactionID = 0;
|
||||
private String id;
|
||||
private boolean isHomeView;
|
||||
private boolean isHome = false;
|
||||
private List<String> roomNames = new ArrayList<>();
|
||||
|
||||
private String currencyType = "3", currencyTypeName;
|
||||
private long animDuration = 500;
|
||||
private ImageView roomGameArrow;
|
||||
|
||||
public CreateSudGamePopup(@NonNull Context context, List<CustomSidebarChildModel> child, boolean isHome) {
|
||||
super(context);
|
||||
@@ -72,19 +84,42 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initDate();
|
||||
initView();
|
||||
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
private String userName;
|
||||
private boolean isYuanbao;
|
||||
|
||||
private void initDate() {
|
||||
currencyTypeName = getContext().getString(R.string.golden_bean);
|
||||
userName = IMLoginManager.get(getContext()).getUserInfo().getUserNicename();
|
||||
roomNames.add(WordUtil.isNewZh() ? "壹起玩吧!" : "Let's play together!");
|
||||
roomNames.add(WordUtil.isNewZh() ? "來戰鬥吧!" : "Let's fight!");
|
||||
roomNames.add(WordUtil.isNewZh() ? "決戰到天亮 " : "Fight until dawn");
|
||||
roomNames.add(WordUtil.isNewZh() ? "在線等遊戲夥伴~" : "Waiting for game partners~");
|
||||
roomNames.add(WordUtil.isNewZh() ? userName + "的房间 " : userName + "‘s room");
|
||||
LiveNetManager.get(getContext()).checkCurrency(new HttpCallback<CheckCurrencyModel>() {
|
||||
@Override
|
||||
public void onSuccess(CheckCurrencyModel data) {
|
||||
isYuanbao = TextUtils.equals(data.getIsYuanbao(), "1") || TextUtils.equals(data.getIsYuanbao(), "true");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
createGameType = findViewById(R.id.create_game_type);
|
||||
selectCurrencyType = findViewById(R.id.select_currency_type);
|
||||
roomName = findViewById(R.id.room_name);
|
||||
gameSill = findViewById(R.id.game_sill);
|
||||
roomGameArrow = findViewById(R.id.room_game_arrow);
|
||||
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
|
||||
ViewClicksAntiShake.clicksAntiShake(createGameType, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
@@ -129,18 +164,19 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.create_room), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
String sill = gameSill.getText().toString();
|
||||
String name = roomName.getText().toString();
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
if (name.length() > 10) {
|
||||
ToastUtil.show("房間名长度为[1-10]");
|
||||
if (name.length() > 15) {
|
||||
ToastUtil.show("房間名长度为[1-15]");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() != Locale.SIMPLIFIED_CHINESE) {
|
||||
if (name.length() > 15) {
|
||||
ToastUtil.show("Room name length is [1-15]");
|
||||
if (name.length() > 30) {
|
||||
ToastUtil.show("Room name length is [1-30]");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -161,43 +197,84 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(sill)) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("数量区间为100--5W");
|
||||
if (TextUtils.equals(currencyType, "3")) {
|
||||
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量區間為[100-5W]");
|
||||
} else {
|
||||
ToastUtil.show("The amount of money ranges from [100-5W]");
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show("The quantity range is 100 to 5 W");
|
||||
}
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||
} else {
|
||||
ToastUtil.show("Currency quantity range [10-1000]");
|
||||
} }
|
||||
|
||||
return;
|
||||
}
|
||||
if (sill.length() > 6 ){
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("数量区间为100--5W");
|
||||
if (TextUtils.equals(currencyType, "3")) {
|
||||
if (sill.length() > 6) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量區間為[100-5W]");
|
||||
} else {
|
||||
ToastUtil.show("The amount of money ranges from [100-5W]");
|
||||
}
|
||||
return;
|
||||
|
||||
} else {
|
||||
ToastUtil.show("The quantity range is 100 to 5 W");
|
||||
int sillNumber = Integer.parseInt(sill);
|
||||
if (sillNumber < 100 || sillNumber > 50000) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量區間為[100-5W]");
|
||||
} else {
|
||||
ToastUtil.show("The amount of money ranges from [100-5W]");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (sillNumber % 10 != 0) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量必須為10的倍數");
|
||||
} else {
|
||||
ToastUtil.show("The number of currency must be a multiple of 10");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}else {
|
||||
int sillNumber = Integer.parseInt(sill);
|
||||
if (sillNumber < 100 || sillNumber > 50000) {
|
||||
} else {
|
||||
if (sill.length() > 4) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("数量区间为100--5W");
|
||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||
} else {
|
||||
ToastUtil.show("The quantity range is 100 to 5 W");
|
||||
ToastUtil.show("Currency quantity range [10-1000]");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (sillNumber%10!=0){
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("金豆數量必須為10的倍數");
|
||||
} else {
|
||||
ToastUtil.show("The number of golden beans must be a multiple of 10");
|
||||
} else {
|
||||
int sillNumber = Integer.parseInt(sill);
|
||||
if (sillNumber < 10 || sillNumber > 1000) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||
} else {
|
||||
ToastUtil.show("Currency quantity range [10-1000]]");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (sillNumber % 10 != 0) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量必須為10的倍數");
|
||||
} else {
|
||||
ToastUtil.show("The number of currency must be a multiple of 10");
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LiveNetManager.get(getContext())
|
||||
.createSudRoom(name, sill, id, new HttpCallback<CreateSudRoomModel>() {
|
||||
.createSudRoom(name, sill, currencyType, id, new HttpCallback<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (isHome) {
|
||||
@@ -221,6 +298,45 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
});
|
||||
}
|
||||
});
|
||||
roomName.setText(WordUtil.isNewZh() ? userName + "的房间 " : userName + "‘s room");
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.create_game_random), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Random random = new Random();
|
||||
int randomNumber = random.nextInt(roomNames.size());
|
||||
roomName.setText(roomNames.get(randomNumber));
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.currency_type), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 0f, 90f);
|
||||
animator.setDuration(animDuration);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
closeAnimSudGameListEvent();
|
||||
}
|
||||
})
|
||||
)
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void closeAnimSudGameListEvent() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 90f, 0f);
|
||||
animator.setDuration(animDuration);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -236,4 +352,16 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
id = event.getId();
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onCurrencyTypeEvent(CurrencyTypeEvent event) {
|
||||
currencyTypeName = event.getCurrencyTypeName();
|
||||
currencyType = event.getCurrencyType();
|
||||
selectCurrencyType.setText(currencyTypeName);
|
||||
if (TextUtils.equals(currencyType, "3")) {
|
||||
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
|
||||
} else {
|
||||
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class LiberalBattlePassPopupWindow extends CenterPopupView {
|
||||
private String spendMoney;//花费钱
|
||||
private boolean mElites;//是否精英战令
|
||||
private TextView liberalBattlePass;
|
||||
private LiberalBattlePassCallback mPassCallback;
|
||||
private String mBattlePassTypeId;
|
||||
|
||||
public LiberalBattlePassPopupWindow(@NonNull Context context, String mSpendMoney, boolean elites, LiberalBattlePassCallback passCallback, String battlePassTypeId) {
|
||||
super(context);
|
||||
spendMoney = mSpendMoney;
|
||||
mElites = elites;
|
||||
mPassCallback = passCallback;
|
||||
mBattlePassTypeId = battlePassTypeId;
|
||||
}
|
||||
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.liberal_battle_pass_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
liberalBattlePass = findViewById(R.id.liberal_battle_pass);
|
||||
//中文版
|
||||
StringBuffer liberalBattlePassHint = new StringBuffer();
|
||||
liberalBattlePassHint.append(WordUtil.isNewZh()?"是否花費":"Did you spend ");
|
||||
liberalBattlePassHint.append(spendMoney).append(mElites ?
|
||||
WordUtil.isNewZh()?"鑽石開通精英戰令!":"diamonds to activate the Elite BattlePass":
|
||||
WordUtil.isNewZh()?"鑽石開通尊享戰令!":"diamonds to activate the Luxury BattlePass");
|
||||
//英文版
|
||||
|
||||
//设置样式
|
||||
String liberalBattlePassStr = liberalBattlePassHint.toString();
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
builder.append(liberalBattlePassStr);
|
||||
int spendMoneyIndex = liberalBattlePassStr.indexOf(spendMoney);
|
||||
int spendMoneySize = spendMoneyIndex + spendMoney.length();
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#CE2BFF")), spendMoneyIndex, spendMoneySize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
liberalBattlePass.setText(builder);
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cancel), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.liberal_battle_sure), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext()).
|
||||
upgradesBattlePass(mBattlePassTypeId, new HttpCallback<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> data) {
|
||||
|
||||
dialog.dismiss();
|
||||
if (mPassCallback != null) {
|
||||
mPassCallback.onCallback(data.getData().getCode(), data.getData().getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
dialog.dismiss();
|
||||
if (mPassCallback != null) {
|
||||
mPassCallback.onCallback(102, error);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public interface LiberalBattlePassCallback {
|
||||
void onCallback(int code, String msg);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
builder.animationDuration(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -21,6 +22,10 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
private OpenAdModel model;
|
||||
private OnItemClickListener<OpenAdModel> mListener;
|
||||
|
||||
public OpenAdCenterDialogPopup(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public OpenAdCenterDialogPopup(@NonNull Context context, OpenAdModel model) {
|
||||
super(context);
|
||||
this.model = model;
|
||||
@@ -33,6 +38,8 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.hasShadowBg(false);
|
||||
builder.animationDuration(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,6 +60,7 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e("-----弹窗-----", "onCreate: 创建弹窗" );
|
||||
mImageView = findViewById(R.id.img);
|
||||
mClose = findViewById(R.id.close);
|
||||
findViewById(R.id.layout).setOnClickListener(v -> dismiss());
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 战令等级 经验
|
||||
*/
|
||||
public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
private TextView orderLevel, orderLevelDiamond, balanceDiamond, current,expText;
|
||||
private int currentExperience, totalExperience;//当前经验,全部经验
|
||||
private String buyExp = "100", currentLevel, balance;
|
||||
private ProgressBar progressBar;
|
||||
private OrderLevelCallback orderLevelCallback;
|
||||
private long maxExp;
|
||||
|
||||
public OrderLevelPopupWindow(@NonNull Context context,
|
||||
int mCurrentExperience, int mTotalExperience,
|
||||
String mCurrentLevel, String mBalance,long maxExp, OrderLevelCallback mOrderLevelCallback) {
|
||||
super(context);
|
||||
currentExperience = mCurrentExperience;
|
||||
totalExperience = mTotalExperience;
|
||||
currentLevel = mCurrentLevel;
|
||||
balance = mBalance;
|
||||
this.maxExp=maxExp;
|
||||
orderLevelCallback = mOrderLevelCallback;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.order_level_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
orderLevel = findViewById(R.id.tickets_plus_minus);
|
||||
orderLevelDiamond = findViewById(R.id.order_level_diamond);
|
||||
balanceDiamond = findViewById(R.id.balance_diamond);
|
||||
current = findViewById(R.id.current);
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
expText = findViewById(R.id.exp_text);
|
||||
orderLevel.setText(buyExp);
|
||||
progressBar.setMax(totalExperience);
|
||||
progressBar.setProgress(currentExperience);
|
||||
expText.setText(String.format("%s/%s", currentExperience, totalExperience));
|
||||
current.setText(String.format("Lv%s", currentLevel));
|
||||
balanceDiamond.setText(balance);
|
||||
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
float exp = new BigDecimal(buyExp).floatValue();
|
||||
if (exp > 100) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("100"));
|
||||
buyExp = String.valueOf(buyExpBigDecimal.intValue());
|
||||
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
|
||||
orderLevel.setText(buyExp);
|
||||
}
|
||||
}
|
||||
});
|
||||
findViewById(R.id.add).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
float exp = new BigDecimal(buyExp).floatValue();
|
||||
if (exp < maxExp && exp < 10000) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("100"));
|
||||
buyExp = String.valueOf(buyExpBigDecimal.intValue());
|
||||
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
|
||||
orderLevel.setText(buyExp);
|
||||
}else if(exp>=maxExp){
|
||||
ToastUtil.show(WordUtil.isNewZh()?"经验已滿":"Experience full");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.war_order_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.buying_experience), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext())
|
||||
.buyingExperiencePoint(buyExp, new HttpCallback<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> data) {
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
|
||||
}dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(102, error);
|
||||
} dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface OrderLevelCallback {
|
||||
void onCallback(int code, String msg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BasePopupView;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
/**
|
||||
* 升級精英/尊享戰令
|
||||
*/
|
||||
public class PromotionElitePopupWindow extends CenterPopupView {
|
||||
private String enjoySpendMoney, quintessenceSpendMoney;//花费钱
|
||||
private LiberalBattlePassPopupWindow.LiberalBattlePassCallback mPassCallback;
|
||||
private String elitesTypeId,enjoyTypeId;
|
||||
private BattlePassUserInfoBean data;
|
||||
|
||||
public PromotionElitePopupWindow(@NonNull Context context, String mEnjoySpendMoney,
|
||||
String mQuintessenceSpendMoney, LiberalBattlePassPopupWindow.LiberalBattlePassCallback passCallback,
|
||||
String elitesTypeId, String enjoyTypeId) {
|
||||
super(context);
|
||||
enjoySpendMoney = mEnjoySpendMoney;
|
||||
quintessenceSpendMoney = mQuintessenceSpendMoney;
|
||||
mPassCallback = passCallback;
|
||||
this.elitesTypeId = elitesTypeId;
|
||||
this.enjoyTypeId = enjoyTypeId;
|
||||
}
|
||||
public PromotionElitePopupWindow setUserData(BattlePassUserInfoBean data) {
|
||||
this.data=data;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.promotion_elite_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.button_quintessence), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if(data!=null && data.getBattlePassUserRecords2()==2){
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_buy_max));
|
||||
return;
|
||||
}
|
||||
dialog.dismiss();
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
|
||||
.asCustom(new ActivateEliteBattleOrderPopupWindow(getContext(), quintessenceSpendMoney, true, mPassCallback, elitesTypeId))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.button_enjoy), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if(data!=null && data.getBattlePassUserRecords3()==2){
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_buy_max));
|
||||
return;
|
||||
}
|
||||
dialog.dismiss();
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
|
||||
.asCustom(new ActivateEliteBattleOrderPopupWindow(getContext(), enjoySpendMoney, false, mPassCallback, enjoyTypeId))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
|
||||
public class RuleOfWarPopupWindow extends CenterPopupView {
|
||||
public RuleOfWarPopupWindow(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
private TextView rule;
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.rule_of_war_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
rule=findViewById(R.id.rule);
|
||||
findViewById(R.id.close).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
initData();
|
||||
}
|
||||
private void initData(){
|
||||
LiveNetManager.get(getContext())
|
||||
.getBattlePassRule(new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
rule.setText(data.replace("\n","\n\n"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.LiveSudGamePopup;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryPopup;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -52,7 +52,7 @@ public class SudGameListPopup extends BottomPopupView {
|
||||
private TextView gameTitle, sillTitle, houseOwnerTitle;
|
||||
private String id = "0", mLiveUid;
|
||||
private int page = 0;
|
||||
private String mSill = "0,0", mSillName, roomHolderType = "0", roomHolderTypeName;
|
||||
private String mSill = "0,0,0", mSillName, roomHolderType = "0", roomHolderTypeName;
|
||||
private CommonRefreshView mRefreshView;
|
||||
private SudGameListAdapter sudGameListAdapter;
|
||||
|
||||
@@ -100,7 +100,7 @@ public class SudGameListPopup extends BottomPopupView {
|
||||
|
||||
for (CustomSidebarChildModel model : customSidebarChildModels) {
|
||||
if (TextUtils.equals(String.valueOf(interactionID), model.getSrc())) {
|
||||
gameTitle.setText(model.getTitle().substring(0, 2));
|
||||
gameTitle.setText(model.getTitle());
|
||||
id = model.getId();
|
||||
}
|
||||
}
|
||||
@@ -114,7 +114,7 @@ public class SudGameListPopup extends BottomPopupView {
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
page = p;
|
||||
LiveHttpUtil.getRoomList(id, mSill, roomHolderType, mLiveUid, p - 1, callback);
|
||||
LiveHttpUtil.getRoomList(id, mSill, roomHolderType, mLiveUid, "3", p - 1, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,14 +158,14 @@ public class SudGameListPopup extends BottomPopupView {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext())
|
||||
.randomRoom(id, mSill, roomHolderType,new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
|
||||
.randomRoom(id, mSill, roomHolderType, new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (data != null) {
|
||||
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||
dialog.dismiss();
|
||||
}else {
|
||||
} else {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("当前没有可加入的房间");
|
||||
} else {
|
||||
@@ -254,9 +254,27 @@ public class SudGameListPopup extends BottomPopupView {
|
||||
.asCustom(new CreateSudGamePopup(getContext(), customSidebarChildModels, false))
|
||||
|
||||
.show();
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule_bottom), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new SudGameRuleBottom(getContext())).show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_history), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new LiveSudGameHistoryPopup(getContext(), customSidebarChildModels)).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -276,13 +294,13 @@ public class SudGameListPopup extends BottomPopupView {
|
||||
public void onSudGameListEvent(SudGameListEvent event) {
|
||||
interactionID = event.getInteractionID();
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
gameTitle.setText(event.getTitle().substring(0, 2));
|
||||
gameTitle.setText(event.getTitle());
|
||||
} else {
|
||||
if (event.getTitle().contains("All")) {
|
||||
gameTitle.setText("All");
|
||||
} else {
|
||||
if ((event.getTitle().length() > 6)) {
|
||||
gameTitle.setText(event.getTitle().substring(0, 5));
|
||||
gameTitle.setText(event.getTitle());
|
||||
} else {
|
||||
gameTitle.setText(event.getTitle());
|
||||
}
|
||||
@@ -302,7 +320,7 @@ public class SudGameListPopup extends BottomPopupView {
|
||||
public void onSudGameListSillEvent(SudGameListSillEvent event) {
|
||||
mSill = event.getSill();
|
||||
mSillName = event.getSillName();
|
||||
if (TextUtils.equals("0,0", mSill)) {
|
||||
if (TextUtils.equals("0,0,0", mSill)) {
|
||||
sillTitle.setText(mSillName);
|
||||
} else {
|
||||
sillTitle.setText(mSillName.substring(0, mSillName.length() - 2));
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.yunbao.common.dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -15,6 +14,8 @@ import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.SudTitleSelectAdapter;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CreateSudGameEvent;
|
||||
import com.yunbao.common.event.CurrencyTypeEvent;
|
||||
import com.yunbao.common.event.LiveSudGameHistoryEvent;
|
||||
import com.yunbao.common.event.RoomHolderTypeEvent;
|
||||
import com.yunbao.common.event.SudGameListEvent;
|
||||
import com.yunbao.common.event.SudGameListSillEvent;
|
||||
@@ -39,6 +40,7 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
private long interactionID = 0;
|
||||
private DialogInterface.OnDismissListener onDismissListener;
|
||||
private String mSill;
|
||||
private boolean isYuanbao;
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, int type, List<CustomSidebarChildModel> child, long interactionID) {
|
||||
super(context);
|
||||
@@ -58,6 +60,20 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
mSill = sill;
|
||||
}
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, int mType, String sill, boolean isYuanbao) {
|
||||
super(context);
|
||||
this.mType = mType;
|
||||
mSill = sill;
|
||||
this.isYuanbao = isYuanbao;
|
||||
}
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, String sill, List<CustomSidebarChildModel> child) {
|
||||
super(context);
|
||||
this.mType = 8;
|
||||
mSill = sill;
|
||||
customSidebarChildModels = child;
|
||||
}
|
||||
|
||||
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.view_sud_game_slelect;
|
||||
@@ -108,13 +124,17 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_0_1));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_1_2));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_2_5));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_5));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0,0");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_0_1), "0,1");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_1_2), "1,2");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_2_5), "2,5");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_5), "5,0");
|
||||
selectString.add(getContext().getString(R.string.room_sill0_100));
|
||||
selectString.add(getContext().getString(R.string.room_sill100_500));
|
||||
selectString.add(getContext().getString(R.string.room_sill500_m));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0,0,0");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_0_1), "0,1,3");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_1_2), "1,5,3");
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_5), "5,0,3");
|
||||
selectSill.put(getContext().getString(R.string.room_sill0_100), "0,1,2");
|
||||
selectSill.put(getContext().getString(R.string.room_sill100_500), "1,5,2");
|
||||
selectSill.put(getContext().getString(R.string.room_sill500_m), "5,0,2");
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
@@ -160,6 +180,127 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
} else if (mType == 5) {
|
||||
selectString.add(getContext().getString(R.string.golden_bean));
|
||||
if (isYuanbao) {
|
||||
selectString.add(getContext().getString(R.string.coins));
|
||||
}
|
||||
selectSill.put(getContext().getString(R.string.golden_bean), "3");
|
||||
if (isYuanbao) {
|
||||
selectSill.put(getContext().getString(R.string.coins), "2");
|
||||
}
|
||||
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String roomHolderTypeName = selectString.get(index);
|
||||
String roomHolderType = selectSill.get(roomHolderTypeName);
|
||||
Bus.get().post(new CurrencyTypeEvent().setCurrencyType(roomHolderType).setCurrencyTypeName(roomHolderTypeName));
|
||||
dialog.dismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (mType == 6) {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.golden_bean));
|
||||
selectString.add(getContext().getString(R.string.coins));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
||||
selectSill.put(getContext().getString(R.string.golden_bean), "3");
|
||||
selectSill.put(getContext().getString(R.string.coins), "2");
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String roomHolderTypeName = selectString.get(index);
|
||||
String roomHolderType = selectSill.get(roomHolderTypeName);
|
||||
Bus.get().post(new LiveSudGameHistoryEvent().setType(roomHolderType).setTypeName(roomHolderTypeName).setIndex(3));
|
||||
dialog.dismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (mType == 7) {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today));
|
||||
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today_7));
|
||||
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today_30));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
||||
selectSill.put(getContext().getString(R.string.sud_in_game_game_game_peer_today), "1");
|
||||
selectSill.put(getContext().getString(R.string.sud_in_game_game_game_peer_today_7), "2");
|
||||
selectSill.put(getContext().getString(R.string.sud_in_game_game_game_peer_today_30), "3");
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String roomHolderTypeName = selectString.get(index);
|
||||
String roomHolderType = selectSill.get(roomHolderTypeName);
|
||||
Bus.get().post(new LiveSudGameHistoryEvent().setType(roomHolderType).setTypeName(roomHolderTypeName).setIndex(2));
|
||||
dialog.dismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (mType == 8) {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
||||
for (int i = 0; i < customSidebarChildModels.size(); i++) {
|
||||
selectString.add(customSidebarChildModels.get(i).getTitle());
|
||||
selectSill.put(customSidebarChildModels.get(i).getTitle(), customSidebarChildModels.get(i).getId());
|
||||
}
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
if (TextUtils.equals(mSill, selectString.get(i))) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index, mType);
|
||||
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
|
||||
topSelect.setVisibility(GONE);
|
||||
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
String roomHolderTypeName = selectString.get(index);
|
||||
String roomHolderType = selectSill.get(roomHolderTypeName);
|
||||
Bus.get().post(new LiveSudGameHistoryEvent().setType(roomHolderType).setTypeName(roomHolderTypeName).setIndex(1));
|
||||
dialog.dismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(topSelect, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
@@ -173,7 +314,7 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
if(onDismissListener!=null){
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class SudGameRuleBottom extends BottomPopupView {
|
||||
public SudGameRuleBottom(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.sud_game_rule_bottom_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class SudGameRulePopup extends CenterPopupView {
|
||||
public SudGameRulePopup(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.sud_game_rule_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,6 @@ import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.views.FlowLayout;
|
||||
import com.yunbao.common.views.LiveSudGamePopup;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -54,6 +53,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
super(context);
|
||||
this.isHome = isHome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
Bus.getOff(this);
|
||||
@@ -172,7 +172,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
private void search(String value) {
|
||||
|
||||
LiveNetManager.get(mContext)
|
||||
.searchRoomList("0", "0,0", "0", value, 0, new HttpCallback<List<SudRoomListModel>>() {
|
||||
.searchRoomList("0", "0,0,0", "0", value, "0", 0, new HttpCallback<List<SudRoomListModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudRoomListModel> data) {
|
||||
if (data.size() > 0) {
|
||||
@@ -203,7 +203,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
findViewById(R.id.layout_history_empty).setVisibility(VISIBLE);
|
||||
listRoom.setVisibility(GONE);
|
||||
history.setVisibility(GONE);
|
||||
@@ -234,10 +234,12 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
super.onDismiss();
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameListDissMissEvent(SudGameListDissMissEvent event) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameListEvent(SudRoomListModelEvent event) {
|
||||
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 战令兑换详情
|
||||
*/
|
||||
public class WarOrderExchangeDetailsPopupWindow extends CenterPopupView {
|
||||
private TextView orderLevel, pointExchange;
|
||||
private String buyExp = "1";
|
||||
private int mPoint, mLimitQuantity, mScale;
|
||||
private String mImageUrl;
|
||||
private ImageView exchangeParticulars;
|
||||
private String battlePassPointsId;
|
||||
private WarOrderExchangeDetailsCallback orderExchangeDetailsCallback;
|
||||
|
||||
/***
|
||||
*
|
||||
* @param context
|
||||
* @param limitQuantity 最大限制数量
|
||||
* @param point 自己的积分
|
||||
* @param scale 兑换比例
|
||||
* @param imageUrl 物品图片的url
|
||||
*/
|
||||
public WarOrderExchangeDetailsPopupWindow(@NonNull Context context, int limitQuantity,
|
||||
int point, int scale, String imageUrl, String battlePassPointsId, WarOrderExchangeDetailsCallback orderExchangeDetailsCallback) {
|
||||
super(context);
|
||||
mPoint = point;
|
||||
mLimitQuantity = limitQuantity;
|
||||
mScale = scale;
|
||||
mImageUrl = imageUrl;
|
||||
this.battlePassPointsId = battlePassPointsId;
|
||||
this.orderExchangeDetailsCallback = orderExchangeDetailsCallback;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.war_order_exchange_details_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
orderLevel = findViewById(R.id.tickets_plus_minus);
|
||||
exchangeParticulars = findViewById(R.id.exchange_particulars);
|
||||
pointExchange = findViewById(R.id.point_exchange);
|
||||
orderLevel.setText(buyExp);
|
||||
BigDecimal needExpBigDecimal = new BigDecimal(buyExp).multiply(new BigDecimal(mScale));
|
||||
pointExchange.setText(String.format("%s",needExpBigDecimal));
|
||||
ImgLoader.display(getContext(), mImageUrl, exchangeParticulars);
|
||||
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
float exp = new BigDecimal(buyExp).floatValue();
|
||||
if (exp > 1) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("1"));
|
||||
buyExp = String.valueOf(buyExpBigDecimal.intValue());
|
||||
orderLevel.setText(buyExp);
|
||||
BigDecimal needExpBigDecimal = buyExpBigDecimal.multiply(new BigDecimal(mScale));
|
||||
pointExchange.setText(String.format("%s",needExpBigDecimal));
|
||||
}
|
||||
}
|
||||
});
|
||||
findViewById(R.id.add).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int number = new BigDecimal(mScale).multiply(new BigDecimal(buyExp)).intValue();
|
||||
int exp = new BigDecimal(buyExp).intValue();
|
||||
if (exp < mLimitQuantity && number < mPoint) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("1"));
|
||||
buyExp = String.valueOf(buyExpBigDecimal.intValue());
|
||||
orderLevel.setText(buyExp);
|
||||
BigDecimal needExpBigDecimal = buyExpBigDecimal.multiply(new BigDecimal(mScale));
|
||||
pointExchange.setText(String.format("%s",needExpBigDecimal));
|
||||
}else if(exp >= mLimitQuantity){
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_exchange_buy_max));
|
||||
}else {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_exchange_buy_integral));
|
||||
}
|
||||
}
|
||||
});
|
||||
findViewById(R.id.war_order_close).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.point_exchange_linear), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext())
|
||||
.pointsExchange(battlePassPointsId, buyExp, new HttpCallback<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> data) {
|
||||
dialog.dismiss();
|
||||
if (orderExchangeDetailsCallback != null) {
|
||||
orderExchangeDetailsCallback.onCallback(data.getData().getCode(), data.getData().getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
dialog.dismiss();
|
||||
if (orderExchangeDetailsCallback != null) {
|
||||
orderExchangeDetailsCallback.onCallback(102, error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface WarOrderExchangeDetailsCallback {
|
||||
void onCallback(int code, String msg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class CheckCurrencyModel extends BaseModel {
|
||||
|
||||
@SerializedName("is_yuanbao")
|
||||
private String isYuanbao;
|
||||
|
||||
public String getIsYuanbao() {
|
||||
return isYuanbao;
|
||||
}
|
||||
|
||||
public CheckCurrencyModel setIsYuanbao(String isYuanbao) {
|
||||
this.isYuanbao = isYuanbao;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,17 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CheckRemainingBalanceEvent extends BaseModel {
|
||||
public int seatIndex;
|
||||
public List<SudMGPMGState.MGCommonGameSettle.PlayerResult> results = new ArrayList<>();
|
||||
public int seatIndex=0;
|
||||
private String SudMGPMGState;
|
||||
|
||||
public List<SudMGPMGState.MGCommonGameSettle.PlayerResult> getResults() {
|
||||
return results;
|
||||
public String getSudMGPMGState() {
|
||||
return SudMGPMGState;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent setResults(List<SudMGPMGState.MGCommonGameSettle.PlayerResult> results) {
|
||||
this.results = results;
|
||||
public CheckRemainingBalanceEvent setSudMGPMGState(String sudMGPMGState) {
|
||||
SudMGPMGState = sudMGPMGState;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class CurrencyTypeEvent extends BaseModel {
|
||||
private String currencyType;
|
||||
private String currencyTypeName;
|
||||
|
||||
public String getCurrencyType() {
|
||||
return currencyType;
|
||||
}
|
||||
|
||||
public CurrencyTypeEvent setCurrencyType(String currencyType) {
|
||||
this.currencyType = currencyType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCurrencyTypeName() {
|
||||
return currencyTypeName;
|
||||
}
|
||||
|
||||
public CurrencyTypeEvent setCurrencyTypeName(String currencyTypeName) {
|
||||
this.currencyTypeName = currencyTypeName;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.bean.VideoBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -23,6 +24,16 @@ public class JavascriptInterfaceEvent extends BaseModel {
|
||||
private String data;
|
||||
private String name;
|
||||
private String image;
|
||||
private CoolConfig coolConfig;
|
||||
|
||||
public CoolConfig getCoolConfig() {
|
||||
return coolConfig;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setCoolConfig(CoolConfig coolConfig) {
|
||||
this.coolConfig = coolConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class LiveSudGameHistoryEvent extends BaseModel {
|
||||
private String type;
|
||||
private String typeName;
|
||||
private int index;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public LiveSudGameHistoryEvent setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public LiveSudGameHistoryEvent setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public LiveSudGameHistoryEvent setIndex(int index) {
|
||||
this.index = index;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class QuickGiftingEvent extends BaseModel {
|
||||
private int index;
|
||||
private String svgaName;
|
||||
private boolean show =false;
|
||||
private boolean reminder = false;
|
||||
|
||||
private String giftRemainingQuantity;
|
||||
private String hotNum;
|
||||
|
||||
public String getHotNum() {
|
||||
return hotNum;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setHotNum(String hotNum) {
|
||||
this.hotNum = hotNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftRemainingQuantity() {
|
||||
return giftRemainingQuantity;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setGiftRemainingQuantity(String giftRemainingQuantity) {
|
||||
this.giftRemainingQuantity = giftRemainingQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isReminder() {
|
||||
return reminder;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setReminder(boolean reminder) {
|
||||
this.reminder = reminder;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isShow() {
|
||||
return show;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setShow(boolean show) {
|
||||
this.show = show;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setIndex(int index) {
|
||||
this.index = index;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSvgaName() {
|
||||
return svgaName;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setSvgaName(String svgaName) {
|
||||
this.svgaName = svgaName;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
15
common/src/main/java/com/yunbao/common/event/SlideEvent.java
Normal file
15
common/src/main/java/com/yunbao/common/event/SlideEvent.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class SlideEvent extends BaseModel {
|
||||
private boolean isSlide;
|
||||
|
||||
public boolean isSlide() {
|
||||
return isSlide;
|
||||
}
|
||||
public SlideEvent setSlide(boolean slide) {
|
||||
isSlide = slide;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,13 @@ public abstract class BaseFragment extends Fragment {
|
||||
* 请求数据
|
||||
*/
|
||||
protected abstract void loadData();
|
||||
public void updateData(){
|
||||
|
||||
}
|
||||
|
||||
protected <T extends View> T findViewById(int id){
|
||||
return contentView.findViewById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
@@ -17,9 +17,11 @@ public class LoadingDialog extends AbsDialogFragment {
|
||||
private TextView hint;
|
||||
private String showText = "";
|
||||
|
||||
public boolean isShow;
|
||||
|
||||
public void setShowText(String showText) {
|
||||
this.showText = showText;
|
||||
|
||||
isShow = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,19 +46,28 @@ public class LoadingDialog extends AbsDialogFragment {
|
||||
hint = (TextView) findViewById(R.id.hint);
|
||||
dots.start();
|
||||
hint.setText(showText);
|
||||
isShow = true;
|
||||
}
|
||||
|
||||
public void setHintText(String text) {
|
||||
if (hint != null) {
|
||||
hint.setText(text);
|
||||
}
|
||||
isShow = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
dots.stop();
|
||||
isShow = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = DeviceUtils.getScreenWidth(getActivity())/2;
|
||||
params.width = DeviceUtils.getScreenWidth(getActivity()) / 2;
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.gravity = Gravity.CENTER;
|
||||
window.setAttributes(params);
|
||||
|
||||
@@ -173,106 +173,95 @@ public class CommonHttpUtil {
|
||||
}
|
||||
Log.i("来了", lang);
|
||||
//或者仅仅使用 locale = Locale.getDefault(); 不需要考虑接口 deprecated(弃用)问题
|
||||
HttpClient.getInstance().get("Home.getConfig", CommonHttpConsts.GET_CONFIG)
|
||||
.params("langue", lang)
|
||||
.params("version", "" + VersionUtil.getVersion())
|
||||
.params("from", "android")
|
||||
.params("appType", "1")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
try {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
ConfigBean bean = JSON.toJavaObject(obj, ConfigBean.class);
|
||||
CommonAppConfig.getInstance().setConfig(bean);
|
||||
CommonAppConfig.getInstance().setLevel(obj.getString("level"));
|
||||
CommonAppConfig.getInstance().setAnchorLevel(obj.getString("levelanchor"));
|
||||
CommonAppConfig.getInstance().alert_time = obj.getInteger("alert_time");
|
||||
CommonAppConfig.getInstance().alert_end_time = obj.getInteger("alert_end_time");
|
||||
//解析粉丝徽章
|
||||
CommonAppConfig.getInstance().setAnchorFansMedal(obj.getString("levelfans"));
|
||||
SpUtil.getInstance().setStringValue(SpUtil.CONFIG, info[0]);
|
||||
if (commonCallback != null) {
|
||||
commonCallback.callback(bean);
|
||||
}
|
||||
if (obj.containsKey("is_chat")) {
|
||||
IMLoginManager.get(context).initChat(String.valueOf(obj.getInteger("is_chat")));
|
||||
}
|
||||
if (obj.containsKey("levelfans")) {
|
||||
JSONArray levelArray = obj.getJSONArray("levelfans");
|
||||
new NewLevelManager(context).upDataFansLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("level_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("level_new");
|
||||
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("levelanchor_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("levelanchor_new");
|
||||
new NewLevelManager(context).UpAnchorDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("liveclass")) {//缓存直播间分类
|
||||
JSONArray levelArray = obj.getJSONArray("liveclass");
|
||||
new LiveClassManager(context).UpDataLiveClass(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("apk_ver")) {
|
||||
APKManager.get().setApkVer(obj.getString("apk_ver"));
|
||||
}
|
||||
if (obj.containsKey("apk_url")) {
|
||||
APKManager.get().setAPKUrl(obj.getString("apk_url"));
|
||||
}
|
||||
if (obj.containsKey("apk_des")) {
|
||||
APKManager.get().setAPKDes(obj.getString("apk_des"));
|
||||
}
|
||||
if (obj.containsKey("google_isup")) {
|
||||
APKManager.get().setAPKGoogleIsUp(obj.getInteger("google_isup"));
|
||||
}
|
||||
if (obj.containsKey("isup")) {
|
||||
APKManager.get().setAPKIsUp(obj.getInteger("isup"));
|
||||
}
|
||||
if (obj.containsKey("clarity")) {
|
||||
IMLoginManager.get(context).setClarity(obj.getString("clarity"));
|
||||
}
|
||||
if (obj.containsKey("defaultBubbleUrl")) {
|
||||
IMLoginManager.get(context).setDefaultBubbleUrl(obj.getString("defaultBubbleUrl"));
|
||||
}
|
||||
if (obj.containsKey("gift_quantity")) {
|
||||
JSONArray giftQuantity = obj.getJSONArray("gift_quantity");
|
||||
new GiftQuantityManager(context).UpGiftQuantity(giftQuantity.toJSONString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||
}
|
||||
} else if (code == 1000) {
|
||||
new DialogUitl
|
||||
.Builder(context)
|
||||
.setContent(msg)
|
||||
.setCancelable(false)
|
||||
.setClickCallback3(new DialogUitl.SimpleCallback3() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog) {
|
||||
AppManager.getInstance().AppExit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
AppManager.getInstance().AppExit();
|
||||
}
|
||||
}).build().show();
|
||||
} else {
|
||||
ToastUtil.show(context.getString(R.string.net_error) + "code:" + code + " msg:" + msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
HttpClient.getInstance().get("Home.getConfig", CommonHttpConsts.GET_CONFIG).params("langue", lang).params("version", "" + VersionUtil.getVersion()).params("from", "android").params("appType", "1").execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
try {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
ConfigBean bean = JSON.toJavaObject(obj, ConfigBean.class);
|
||||
CommonAppConfig.getInstance().setConfig(bean);
|
||||
CommonAppConfig.getInstance().alert_time = obj.getInteger("alert_time");
|
||||
CommonAppConfig.getInstance().alert_end_time = obj.getInteger("alert_end_time");
|
||||
//解析粉丝徽章
|
||||
CommonAppConfig.getInstance().setAnchorFansMedal(obj.getString("levelfans"));
|
||||
SpUtil.getInstance().setStringValue(SpUtil.CONFIG, info[0]);
|
||||
if (commonCallback != null) {
|
||||
commonCallback.callback(null);
|
||||
commonCallback.callback(bean);
|
||||
}
|
||||
if (obj.containsKey("is_chat")) {
|
||||
IMLoginManager.get(context).initChat(String.valueOf(obj.getInteger("is_chat")));
|
||||
}
|
||||
if (obj.containsKey("levelfans")) {
|
||||
JSONArray levelArray = obj.getJSONArray("levelfans");
|
||||
new NewLevelManager(context).upDataFansLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("level_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("level_new");
|
||||
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("levelanchor_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("levelanchor_new");
|
||||
new NewLevelManager(context).UpAnchorDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("liveclass")) {//缓存直播间分类
|
||||
JSONArray levelArray = obj.getJSONArray("liveclass");
|
||||
new LiveClassManager(context).UpDataLiveClass(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("apk_ver")) {
|
||||
APKManager.get().setApkVer(obj.getString("apk_ver"));
|
||||
}
|
||||
if (obj.containsKey("apk_url")) {
|
||||
APKManager.get().setAPKUrl(obj.getString("apk_url"));
|
||||
}
|
||||
if (obj.containsKey("apk_des")) {
|
||||
APKManager.get().setAPKDes(obj.getString("apk_des"));
|
||||
}
|
||||
if (obj.containsKey("google_isup")) {
|
||||
APKManager.get().setAPKGoogleIsUp(obj.getInteger("google_isup"));
|
||||
}
|
||||
if (obj.containsKey("isup")) {
|
||||
APKManager.get().setAPKIsUp(obj.getInteger("isup"));
|
||||
}
|
||||
if (obj.containsKey("clarity")) {
|
||||
IMLoginManager.get(context).setClarity(obj.getString("clarity"));
|
||||
}
|
||||
if (obj.containsKey("defaultBubbleUrl")) {
|
||||
IMLoginManager.get(context).setDefaultBubbleUrl(obj.getString("defaultBubbleUrl"));
|
||||
}
|
||||
if (obj.containsKey("gift_quantity")) {
|
||||
JSONArray giftQuantity = obj.getJSONArray("gift_quantity");
|
||||
new GiftQuantityManager(context).UpGiftQuantity(giftQuantity.toJSONString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||
}
|
||||
});
|
||||
} else if (code == 1000) {
|
||||
new DialogUitl.Builder(context).setContent(msg).setCancelable(false).setClickCallback3(new DialogUitl.SimpleCallback3() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog) {
|
||||
AppManager.getInstance().AppExit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
AppManager.getInstance().AppExit();
|
||||
}
|
||||
}).build().show();
|
||||
} else {
|
||||
ToastUtil.show(context.getString(R.string.net_error) + "code:" + code + " msg:" + msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
if (commonCallback != null) {
|
||||
commonCallback.callback(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -280,20 +269,18 @@ public class CommonHttpUtil {
|
||||
* QQ登录的时候 获取unionID 与PC端互通的时候用
|
||||
*/
|
||||
public static void getQQLoginUnionID(String accessToken, final CommonCallback<String> commonCallback) {
|
||||
OkGo.<String>get("https://graph.qq.com/oauth2.0/me?access_token=" + accessToken + "&unionid=1")
|
||||
.tag(CommonHttpConsts.GET_QQ_LOGIN_UNION_ID)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(Response<String> response) {
|
||||
if (commonCallback != null) {
|
||||
String data = response.body();
|
||||
data = data.substring(data.indexOf("{"), data.lastIndexOf("}") + 1);
|
||||
L.e("getQQLoginUnionID------>" + data);
|
||||
JSONObject obj = JSON.parseObject(data);
|
||||
commonCallback.callback(obj.getString("unionid"));
|
||||
}
|
||||
}
|
||||
});
|
||||
OkGo.<String>get("https://graph.qq.com/oauth2.0/me?access_token=" + accessToken + "&unionid=1").tag(CommonHttpConsts.GET_QQ_LOGIN_UNION_ID).execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(Response<String> response) {
|
||||
if (commonCallback != null) {
|
||||
String data = response.body();
|
||||
data = data.substring(data.indexOf("{"), data.lastIndexOf("}") + 1);
|
||||
L.e("getQQLoginUnionID------>" + data);
|
||||
JSONObject obj = JSON.parseObject(data);
|
||||
commonCallback.callback(obj.getString("unionid"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -312,13 +299,11 @@ public class CommonHttpUtil {
|
||||
ToastUtil.show(WordUtil.getString(R.string.cannot_follow_self));
|
||||
return;
|
||||
}
|
||||
HttpClient.getInstance().get("User.setAttents", tag)
|
||||
.params("touid", touid)
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0 || code == 1001) {
|
||||
int isAttention = JSON.parseObject(info[0]).getIntValue("isattent");//1是 关注 0是未关注
|
||||
HttpClient.getInstance().get("User.setAttents", tag).params("touid", touid).execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0 || code == 1001) {
|
||||
int isAttention = JSON.parseObject(info[0]).getIntValue("isattent");//1是 关注 0是未关注
|
||||
/* if (code == 1001) {
|
||||
if (WordUtil.isNewZh()) {
|
||||
ToastUtil.show("粉絲團等級已清零,待領取獎勵已自動領取至【個性裝扮】");
|
||||
@@ -326,13 +311,13 @@ public class CommonHttpUtil {
|
||||
ToastUtil.show("The level of the fan club has been cleared, and the rewards to be claimed have been automatically received to [Personalized Dressing]");
|
||||
}
|
||||
}*/
|
||||
EventBus.getDefault().post(new FollowEvent(touid, isAttention));
|
||||
if (callback != null) {
|
||||
callback.callback(isAttention);
|
||||
}
|
||||
}
|
||||
EventBus.getDefault().post(new FollowEvent(touid, isAttention));
|
||||
if (callback != null) {
|
||||
callback.callback(isAttention);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -340,15 +325,14 @@ public class CommonHttpUtil {
|
||||
*/
|
||||
public static void getBalance(HttpCallback callback) {
|
||||
String isGoogle;
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
isGoogle = "1";
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
isGoogle = "2";
|
||||
} else {
|
||||
isGoogle = "-1";
|
||||
}
|
||||
HttpClient.getInstance().get("User.getBalance", CommonHttpConsts.GET_BALANCE)
|
||||
.params("type", 0)
|
||||
.params("isGooglePay", isGoogle)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get("User.getBalance", CommonHttpConsts.GET_BALANCE).params("type", 0).params("isGooglePay", isGoogle).execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -357,8 +341,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getAliOrder(String parmas, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_ALI_ORDER)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_ALI_ORDER).execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -367,8 +350,7 @@ public class CommonHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getWxOrder(String parmas, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_WX_ORDER)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_WX_ORDER).execute(callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -379,8 +361,7 @@ public class CommonHttpUtil {
|
||||
*/
|
||||
|
||||
public static void getCashierOrder(String parmas, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_CASHIER_ORDER)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_CASHIER_ORDER).execute(callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -392,8 +373,7 @@ public class CommonHttpUtil {
|
||||
|
||||
|
||||
public static void getWxH5Order(String parmas, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_WX_H5ORDER)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(parmas, CommonHttpConsts.GET_WX_H5ORDER).execute(callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -401,8 +381,7 @@ public class CommonHttpUtil {
|
||||
* 检查token是否失效
|
||||
*/
|
||||
public static void checkTokenInvalid() {
|
||||
HttpClient.getInstance().get("User.ifToken", CommonHttpConsts.CHECK_TOKEN_INVALID)
|
||||
.execute(NO_CALLBACK);
|
||||
HttpClient.getInstance().get("User.ifToken", CommonHttpConsts.CHECK_TOKEN_INVALID).execute(NO_CALLBACK);
|
||||
}
|
||||
|
||||
|
||||
@@ -410,32 +389,15 @@ public class CommonHttpUtil {
|
||||
* 谷歌支付成功后,通知自己服务器
|
||||
*/
|
||||
public static void notifyMeGoogle(String purchaseToken, String productId, String orderno, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE)
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("productId", productId)
|
||||
.params("orderno", orderno)
|
||||
.params("package_name", "com.pdlive.shayu")
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE).params("purchaseToken", purchaseToken).params("productId", productId).params("orderno", orderno).params("package_name", "com.pdlive.shayu").execute(callback);
|
||||
}
|
||||
|
||||
public static void notifyGoogle(String purchaseToken, String orderNo, String tradeNo, String allData, String gps_adid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE)
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("allData", allData)
|
||||
.params("gps_adid", gps_adid)
|
||||
.params("package_name", "com.pdlive.shayu")
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE).params("purchaseToken", purchaseToken).params("orderno", orderNo).params("trade_no", tradeNo).params("allData", allData).params("gps_adid", gps_adid).params("package_name", "com.pdlive.shayu").execute(callback);
|
||||
}
|
||||
|
||||
public static void Google_sec_pay(String purchaseToken, String orderNo, String tradeNo, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Charge.Google_sec_pay", "Charge.Google_sec_pay")
|
||||
.params("purchaseToken", purchaseToken)
|
||||
.params("orderno", orderNo)
|
||||
.params("trade_no", tradeNo)
|
||||
.params("package_name", "com.pdlive.shayu")
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get("Charge.Google_sec_pay", "Charge.Google_sec_pay").params("purchaseToken", purchaseToken).params("orderno", orderNo).params("trade_no", tradeNo).params("package_name", "com.pdlive.shayu").execute(callback);
|
||||
}
|
||||
|
||||
//不做任何操作的HttpCallback
|
||||
@@ -452,20 +414,9 @@ public class CommonHttpUtil {
|
||||
public static void setCommunityReport(String community_type, String comment_id, String dynamic_id, String content, File file1, File file2, File file3, String report_type, HttpCallback callback) {
|
||||
PostRequest<JsonBean> request;
|
||||
if ("2".equals(community_type)) {
|
||||
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT)
|
||||
.isMultipart(true)
|
||||
.params("dynamic_id", dynamic_id)
|
||||
.params("report_type", report_type)
|
||||
.params("content", content)
|
||||
.params("community_type", community_type)
|
||||
.params("comment_id", comment_id);
|
||||
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT).isMultipart(true).params("dynamic_id", dynamic_id).params("report_type", report_type).params("content", content).params("community_type", community_type).params("comment_id", comment_id);
|
||||
} else {
|
||||
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT)
|
||||
.isMultipart(true)
|
||||
.params("dynamic_id", dynamic_id)
|
||||
.params("report_type", report_type)
|
||||
.params("content", content)
|
||||
.params("community_type", community_type);
|
||||
request = HttpClient.getInstance().post(CommonHttpConsts.COMMUNITY_SETREPORT, CommonHttpConsts.COMMUNITY_SETREPORT).isMultipart(true).params("dynamic_id", dynamic_id).params("report_type", report_type).params("content", content).params("community_type", community_type);
|
||||
}
|
||||
if (file1 != null) {
|
||||
request.params("file1", file1);
|
||||
@@ -483,9 +434,7 @@ public class CommonHttpUtil {
|
||||
* 用户个人主页信息
|
||||
*/
|
||||
public static void getUserBaseinfo(String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO).params("touid", touid).execute(callback);
|
||||
}
|
||||
//
|
||||
// //埋点唯一性
|
||||
|
||||
@@ -350,7 +350,11 @@ public class LiveHttpUtil {
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void getContactMsg(int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getContactMsg", "getContactMsg")
|
||||
.params("p", page)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众跟主播连麦时,获取自己的流地址
|
||||
@@ -970,13 +974,34 @@ public class LiveHttpUtil {
|
||||
|
||||
}
|
||||
|
||||
public static void getRoomList(String sudGameId, String threshold, String roomHolderType, String liveUid,int page,HttpCallback callback ) {
|
||||
public static void getRoomList(String sudGameId, String threshold, String roomHolderType, String liveUid, String currencyType, int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Sudgameserver.getRoomList", "Sudgameserver.getRoomList")
|
||||
.params("sud_game_id",sudGameId)
|
||||
.params("threshold",threshold)
|
||||
.params("room_holder_type",roomHolderType)
|
||||
.params("liveuid",liveUid)
|
||||
.params("page",page)
|
||||
.params("sud_game_id", sudGameId)
|
||||
.params("threshold", threshold)
|
||||
.params("room_holder_type", roomHolderType)
|
||||
.params("liveuid", liveUid)
|
||||
.params("currency_type ", currencyType)
|
||||
.params("page", page)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戲記錄
|
||||
*
|
||||
* @param sudGameId sud_game_id 游戏ID
|
||||
* @param currencyType currency_type 游戏货币类型 3=>金豆 2=>星币 0=>星币
|
||||
* @param dateType date_type 时间 0=>不限 1=>今日 2=>7日内 3=>30日内
|
||||
* @param page
|
||||
* @param callback
|
||||
*/
|
||||
public static void gameRecord(String sudGameId, String currencyType, String dateType, int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Sudgameserver.gameRecord", "Sudgameserver.gameRecord")
|
||||
.params("sud_game_id", sudGameId)
|
||||
.params("currency_type", currencyType)
|
||||
.params("date_type", dateType)
|
||||
.params("page", page)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,10 +5,14 @@ import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.ContributeModel;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.DiscountsModel;
|
||||
@@ -30,6 +34,7 @@ import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
@@ -46,6 +51,7 @@ import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
import com.yunbao.common.bean.QuickGiftSendGiftModel;
|
||||
import com.yunbao.common.bean.RandomPkUserBean;
|
||||
import com.yunbao.common.bean.RankPkInfoBean;
|
||||
import com.yunbao.common.bean.RedPacketDetailsBean;
|
||||
@@ -63,6 +69,7 @@ import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
import com.yunbao.common.bean.WishListGiftConfModel;
|
||||
import com.yunbao.common.bean.WishListModel;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -552,7 +559,7 @@ public interface PDLiveApi {
|
||||
/**
|
||||
* 机器人删除话术
|
||||
*/
|
||||
@GET("/api/public/?service=Live.delAiAutomaticSpeech ")
|
||||
@GET("/api/public/?service=Live.delAiAutomaticSpeech")
|
||||
Observable<ResponseModel<List<String>>> delAiAutomaticSpeech(
|
||||
@Query("type") String type,
|
||||
@Query("id") String id
|
||||
@@ -660,7 +667,9 @@ public interface PDLiveApi {
|
||||
* 获取收件箱信息
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getContactMsg")
|
||||
Observable<ResponseModel<List<LiveUserMailBoxModel>>> getContactMsg();
|
||||
Observable<ResponseModel<List<LiveUserMailBoxModel>>> getContactMsg(
|
||||
@Query("p") int page
|
||||
);
|
||||
|
||||
/**
|
||||
* 删除联系方式信件
|
||||
@@ -996,6 +1005,7 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<CreateSudRoomModel>> createSudRoom(
|
||||
@Query("room_name") String roomName,
|
||||
@Query("golden_bean_number") String goldenBeanNumber,
|
||||
@Query("currency_type") String currencyType,
|
||||
@Query("game_id") String gameId);
|
||||
|
||||
/**
|
||||
@@ -1009,6 +1019,7 @@ public interface PDLiveApi {
|
||||
@Query("threshold") String threshold,
|
||||
@Query("room_holder_type") String roomHolderType,
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("currency_type") String currencyType,
|
||||
@Query("page") int page
|
||||
);
|
||||
|
||||
@@ -1022,6 +1033,7 @@ public interface PDLiveApi {
|
||||
@Query("room_holder_type") String roomHolderType,
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("search") String search,
|
||||
@Query("currency_type") String currencyType,
|
||||
@Query("page") int page
|
||||
);
|
||||
|
||||
@@ -1048,5 +1060,79 @@ public interface PDLiveApi {
|
||||
@GET("/api/public/?service=Home.activityPopup")
|
||||
Observable<ResponseModel<List<OpenAdModel>>> activityPopup();
|
||||
|
||||
@GET("/api/public/?service=Sudgameserver.gameStartCheckRemainingBalance")
|
||||
Observable<ResponseModel<CheckRemainingBalance>> gameStartCheckRemainingBalance(
|
||||
@Query("mg_id") String mgId,
|
||||
@Query("room_id") String roomId
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Sudgameserver.deductMoney")
|
||||
Observable<ResponseModel<Object>> deductMoney(
|
||||
@Query("room_id") String roomId
|
||||
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Sudgameserver.checkCurrency")
|
||||
Observable<ResponseModel<CheckCurrencyModel>> checkCurrency(
|
||||
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Quickgift.sendGift")
|
||||
Observable<ResponseModel<QuickGiftSendGiftModel>> quickGiftSendGift(
|
||||
@Query("quick_gift_number") String quickGiftNumber,
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("stream") String stream
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Quickgift.viewingDurationGetGift")
|
||||
Observable<ResponseModel<QuickGiftSendGiftModel>> viewingDurationGetGift(
|
||||
@Query("liveuid") String liveUid
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=cool.config")
|
||||
Observable<ResponseModel<CoolConfig>> getCoolConfig();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/api/public/?service=cool.buy_ticket")
|
||||
Observable<ResponseModel<Object>> buyTicket(
|
||||
@Field("quantity") String quantity
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Livebattlepass.upgradesBattlePass")
|
||||
Observable<ResponseModel<Object>> upgradesBattlePass(@Query("battle_pass_type_id") String battlePassTypeId);
|
||||
|
||||
@GET("/api/public/?service=Livebattlepass.buyingExperiencePoint")
|
||||
Observable<ResponseModel<Object>> buyingExperiencePoint(@Query("exp_count") String expCount);
|
||||
|
||||
/**
|
||||
* battle_pass_points_id => 兑换列表ID
|
||||
* count => 兑换物品的数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Livebattlepass.pointsExchange")
|
||||
Observable<ResponseModel<Object>> pointsExchange(
|
||||
@Query("battle_pass_points_id") String battlePassPointsId,
|
||||
@Query("count") String count
|
||||
);
|
||||
@GET("/api/public/?service=Livebattlepass.getBattlePassUserInfo")
|
||||
Observable<ResponseModel<BattlePassUserInfoBean>> getBattlePassUserInfo();
|
||||
|
||||
@GET("/api/public/?service=Livebattlepass.getLiveBattlePassRewards")
|
||||
Observable<ResponseModel<LiveBattlePassRewardsBean>> getLiveBattlePassRewards();
|
||||
@GET("/api/public/?service=Livebattlepass.getRewards")
|
||||
Observable<ResponseModel<List<BaseModel>>> getRewards(
|
||||
@Query("live_battle_pass_level_id")String rewardLevelId,
|
||||
@Query("live_battle_pass_rewards_id")String rewardId
|
||||
);
|
||||
@GET("/api/public/?service=Livebattlepass.getBattlePassTask")
|
||||
Observable<ResponseModel<BattlePassTask>> getBattlePassTask();
|
||||
@GET("/api/public/?service=Livebattlepass.getTask")
|
||||
Observable<ResponseModel<List<BaseModel>>> getTask(@Query("task_id")String taskId);
|
||||
@GET("/api/public/?service=Livebattlepass.getBattlePassPoints")
|
||||
Observable<ResponseModel<List<BattlePassPoints>>> getBattlePassPoints();
|
||||
@GET("/api/public/?service=Livebattlepass.battlePassRule")
|
||||
Observable<ResponseModel<String>> battlePassRule();
|
||||
@GET("/api/public/?service=Livebattlepass.addChatCount")
|
||||
Observable<ResponseModel<List<BaseModel>>> addChatCount();
|
||||
}
|
||||
|
||||
@@ -8,9 +8,13 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.DiscountsModel;
|
||||
@@ -30,6 +34,7 @@ import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
@@ -44,6 +49,7 @@ import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
import com.yunbao.common.bean.QuickGiftSendGiftModel;
|
||||
import com.yunbao.common.bean.RandomPkUserBean;
|
||||
import com.yunbao.common.bean.RankPkInfoBean;
|
||||
import com.yunbao.common.bean.RedPacketDetailsBean;
|
||||
@@ -59,10 +65,12 @@ import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
import com.yunbao.common.bean.WishListGiftConfModel;
|
||||
import com.yunbao.common.bean.WishListModel;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.CheckLiveCallBack;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -1259,20 +1267,25 @@ public class LiveNetManager {
|
||||
*
|
||||
* @param callback 回调
|
||||
*/
|
||||
public void getContactMsg(HttpCallback<List<LiveUserMailBoxModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getContactMsg()
|
||||
private Disposable contactMsgApi;
|
||||
|
||||
public synchronized void getContactMsg(int page, HttpCallback<List<LiveUserMailBoxModel>> callback) {
|
||||
contactMsgApi = API.get().pdLiveApi(mContext)
|
||||
.getContactMsg(page)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
contactMsgApi = null;
|
||||
}, throwable -> {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
contactMsgApi = null;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2243,9 +2256,9 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void createSudRoom(String roomName, String goldenBeanNumber, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
||||
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createSudRoom(roomName, goldenBeanNumber, gameId)
|
||||
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {
|
||||
@@ -2314,9 +2327,239 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getRoomList(String sudGameId, String threshold, String roomHolderType, String liveUid, int page, HttpCallback<List<SudRoomListModel>> callback) {
|
||||
public void deductMoney(String roomId) {
|
||||
// API.get().pdLiveApi(mContext)
|
||||
// .deductMoney(roomId)
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
// @Override
|
||||
// public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
//
|
||||
// }
|
||||
// }, new Consumer<Throwable>() {
|
||||
// @Override
|
||||
// public void accept(Throwable throwable) throws Exception {
|
||||
//
|
||||
// }
|
||||
// }).isDisposed();
|
||||
}
|
||||
|
||||
public void checkCurrency(HttpCallback<CheckCurrencyModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getRoomList(sudGameId, threshold, roomHolderType, liveUid, page)
|
||||
.checkCurrency()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CheckCurrencyModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CheckCurrencyModel> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(objectResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void gameStartCheckRemainingBalance(String mgId, String roomId, HttpCallback<CheckRemainingBalance> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.gameStartCheckRemainingBalance(mgId, roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CheckRemainingBalance>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CheckRemainingBalance> createSudRoomModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
if (createSudRoomModelResponseModel.getData().getInfo().getStatus() == 1) {
|
||||
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
||||
} else {
|
||||
callback.onError(createSudRoomModelResponseModel.getData().getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
|
||||
callback.onError(WordUtil.isNewZh() ? "金豆不够" : "Insufficient money ");
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void viewingDurationGetGift(String liveUid, HttpCallback<QuickGiftSendGiftModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.viewingDurationGetGift(liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<QuickGiftSendGiftModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<QuickGiftSendGiftModel> quickGiftSendGiftModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(quickGiftSendGiftModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getCoolConfig(HttpCallback<CoolConfig> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getCoolConfig()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CoolConfig>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CoolConfig> coolConfigResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(coolConfigResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
|
||||
}
|
||||
|
||||
public void buyTicket(String quantity, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.buyTicket(quantity)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
if (objectResponseModel.getData().getCode() == 200) {
|
||||
callback.onSuccess("1");
|
||||
} else if (objectResponseModel.getData().getCode() == 500) {
|
||||
callback.onSuccess("2");
|
||||
} else {
|
||||
callback.onError(objectResponseModel.getData().getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void pointsExchange(String battlePassPointsId, String count, HttpCallback<ResponseModel<Object>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.pointsExchange(battlePassPointsId, count)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(objectResponseModel);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void buyingExperiencePoint(String expCount, HttpCallback<ResponseModel<Object>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.buyingExperiencePoint(expCount)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(objectResponseModel);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void upgradesBattlePass(String battlePassTypeId, HttpCallback<ResponseModel<Object>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.upgradesBattlePass(battlePassTypeId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(objectResponseModel);
|
||||
}
|
||||
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void quickGiftSendGift(String quickGiftNumber, String liveUid, String stream, HttpCallback<QuickGiftSendGiftModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.quickGiftSendGift(quickGiftNumber, liveUid, stream)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<QuickGiftSendGiftModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<QuickGiftSendGiftModel> quickGiftSendGiftModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(quickGiftSendGiftModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getRoomList(String sudGameId, String threshold, String roomHolderType, String liveUid, String currencyType, int page, HttpCallback<List<SudRoomListModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getRoomList(sudGameId, threshold, roomHolderType, liveUid, currencyType, page)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<SudRoomListModel>>>() {
|
||||
@@ -2336,9 +2579,9 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void searchRoomList(String sudGameId, String threshold, String roomHolderType, String search, int page, HttpCallback<List<SudRoomListModel>> callback) {
|
||||
public void searchRoomList(String sudGameId, String threshold, String roomHolderType, String search, String currencyType, int page, HttpCallback<List<SudRoomListModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.searchRoomList(sudGameId, threshold, roomHolderType, "0", search, page)
|
||||
.searchRoomList(sudGameId, threshold, roomHolderType, "0", search, currencyType, page)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<SudRoomListModel>>>() {
|
||||
@@ -2382,6 +2625,170 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getBattlePassUserInfo(HttpCallback<BattlePassUserInfoBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getBattlePassUserInfo()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getLiveBattlePassRewards(HttpCallback<LiveBattlePassRewardsBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveBattlePassRewards()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getRewards(String rewardLevelId, String rewardId, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getRewards(rewardLevelId, rewardId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getBattlePassTask(HttpCallback<BattlePassTask> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getBattlePassTask()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getBattlePassTaskOver(String taskId, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getTask(taskId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getBattlePassPoints(HttpCallback<List<BattlePassPoints>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getBattlePassPoints()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getBattlePassRule(HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.battlePassRule()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void addChatCount(HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.addChatCount()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
@@ -2395,5 +2802,8 @@ public class LiveNetManager {
|
||||
if (randomPkApi != null) {
|
||||
randomPkApi.dispose();
|
||||
}
|
||||
if (contactMsgApi != null) {
|
||||
contactMsgApi.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,14 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
}
|
||||
|
||||
public boolean getRedPoint() {
|
||||
return !TextUtils.isEmpty(getString("RedPoint")) && !TextUtils.equals(getString("RedPoint"), "1");
|
||||
return !TextUtils.isEmpty(getString("RedPoint")) || !TextUtils.equals(getString("RedPoint"), "1");
|
||||
}
|
||||
public void setQuickGiftIfFirst() {
|
||||
put("quick_gift_if_first", "1");
|
||||
}
|
||||
|
||||
public boolean getQuickGiftIfFirst() {
|
||||
return TextUtils.isEmpty(getString("quick_gift_if_first")) || !TextUtils.equals(getString("quick_gift_if_first"), "1");
|
||||
}
|
||||
|
||||
public void setSudGameMin() {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.yunbao.common.bean.LiveClassBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -36,7 +37,30 @@ public class LiveClassManager extends BaseCacheManager {
|
||||
* @return
|
||||
*/
|
||||
public List<LiveClassBean> getLiveClass() {
|
||||
return getList(KEY_LIVE_CLASS, new TypeToken<List<LiveClassBean>>() {
|
||||
List<LiveClassBean> liveModels = new ArrayList<>();
|
||||
List<LiveClassBean> liveClassBeans = getList(KEY_LIVE_CLASS, new TypeToken<List<LiveClassBean>>() {
|
||||
}.getType());
|
||||
if (WordUtil.isNewZh()) {
|
||||
for (int i = 0; i < liveClassBeans.size(); i++) {
|
||||
if (TextUtils.equals(liveClassBeans.get(i).getEnglish(), "Hot") || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "hot") || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "熱門")) {
|
||||
liveModels.add(0, liveClassBeans.get(i));
|
||||
} else {
|
||||
liveModels.add(liveClassBeans.get(i));
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < liveClassBeans.size(); i++) {
|
||||
if (TextUtils.equals(liveClassBeans.get(i).getEnglish(), "English") || TextUtils.equals(liveClassBeans.get(i).getEnglish(), "english")
|
||||
|| TextUtils.equals(liveClassBeans.get(i).getEnglish(), "英語")) {
|
||||
liveModels.add(0, liveClassBeans.get(i));
|
||||
} else {
|
||||
liveModels.add(liveClassBeans.get(i));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return liveModels;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import com.yunbao.common.dialog.OpenAdBottomDialogPopup;
|
||||
import com.yunbao.common.dialog.OpenAdCenterDialogPopup;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -81,18 +83,34 @@ public class OpenAdManager {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private static long showTime=0;
|
||||
public synchronized void show(int type, boolean isGuard) {
|
||||
if (list == null) {
|
||||
init(true);
|
||||
return;
|
||||
}
|
||||
if(System.currentTimeMillis()-showTime<100){
|
||||
return;
|
||||
}
|
||||
showTime=System.currentTimeMillis();
|
||||
showType = type;
|
||||
for (OpenAdModel model : list) {
|
||||
if (model.getType() == type) {
|
||||
if (type == OpenAdModel.TYPE_LIVE && !model.userIsPermission(isGuard)) {
|
||||
continue;
|
||||
}
|
||||
if (model.getShowModel() == OpenAdModel.SHOW_ONE) {
|
||||
if (SpUtil.getInstance().getBooleanValue("open_ad_popup_" + model.getId())) {
|
||||
continue;
|
||||
}
|
||||
SpUtil.getInstance().setBooleanValue("open_ad_popup_" + model.getId(), true);
|
||||
}
|
||||
if (model.getShowModel() == OpenAdModel.SHOW_DIY) {
|
||||
String value = SpUtil.getStringValue("open_ad_popup_time_" + model.getId());
|
||||
if (!StringUtil.isEmpty(value) && System.currentTimeMillis() < Long.parseLong(value)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (runnableMap.containsKey(model.getId())) {
|
||||
AdRunnable runnable = runnableMap.get(model.getId());
|
||||
if (runnable != null) {
|
||||
@@ -165,7 +183,16 @@ public class OpenAdManager {
|
||||
if (model.getType() != showType) {
|
||||
return;
|
||||
}
|
||||
if(isShow(model)){
|
||||
Log.i(TAG,"展示过:"+model);
|
||||
return;
|
||||
}
|
||||
showMap.put(model.getId(), true);
|
||||
if (model.getShowModel() == OpenAdModel.SHOW_DIY) {
|
||||
String nextTime= String.valueOf(System.currentTimeMillis() + (Long.parseLong(model.getSection()) * 60 * 1000));
|
||||
SpUtil.setStringValue("open_ad_popup_time_" + model.getId(), nextTime);
|
||||
showMap.remove(model.getId());
|
||||
}
|
||||
if (model.getModel() == OpenAdModel.MODEL_BOTTOM) {
|
||||
new OpenAdBottomDialogPopup(CommonAppContext.getTopActivity(), model).setListener((bean, position) -> {
|
||||
}).showDialog();
|
||||
|
||||
@@ -4,12 +4,8 @@ import android.app.Activity;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
import com.android.billingclient.api.SkuDetails;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
@@ -19,16 +15,12 @@ import com.yunbao.common.event.CoinChangeEvent;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.pay.wx.WxPayBuilder;
|
||||
import com.yunbao.common.utils.GoogleBillingUtil;
|
||||
import com.yunbao.common.utils.OnGoogleBillingListener;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/22.
|
||||
@@ -48,7 +40,7 @@ public class PayPresenter {
|
||||
private PayCallback mPayCallback;
|
||||
|
||||
|
||||
private GoogleBillingUtil googleBillingUtil;
|
||||
//private GoogleBillingUtil googleBillingUtil;
|
||||
private String TAG = "PayPresenter";
|
||||
private String[] arrPro = {"1"};
|
||||
private String mOrderid;
|
||||
@@ -174,12 +166,12 @@ public class PayPresenter {
|
||||
}
|
||||
|
||||
private void initGooglePay() {
|
||||
GoogleBillingUtil.isDebug(true);
|
||||
/*GoogleBillingUtil.isDebug(true);
|
||||
GoogleBillingUtil.setSkus(arrPro, null);
|
||||
GoogleBillingUtil.setIsAutoAcknowledgePurchase(true);//设置自动确认购买
|
||||
googleBillingUtil = GoogleBillingUtil.getInstance()
|
||||
.addOnGoogleBillingListener(mActivity, mOnMyGoogleBillingListener)
|
||||
.build(mActivity);
|
||||
.build(mActivity);*/
|
||||
}
|
||||
|
||||
private void paypalPay(String orderParams) {
|
||||
@@ -370,125 +362,10 @@ public class PayPresenter {
|
||||
}
|
||||
|
||||
|
||||
private OnGoogleBillingListener mOnMyGoogleBillingListener = new OnGoogleBillingListener() {
|
||||
@Override
|
||||
public void onSetupSuccess(boolean isSelf) {
|
||||
super.onSetupSuccess(isSelf);
|
||||
Log.d(TAG, "内购服务初始化完成");
|
||||
checkSubs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQuerySuccess(@NonNull String skuType, @NonNull List<SkuDetails> list, boolean isSelf) {
|
||||
// if(!isSelf) return;
|
||||
// StringBuffer tempBuffer =new StringBuffer();
|
||||
// tempBuffer.append("查询商品信息成功,数量=" + list.size() + "\n");
|
||||
// Log.d(TAG,tempBuffer.toString());
|
||||
// if (list.size()<=0){
|
||||
// ToastUtil.show("商品金额过大,无法支付");
|
||||
// return;
|
||||
// }
|
||||
// for(int i=0;i<list.size();i++){
|
||||
// String details = String.format(Locale.getDefault(),"%s , %s",
|
||||
// list.get(i).getSku(),list.get(i).getPrice()
|
||||
// );
|
||||
// tempBuffer.append(details);
|
||||
// if(i!=list.size()-1){
|
||||
// tempBuffer.append("\n");
|
||||
// }
|
||||
// }
|
||||
// googleBillingUtil.purchaseInApp(mActivity,"zs640");
|
||||
|
||||
googleBillingUtil.purchaseInApp(mActivity, googleBillingUtil.getInAppSkuByPosition(0));
|
||||
|
||||
// Log.d(TAG,tempBuffer.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPurchaseSuccess(@NonNull Purchase purchase, boolean isSelf) {
|
||||
StringBuffer tempBuffer = new StringBuffer();
|
||||
if (purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) {
|
||||
tempBuffer.append("购买成功:");
|
||||
//通知自己服务器
|
||||
if (mOrderid == null || purchase.getOrderId() == null) {
|
||||
return false;
|
||||
}
|
||||
String allData = "";
|
||||
allData = "OrderId=" + purchase.getOrderId() +
|
||||
",PackageName=" + purchase.getPackageName() +
|
||||
",Sku=" + "purchase.getSku()" +
|
||||
",PurchaseTime=" + purchase.getPurchaseTime() +
|
||||
",PurchaseToken=" + purchase.getPurchaseToken() +
|
||||
",DeveloperPayload=" + purchase.getDeveloperPayload() +
|
||||
",OriginalJson=" + purchase.getOriginalJson() +
|
||||
",PurchaseState=" + purchase.getPurchaseState() +
|
||||
",Signature=" + purchase.getSignature();
|
||||
// CommonHttpUtil.notifyGoogle("1",mOrderid,purchase.getOrderId(),allData, new HttpCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(int code, String msg, String[] info) {
|
||||
// if(code==0){
|
||||
// try {
|
||||
// ToastUtil.show("购买成功!");
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }else {
|
||||
// ToastUtil.show("购买失败,请联系客服");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
} else {
|
||||
tempBuffer.append("暂未支付:");
|
||||
}
|
||||
String details = String.format(Locale.getDefault(), "%s \n", " purchase.getSku()");
|
||||
tempBuffer.append(details);
|
||||
Log.d(TAG, tempBuffer.toString());
|
||||
return true;//自动消耗(只有当isSelf为true,并且支付状态为PURCHASED时,该值才会生效)
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onRecheck(@NonNull String skuType, @NonNull Purchase purchase, boolean isSelf) {
|
||||
StringBuffer tempBuffer = new StringBuffer();
|
||||
tempBuffer.append("检测到未处理的订单($skuType):${purchase.sku}()");
|
||||
Log.d(TAG, tempBuffer.toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBillingServiceDisconnected() {
|
||||
super.onBillingServiceDisconnected();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsumeSuccess(@NonNull String purchaseToken, boolean isSelf) {
|
||||
Log.d(TAG, "消耗商品成功:$purchaseToken");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAcknowledgePurchaseSuccess(boolean isSelf) {
|
||||
Log.d(TAG, "确认购买商品成功");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, int responseCode, boolean isSelf) {
|
||||
Log.d(TAG, "操作失败:tag=${" + tag.name() + "responseCode=" + responseCode);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, boolean isSelf) {
|
||||
Log.d(TAG, "发生错误:tag=" + tag.name());
|
||||
}
|
||||
|
||||
};
|
||||
//private OnGoogleBillingListener mOnMyGoogleBillingListener = null;
|
||||
|
||||
private void checkSubs() {
|
||||
int size = googleBillingUtil.getPurchasesSizeSubs(mActivity);
|
||||
/*int size = googleBillingUtil.getPurchasesSizeSubs(mActivity);
|
||||
switch (size) {
|
||||
case 0:
|
||||
//不具备有效订阅
|
||||
@@ -502,18 +379,18 @@ public class PayPresenter {
|
||||
//具有有效订阅
|
||||
Log.d(TAG, "有效订阅数:$size(具备有效订阅)");
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public void release() {
|
||||
mActivity = null;
|
||||
mPayCallback = null;
|
||||
|
||||
if (googleBillingUtil != null) {
|
||||
/*if (googleBillingUtil != null) {
|
||||
googleBillingUtil.onDestroy(mActivity);
|
||||
//退出程序的时候可以调用(实验性)
|
||||
GoogleBillingUtil.endConnection();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
62
common/src/main/java/com/yunbao/common/pay/hw/HwBuilder.java
Normal file
62
common/src/main/java/com/yunbao/common/pay/hw/HwBuilder.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.yunbao.common.pay.hw;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
/**
|
||||
* 华为支付
|
||||
*/
|
||||
public class HwBuilder {
|
||||
|
||||
private Activity mActivity;
|
||||
|
||||
public HwBuilder(Activity activity) {
|
||||
mActivity = activity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付
|
||||
*/
|
||||
public void pay(String changeid) {
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_huawei.utils.HuaWeiPayManage");
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
invite.getClass().getMethod("pay", String.class).invoke(invite, changeid);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗所有商品
|
||||
*/
|
||||
public void consume() {
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_huawei.utils.HuaWeiPayManage");
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
invite.getClass().getMethod("consume").invoke(invite);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付结果
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public JSONObject getPayResult(Intent intent) {
|
||||
JSONObject object;
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_huawei.utils.HuaWeiPayManage");
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
object = (JSONObject) invite.getClass().getMethod("getPayResult", Intent.class).invoke(invite, intent);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return object;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import android.app.Activity;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.Toast;
|
||||
@@ -106,7 +107,7 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
||||
String appKey = getAppKey();
|
||||
boolean testEnv = isTestEnv();
|
||||
// 初始化sdk
|
||||
SudMGP.initSDK(activity, appId, appKey,testEnv, new ISudListenerInitSDK() {
|
||||
SudMGP.initSDK(activity, appId, appKey, testEnv, new ISudListenerInitSDK() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
loadGame(activity, code, gameId);
|
||||
@@ -280,6 +281,7 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
||||
@Override
|
||||
public void onGameLog(String str) {
|
||||
SudFSMMGListener.super.onGameLog(str);
|
||||
Log.e("onGameStarted", "游戏日志:" + str);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -288,6 +290,7 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
||||
*/
|
||||
@Override
|
||||
public void onGameStarted() {
|
||||
Log.e("onGameStarted", "游戏开始--------------------");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -173,11 +173,11 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
} else {
|
||||
listener.onGameMGCommonGameSettle(handle, mgCommonGameSettle);
|
||||
}
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setResults(mgCommonGameSettle.results));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE));
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: // 4. 加入游戏按钮点击状态
|
||||
SudMGPMGState.MGCommonSelfClickJoinBtn mgCommonSelfClickJoinBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickJoinBtn.class);
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSeatIndex(mgCommonSelfClickJoinBtn.seatIndex));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSeatIndex(mgCommonSelfClickJoinBtn.seatIndex).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN));
|
||||
// if (listener == null) {
|
||||
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
// } else {
|
||||
@@ -211,11 +211,12 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN: // 8. 开始游戏按钮点击状态
|
||||
SudMGPMGState.MGCommonSelfClickStartBtn mgCommonSelfClickStartBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickStartBtn.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonSelfClickStartBtn(handle, mgCommonSelfClickStartBtn);
|
||||
}
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN));
|
||||
// if (listener == null) {
|
||||
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
// } else {
|
||||
// listener.onGameMGCommonSelfClickStartBtn(handle, mgCommonSelfClickStartBtn);
|
||||
// }
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_SHARE_BTN: // 9. 分享按钮点击状态
|
||||
SudMGPMGState.MGCommonSelfClickShareBtn mgCommonSelfClickShareBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickShareBtn.class);
|
||||
@@ -226,8 +227,12 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_STATE: // 10. 游戏状态
|
||||
Log.e("onGameStateChange", "mg_common_game_state:::::" + "dataJson:::::"+dataJson);
|
||||
SudMGPMGState.MGCommonGameState mgCommonGameState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameState.class);
|
||||
sudFSMMGCache.onGameMGCommonGameState(mgCommonGameState);
|
||||
if (mgCommonGameState.gameState==2){
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
|
||||
}
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
@@ -244,11 +249,12 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN: // 12. 结算界面再来一局按钮点击状态(2021-12-27新增)
|
||||
SudMGPMGState.MGCommonSelfClickGameSettleAgainBtn mgCommonSelfClickGameSettleAgainBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickGameSettleAgainBtn.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonSelfClickGameSettleAgainBtn(handle, mgCommonSelfClickGameSettleAgainBtn);
|
||||
}
|
||||
// if (listener == null) {
|
||||
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
// } else {
|
||||
// listener.onGameMGCommonSelfClickGameSettleAgainBtn(handle, mgCommonSelfClickGameSettleAgainBtn);
|
||||
// }
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN));
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SOUND_LIST: // 13. 游戏上报游戏中的声音列表(2021-12-30新增,现在只支持碰碰我最强)
|
||||
SudMGPMGState.MGCommonGameSoundList mgCommonGameSoundList = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSoundList.class);
|
||||
@@ -815,7 +821,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
if (listener != null && listener.onPlayerStateChange(handle, userId, state, dataJson)) {
|
||||
return;
|
||||
}
|
||||
Log.e("SudFSMMGDecorator", "userId:" + userId + " state:" + state + " dataJson:" + dataJson);
|
||||
Log.e("onPlayerStateChange", "userId:" + userId + " state:" + state + " dataJson:" + dataJson);
|
||||
switch (state) {
|
||||
case SudMGPMGState.MG_COMMON_PLAYER_IN: // 1.加入状态(已修改)
|
||||
SudMGPMGState.MGCommonPlayerIn mgCommonPlayerIn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonPlayerIn.class);
|
||||
|
||||
@@ -89,13 +89,13 @@ public class SudFSTAPPDecorator {
|
||||
* @param isPlaying true 开始游戏,false 结束游戏
|
||||
* @param reportGameInfoExtras string类型,Https服务回调report_game_info参数,最大长度1024字节,超过则截断(2022-01-21)
|
||||
*/
|
||||
public void notifyAPPCommonSelfPlaying(boolean isPlaying, String reportGameInfoExtras, String reportGameInfoKey) {
|
||||
public void notifyAPPCommonSelfPlaying(boolean isPlaying) {
|
||||
ISudFSTAPP iSudFSTAPP = this.iSudFSTAPP;
|
||||
if (iSudFSTAPP != null) {
|
||||
SudMGPAPPState.APPCommonSelfPlaying state = new SudMGPAPPState.APPCommonSelfPlaying();
|
||||
state.isPlaying = isPlaying;
|
||||
state.reportGameInfoExtras = reportGameInfoExtras;
|
||||
state.reportGameInfoKey = reportGameInfoKey;
|
||||
// state.reportGameInfoExtras = deductMoneyKey;
|
||||
// state.reportGameInfoKey = reportGameInfoKey;
|
||||
iSudFSTAPP.notifyStateChange(SudMGPAPPState.APP_COMMON_SELF_PLAYING, SudJsonUtils.toJson(state), null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
/**
|
||||
@@ -15,12 +18,13 @@ public class AndroidBug5497Workaround {
|
||||
// For more information, see https://issuetracker.google.com/issues/36911528
|
||||
// To use this class, simply invoke assistActivity() on an Activity that already has its content view set.
|
||||
|
||||
public static void assistActivity (Activity activity) {
|
||||
public static void assistActivity(Activity activity) {
|
||||
new AndroidBug5497Workaround(activity);
|
||||
}
|
||||
|
||||
private View mChildOfContent;
|
||||
private int usableHeightPrevious;
|
||||
private int defHeight = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
private FrameLayout.LayoutParams frameLayoutParams;
|
||||
|
||||
private AndroidBug5497Workaround(Activity activity) {
|
||||
@@ -29,8 +33,14 @@ public class AndroidBug5497Workaround {
|
||||
mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
public void onGlobalLayout() {
|
||||
possiblyResizeChildOfContent();
|
||||
int heightDiff = mChildOfContent.getRootView().getHeight() - mChildOfContent.getHeight();
|
||||
if (heightDiff < 100) {
|
||||
frameLayoutParams.height = defHeight;
|
||||
mChildOfContent.requestLayout();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();
|
||||
}
|
||||
|
||||
@@ -39,7 +49,7 @@ public class AndroidBug5497Workaround {
|
||||
if (usableHeightNow != usableHeightPrevious) {
|
||||
int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();
|
||||
int heightDifference = usableHeightSansKeyboard - usableHeightNow;
|
||||
if (heightDifference > (usableHeightSansKeyboard/4)) {
|
||||
if (heightDifference > (usableHeightSansKeyboard / 4)) {
|
||||
// keyboard probably just became visible
|
||||
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
|
||||
} else {
|
||||
|
||||
@@ -1,926 +0,0 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.billingclient.api.AcknowledgePurchaseParams;
|
||||
import com.android.billingclient.api.AcknowledgePurchaseResponseListener;
|
||||
import com.android.billingclient.api.BillingClient;
|
||||
import com.android.billingclient.api.BillingClientStateListener;
|
||||
import com.android.billingclient.api.BillingFlowParams;
|
||||
import com.android.billingclient.api.BillingResult;
|
||||
import com.android.billingclient.api.ConsumeParams;
|
||||
import com.android.billingclient.api.ConsumeResponseListener;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
import com.android.billingclient.api.PurchaseHistoryResponseListener;
|
||||
import com.android.billingclient.api.PurchasesUpdatedListener;
|
||||
import com.android.billingclient.api.SkuDetails;
|
||||
import com.android.billingclient.api.SkuDetailsParams;
|
||||
import com.android.billingclient.api.SkuDetailsResponseListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 作者:天镜baobao
|
||||
* 时间:2019/1/5 15:16
|
||||
* 说明:允许使用,但请遵循Apache License 2.0
|
||||
* 使用:
|
||||
* Copyright 2019 天镜baobao
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@SuppressWarnings({"WeakerAccess", "unused", "UnusedReturnValue"})
|
||||
public class GoogleBillingUtil {
|
||||
|
||||
private static final String TAG = "GoogleBillingUtil";
|
||||
private static boolean IS_DEBUG = false;
|
||||
private static String[] inAppSKUS = new String[]{};//内购ID,必填,注意!如果用不着的请去掉多余的""
|
||||
private static String[] subsSKUS = new String[]{};//订阅ID,必填,注意!如果用不着的请去掉多余的""
|
||||
|
||||
public static final String BILLING_TYPE_INAPP = BillingClient.SkuType.INAPP;//内购
|
||||
public static final String BILLING_TYPE_SUBS = BillingClient.SkuType.SUBS;//订阅
|
||||
|
||||
private static BillingClient mBillingClient;
|
||||
private static BillingClient.Builder builder ;
|
||||
private static List<OnGoogleBillingListener> onGoogleBillingListenerList = new ArrayList<>();
|
||||
private static Map<String,OnGoogleBillingListener> onGoogleBillingListenerMap = new HashMap<>();
|
||||
private MyPurchasesUpdatedListener purchasesUpdatedListener = new MyPurchasesUpdatedListener();
|
||||
|
||||
private static boolean isAutoAcknowledgePurchase = true;
|
||||
|
||||
private static final GoogleBillingUtil mGoogleBillingUtil = new GoogleBillingUtil() ;
|
||||
|
||||
private GoogleBillingUtil()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//region===================================初始化google应用内购买服务=================================
|
||||
|
||||
/**
|
||||
* 设置skus
|
||||
* @param inAppSKUS 内购id
|
||||
* @param subsSKUS 订阅id
|
||||
*/
|
||||
public static void setSkus(@Nullable String[] inAppSKUS, @Nullable String[] subsSKUS){
|
||||
if(inAppSKUS!=null){
|
||||
GoogleBillingUtil.inAppSKUS = Arrays.copyOf(inAppSKUS,inAppSKUS.length);
|
||||
}
|
||||
if(subsSKUS!=null){
|
||||
GoogleBillingUtil.subsSKUS = Arrays.copyOf(subsSKUS,subsSKUS.length);
|
||||
}
|
||||
}
|
||||
|
||||
private static <T> void copyToArray(T[] base,T[] target){
|
||||
System.arraycopy(base, 0, target, 0, base.length);
|
||||
}
|
||||
|
||||
public static GoogleBillingUtil getInstance()
|
||||
{
|
||||
return mGoogleBillingUtil;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始建立内购连接
|
||||
* @param activity activity
|
||||
*/
|
||||
public GoogleBillingUtil build(Activity activity)
|
||||
{
|
||||
purchasesUpdatedListener.tag = getTag(activity);
|
||||
if(mBillingClient==null)
|
||||
{
|
||||
synchronized (mGoogleBillingUtil)
|
||||
{
|
||||
if(mBillingClient==null)
|
||||
{
|
||||
builder = BillingClient.newBuilder(activity);
|
||||
mBillingClient = builder.setListener(purchasesUpdatedListener)
|
||||
.enablePendingPurchases()
|
||||
.build();
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.setListener(purchasesUpdatedListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.setListener(purchasesUpdatedListener);
|
||||
}
|
||||
synchronized (mGoogleBillingUtil)
|
||||
{
|
||||
if(mGoogleBillingUtil.startConnection(activity))
|
||||
{
|
||||
mGoogleBillingUtil.queryInventoryInApp(getTag(activity));
|
||||
mGoogleBillingUtil.queryInventorySubs(getTag(activity));
|
||||
mGoogleBillingUtil.queryPurchasesInApp(getTag(activity));
|
||||
}
|
||||
}
|
||||
return mGoogleBillingUtil;
|
||||
}
|
||||
|
||||
public boolean startConnection(Activity activity){
|
||||
return startConnection(getTag(activity));
|
||||
}
|
||||
|
||||
private boolean startConnection(String tag)
|
||||
{
|
||||
if(mBillingClient==null)
|
||||
{
|
||||
log("初始化失败:mBillingClient==null");
|
||||
return false;
|
||||
}
|
||||
if(!mBillingClient.isReady())
|
||||
{
|
||||
mBillingClient.startConnection(new BillingClientStateListener() {
|
||||
@Override
|
||||
public void onBillingSetupFinished(BillingResult billingResult) {
|
||||
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onSetupSuccess(listener.tag.equals(tag));
|
||||
}
|
||||
queryInventoryInApp(tag);
|
||||
queryInventorySubs(tag);
|
||||
queryPurchasesInApp(tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
log("初始化失败:onSetupFail:code="+billingResult.getResponseCode());
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onFail(GoogleBillingListenerTag.SETUP,billingResult.getResponseCode(), listener.tag.equals(tag));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBillingServiceDisconnected() {
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onBillingServiceDisconnected();
|
||||
}
|
||||
log("初始化失败:onBillingServiceDisconnected");
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region===================================查询商品=================================
|
||||
|
||||
/**
|
||||
* 查询内购商品信息
|
||||
*/
|
||||
public void queryInventoryInApp(Activity activity)
|
||||
{
|
||||
queryInventoryInApp(getTag(activity));
|
||||
}
|
||||
|
||||
private void queryInventoryInApp(String tag)
|
||||
{
|
||||
queryInventory(tag, BillingClient.SkuType.INAPP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订阅商品信息
|
||||
*/
|
||||
public void queryInventorySubs(Activity activity)
|
||||
{
|
||||
queryInventory(getTag(activity), BillingClient.SkuType.SUBS);
|
||||
}
|
||||
|
||||
public void queryInventorySubs(String tag)
|
||||
{
|
||||
queryInventory(tag, BillingClient.SkuType.SUBS);
|
||||
}
|
||||
|
||||
private void queryInventory(String tag,final String skuType) {
|
||||
Runnable runnable=new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
if (mBillingClient == null)
|
||||
{
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onError(GoogleBillingListenerTag.QUERY, listener.tag.equals(tag));
|
||||
}
|
||||
return ;
|
||||
}
|
||||
ArrayList<String> skuList = new ArrayList<>();
|
||||
if(skuType.equals(BillingClient.SkuType.INAPP))
|
||||
{
|
||||
Collections.addAll(skuList, inAppSKUS);
|
||||
}
|
||||
else if(skuType.equals(BillingClient.SkuType.SUBS))
|
||||
{
|
||||
Collections.addAll(skuList, subsSKUS);
|
||||
}
|
||||
if(!skuList.isEmpty()){
|
||||
SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder();
|
||||
params.setSkusList(skuList).setType(skuType);
|
||||
mBillingClient.querySkuDetailsAsync(params.build(),new MySkuDetailsResponseListener(skuType,tag));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
executeServiceRequest(tag,runnable);
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region===================================购买商品=================================
|
||||
/**
|
||||
* 发起内购
|
||||
* @param skuId 内购商品id
|
||||
*/
|
||||
public void purchaseInApp(Activity activity, String skuId)
|
||||
{
|
||||
purchase(activity,skuId, BillingClient.SkuType.INAPP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起订阅
|
||||
* @param skuId 订阅商品id
|
||||
*/
|
||||
public void purchaseSubs(Activity activity,String skuId)
|
||||
{
|
||||
purchase(activity,skuId, BillingClient.SkuType.SUBS);
|
||||
}
|
||||
|
||||
private void purchase(Activity activity,final String skuId,final String skuType)
|
||||
{
|
||||
String tag = getTag(activity);
|
||||
if(mBillingClient==null)
|
||||
{
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onError(GoogleBillingListenerTag.PURCHASE, listener.tag.equals(tag));
|
||||
}
|
||||
return ;
|
||||
}
|
||||
if(startConnection(tag))
|
||||
{
|
||||
purchasesUpdatedListener.tag = tag;
|
||||
builder.setListener(purchasesUpdatedListener);
|
||||
List<String> skuList = new ArrayList<>();
|
||||
skuList.add(skuId);
|
||||
SkuDetailsParams skuDetailsParams = SkuDetailsParams.newBuilder()
|
||||
.setSkusList(skuList)
|
||||
.setType(skuType)
|
||||
.build();
|
||||
mBillingClient.querySkuDetailsAsync(skuDetailsParams, new SkuDetailsResponseListener() {
|
||||
@Override
|
||||
public void onSkuDetailsResponse(BillingResult billingResult, List<SkuDetails> skuDetailsList) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mBillingClient.querySkuDetailsAsync(skuDetailsParams, new SkuDetailsResponseListener() {
|
||||
@Override
|
||||
public void onSkuDetailsResponse(BillingResult billingResult, List<SkuDetails> skuDetailsList) {
|
||||
if(skuDetailsList!=null&&!skuDetailsList.isEmpty()){
|
||||
BillingFlowParams flowParams = BillingFlowParams.newBuilder()
|
||||
.setSkuDetails(skuDetailsList.get(0))
|
||||
.build();
|
||||
mBillingClient.launchBillingFlow(activity,flowParams);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onError(GoogleBillingListenerTag.PURCHASE,listener.tag.equals(tag));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//endregion
|
||||
|
||||
//region===================================消耗商品=================================
|
||||
|
||||
/**
|
||||
* 消耗商品
|
||||
* @param purchaseToken {@link Purchase#getPurchaseToken()}
|
||||
*/
|
||||
public void consumeAsync(Activity activity,String purchaseToken)
|
||||
{
|
||||
consumeAsync(getTag(activity),purchaseToken,null);
|
||||
}
|
||||
|
||||
|
||||
public void consumeAsync(Activity activity,String purchaseToken,@Nullable String developerPayload)
|
||||
{
|
||||
consumeAsync(getTag(activity),purchaseToken,developerPayload);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗商品
|
||||
* @param purchaseToken {@link Purchase#getPurchaseToken()}
|
||||
*/
|
||||
private void consumeAsync(String tag,String purchaseToken){
|
||||
consumeAsync(tag,purchaseToken,null);
|
||||
}
|
||||
|
||||
|
||||
private void consumeAsync(String tag,String purchaseToken,@Nullable String developerPayload)
|
||||
{
|
||||
if(mBillingClient==null)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
ConsumeParams consumeParams = ConsumeParams.newBuilder()
|
||||
.setPurchaseToken(purchaseToken)
|
||||
.build();
|
||||
mBillingClient.consumeAsync(consumeParams,new MyConsumeResponseListener(tag));
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗内购商品-通过sku数组
|
||||
* @param sku sku
|
||||
*/
|
||||
public void consumeAsyncInApp(Activity activity,@NonNull String... sku)
|
||||
{
|
||||
if(mBillingClient==null) {
|
||||
return ;
|
||||
}
|
||||
List<String> skuList = Arrays.asList(sku);
|
||||
consumeAsyncInApp(activity,skuList,null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗内购商品-通过sku数组
|
||||
* @param skuList sku数组
|
||||
*/
|
||||
public void consumeAsyncInApp(Activity activity,@NonNull List<String> skuList,@Nullable List<String> developerPayloadList)
|
||||
{
|
||||
if(mBillingClient==null) {
|
||||
return ;
|
||||
}
|
||||
List<Purchase> purchaseList = queryPurchasesInApp(activity);
|
||||
if(purchaseList!=null){
|
||||
for(Purchase purchase : purchaseList){
|
||||
int index = skuList.indexOf("purchase.getSku()");
|
||||
if(index!=-1){
|
||||
if(developerPayloadList!=null&&index<developerPayloadList.size()){
|
||||
consumeAsync(activity,purchase.getPurchaseToken(),developerPayloadList.get(index));
|
||||
}else{
|
||||
consumeAsync(activity,purchase.getPurchaseToken(),null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region===================================确认购买=================================
|
||||
|
||||
/**
|
||||
* 确认购买
|
||||
* @param activity activity
|
||||
* @param purchaseToken token
|
||||
*/
|
||||
public void acknowledgePurchase(Activity activity,String purchaseToken){
|
||||
acknowledgePurchase(activity,purchaseToken,null);
|
||||
}
|
||||
|
||||
public void acknowledgePurchase(Activity activity,String purchaseToken,@Nullable String developerPayload){
|
||||
acknowledgePurchase(getTag(activity),purchaseToken,developerPayload);
|
||||
}
|
||||
|
||||
private void acknowledgePurchase(String tag,String purchaseToken){
|
||||
acknowledgePurchase(tag,purchaseToken,null);
|
||||
}
|
||||
|
||||
private void acknowledgePurchase(String tag,String purchaseToken,@Nullable String developerPayload){
|
||||
if(mBillingClient==null)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
AcknowledgePurchaseParams params = AcknowledgePurchaseParams.newBuilder()
|
||||
.setPurchaseToken(purchaseToken)
|
||||
.build();
|
||||
mBillingClient.acknowledgePurchase(params,new MyAcknowledgePurchaseResponseListener(tag));
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region===================================本地订单查询=================================
|
||||
/**
|
||||
* 获取已经内购的商品
|
||||
* @return 商品列表
|
||||
*/
|
||||
public List<Purchase> queryPurchasesInApp(Activity activity)
|
||||
{
|
||||
return queryPurchases(getTag(activity), BillingClient.SkuType.INAPP);
|
||||
}
|
||||
|
||||
private List<Purchase> queryPurchasesInApp(String tag)
|
||||
{
|
||||
return queryPurchases(tag, BillingClient.SkuType.INAPP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已经订阅的商品
|
||||
* @return 商品列表
|
||||
*/
|
||||
public List<Purchase> queryPurchasesSubs(Activity activity)
|
||||
{
|
||||
return queryPurchases(getTag(activity), BillingClient.SkuType.SUBS);
|
||||
}
|
||||
|
||||
private List<Purchase> queryPurchases(String tag, String skuType)
|
||||
{
|
||||
// if(mBillingClient==null)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// if(!mBillingClient.isReady())
|
||||
// {
|
||||
// startConnection(tag);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Purchase.PurchasesResult purchasesResult = mBillingClient.queryPurchases(skuType);
|
||||
// if(purchasesResult!=null)
|
||||
// {
|
||||
// if(purchasesResult.getResponseCode()== BillingClient.BillingResponseCode.OK)
|
||||
// {
|
||||
// List<Purchase> purchaseList = purchasesResult.getPurchasesList();
|
||||
// if(purchaseList!=null&&!purchaseList.isEmpty())
|
||||
// {
|
||||
// for(Purchase purchase:purchaseList)
|
||||
// {
|
||||
// for(OnGoogleBillingListener listener : onGoogleBillingListenerList) {
|
||||
// boolean isSelf = listener.tag.equals(tag);//是否是当前页面
|
||||
// boolean isSuccess = listener.onRecheck(skuType, purchase, isSelf);//是否消耗或者确认
|
||||
// if(isSelf){
|
||||
// if (purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) {
|
||||
// if(skuType.equals(BillingClient.SkuType.INAPP)) {
|
||||
// if(isSuccess){
|
||||
// consumeAsync(tag,purchase.getPurchaseToken());
|
||||
// }else if(isAutoAcknowledgePurchase){
|
||||
// if(!purchase.isAcknowledged()){
|
||||
// acknowledgePurchase(tag,purchase.getPurchaseToken());
|
||||
// }
|
||||
// }
|
||||
// }else if(skuType.equals(BillingClient.SkuType.SUBS)){
|
||||
// if(isAutoAcknowledgePurchase){
|
||||
// if(!purchase.isAcknowledged()){
|
||||
// acknowledgePurchase(tag,purchase.getPurchaseToken());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// log("未支付的订单:"+"purchase.getSku()");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return purchaseList;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
//endregion
|
||||
|
||||
//region===================================在线订单查询=================================
|
||||
|
||||
/**
|
||||
* 异步联网查询所有的内购历史-无论是过期的、取消、等等的订单
|
||||
* @param listener 监听器
|
||||
* @return 返回false的时候说明网络出错
|
||||
*/
|
||||
public boolean queryPurchaseHistoryAsyncInApp(PurchaseHistoryResponseListener listener){
|
||||
if(isReady()) {
|
||||
mBillingClient.queryPurchaseHistoryAsync(BillingClient.SkuType.INAPP,listener);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* 异步联网查询所有的订阅历史-无论是过期的、取消、等等的订单
|
||||
* @param listener 监听器
|
||||
* @return 返回false的时候说明网络出错
|
||||
*/
|
||||
public boolean queryPurchaseHistoryAsyncSubs(PurchaseHistoryResponseListener listener){
|
||||
if(isReady()) {
|
||||
mBillingClient.queryPurchaseHistoryAsync(BillingClient.SkuType.SUBS,listener);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region===================================工具集合=================================
|
||||
/**
|
||||
* 获取有效订阅的数量
|
||||
* @return -1查询失败,0没有有效订阅,>0具有有效的订阅
|
||||
*/
|
||||
public int getPurchasesSizeSubs(Activity activity)
|
||||
{
|
||||
List<Purchase> list = queryPurchasesSubs(activity);
|
||||
if(list!=null)
|
||||
{
|
||||
return list.size();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过sku获取订阅商品序号
|
||||
* @param sku sku
|
||||
* @return 序号
|
||||
*/
|
||||
public int getSubsPositionBySku(String sku)
|
||||
{
|
||||
return getPositionBySku(sku, BillingClient.SkuType.SUBS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过sku获取内购商品序号
|
||||
* @param sku sku
|
||||
* @return 成功返回需要 失败返回-1
|
||||
*/
|
||||
public int getInAppPositionBySku(String sku)
|
||||
{
|
||||
return getPositionBySku(sku, BillingClient.SkuType.INAPP);
|
||||
}
|
||||
|
||||
private int getPositionBySku(String sku,String skuType)
|
||||
{
|
||||
|
||||
if(skuType.equals(BillingClient.SkuType.INAPP))
|
||||
{
|
||||
int i = 0;
|
||||
for(String s:inAppSKUS)
|
||||
{
|
||||
if(s.equals(sku))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else if(skuType.equals(BillingClient.SkuType.SUBS))
|
||||
{
|
||||
int i = 0;
|
||||
for(String s:subsSKUS)
|
||||
{
|
||||
if(s.equals(sku))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过序号获取订阅sku
|
||||
* @param position 序号
|
||||
* @return sku
|
||||
*/
|
||||
public String getSubsSkuByPosition(int position)
|
||||
{
|
||||
if(position>=0&&position<subsSKUS.length)
|
||||
{
|
||||
return subsSKUS[position];
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过序号获取内购sku
|
||||
* @param position 序号
|
||||
* @return sku
|
||||
*/
|
||||
public String getInAppSkuByPosition(int position)
|
||||
{
|
||||
if(position>=0&&position<inAppSKUS.length)
|
||||
{
|
||||
return inAppSKUS[position];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过sku获取商品类型(订阅获取内购)
|
||||
* @param sku sku
|
||||
* @return inapp内购,subs订阅
|
||||
*/
|
||||
public String getSkuType(String sku)
|
||||
{
|
||||
if(Arrays.asList(inAppSKUS).contains(sku))
|
||||
{
|
||||
return BillingClient.SkuType.INAPP;
|
||||
}
|
||||
else if(Arrays.asList(subsSKUS).contains(sku))
|
||||
{
|
||||
return BillingClient.SkuType.SUBS;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getTag(Activity activity){
|
||||
if (activity==null){return "";}
|
||||
return activity.getLocalClassName();
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region===================================其他方法=================================
|
||||
|
||||
private void executeServiceRequest(String tag,final Runnable runnable) {
|
||||
if(startConnection(tag))
|
||||
{
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* google内购服务是否已经准备好
|
||||
* @return boolean
|
||||
*/
|
||||
public static boolean isReady() {
|
||||
return mBillingClient!=null&&mBillingClient.isReady();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否自动确认购买
|
||||
* @param isAutoAcknowledgePurchase boolean
|
||||
*/
|
||||
public static void setIsAutoAcknowledgePurchase(boolean isAutoAcknowledgePurchase){
|
||||
GoogleBillingUtil.isAutoAcknowledgePurchase = isAutoAcknowledgePurchase;
|
||||
}
|
||||
|
||||
/**
|
||||
* 断开连接google服务
|
||||
* 注意!!!一般情况不建议调用该方法,让google保留连接是最好的选择。
|
||||
*/
|
||||
public static void endConnection()
|
||||
{
|
||||
//注意!!!一般情况不建议调用该方法,让google保留连接是最好的选择。
|
||||
if(mBillingClient!=null)
|
||||
{
|
||||
if(mBillingClient.isReady())
|
||||
{
|
||||
mBillingClient.endConnection();
|
||||
mBillingClient = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
public GoogleBillingUtil addOnGoogleBillingListener(Activity activity,OnGoogleBillingListener onGoogleBillingListener){
|
||||
String tag = getTag(activity);
|
||||
onGoogleBillingListener.tag = tag;
|
||||
onGoogleBillingListenerMap.put(getTag(activity),onGoogleBillingListener);
|
||||
for(int i=onGoogleBillingListenerList.size()-1;i>=0;i--){
|
||||
OnGoogleBillingListener listener = onGoogleBillingListenerList.get(i);
|
||||
if(listener.tag.equals(tag)){
|
||||
onGoogleBillingListenerList.remove(listener);
|
||||
}
|
||||
}
|
||||
onGoogleBillingListenerList.add(onGoogleBillingListener);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void removeOnGoogleBillingListener(OnGoogleBillingListener onGoogleBillingListener){
|
||||
onGoogleBillingListenerList.remove(onGoogleBillingListener);
|
||||
}
|
||||
|
||||
public void removeOnGoogleBillingListener(Activity activity){
|
||||
String tag = getTag(activity);
|
||||
for(int i=onGoogleBillingListenerList.size()-1;i>=0;i--){
|
||||
OnGoogleBillingListener listener = onGoogleBillingListenerList.get(i);
|
||||
if(listener.tag.equals(tag)){
|
||||
removeOnGoogleBillingListener(listener);
|
||||
onGoogleBillingListenerMap.remove(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 清除内购监听器,防止内存泄漏-在Activity-onDestroy里面调用。
|
||||
* 需要确保onDestroy和build方法在同一个线程。
|
||||
*/
|
||||
public void onDestroy(Activity activity){
|
||||
if(builder!=null) {
|
||||
builder.setListener(null);
|
||||
}
|
||||
if (activity != null)
|
||||
removeOnGoogleBillingListener(activity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Google购买商品回调接口(订阅和内购都走这个接口)
|
||||
*/
|
||||
private class MyPurchasesUpdatedListener implements PurchasesUpdatedListener
|
||||
{
|
||||
|
||||
public String tag ;
|
||||
|
||||
@Override
|
||||
public void onPurchasesUpdated(BillingResult billingResult, @Nullable List<Purchase> list) {
|
||||
if(billingResult.getResponseCode()== BillingClient.BillingResponseCode.OK&&list!=null)
|
||||
{
|
||||
for(Purchase purchase:list) {
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
boolean isSelf = listener.tag.equals(tag);//是否是当前页面
|
||||
boolean isSuccess = listener.onPurchaseSuccess(purchase,isSelf);//是否自动消耗
|
||||
if(isSelf&&purchase.getPurchaseState()== Purchase.PurchaseState.PURCHASED){
|
||||
//是当前页面,并且商品状态为支付成功,才会进行消耗与确认的操作
|
||||
String skuType = getSkuType("purchase.getSku()");
|
||||
if(BillingClient.SkuType.INAPP.equals(skuType)){
|
||||
if(isSuccess){
|
||||
//进行消耗
|
||||
consumeAsync(tag,purchase.getPurchaseToken());
|
||||
}else if(isAutoAcknowledgePurchase){
|
||||
//进行确认购买
|
||||
if(!purchase.isAcknowledged()){
|
||||
acknowledgePurchase(tag,purchase.getPurchaseToken());
|
||||
}
|
||||
}
|
||||
}else if(BillingClient.SkuType.SUBS.equals(skuType)){
|
||||
//进行确认购买
|
||||
if(isAutoAcknowledgePurchase){
|
||||
if(!purchase.isAcknowledged()){
|
||||
acknowledgePurchase(tag,purchase.getPurchaseToken());
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(purchase.getPurchaseState()== Purchase.PurchaseState.PENDING){
|
||||
log("待处理的订单:"+"purchase.getSku()");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(IS_DEBUG){
|
||||
log("购买失败,responseCode:"+billingResult.getResponseCode()+",msg:"+billingResult.getDebugMessage());
|
||||
}
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onFail(GoogleBillingListenerTag.PURCHASE,billingResult.getResponseCode(),listener.tag.equals(tag));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Google查询商品信息回调接口
|
||||
*/
|
||||
private class MySkuDetailsResponseListener implements SkuDetailsResponseListener
|
||||
{
|
||||
private String skuType ;
|
||||
private String tag;
|
||||
|
||||
public MySkuDetailsResponseListener(String skuType,String tag) {
|
||||
this.skuType = skuType;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSkuDetailsResponse(BillingResult billingResult, List<SkuDetails> list) {
|
||||
if(billingResult.getResponseCode()== BillingClient.BillingResponseCode.OK&&list!=null)
|
||||
{
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onQuerySuccess(skuType,list,listener.tag.equals(tag));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onFail(GoogleBillingListenerTag.QUERY,billingResult.getResponseCode(),listener.tag.equals(tag));
|
||||
}
|
||||
if(IS_DEBUG){
|
||||
log("查询失败,responseCode:"+billingResult.getResponseCode()+",msg:"+billingResult.getDebugMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Googlg消耗商品回调
|
||||
*/
|
||||
private class MyConsumeResponseListener implements ConsumeResponseListener
|
||||
{
|
||||
private String tag ;
|
||||
|
||||
public MyConsumeResponseListener(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsumeResponse(BillingResult billingResult, String purchaseToken) {
|
||||
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onConsumeSuccess(purchaseToken,listener.tag.equals(tag));
|
||||
}
|
||||
}else{
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onFail(GoogleBillingListenerTag.COMSUME,billingResult.getResponseCode(),listener.tag.equals(tag));
|
||||
}
|
||||
if(IS_DEBUG){
|
||||
log("消耗失败,responseCode:"+billingResult.getResponseCode()+",msg:"+billingResult.getDebugMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Googlg消耗商品回调
|
||||
*/
|
||||
private class MyAcknowledgePurchaseResponseListener implements AcknowledgePurchaseResponseListener {
|
||||
|
||||
private String tag ;
|
||||
|
||||
public MyAcknowledgePurchaseResponseListener(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAcknowledgePurchaseResponse(BillingResult billingResult) {
|
||||
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onAcknowledgePurchaseSuccess(listener.tag.equals(tag));
|
||||
}
|
||||
}else{
|
||||
for(OnGoogleBillingListener listener:onGoogleBillingListenerList){
|
||||
listener.onFail(GoogleBillingListenerTag.AcKnowledgePurchase,billingResult.getResponseCode(),listener.tag.equals(tag));
|
||||
}
|
||||
if(IS_DEBUG){
|
||||
log("确认购买失败,responseCode:"+billingResult.getResponseCode()+",msg:"+billingResult.getDebugMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum GoogleBillingListenerTag{
|
||||
|
||||
QUERY("query"),
|
||||
PURCHASE("purchase"),
|
||||
SETUP("setup"),
|
||||
COMSUME("comsume"),
|
||||
AcKnowledgePurchase("AcKnowledgePurchase"),
|
||||
;
|
||||
public String tag ;
|
||||
GoogleBillingListenerTag(String tag){
|
||||
this.tag = tag;
|
||||
}
|
||||
}
|
||||
|
||||
private static void log(String msg)
|
||||
{
|
||||
if(IS_DEBUG)
|
||||
{
|
||||
Log.e(TAG,msg);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isDebug(boolean isDebug){
|
||||
GoogleBillingUtil.IS_DEBUG = isDebug;
|
||||
}
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.billingclient.api.BillingClient;
|
||||
import com.android.billingclient.api.BillingClientStateListener;
|
||||
import com.android.billingclient.api.BillingFlowParams;
|
||||
import com.android.billingclient.api.BillingResult;
|
||||
import com.android.billingclient.api.ConsumeParams;
|
||||
import com.android.billingclient.api.ConsumeResponseListener;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
import com.android.billingclient.api.PurchasesResponseListener;
|
||||
import com.android.billingclient.api.PurchasesUpdatedListener;
|
||||
import com.android.billingclient.api.QueryPurchasesParams;
|
||||
import com.android.billingclient.api.SkuDetails;
|
||||
import com.android.billingclient.api.SkuDetailsParams;
|
||||
import com.android.billingclient.api.SkuDetailsResponseListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新写Google内付工具类做简单的封装
|
||||
* 支付流程:初始化Google支付服务-->查询商品-->购买-->支付成功回调-->消耗商品
|
||||
*/
|
||||
public class GoogleBillingUtilNew {
|
||||
private BillingClient billingClient;
|
||||
private Activity mContext;
|
||||
private String TAG = "GoogleBillingUtilNew";
|
||||
private static GoogleBillingUtilNew googleBillingUtilNew;
|
||||
|
||||
public static GoogleBillingUtilNew getInstance() {
|
||||
if (googleBillingUtilNew == null) {
|
||||
googleBillingUtilNew = new GoogleBillingUtilNew();
|
||||
}
|
||||
return googleBillingUtilNew;
|
||||
}
|
||||
|
||||
public void initGooglePay(Activity mContext) {
|
||||
this.mContext = mContext;
|
||||
billingClient = BillingClient.newBuilder(mContext)
|
||||
.setListener(purchasesUpdatedListener)
|
||||
.enablePendingPurchases()
|
||||
.build();
|
||||
//请求连接到GooglePay
|
||||
billingClient.startConnection(new BillingClientStateListener() {
|
||||
@Override
|
||||
public void onBillingSetupFinished(@NonNull BillingResult billingResult) {
|
||||
int code = billingResult.getResponseCode();
|
||||
if (code != BillingClient.BillingResponseCode.OK) {
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "连接到GooglePay失败 code = " + code + " msg = " + msg);
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "连接到GooglePay成功");
|
||||
|
||||
}
|
||||
|
||||
//连接失败
|
||||
@Override
|
||||
public void onBillingServiceDisconnected() {
|
||||
Log.e(TAG, "连接到GooglePay失败,请重试");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//查询商品
|
||||
public void checkSku(String id) {
|
||||
List<String> skuList = new ArrayList<>();
|
||||
skuList.add(id);
|
||||
SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder()
|
||||
.setSkusList(skuList)
|
||||
.setType(BillingClient.SkuType.INAPP);
|
||||
billingClient.querySkuDetailsAsync(params.build(), new SkuDetailsResponseListener() {
|
||||
@Override
|
||||
public void onSkuDetailsResponse(@NonNull BillingResult billingResult, @Nullable List<SkuDetails> list) {
|
||||
int code = billingResult.getResponseCode();
|
||||
if (code != BillingClient.BillingResponseCode.OK || list == null || list.isEmpty()) {
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "查询商品失败 code = " + code + " msg = " + msg);
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "查询商品成功");
|
||||
buyIt(list.get(0));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//购买
|
||||
private void buyIt(SkuDetails skuDetails) {
|
||||
BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
|
||||
.setSkuDetails(skuDetails)
|
||||
.build();
|
||||
BillingResult billingResult = billingClient.launchBillingFlow(mContext, billingFlowParams);
|
||||
int code = billingResult.getResponseCode();
|
||||
if (code != BillingClient.BillingResponseCode.OK) {
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "购买商品失败 code = " + code + " msg = " + msg);
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "购买商品" + skuDetails.toString());
|
||||
}
|
||||
|
||||
private PurchasesUpdatedListener purchasesUpdatedListener = new PurchasesUpdatedListener() {
|
||||
@Override
|
||||
public void onPurchasesUpdated(@NonNull BillingResult billingResult, @Nullable List<Purchase> list) {
|
||||
int code = billingResult.getResponseCode();
|
||||
String msg = billingResult.getDebugMessage();
|
||||
Log.e(TAG, "onPurchasesUpdated:code = " + code + " msg = " + msg);
|
||||
if (list != null) {
|
||||
for (Purchase purchase : list) {
|
||||
Log.e(TAG, "onPurchasesUpdated:" + purchase.toString());
|
||||
}
|
||||
}
|
||||
if (code == BillingClient.BillingResponseCode.OK && list != null) {
|
||||
consume(list);
|
||||
Log.e(TAG, "支付成功");
|
||||
if (billingListener != null) {
|
||||
billingListener.onPaySuccess(list);
|
||||
}
|
||||
} else if (code == BillingClient.BillingResponseCode.USER_CANCELED) {
|
||||
Log.e(TAG, "支付取消");
|
||||
if (billingListener != null) {
|
||||
billingListener.onPayFailed(code, msg);
|
||||
}
|
||||
} else {
|
||||
if (billingListener != null) {
|
||||
billingListener.onPayFailed(code, msg);
|
||||
}
|
||||
Log.e(TAG, "支付失败:code = " + code + " msg = " + msg);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
//消耗商品
|
||||
public void consume(List<Purchase> list) {
|
||||
if (list == null || list.isEmpty() || billingClient == null) {
|
||||
return;
|
||||
}
|
||||
for (Purchase purchase : list) {
|
||||
billingClient.consumeAsync(ConsumeParams.newBuilder().setPurchaseToken(purchase.getPurchaseToken()).build(), new ConsumeResponseListener() {
|
||||
@Override
|
||||
public void onConsumeResponse(BillingResult billingResult, String purchaseToken) {
|
||||
Log.e(TAG, "onConsumeResponse code = " + billingResult.getResponseCode() + " , msg = " + billingResult.getDebugMessage() + " , purchaseToken = " + purchaseToken);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品订单
|
||||
*/
|
||||
public void queryPurchasesAsync(PurchasesResponseListener responseListener) {
|
||||
if (billingClient == null) return;
|
||||
//内购商品交易查询
|
||||
//内购商品交易查询
|
||||
QueryPurchasesParams inAppPurchasesQurey = QueryPurchasesParams.newBuilder()
|
||||
.setProductType(BillingClient.ProductType.INAPP)
|
||||
.build();
|
||||
billingClient.queryPurchasesAsync(inAppPurchasesQurey, responseListener);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定义接口返回支付结果
|
||||
*/
|
||||
public interface GoogleBillingListener {
|
||||
void onPaySuccess(List<Purchase> list);
|
||||
|
||||
void onPayFailed(int code, String msg);
|
||||
}
|
||||
|
||||
private GoogleBillingListener billingListener;
|
||||
|
||||
public GoogleBillingUtilNew setBillingListener(GoogleBillingListener billingListener) {
|
||||
this.billingListener = billingListener;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
public class GoogleCallBack {
|
||||
public void processResponse() {
|
||||
L.e("___GoogleCallBack___processResponse");
|
||||
}
|
||||
}
|
||||
256
common/src/main/java/com/yunbao/common/utils/GoogleUtils.java
Normal file
256
common/src/main/java/com/yunbao/common/utils/GoogleUtils.java
Normal file
@@ -0,0 +1,256 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* 谷歌工具类
|
||||
*/
|
||||
public class GoogleUtils {
|
||||
|
||||
Activity mActivity;
|
||||
|
||||
Context mContext;
|
||||
|
||||
Object googlePay;
|
||||
|
||||
public static GoogleUtils googleUtils;
|
||||
|
||||
public GoogleUtils(Activity activity) {
|
||||
this.mActivity = activity;
|
||||
}
|
||||
|
||||
public GoogleUtils(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
|
||||
public static GoogleUtils newInstance(Context mContext) {
|
||||
if (googleUtils == null) {
|
||||
googleUtils = new GoogleUtils(mContext);
|
||||
}
|
||||
return googleUtils;
|
||||
}
|
||||
|
||||
|
||||
public static GoogleUtils newInstance(Activity mContext) {
|
||||
if (googleUtils == null) {
|
||||
googleUtils = new GoogleUtils(mContext);
|
||||
}
|
||||
return googleUtils;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取登录Intnet
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Intent getIntent() {
|
||||
Intent intent;
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleManage");
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
intent = (Intent) invite.getClass().getMethod("googleLogin").invoke(invite);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付结果
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public JSONObject getLoginResult(Intent intent) {
|
||||
JSONObject object;
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleManage");
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
object = (JSONObject) invite.getClass().getMethod("getLoginResult", Intent.class).invoke(invite, intent);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化谷歌支付
|
||||
*/
|
||||
public void initGooglePay() {
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleBillingManage");
|
||||
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
googlePay.getClass().getMethod("initGooglePay").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getAdid() {
|
||||
String adId;
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleBillingManage");
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
adId = (String) invite.getClass().getMethod("getAdid").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return adId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购买
|
||||
*/
|
||||
public void purchase(String skuId) {
|
||||
try {
|
||||
googlePay.getClass().getMethod("checkSku", String.class).invoke(googlePay, skuId);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
Timer timer;
|
||||
|
||||
public void setBillingListener(GoogleBillingListener billingListener) {
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
|
||||
try {
|
||||
googlePay.getClass().getMethod("initResultCode").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
timer = new Timer();
|
||||
TimerTask task = new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
JSONObject resultCode = (JSONObject) googlePay.getClass().getMethod("getPayResult").invoke(googlePay);
|
||||
int code = resultCode.getInt("resultCode");
|
||||
String token = resultCode.getString("resultToken");
|
||||
String orderId = resultCode.getString("resultOrderId");
|
||||
if (code == 0) {
|
||||
timer.cancel();
|
||||
billingListener.onPaySuccess(token, orderId);
|
||||
} else if (code == 1) {
|
||||
timer.cancel();
|
||||
billingListener.onPayFailed("支付取消");
|
||||
} else if (code == 2) {
|
||||
timer.cancel();
|
||||
billingListener.onPayFailed("支付失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
timer.schedule(task, 1000, 1000);
|
||||
}
|
||||
|
||||
public void initializeApp(Context context) {
|
||||
try {
|
||||
Class<?> clz = context.getClassLoader().loadClass("com.shayu.lib_google.utils.FirebaseManage");
|
||||
Object invite = clz.getConstructor(Context.class).newInstance(context);
|
||||
invite.getClass().getMethod("initializeApp").invoke(invite);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setFirebaseTokenListener(Activity activity, FirebaseTokenListener firebaseTokenListener) {
|
||||
Timer timer = new Timer();
|
||||
TimerTask task = new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Class<?> clz = activity.getClassLoader().loadClass("com.shayu.lib_google.utils.FirebaseManage");
|
||||
googlePay = clz.getConstructor(Activity.class).newInstance(activity);
|
||||
String token = (String) googlePay.getClass().getMethod("getToken").invoke(googlePay);
|
||||
if (!StringUtil.isEmpty(token)) {
|
||||
firebaseTokenListener.onResultToken(token);
|
||||
timer.cancel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
timer.schedule(task, 1000, 1000);
|
||||
}
|
||||
|
||||
public void initFireToken(Activity activity) {
|
||||
try {
|
||||
Class<?> clz = activity.getClassLoader().loadClass("com.shayu.lib_google.utils.FirebaseManage");
|
||||
googlePay = clz.getConstructor(Activity.class).newInstance(activity);
|
||||
googlePay.getClass().getMethod("initToken").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void queryPurchasesAsync() {
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleBillingManage");
|
||||
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
googlePay.getClass().getMethod("consumeAll").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setQueryPurchaseListener(Activity activity, QueryPurchasesListener queryPurchasesListener) {
|
||||
Timer timer = new Timer();
|
||||
TimerTask task = new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
JSONObject object = (JSONObject) googlePay.getClass().getMethod("getQuerySize").invoke(googlePay);
|
||||
L.e("setQueryPurchaseListenersetQueryPurchaseListener__" + object.getInt("querySize"));
|
||||
if (object.getInt("querySize") != -1) {
|
||||
queryPurchasesListener.onResult(object);
|
||||
timer.cancel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
timer.schedule(task, 1000, 1000);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定义接口返回支付结果
|
||||
*/
|
||||
public interface GoogleBillingListener {
|
||||
void onPaySuccess(String token, String orderId);
|
||||
|
||||
void onPayFailed(String msg);
|
||||
}
|
||||
|
||||
public interface FirebaseTokenListener {
|
||||
void onResultToken(String token);
|
||||
}
|
||||
|
||||
public interface QueryPurchasesListener {
|
||||
void onResult(JSONObject obj);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import com.momo.mcamera.util.JsonUtil;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
|
||||
public class JavascriptInterfacePlayLetUtils {
|
||||
private Activity mContext;
|
||||
private WebView mWebView;
|
||||
private static JavascriptInterfacePlayLetUtils sInstance;
|
||||
|
||||
public static JavascriptInterfacePlayLetUtils getInstance() {
|
||||
|
||||
synchronized (JavascriptInterfacePlayLetUtils.class) {
|
||||
|
||||
sInstance = new JavascriptInterfacePlayLetUtils();
|
||||
|
||||
return sInstance;
|
||||
}
|
||||
}
|
||||
|
||||
public JavascriptInterfacePlayLetUtils setmContext(Activity mContext, WebView mWebView) {
|
||||
this.mContext = mContext;
|
||||
this.mWebView = mWebView;
|
||||
// webView.evaluateJavascript("javascript:nativeCallback('" + params + "')", new ValueCallback<String>() {
|
||||
// @Override
|
||||
// public void onReceiveValue(String value) {
|
||||
// }
|
||||
// });
|
||||
return this;
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void postEvent(String name, String data) {
|
||||
Log.e("TAG", "postEvent name==" + name);
|
||||
Log.e("TAG", "postEvent data==" + data);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void postWeakBalance(String data) {
|
||||
CoolConfig coolConfig = new JsonUtil().fromJson(data, CoolConfig.class);
|
||||
Log.e("TAG", "postWeakBalance data==" + data);
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setCoolConfig(coolConfig)
|
||||
.setMethod("postWeakBalance"));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,13 @@ package com.yunbao.common.utils;
|
||||
|
||||
import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_REWARD;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.JavascriptInterface;
|
||||
@@ -25,6 +27,7 @@ import com.yunbao.common.bean.VideoBean;
|
||||
import com.yunbao.common.bean.VideoListBean;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.event.QuickGiftingEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
@@ -124,10 +127,10 @@ public class JavascriptInterfaceUtils {
|
||||
url = CommonAppConfig.HOST + url;
|
||||
if (url.contains("?")) {
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
+ CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
} else {
|
||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
+ CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
}
|
||||
if (LiveZhuangBana) {
|
||||
RouteUtil.forwardLiveZhuangBanActivity(url, false);
|
||||
@@ -147,10 +150,10 @@ public class JavascriptInterfaceUtils {
|
||||
url = CommonAppConfig.HOST + url;
|
||||
if (url.contains("?")) {
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
+ CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
} else {
|
||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
+ CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
}
|
||||
if (LiveZhuangBana) {
|
||||
RouteUtil.forwardLiveZhuangBanActivity(url, title);
|
||||
@@ -259,11 +262,12 @@ public class JavascriptInterfaceUtils {
|
||||
|
||||
/**
|
||||
* 跳转直播并打开礼物栏选中礼物
|
||||
*
|
||||
* @param liveId 直播间id
|
||||
* @param giftId 礼物id
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void androidMethodLookToLiveGift(String liveId,String giftId){
|
||||
public void androidMethodLookToLiveGift(String liveId, String giftId) {
|
||||
LiveHttpUtil.getLiveInfo(liveId, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -300,6 +304,7 @@ public class JavascriptInterfaceUtils {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidMethodLookToLive(String liveId) {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
@@ -598,6 +603,18 @@ public class JavascriptInterfaceUtils {
|
||||
.setMethod("clickLogOffAccount"));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidClickToTaskPage() {
|
||||
ARouter.getInstance().build(PATH_REWARD).withString("url",
|
||||
CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index" + "&uid=" + CommonAppConfig.getInstance().getUid()
|
||||
+ "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1"+ "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidQuickGiftRemainingQuantity(int giftRemainingQuantity) {
|
||||
Bus.get().post(new QuickGiftingEvent().setGiftRemainingQuantity(String.valueOf(giftRemainingQuantity)));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidFansGroupBuy(String id) {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
@@ -644,8 +661,9 @@ public class JavascriptInterfaceUtils {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("androidCancelAnchorAttention"));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidLnsufficientBalanceClick(String msg){
|
||||
public void androidLnsufficientBalanceClick(String msg) {
|
||||
DialogUitl.showSimpleDialog(mContext, msg, new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
@@ -659,4 +677,5 @@ public class JavascriptInterfaceUtils {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -99,50 +99,41 @@ public class LogUtil {
|
||||
} else {
|
||||
time = System.currentTimeMillis() + "";
|
||||
}
|
||||
PostRequest<String> request = OkGo.<String>post("https://newht.yaoulive.com/index.php/api/error_log/report")
|
||||
.params("log", err)
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("time", time)
|
||||
.params("isGoogle", CommonAppConfig.IS_GOOGLE_PLAY)
|
||||
.params("appVersion", CommonAppConfig.getInstance().getVersion())
|
||||
.tag("errorLog")
|
||||
.converter(new StringCallback() {
|
||||
String TAG = "异常上传";
|
||||
PostRequest<String> request = OkGo.<String>post("https://newht.yaoulive.com/index.php/api/error_log/report").params("log", err).params("uid", CommonAppConfig.getInstance().getUid()).params("time", time).params("isGoogle", CommonAppConfig.IS_GOOGLE_PLAY).params("appVersion", CommonAppConfig.getInstance().getVersion()).tag("errorLog").converter(new StringCallback() {
|
||||
String TAG = "异常上传";
|
||||
|
||||
@Override
|
||||
public void onSuccess(Response<String> response) {
|
||||
Log.i(TAG, "onSuccess: " + response.message());
|
||||
file.delete();
|
||||
}
|
||||
});
|
||||
UploadTask<String> task = OkUpload.request("errorLog", request)
|
||||
.save()
|
||||
.register(new UploadListener<String>("errorLog") {
|
||||
@Override
|
||||
public void onSuccess(Response<String> response) {
|
||||
Log.i(TAG, "onSuccess: " + response.message());
|
||||
file.delete();
|
||||
}
|
||||
});
|
||||
UploadTask<String> task = OkUpload.request("errorLog", request).save().register(new UploadListener<String>("errorLog") {
|
||||
|
||||
@Override
|
||||
public void onStart(Progress progress) {
|
||||
@Override
|
||||
public void onStart(Progress progress) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(Progress progress) {
|
||||
@Override
|
||||
public void onProgress(Progress progress) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Progress progress) {
|
||||
}
|
||||
@Override
|
||||
public void onError(Progress progress) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish(String s, Progress progress) {
|
||||
file.delete();
|
||||
}
|
||||
@Override
|
||||
public void onFinish(String s, Progress progress) {
|
||||
file.delete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemove(Progress progress) {
|
||||
@Override
|
||||
public void onRemove(Progress progress) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
task.start();
|
||||
}
|
||||
}
|
||||
@@ -160,12 +151,12 @@ public class LogUtil {
|
||||
public static void shareFile(Context context) {
|
||||
try {
|
||||
IMLoginModel bean = IMLoginManager.get(context).getUserInfo();
|
||||
boolean isAnchor=false;
|
||||
if(bean!=null){
|
||||
isAnchor=bean.anchorUserType();
|
||||
boolean isAnchor = false;
|
||||
if (bean != null) {
|
||||
isAnchor = bean.anchorUserType();
|
||||
}
|
||||
//有debug文件或主播才允许
|
||||
if (!new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "pdlive.debug").exists()&&!isAnchor) {
|
||||
if (!new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "pdlive.debug").exists() && !isAnchor) {
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -225,7 +216,7 @@ public class LogUtil {
|
||||
share.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
context.startActivity(Intent.createChooser(share, "分享文件"));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && !CommonAppConfig.IS_GOOGLE_PLAY) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && CommonAppConfig.IS_GOOGLE_PLAY == 0) {
|
||||
if (!Environment.isExternalStorageManager()) {
|
||||
Intent intent = new Intent(ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
|
||||
context.startActivity(intent);
|
||||
@@ -244,17 +235,14 @@ public class LogUtil {
|
||||
|
||||
}
|
||||
}
|
||||
private static String TAG="Upload";
|
||||
|
||||
private static String TAG = "Upload";
|
||||
|
||||
private static void uploadLog(File log) {
|
||||
|
||||
JSONObject body = new JSONObject();
|
||||
|
||||
MultipartBody requestBody = new MultipartBody.Builder()
|
||||
.addFormDataPart("uid", CommonAppConfig.getInstance().getUid())
|
||||
.addFormDataPart("time", new SimpleDateFormat("yyyy-DD-mm HH:mm:ss", Locale.getDefault()).format(new Date()))
|
||||
.addFormDataPart("isGoogle", CommonAppConfig.IS_GOOGLE_PLAY+"")
|
||||
.addFormDataPart("appVersion", CommonAppConfig.getInstance().getVersion())
|
||||
.addFormDataPart("file","file", RequestBody.create(MediaType.parse("application/octet-stream"),log)) //上报日志文件
|
||||
MultipartBody requestBody = new MultipartBody.Builder().addFormDataPart("uid", CommonAppConfig.getInstance().getUid()).addFormDataPart("time", new SimpleDateFormat("yyyy-DD-mm HH:mm:ss", Locale.getDefault()).format(new Date())).addFormDataPart("isGoogle", CommonAppConfig.IS_GOOGLE_PLAY + "").addFormDataPart("appVersion", CommonAppConfig.getInstance().getVersion()).addFormDataPart("file", "file", RequestBody.create(MediaType.parse("application/octet-stream"), log)) //上报日志文件
|
||||
.build();
|
||||
|
||||
body.put("uid", CommonAppConfig.getInstance().getUid());
|
||||
@@ -262,28 +250,23 @@ public class LogUtil {
|
||||
body.put("isGoogle", CommonAppConfig.IS_GOOGLE_PLAY);
|
||||
body.put("appVersion", CommonAppConfig.getInstance().getVersion());
|
||||
|
||||
OkHttpClient client = new OkHttpClient.Builder()
|
||||
.connectTimeout(3, TimeUnit.SECONDS)
|
||||
.build();
|
||||
Request request = new Request.Builder()
|
||||
.url("https://newht.yaoulive.com/index.php/api/error_log/report") //无法接受文件
|
||||
.post(requestBody)
|
||||
.build();
|
||||
client.newCall(request)
|
||||
.enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(@NonNull Call call, @NonNull IOException e) {
|
||||
Log.e(TAG, "error",e );
|
||||
}
|
||||
OkHttpClient client = new OkHttpClient.Builder().connectTimeout(3, TimeUnit.SECONDS).build();
|
||||
Request request = new Request.Builder().url("https://newht.yaoulive.com/index.php/api/error_log/report") //无法接受文件
|
||||
.post(requestBody).build();
|
||||
client.newCall(request).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(@NonNull Call call, @NonNull IOException e) {
|
||||
Log.e(TAG, "error", e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, okhttp3.Response response) throws IOException {
|
||||
String body = response.body().string();
|
||||
Log.i(TAG, "onResponse: "+body);
|
||||
}
|
||||
@Override
|
||||
public void onResponse(Call call, okhttp3.Response response) throws IOException {
|
||||
String body = response.body().string();
|
||||
Log.i(TAG, "onResponse: " + body);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.billingclient.api.Purchase;
|
||||
import com.android.billingclient.api.SkuDetails;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者:天镜baobao
|
||||
* 时间:2019/6/2 13:51
|
||||
* 说明:允许使用,但请遵循Apache License 2.0
|
||||
* 使用:
|
||||
* Copyright 2019 天镜baobao
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
public class OnGoogleBillingListener {
|
||||
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
public String tag = null;
|
||||
|
||||
/**
|
||||
* 查询成功
|
||||
* @param skuType 内购或者订阅
|
||||
* @param list 商品列表
|
||||
* @param isSelf 是否是当前页面的结果
|
||||
*/
|
||||
public void onQuerySuccess(@NonNull String skuType, @NonNull List<SkuDetails> list, boolean isSelf){}
|
||||
|
||||
/**
|
||||
* 购买成功
|
||||
* @param purchase 商品
|
||||
* @param isSelf 是否是当前页面的结果
|
||||
*
|
||||
// * @return 是否消耗,只有当isSelf为true,并且支付状态为{@link com.android.billingclient.api.Purchase.PurchaseState.PURCHASED}时,该值才会生效。
|
||||
*/
|
||||
public boolean onPurchaseSuccess(@NonNull Purchase purchase, boolean isSelf){return true;}
|
||||
|
||||
/**
|
||||
* 初始化成功
|
||||
* @param isSelf 是否是当前页面的结果
|
||||
*/
|
||||
public void onSetupSuccess(boolean isSelf){}
|
||||
|
||||
/**
|
||||
* 每次启动重新检查订单,返回有效的订单
|
||||
*
|
||||
* @param skuType 内购或者订阅
|
||||
* @param purchase 商品
|
||||
* @param isSelf 是否是当前页面的结果
|
||||
*
|
||||
* @return 是否自动消耗,只有当isSelf为true,并且支付状态为{@link com.android.billingclient.api.Purchase.PurchaseState.PURCHASED}时,该值才会生效。
|
||||
*/
|
||||
public boolean onRecheck(@NonNull String skuType, @NonNull Purchase purchase, boolean isSelf) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 链接断开
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
public void onBillingServiceDisconnected(){ }
|
||||
|
||||
/**
|
||||
* 消耗成功
|
||||
* @param purchaseToken token
|
||||
* @param isSelf 是否是当前页面的结果
|
||||
*/
|
||||
public void onConsumeSuccess(@NonNull String purchaseToken,boolean isSelf){}
|
||||
|
||||
|
||||
/**
|
||||
* 确认购买成功
|
||||
* @param isSelf 是否是当前页面的结果
|
||||
*/
|
||||
public void onAcknowledgePurchaseSuccess(boolean isSelf){}
|
||||
|
||||
/**
|
||||
* 失败回调
|
||||
* @param tag {@link GoogleBillingUtil.GoogleBillingListenerTag}
|
||||
* @param responseCode 返回码{https://developer.android.com/google/play/billing/billing_reference}
|
||||
* @param isSelf 是否是当前页面的结果
|
||||
*/
|
||||
public void onFail(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, int responseCode, boolean isSelf){}
|
||||
|
||||
/**
|
||||
* google组件初始化失败等等。
|
||||
* @param tag {@link GoogleBillingUtil.GoogleBillingListenerTag}
|
||||
* @param isSelf 是否是当前页面的结果
|
||||
*/
|
||||
public void onError(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, boolean isSelf){}
|
||||
|
||||
}
|
||||
@@ -45,6 +45,7 @@ public class RouteUtil {
|
||||
public static final String PATH_RED_PACKET_INFO = "/main/RedPacketInfoActivity";
|
||||
public static final String PATH_RED_PACKET_USER = "/main/RedPacketUsersActivity";
|
||||
public static final String PATH_SELECT_AVATAR="/main/UserAvatarSelectActivity";
|
||||
public static final String PATH_BattlePassActivity="/main/BattlePassActivity";
|
||||
|
||||
public static void forwardFansActivity(String uid) {
|
||||
ARouter.getInstance().build(PATH_FANSACTIVITY)
|
||||
@@ -315,4 +316,12 @@ public class RouteUtil {
|
||||
ARouter.getInstance().build(PATH_SELECT_AVATAR)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
/**
|
||||
* 战令
|
||||
*/
|
||||
public static void forwardBattlePass(){
|
||||
ARouter.getInstance().build(PATH_BattlePassActivity)
|
||||
.navigation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,11 +40,61 @@ public class VersionUtil {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//是否是谷歌版本
|
||||
public void showDialog(Activity context, ConfigBean configBean, String downloadUrl) {
|
||||
//不是谷歌
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == false) {
|
||||
//华为版本
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
//todo
|
||||
//谷歌版本
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
//谷歌强制更新
|
||||
if (configBean.getGoogle_isup().equals("1")) {
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||
builder.setTitle(context.getString(R.string.version_update))
|
||||
.setContent(configBean.getUpdateDes())
|
||||
.setConfirmString(context.getString(R.string.version_immediate_use))
|
||||
.setCancelString(context.getString(R.string.version_not_update))
|
||||
.setCancelable(false)
|
||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||
public void onCancelClick() {
|
||||
context.finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
.show();
|
||||
//谷歌不强制
|
||||
} else {
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||
builder.setTitle(context.getString(R.string.version_update))
|
||||
.setContent(configBean.getUpdateDes())
|
||||
.setConfirmString(context.getString(R.string.version_immediate_use))
|
||||
.setCancelString(context.getString(R.string.version_not_update))
|
||||
.setCancelable(false)
|
||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||
public void onCancelClick() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
.show();
|
||||
}
|
||||
} else {
|
||||
|
||||
//不强更
|
||||
if (configBean.getForceUpdate() != 1) {
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||
@@ -103,55 +153,6 @@ public class VersionUtil {
|
||||
.build()
|
||||
.show();
|
||||
}
|
||||
|
||||
//谷歌版本
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
|
||||
//谷歌强制更新
|
||||
if (configBean.getGoogle_isup().equals("1")) {
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||
builder.setTitle(context.getString(R.string.version_update))
|
||||
.setContent(configBean.getUpdateDes())
|
||||
.setConfirmString(context.getString(R.string.version_immediate_use))
|
||||
.setCancelString(context.getString(R.string.version_not_update))
|
||||
.setCancelable(false)
|
||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||
public void onCancelClick() {
|
||||
context.finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
.show();
|
||||
//谷歌不强制
|
||||
} else {
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||
builder.setTitle(context.getString(R.string.version_update))
|
||||
.setContent(configBean.getUpdateDes())
|
||||
.setConfirmString(context.getString(R.string.version_immediate_use))
|
||||
.setCancelString(context.getString(R.string.version_not_update))
|
||||
.setCancelable(false)
|
||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||
public void onCancelClick() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ public class WordUtil {
|
||||
}
|
||||
|
||||
public static boolean isNewZh() {
|
||||
return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE;
|
||||
return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE ;
|
||||
}
|
||||
|
||||
public static String getNewString(int res) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.alibaba.android.arouter.utils.TextUtils;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
@@ -69,10 +70,10 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
|
||||
private void initView() {
|
||||
if (!mInside) {
|
||||
if (!CommonAppConfig.IS_GOOGLE_PLAY && APKManager.get().getAPKGoogleIsUp() == 1) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && APKManager.get().getAPKGoogleIsUp() == 1) {
|
||||
findViewById(R.id.dialog_close).setVisibility(GONE);
|
||||
}
|
||||
if (!CommonAppConfig.IS_GOOGLE_PLAY && APKManager.get().getAPKGoogleIsUp() == 1) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && APKManager.get().getAPKGoogleIsUp() == 1) {
|
||||
findViewById(R.id.dialog_close).setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
@@ -84,27 +85,37 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
updateLine.setVisibility(GONE);
|
||||
updateText.setText(APKManager.get().getAPKDes());
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dialog_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (mInside){
|
||||
dismiss();
|
||||
}else {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY && APKManager.get().getAPKGoogleIsUp() != 1) {
|
||||
dismiss();
|
||||
}
|
||||
if (!CommonAppConfig.IS_GOOGLE_PLAY && APKManager.get().getApkIsUp() != 1) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (mInside) {
|
||||
dismiss();
|
||||
} else {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1 && APKManager.get().getAPKGoogleIsUp() != 1) {
|
||||
dismiss();
|
||||
}
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 2 && APKManager.get().getAPKGoogleIsUp() != 1) {
|
||||
dismiss();
|
||||
}
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && APKManager.get().getApkIsUp() != 1) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(versionImmediateUse, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
//不是谷歌
|
||||
if (!CommonAppConfig.IS_GOOGLE_PLAY) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||
mContext.startActivity(i);
|
||||
mContext.finish();
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
//华为
|
||||
//todo
|
||||
launchAppDetail(mContext, "com.pdlive.shayu", "com.pdlive.shayu");
|
||||
} else {
|
||||
versionImmediateUse.setVisibility(GONE);
|
||||
updateLine.setVisibility(VISIBLE);
|
||||
downloadAPK(mContext, APKManager.get().getAPKUrl(), new APKDownloadUtil.OnUpdateListener() {
|
||||
@@ -113,24 +124,35 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||
mContext.startActivity(i);
|
||||
mContext.finish();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void launchAppDetail(Context mContext, String appPkg, String marketPkg) {
|
||||
try {
|
||||
if (TextUtils.isEmpty(appPkg)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Uri uri = Uri.parse("market://details?id=" + appPkg);
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||
if (!TextUtils.isEmpty(marketPkg)) {
|
||||
intent.setPackage(marketPkg);
|
||||
}
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void downloadAPK(Activity context, String url, APKDownloadUtil.OnUpdateListener listener) {
|
||||
Request request = new Request.Builder().url(url)
|
||||
.addHeader("Accept-Encoding", "identity").build();
|
||||
Request request = new Request.Builder().url(url).addHeader("Accept-Encoding", "identity").build();
|
||||
File downloadFile = new File(context.getCacheDir(), "update_app.apk");
|
||||
try {
|
||||
if (!downloadFile.exists()
|
||||
&& !downloadFile.createNewFile()) {
|
||||
if (!downloadFile.exists() && !downloadFile.createNewFile()) {
|
||||
return;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
@@ -153,8 +175,7 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
Looper.prepare();
|
||||
byte[] buf = new byte[2048];
|
||||
int len;
|
||||
try (InputStream inputStream = response.body().byteStream();
|
||||
FileOutputStream outputStream = new FileOutputStream(downloadFile)) {
|
||||
try (InputStream inputStream = response.body().byteStream(); FileOutputStream outputStream = new FileOutputStream(downloadFile)) {
|
||||
long total = response.body().contentLength();
|
||||
long sum = 0;
|
||||
while ((len = inputStream.read(buf)) != -1) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class InteractionGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
|
||||
funGameName.setText(model.getTitle());
|
||||
if (!TextUtils.isEmpty(model.getSudGameIsNew())||TextUtils.equals(model.getSudGameIsNew(),"1")){
|
||||
if (!TextUtils.isEmpty(model.getSudGameIsNew())&&TextUtils.equals(model.getSudGameIsNew(),"1")){
|
||||
itemView.findViewById(R.id.icon_new_game).setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
itemView.findViewById(R.id.icon_new_game).setVisibility(View.GONE);
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.lxj.xpopup.enums.PopupPosition;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.LiveSudGameHistoryAdapter;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.GameRecordModel;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.dialog.SudGameListSelectPopup;
|
||||
import com.yunbao.common.event.LiveSudGameHistoryEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveSudGameHistoryPopup extends BottomPopupView {
|
||||
private CommonRefreshView mRefreshView;
|
||||
private LiveSudGameHistoryAdapter sudGameListAdapter;
|
||||
private String sudGameId = "0", currencyType = "0", dateType = "0";
|
||||
private String sudGameIdName, currencyTypeName, dateTypeName;
|
||||
private int page = 1;
|
||||
|
||||
private TextView gameTitle, roomSillText, houseOwnerText;
|
||||
|
||||
private ImageView houseOwnerArrow, roomSillArrow, roomGameArrow;
|
||||
private long animDuration = 500;
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
|
||||
public LiveSudGameHistoryPopup(@NonNull Context context, List<CustomSidebarChildModel> customSidebarChildModels) {
|
||||
super(context);
|
||||
this.customSidebarChildModels = customSidebarChildModels;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_live_sud_game_history;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
Bus.getOff(this);
|
||||
super.onDismiss();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mRefreshView = findViewById(R.id.refreshView);
|
||||
gameTitle = findViewById(R.id.game_title);
|
||||
roomSillText = findViewById(R.id.room_sill_text);
|
||||
houseOwnerText = findViewById(R.id.house_owner_text);
|
||||
houseOwnerArrow = findViewById(R.id.house_owner_arrow);
|
||||
roomSillArrow = findViewById(R.id.room_sill_arrow);
|
||||
roomGameArrow = findViewById(R.id.room_game_arrow);
|
||||
|
||||
mRefreshView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
sudGameListAdapter = new LiveSudGameHistoryAdapter(getContext());
|
||||
mRefreshView.setLoadMoreEnable(true);
|
||||
mRefreshView.setRecyclerViewAdapter(sudGameListAdapter);
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<GameRecordModel>() {
|
||||
@Override
|
||||
public RefreshAdapter<GameRecordModel> getAdapter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
page = p;
|
||||
LiveHttpUtil.gameRecord(sudGameId, currencyType, dateType, p, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GameRecordModel> processData(String[] info) {
|
||||
if (info.length > 0) {
|
||||
List<GameRecordModel> sudRoomListModels = new ArrayList<>();
|
||||
for (String json : info) {
|
||||
GameRecordModel model = new Gson().fromJson(json, GameRecordModel.class);
|
||||
sudRoomListModels.add(model);
|
||||
}
|
||||
return sudRoomListModels;
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<GameRecordModel> list, int listCount) {
|
||||
Log.i("onRefreshSuccess", listCount + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<GameRecordModel> loadItemList, int loadItemCount) {
|
||||
sudGameListAdapter.insertList(loadItemList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
mRefreshView.initData();
|
||||
mRefreshView.setEmptyLayoutId(R.layout.sud_game_no);
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.house_owner), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(houseOwnerArrow, "rotation", 0f, 90f);
|
||||
animator.setDuration(500);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.house_owner));
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 6, currencyTypeName)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
closeAnimSudGameListEvent(houseOwnerArrow);
|
||||
}
|
||||
})
|
||||
)
|
||||
.show();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.room_sill), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomSillArrow, "rotation", 0f, 90f);
|
||||
animator.setDuration(500);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.room_sill));
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 7, dateTypeName)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
closeAnimSudGameListEvent(roomSillArrow);
|
||||
}
|
||||
})
|
||||
)
|
||||
.show();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.interactive_game_room_game), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 0f, 90f);
|
||||
animator.setDuration(500);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.interactive_game_room_game));
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), sudGameIdName, customSidebarChildModels)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
closeAnimSudGameListEvent(roomGameArrow);
|
||||
}
|
||||
})
|
||||
)
|
||||
.show();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void closeAnimSudGameListEvent(View view) {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(view, "rotation", 90f, 0f);
|
||||
animator.setDuration(animDuration);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
sudGameIdName = getContext().getString(R.string.interactive_game_create_unlimited);
|
||||
currencyTypeName = getContext().getString(R.string.interactive_game_create_unlimited);
|
||||
dateTypeName = getContext().getString(R.string.interactive_game_create_unlimited);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveSudGameHistoryEvent(LiveSudGameHistoryEvent event) {
|
||||
if (event.getIndex() == 3) {
|
||||
currencyTypeName = event.getTypeName();
|
||||
currencyType = event.getType();
|
||||
houseOwnerText.setText(currencyTypeName);
|
||||
} else if (event.getIndex() == 2) {
|
||||
dateTypeName = event.getTypeName();
|
||||
dateType = event.getType();
|
||||
roomSillText.setText(dateTypeName);
|
||||
}else if (event.getIndex() == 1) {
|
||||
sudGameIdName = event.getTypeName();
|
||||
sudGameId = event.getType();
|
||||
gameTitle.setText(sudGameIdName);
|
||||
}
|
||||
|
||||
mRefreshView.initData();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GameRecordModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
public class LiveSudGameHistoryViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView sudGameName, sudGameTime, sudGameUser, sudGameCoin;
|
||||
|
||||
private ImageView sudGameType;
|
||||
|
||||
public LiveSudGameHistoryViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
sudGameName = itemView.findViewById(R.id.sud_game_name);
|
||||
sudGameTime = itemView.findViewById(R.id.sud_game_time);
|
||||
sudGameUser = itemView.findViewById(R.id.sud_game_user);
|
||||
sudGameCoin = itemView.findViewById(R.id.sud_game_coin);
|
||||
sudGameType = itemView.findViewById(R.id.sud_game_type);
|
||||
}
|
||||
|
||||
public void setData(GameRecordModel model) {
|
||||
sudGameName.setText(model.getTitle());
|
||||
sudGameTime.setText(model.getGameEndTime());
|
||||
sudGameCoin.setText(String.valueOf(model.getSettlement()));
|
||||
if (model.getCurrencyType() == 3) {
|
||||
|
||||
ImgLoader.display(itemView.getContext(), R.mipmap.gold_coin, sudGameType);
|
||||
}
|
||||
if (model.getCurrencyType() == 2) {
|
||||
ImgLoader.display(itemView.getContext(), R.mipmap.icon_collectibles, sudGameType);
|
||||
}
|
||||
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
for (int i = 0; i < model.getUserName().size(); i++) {
|
||||
stringBuffer.append(model.getUserName().get(i))
|
||||
.append("/");
|
||||
}
|
||||
if (stringBuffer.length() > 0) {
|
||||
sudGameUser.setText(stringBuffer.toString().substring(0, stringBuffer.toString().length() - 1));
|
||||
} else {
|
||||
sudGameUser.setText(stringBuffer.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@ import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.event.HideShowEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
@@ -25,6 +27,7 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.sud.QuickStartGameViewModel;
|
||||
import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
@@ -32,6 +35,8 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
@@ -46,6 +51,7 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
private CreateSudRoomModel mCreateSudRoomModel;
|
||||
private TextView gameTitle, roomName, roomNumber;
|
||||
private RoundedImageView mAvatar;
|
||||
private boolean selfClick = false;
|
||||
|
||||
public LiveSudGamePopup(@NonNull Context context, long interactionID, String liveUid) {
|
||||
super(context);
|
||||
@@ -96,6 +102,15 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(2));
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_history), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new LiveSudGameHistoryPopup(getContext(), customSidebarChildModels)).show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.min_game), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
@@ -147,16 +162,38 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
|
||||
gameConfigModel.ui.lobby_players.custom = true;
|
||||
gameConfigModel.ui.join_btn.custom = true;
|
||||
gameConfigModel.ui.game_settle_again_btn.custom = true;
|
||||
gameConfigModel.ui.start_btn.custom = true;
|
||||
// SudMGP平台64bit游戏ID
|
||||
gameViewModel.switchGame((Activity) getContext(), mLiveUid, mInteractionID);
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
|
||||
private void initDate() {
|
||||
LiveNetManager.get(getContext())
|
||||
.getCustomSidebarInfo("1", new HttpCallback<List<CustomSidebarInfoModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<CustomSidebarInfoModel> data) {
|
||||
for (CustomSidebarInfoModel datum : data) {
|
||||
if (datum.getType().equals("6")) {
|
||||
customSidebarChildModels = datum.getChild();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
public void BusGetOff(){
|
||||
|
||||
public void BusGetOff() {
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
|
||||
@@ -178,34 +215,63 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
|
||||
if (event.getResults().size() > 0) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
} else {
|
||||
LiveNetManager.get(getContext()).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getGoldenBeanRemainingBalance() == 1) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||
} else {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("金豆不够 ");
|
||||
switch (event.getSudMGPMGState()) {
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
||||
LiveNetManager.get(getContext()).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getGoldenBeanRemainingBalance() == 1) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||
} else {
|
||||
ToastUtil.show("Insufficient money ");
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
} else {
|
||||
ToastUtil.show("Shortage of money");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("金豆不够 ");
|
||||
} else {
|
||||
ToastUtil.show("Insufficient money ");
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
} else {
|
||||
ToastUtil.show("Shortage of money");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
|
||||
LiveNetManager.get(getContext()).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
|
||||
mCreateSudRoomModel.getSudGameRoomId(), new
|
||||
HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getStatus() == 1) {
|
||||
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfPlaying(true);
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_STATE:
|
||||
LiveNetManager.get(getContext()).deductMoney(mCreateSudRoomModel.getSudGameRoomId());
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView roomName, playerWeAre, playerWeAre2, goldenBeanNumber;
|
||||
private RoundedImageView avatarList1, avatarList2, avatarList3, avatarList4, avatarList5;
|
||||
private ImageView gifImageView;
|
||||
private ImageView sex, game_icon;
|
||||
private ImageView sex, game_icon, gold_coin;
|
||||
|
||||
|
||||
public SudGameListViewHolder(@NonNull View itemView) {
|
||||
@@ -58,6 +58,7 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
avatarList3 = itemView.findViewById(R.id.avatar_list3);
|
||||
avatarList4 = itemView.findViewById(R.id.avatar_list4);
|
||||
avatarList5 = itemView.findViewById(R.id.avatar_list5);
|
||||
gold_coin = itemView.findViewById(R.id.gold_coin);
|
||||
sex = itemView.findViewById(R.id.sex);
|
||||
avatarList1.setVisibility(View.GONE);
|
||||
avatarList2.setVisibility(View.GONE);
|
||||
@@ -78,6 +79,11 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
} else if (TextUtils.equals(model.getSex(), "2")) {
|
||||
ImgLoader.display(itemView.getContext(), R.mipmap.icon_sex_woman, sex);
|
||||
}
|
||||
if (TextUtils.equals(model.getCurrencyType(), "2")) {
|
||||
ImgLoader.display(itemView.getContext(), R.mipmap.icon_collectibles, gold_coin);
|
||||
} else {
|
||||
ImgLoader.display(itemView.getContext(), R.mipmap.gold_coin, gold_coin);
|
||||
}
|
||||
ImgLoader.display(itemView.getContext(), model.getSudgameicon(), game_icon);
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView.findViewById(R.id.layout), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
@@ -134,7 +140,7 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
public void run() {
|
||||
Bus.get().post(new LiveOpenSudRoomEvent().setCreateSudRoomModel(createSudRoomModel));
|
||||
}
|
||||
},1500);
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.yunbao.common.views.weight;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class CircleProgress2 extends View {
|
||||
private Paint mPaint;
|
||||
private RectF mRectF;
|
||||
private int mCurrent = 10, mMax = 100;
|
||||
//圆弧(也可以说是圆环)的宽度
|
||||
private float mArcWidth =7;
|
||||
//控件的宽度
|
||||
private float mWidth;
|
||||
|
||||
public CircleProgress2(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public CircleProgress2(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public CircleProgress2(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mPaint = new Paint();
|
||||
mPaint.setAntiAlias(true);
|
||||
mRectF = new RectF();
|
||||
}
|
||||
|
||||
public void setCurrent(int mCurrent) {
|
||||
this.mCurrent = mCurrent;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void setMax(int mMax) {
|
||||
this.mMax = mMax;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
//getMeasuredWidth获取的是view的原始大小,也就是xml中配置或者代码中设置的大小
|
||||
//getWidth获取的是view最终显示的大小,这个大小不一定等于原始大小
|
||||
mWidth = getMeasuredWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
mPaint.setStyle(Paint.Style.STROKE);
|
||||
//设置圆弧的宽度(圆环的宽度)
|
||||
mPaint.setStrokeWidth(mArcWidth);
|
||||
mPaint.setColor(Color.TRANSPARENT);
|
||||
//大圆的半径
|
||||
float bigCircleRadius = mWidth / 2;
|
||||
//小圆的半径
|
||||
float smallCircleRadius = bigCircleRadius;
|
||||
//绘制小圆
|
||||
canvas.drawCircle(bigCircleRadius, bigCircleRadius, smallCircleRadius, mPaint);
|
||||
mPaint.setColor(Color.parseColor("#FEC51B"));
|
||||
mRectF.set(mArcWidth, mArcWidth, mWidth - mArcWidth, mWidth - mArcWidth);
|
||||
//绘制圆弧
|
||||
canvas.drawArc(mRectF, -90, mCurrent * 360 / mMax, false, mPaint);
|
||||
setBackgroundColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
}
|
||||
5
common/src/main/res/drawable/backgroud_panda_time.xml
Normal file
5
common/src/main/res/drawable/backgroud_panda_time.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#9946433F" />
|
||||
<corners android:radius="200dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="16dp" android:topLeftRadius="16dp" android:topRightRadius="0dp" />
|
||||
<gradient android:angle="360" android:endColor="#F6F5FF" android:startColor="#D3E3FF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
22
common/src/main/res/drawable/background_order_dialog.xml
Normal file
22
common/src/main/res/drawable/background_order_dialog.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="fill_vertical|fill_horizontal"
|
||||
android:src="@drawable/background_order_dialog_out_layout" />
|
||||
</item>
|
||||
<item
|
||||
android:bottom="3dp"
|
||||
android:left="3dp"
|
||||
android:right="4dp"
|
||||
android:top="4dp">
|
||||
<shape>
|
||||
<solid android:color="#F5F5FF" />
|
||||
|
||||
<corners android:radius="10dp" />
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="#657FE4" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 873 KiB |
5
common/src/main/res/drawable/bg_live_sud_random_home.xml
Normal file
5
common/src/main/res/drawable/bg_live_sud_random_home.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="14dp" />
|
||||
<solid android:color="#FFB72B" />
|
||||
</shape>
|
||||
21
common/src/main/res/drawable/order_level_progress_bg.xml
Normal file
21
common/src/main/res/drawable/order_level_progress_bg.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#B7AFCD" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip android:clipOrientation="horizontal">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#CE2BFF" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
||||
176
common/src/main/res/layout/activate_elite_battle_order_popup.xml
Normal file
176
common/src/main/res/layout/activate_elite_battle_order_popup.xml
Normal file
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="17dp"
|
||||
android:layout_marginEnd="17dp">
|
||||
<ImageView
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/war_order_close"
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:src="@mipmap/icon_sud_rule_close" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/elites_image"
|
||||
android:layout_width="211dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="3dp"
|
||||
android:src="@mipmap/icon_activate_the_elite_battle_order"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/enjoy_image"
|
||||
android:layout_width="211dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="3dp"
|
||||
android:src="@mipmap/icon_enjoy_image"
|
||||
android:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/icon_war_order_diamond" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_overvalue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/gift_overvalue"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_overvalue3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/gift_overvalue3"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/icon_order_score" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/more_integral"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/icon_war_order_gift" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift3_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/unlock_more_gifts"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/has_reached_level_after_opening"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/button_war_order"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@mipmap/button_war_order"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/button_war_order_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="123" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/diamond" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
40
common/src/main/res/layout/activity_end_popup.xml
Normal file
40
common/src/main/res/layout/activity_end_popup.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="218dp"
|
||||
android:layout_marginStart="22dp"
|
||||
android:layout_marginEnd="22dp"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="75dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/this_activity_is_over"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/confirm"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="33dp"
|
||||
android:background="@mipmap/button_buying_experience"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/edit_one_4"
|
||||
android:textColor="#E03600"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
@@ -29,10 +29,17 @@
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@mipmap/icon_interactive_game_create_room_seats" />
|
||||
android:src="@mipmap/icon_interactive_game_create_room_seats"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sud_history"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:src="@mipmap/icon_sud_history_live" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exit"
|
||||
@@ -65,10 +72,10 @@
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="35dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<LinearLayout
|
||||
|
||||
171
common/src/main/res/layout/cinema_ticket_popup.xml
Normal file
171
common/src/main/res/layout/cinema_ticket_popup.xml
Normal file
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="475dp"
|
||||
android:layout_marginStart="21dp"
|
||||
android:layout_marginEnd="21dp"
|
||||
android:background="@mipmap/background_cinema_ticket"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cinema_ticket_close"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_margin="12dp"
|
||||
android:src="@mipmap/icon_cinema_ticket_close" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="222dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/icon_cinema_ticket_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="15dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cinema_ticket"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="#DFEAFF"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:src="@mipmap/icon_cinema_ticket" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="35dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/conversion_quantity"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="25dp"
|
||||
android:background="@mipmap/backgroud_tickets_plus_minus">
|
||||
|
||||
<View
|
||||
android:id="@+id/sub"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tickets_plus_minus"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="0"
|
||||
android:textColor="#000000"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/add"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="13dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quantity_need"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/conversion_quantity_need"
|
||||
android:textColor="#DFEAFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:src="@mipmap/icon_collectibles2" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/cinema_ticket_exchange"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@mipmap/backgroundn_cinema_ticket_exchange" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:layout_marginBottom="23dp"
|
||||
android:background="@drawable/background_cinema_ticket_hint">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="3dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/conversion_quantity_need_of_use"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="11dp"
|
||||
android:text="@string/conversion_quantity_need_of_use1"
|
||||
android:textColor="#000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/conversion_quantity_need_of_use2"
|
||||
android:textColor="#000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/conversion_quantity_need_of_use3"
|
||||
android:textColor="#000000"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
@@ -40,45 +40,66 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="50dp"
|
||||
android:gravity="center_vertical">
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:gravity="end"
|
||||
android:gravity="start"
|
||||
android:text="@string/interactive_game_create_room_name"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/room_name"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_live_sud_list_input"
|
||||
android:hint="@string/interactive_game_create_room_name_input"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="9dp"
|
||||
android:paddingBottom="9dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/room_name"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_live_sud_list_input"
|
||||
android:hint="@string/interactive_game_create_room_name_input"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="9dp"
|
||||
android:paddingBottom="9dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/create_game_random"
|
||||
android:layout_width="57dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:background="@drawable/bg_live_sud_random_home"
|
||||
android:gravity="center"
|
||||
|
||||
android:text="@string/sud_in_game_random_name"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="26dp"
|
||||
android:gravity="center_vertical">
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:gravity="end"
|
||||
android:gravity="start"
|
||||
android:text="@string/interactive_game_create_game_type"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
@@ -87,6 +108,7 @@
|
||||
android:id="@+id/create_game_type"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_live_sud_list_input"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="9dp"
|
||||
@@ -99,36 +121,73 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="26dp"
|
||||
android:gravity="center_vertical">
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:gravity="end"
|
||||
android:gravity="start"
|
||||
android:text="@string/interactive_game_create_game_sill"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/game_sill"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_live_sud_list_input"
|
||||
android:ellipsize="end"
|
||||
android:hint="@string/interactive_game_create_gold_bean_quantity"
|
||||
android:inputType="numberDecimal"
|
||||
android:maxEms="5"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="9dp"
|
||||
android:singleLine="true"
|
||||
android:paddingBottom="9dp"
|
||||
android:digits="1234567890"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/currency_type"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_live_sud_list_input"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/select_currency_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="@string/golden_bean"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/room_game_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@mipmap/icon_home_interactive_game_arrow" />
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/game_sill"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:background="@drawable/bg_live_sud_list_input"
|
||||
android:digits="1234567890"
|
||||
android:ellipsize="end"
|
||||
android:hint="@string/interactive_game_create_gold_bean_quantity"
|
||||
android:inputType="numberDecimal"
|
||||
android:maxEms="5"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="9dp"
|
||||
android:paddingBottom="9dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -41,54 +41,76 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="50dp"
|
||||
android:gravity="center_vertical">
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:gravity="end"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:gravity="start"
|
||||
android:text="@string/interactive_game_create_room_name"
|
||||
android:textColor="#000"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/room_name"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_live_sud_list_input_home"
|
||||
android:hint="@string/interactive_game_create_room_name_input"
|
||||
android:paddingStart="12dp"
|
||||
android:singleLine="true"
|
||||
android:paddingTop="9dp"
|
||||
android:paddingBottom="9dp"
|
||||
android:textColor="#E6000000"
|
||||
android:textColorHint="#E6000000"
|
||||
android:textSize="10sp" />
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/room_name"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_live_sud_list_input_home"
|
||||
android:hint="@string/interactive_game_create_room_name_input"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="9dp"
|
||||
android:paddingBottom="9dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="#E6000000"
|
||||
android:textColorHint="#E6000000"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/create_game_random"
|
||||
android:layout_width="57dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:background="@drawable/bg_live_sud_random_home"
|
||||
android:gravity="center"
|
||||
|
||||
android:text="@string/sud_in_game_random_name"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="26dp"
|
||||
android:gravity="center_vertical">
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:gravity="end"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:gravity="start"
|
||||
android:text="@string/interactive_game_create_game_type"
|
||||
android:textColor="#000"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/create_game_type"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_live_sud_list_input_home"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="9dp"
|
||||
@@ -101,36 +123,74 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="26dp"
|
||||
android:gravity="center_vertical">
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:gravity="end"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:gravity="start"
|
||||
android:text="@string/interactive_game_create_game_sill"
|
||||
android:textColor="#000"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/game_sill"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:digits="1234567890"
|
||||
android:background="@drawable/bg_live_sud_list_input_home"
|
||||
android:hint="@string/interactive_game_create_gold_bean_quantity"
|
||||
android:inputType="numberDecimal"
|
||||
android:paddingStart="12dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:maxEms="5"
|
||||
android:paddingTop="9dp"
|
||||
android:paddingBottom="9dp"
|
||||
android:textColor="#E6000000"
|
||||
android:textColorHint="#E6000000"
|
||||
android:textSize="10sp" />
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/currency_type"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_live_sud_list_input_home"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/select_currency_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="@string/golden_bean"
|
||||
android:textColor="#E6000000"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/room_game_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@mipmap/icon_home_interactive_game_arrow" />
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/game_sill"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:background="@drawable/bg_live_sud_list_input_home"
|
||||
android:digits="1234567890"
|
||||
android:ellipsize="end"
|
||||
android:hint="@string/interactive_game_create_gold_bean_quantity"
|
||||
android:inputType="numberDecimal"
|
||||
android:maxEms="5"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="9dp"
|
||||
android:paddingBottom="9dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="#E6000000"
|
||||
android:textColorHint="#E6000000"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="360dp"
|
||||
android:layout_height="395dp"
|
||||
android:background="@drawable/bg_live_tota"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
android:id="@+id/drawerList"
|
||||
android:overScrollMode="never"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="384dp" />
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -2,7 +2,7 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="580dp"
|
||||
android:layout_height="650dp"
|
||||
android:background="@drawable/bg_live_sud_list"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sud_history"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:src="@mipmap/icon_sud_history_live" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/min_game"
|
||||
android:layout_width="30dp"
|
||||
@@ -92,9 +99,10 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/room_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="98dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user