Compare commits
94 Commits
v6.8.0
...
新改版_poyo_启
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e447824ea1 | ||
|
|
54eb9ea099 | ||
|
|
98cb22a706 | ||
|
|
767bc41820 | ||
|
|
ef99178d33 | ||
|
|
24fa740e05 | ||
|
|
d662d5c3ea | ||
|
|
b9a6d9b966 | ||
|
|
0586360408 | ||
|
|
9d8bef398a | ||
|
|
602417f45d | ||
|
|
86902a8f9b | ||
|
|
7cb89035d8 | ||
|
|
f39f2b483e | ||
|
|
15f19e39a7 | ||
|
|
10d1d22b8a | ||
|
|
96b302f0ee | ||
|
|
99d8df2ec3 | ||
|
|
4e42a4b04c | ||
|
|
c582376cc4 | ||
|
|
e58ce7932f | ||
|
|
9a72e54ca3 | ||
|
|
6de4523d27 | ||
|
|
40966e0b33 | ||
|
|
935a5a3ec5 | ||
|
|
34aaa61f11 | ||
|
|
5373f6b5bc | ||
|
|
c84fc9e8f1 | ||
|
|
b68b334e00 | ||
|
|
bfb172c1e8 | ||
|
|
277684b8e0 | ||
|
|
d181e0e743 | ||
|
|
361d23b9ef | ||
|
|
745702e36c | ||
|
|
0b62d4ddc4 | ||
|
|
23d3c9a915 | ||
|
|
8a23e76788 | ||
|
|
6f2de3a4d7 | ||
|
|
68f444b3fc | ||
|
|
f616fb1192 | ||
|
|
cd4d0c13c1 | ||
|
|
a8f92a1e38 | ||
|
|
a1b59733b3 | ||
|
|
f1670965b9 | ||
|
|
1985eebfb1 | ||
|
|
d299e579d6 | ||
|
|
02ee96e369 | ||
|
|
ed595ec1f4 | ||
|
|
5dc2b15bd8 | ||
|
|
08bc59f80e | ||
|
|
25a926e507 | ||
|
|
abfb8e74be | ||
|
|
6e0e195c20 | ||
|
|
0854d931d4 | ||
|
|
98a0009019 | ||
|
|
b9503b91f5 | ||
|
|
dee916ea7d | ||
|
|
2e1eb3c7b4 | ||
|
|
2102a3bfc2 | ||
|
|
1576a75c08 | ||
|
|
89e4373d81 | ||
|
|
59271ce709 | ||
| 528647a0bc | |||
| 238dfcc2d3 | |||
| 61b1101c3f | |||
| daf881f6a7 | |||
| 38f3b721e0 | |||
| 04ae7eeacc | |||
| d863c0af5a | |||
| 99c1037a15 | |||
|
|
3440b71229 | ||
| 50686957dc | |||
|
|
214e6f5d89 | ||
| 2d9e1cd685 | |||
| 60485deed5 | |||
| 7196ebd16e | |||
| 6eee7b9ede | |||
| e0405e9c13 | |||
| e8e0fc32f9 | |||
| 3d4ad99c99 | |||
| a25e22b142 | |||
| 3aeabfa32b | |||
| 47da21351e | |||
| 451a875526 | |||
| dc7b987eda | |||
| fe28d3508b | |||
|
|
cb87974320 | ||
|
|
dbd684a6e2 | ||
| abc37aa486 | |||
| 3349b2d7df | |||
| 97d636ddec | |||
| 3b8aedaa17 | |||
| 40ba4b8aa8 | |||
| f7db0b0768 |
@@ -5,7 +5,7 @@ apply plugin: 'kotlin-parcelize'
|
||||
apply from: "../package_config.gradle"
|
||||
|
||||
android {
|
||||
namespace "com.pdlive.shayu"
|
||||
namespace "com.newpdlive.sy"
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
packagingOptions {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<queries>
|
||||
<package android:name="com.pdlive.shayu"/>
|
||||
<package android:name="com.newpdlive.sy"/>
|
||||
<package android:name="com.facebook.orca"/>
|
||||
|
||||
<package
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<provider
|
||||
android:name="com.facebook.FacebookContentProvider"
|
||||
android:authorities="com.facebook.app.FacebookContentProvider2011402032399020"
|
||||
android:authorities="com.facebook.app.FacebookContentProvider2011402032399022"
|
||||
android:exported="true" />
|
||||
<receiver
|
||||
android:name="com.yunbao.share.receiver.TwitterResultReceiver"
|
||||
|
||||
@@ -13,7 +13,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.pdlive.shayu.R;
|
||||
import com.newpdlive.sy.R;
|
||||
import com.yunbao.share.ICallback;
|
||||
import com.yunbao.share.bean.ShareBuilder;
|
||||
import com.yunbao.share.platform.FacebookShare;
|
||||
|
||||
@@ -19,7 +19,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.newpdlive.sy.R;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
|
||||
@@ -13,7 +13,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.pdlive.shayu.R;
|
||||
import com.newpdlive.sy.R;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<string name="com.twitter.sdk.android.CONSUMER_SECRET">aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws</string>
|
||||
|
||||
<string name="dialog_share_title">分享</string>
|
||||
<string name="dialog_share_info">快來 PDLIVE觀看%s直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_info">快來 POYO觀看%s直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_app_facebook" >Facebook</string>
|
||||
<string name="dialog_share_app_line" >Line</string>
|
||||
<string name="dialog_share_app_twitter">Twitter</string>
|
||||
@@ -13,6 +13,6 @@
|
||||
<string name="dialog_share_app_instagram" >Instagram</string>
|
||||
|
||||
<string name="dialog_invite_title">邀請好友</string>
|
||||
<string name="dialog_invite_info">快來 PDLIVE觀看直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_invite_info">快來 POYO觀看直播,認識更多有趣的朋友吧!</string>
|
||||
<string name="dialog_share_copy">複製</string>
|
||||
</resources>
|
||||
@@ -9,8 +9,8 @@
|
||||
<string name="dialog_share_app_messenger">Messenger</string>
|
||||
<string name="dialog_share_app_instagram" >Instagram</string>
|
||||
<string name="dialog_share_title">Share</string>
|
||||
<string name="dialog_share_info">Come and watch %s live on PDLIVE and meet more interesting people!</string>
|
||||
<string name="dialog_share_info">Come and watch %s live on PoYo and meet more interesting people!</string>
|
||||
<string name="dialog_invite_title">Invite Friends</string>
|
||||
<string name="dialog_invite_info">Come to PDLIVE to discover more and better live streams.</string>
|
||||
<string name="dialog_invite_info">Come to PoYo to discover more and better live streams.</string>
|
||||
<string name="dialog_share_copy">Copy</string>
|
||||
</resources>
|
||||
@@ -1,96 +0,0 @@
|
||||
{
|
||||
"agcgw":{
|
||||
"backurl":"connect-drcn.hispace.hicloud.com",
|
||||
"url":"connect-drcn.dbankcloud.cn",
|
||||
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
|
||||
},
|
||||
"agcgw_all":{
|
||||
"CN":"connect-drcn.dbankcloud.cn",
|
||||
"CN_back":"connect-drcn.hispace.hicloud.com",
|
||||
"DE":"connect-dre.dbankcloud.cn",
|
||||
"DE_back":"connect-dre.hispace.hicloud.com",
|
||||
"RU":"connect-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-dra.dbankcloud.cn",
|
||||
"SG_back":"connect-dra.hispace.hicloud.com"
|
||||
},
|
||||
"websocketgw_all":{
|
||||
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
|
||||
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
|
||||
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
|
||||
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
|
||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
||||
},
|
||||
"client":{
|
||||
"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":"109612651",
|
||||
"client_type":1
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"109612651",
|
||||
"package_name":"com.pdlive.shayu"
|
||||
},
|
||||
"service":{
|
||||
"analytics":{
|
||||
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
||||
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
||||
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
||||
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"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"
|
||||
},
|
||||
"cloudstorage":{
|
||||
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
|
||||
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
|
||||
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
|
||||
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
|
||||
"storage_url_de":"https://ops-dre.agcstorage.link",
|
||||
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||
"storage_url_sg":"https://ops-dra.agcstorage.link",
|
||||
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
|
||||
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
|
||||
},
|
||||
"ml":{
|
||||
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
||||
}
|
||||
},
|
||||
"region":"CN",
|
||||
"configuration_version":"3.0",
|
||||
"appInfos":[
|
||||
{
|
||||
"package_name":"com.pdlive.shayu",
|
||||
"client":{
|
||||
"app_id":"109612651"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"com.pdlive.shayu",
|
||||
"app_id":"109612651"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_type":1,
|
||||
"client_id":"109612651"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -97,11 +97,13 @@ android {
|
||||
String variantName = variant.name.capitalize()
|
||||
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
||||
processManifestTask.doLast { pm ->
|
||||
String manifestPath = "build/intermediates/bundle_manifest/google_onlineRelease/bundle-manifest/AndroidManifest.xml"
|
||||
def isGooglePlay = variant.name.contains("google")
|
||||
// String manifestPath = "build/intermediates/bundle_manifest/google_onlineRelease/bundle-manifest/AndroidManifest.xml"
|
||||
String manifestPath = "build/intermediates/merged_manifests/${variant.name}/process${variantName}Manifest/AndroidManifest.xml"
|
||||
def isGooglePlay = !variant.name.contains("link")
|
||||
println "variant = ${variant.name}"
|
||||
println "谷歌版本:" + isGooglePlay
|
||||
println "文件存在" + file(manifestPath).exists()
|
||||
println "" + (isGooglePlay != 0)
|
||||
println "" + (isGooglePlay)
|
||||
println "" + (file(manifestPath).exists() && isGooglePlay)
|
||||
if (file(manifestPath).exists() && isGooglePlay) {
|
||||
def manifestContent = file(manifestPath).getText()
|
||||
@@ -124,8 +126,8 @@ 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_face_processor.bundle',
|
||||
'model/ai_face_processor_lite.bundle',
|
||||
'model/ai_hairseg.bundle',
|
||||
'model/ai_hand_processor.bundle',
|
||||
'model/ai_human_processor.bundle',
|
||||
@@ -133,7 +135,7 @@ android {
|
||||
'model/ai_human_processor_mb_fast.bundle',
|
||||
'graphics/body_slim.bundle',
|
||||
'graphics/controller_cpp.bundle',
|
||||
//'graphics/face_beautification.bundle',
|
||||
'graphics/face_beautification.bundle',
|
||||
'graphics/face_makeup.bundle',
|
||||
'graphics/fuzzytoonfilter.bundle',
|
||||
'graphics/fxaa.bundle',
|
||||
@@ -175,7 +177,7 @@ android {
|
||||
} else {
|
||||
server = '测试服'
|
||||
}
|
||||
def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.apk"
|
||||
def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PoYo-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.apk"
|
||||
variant.outputs.forEach { fe ->
|
||||
copy {
|
||||
from fe.outputFile
|
||||
@@ -205,24 +207,24 @@ android {
|
||||
} else {
|
||||
server = '测试服'
|
||||
}
|
||||
def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.aab"
|
||||
def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PoYo-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.aab"
|
||||
File finalFile = new File("${project.rootDir}\\outputs\\aab", fileName)
|
||||
finalBundleFile.set(finalFile)
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
keyAlias 'phonelive'
|
||||
keyPassword 'phonelive'
|
||||
storeFile file('../hdl.jks')
|
||||
storePassword 'phonelive'
|
||||
keyAlias 'poyo'
|
||||
keyPassword 'poyolive'
|
||||
storeFile file('../py.jks')
|
||||
storePassword 'poyolive'
|
||||
}
|
||||
//陌陌本地配置需要
|
||||
config {//TODO BEAUTYSDK 这里需要配置keystore相关信息
|
||||
keyAlias 'phonelive'
|
||||
keyPassword 'phonelive'
|
||||
storeFile file('../hdl.jks')//keystore的存放路径
|
||||
storePassword 'phonelive'
|
||||
keyAlias 'poyo'
|
||||
keyPassword 'poyolive'
|
||||
storeFile file('../py.jks')//keystore的存放路径
|
||||
storePassword 'poyolive'
|
||||
v2SigningEnabled true // android 5.0-8.0,必须用V2,否则会有安全问题
|
||||
v1SigningEnabled true
|
||||
}
|
||||
|
||||
47
app/src/google_online/google-services.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "163991854180",
|
||||
"project_id": "poyo-597a0",
|
||||
"storage_bucket": "poyo-597a0.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:163991854180:android:c6d4c189e941c4b1da9371",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pdsylive.yo"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "163991854180-lcd5n8kk2q9pv3bktp0ch2e3s2tl4mhs.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdsylive.yo",
|
||||
"certificate_hash": "5dda5ab9aee4b4a8d357b6a953cb331c8f34d1cf"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "163991854180-035qp9l27o2s4n3n2v4hbvrog17ufbs5.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBjHYkGdAIx9kh-FQ88eLLL6g6KGa8c7bw"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "163991854180-035qp9l27o2s4n3n2v4hbvrog17ufbs5.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
47
app/src/google_test/google-services.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "163991854180",
|
||||
"project_id": "poyo-597a0",
|
||||
"storage_bucket": "poyo-597a0.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:163991854180:android:c6d4c189e941c4b1da9371",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pdsylive.yo"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "163991854180-lcd5n8kk2q9pv3bktp0ch2e3s2tl4mhs.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdsylive.yo",
|
||||
"certificate_hash": "5dda5ab9aee4b4a8d357b6a953cb331c8f34d1cf"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "163991854180-035qp9l27o2s4n3n2v4hbvrog17ufbs5.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBjHYkGdAIx9kh-FQ88eLLL6g6KGa8c7bw"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "163991854180-035qp9l27o2s4n3n2v4hbvrog17ufbs5.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
70
app/src/huawei_test/google-services.json
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "292494634914",
|
||||
"project_id": "pdlive-1631521064967",
|
||||
"storage_bucket": "pdlive-1631521064967.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:292494634914:android:d8db197d7e7a6c3a3a4cfb",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pdlive.shayu"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-8nuhhoeo061ki1jevbcsrl7dfdl6dlm0.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ctr3fptp5mkv2qqr4gkgjo9uluq2joqb.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ejtqvaj86a2lldv0di2pr3d5gngprahd.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDVnuGnQzjI_vDrxh20Hv_S1OMUD7Vp3zU"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-v9j4rei86q2pfh9as4seotb23vr2744a.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.live.pd"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
70
app/src/link_online/google-services.json
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "292494634914",
|
||||
"project_id": "pdlive-1631521064967",
|
||||
"storage_bucket": "pdlive-1631521064967.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:292494634914:android:d8db197d7e7a6c3a3a4cfb",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pdlive.shayu"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-8nuhhoeo061ki1jevbcsrl7dfdl6dlm0.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ctr3fptp5mkv2qqr4gkgjo9uluq2joqb.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ejtqvaj86a2lldv0di2pr3d5gngprahd.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDVnuGnQzjI_vDrxh20Hv_S1OMUD7Vp3zU"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-v9j4rei86q2pfh9as4seotb23vr2744a.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.live.pd"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
70
app/src/link_test/google-services.json
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "292494634914",
|
||||
"project_id": "pdlive-1631521064967",
|
||||
"storage_bucket": "pdlive-1631521064967.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:292494634914:android:d8db197d7e7a6c3a3a4cfb",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pdlive.shayu"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-8nuhhoeo061ki1jevbcsrl7dfdl6dlm0.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ctr3fptp5mkv2qqr4gkgjo9uluq2joqb.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ejtqvaj86a2lldv0di2pr3d5gngprahd.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDVnuGnQzjI_vDrxh20Hv_S1OMUD7Vp3zU"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-v9j4rei86q2pfh9as4seotb23vr2744a.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.live.pd"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.CALL_PHONE"
|
||||
@@ -53,6 +54,7 @@
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.NETWORK_PROVIDER" />
|
||||
@@ -104,7 +106,7 @@
|
||||
<application
|
||||
android:name="com.shayu.phonelive.AppContext"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@mipmap/new_logo"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:preserveLegacyExternalStorage="true"
|
||||
@@ -126,11 +128,32 @@
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- -->
|
||||
|
||||
<activity
|
||||
android:name="com.shayu.phonelive.activity.LauncherActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
tools:ignore="LockedOrientationActivity">
|
||||
>
|
||||
<!-- <intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>-->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
|
||||
<data android:scheme="um.64e40ee55488fe7b3afa2c96" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.shayu.phonelive.activity.TestActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/MySplashTheme"
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -170,17 +193,32 @@
|
||||
<meta-data
|
||||
android:name="SW_RELEASE_MODEL"
|
||||
android:value="${swReleaseModel}" />
|
||||
<meta-data
|
||||
android:name="LINE_ID"
|
||||
android:value="${lineChannelId}" />
|
||||
<meta-data
|
||||
android:name="com.openinstall.APP_KEY"
|
||||
android:value="smvslm" />
|
||||
<meta-data
|
||||
android:name="HIDE_GOOGLE_LOGIN"
|
||||
android:value="${isHideGoogleLogin}" />
|
||||
<meta-data
|
||||
android:name="HIDE_FACEBOOK_LOGIN"
|
||||
android:value="${isHideFacebookLogin}" />
|
||||
<meta-data
|
||||
android:name="HIDE_LINE_LOGIN"
|
||||
android:value="${isHideLineLogin}" />
|
||||
<meta-data
|
||||
android:name="HIDE_TWITTER_LOGIN"
|
||||
android:value="${isHideTwitterLogin}" />
|
||||
|
||||
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ApplicationId"
|
||||
android:value="@string/facebook_app_id" />
|
||||
android:value="${facebook_app_id}" />
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ClientToken"
|
||||
android:value="@string/facebook_client_token" />
|
||||
android:value="${facebook_client_token}" />
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
|
||||
android:value="false" />
|
||||
@@ -191,6 +229,7 @@
|
||||
android:name="firebase_analytics_collection_enabled"
|
||||
android:value="false" />
|
||||
|
||||
|
||||
<receiver
|
||||
android:name="com.shayu.phonelive.utils.CustomMessageReceiver"
|
||||
android:exported="true">
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.facebook.appevents.AppEventsLogger;
|
||||
import com.fm.openinstall.OpenInstall;
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.LogUtils;
|
||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
@@ -143,10 +144,12 @@ public class AppContext extends CommonAppContext {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
if (!isMainProcess()) {
|
||||
return;
|
||||
}
|
||||
super.onCreate();
|
||||
long startTime = System.currentTimeMillis();
|
||||
Log.d("AppStart AppContext", "App start time: " + startTime);
|
||||
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
|
||||
//注册全局异常捕获
|
||||
registerError();
|
||||
@@ -355,7 +358,7 @@ public class AppContext extends CommonAppContext {
|
||||
NeverCrashUtils.getInstance().setDebugMode(BuildConfig.DEBUG).setMainCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
e.printStackTrace();
|
||||
AppManager.runDebugCode(() -> {
|
||||
DebugUtils.runDebugCode(() -> {
|
||||
//闪退后finish所有Activity并且杀死进程
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
if (activity != null && activity.get() != null) {
|
||||
@@ -371,7 +374,7 @@ public class AppContext extends CommonAppContext {
|
||||
});
|
||||
|
||||
}).setUncaughtCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
Log.e("ApplicationError", "子线程异常");
|
||||
e.printStackTrace();
|
||||
}).register(this);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.widget.Toast;
|
||||
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.FileUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
|
||||
@@ -105,10 +106,10 @@ public class NeverCrashUtils {
|
||||
}
|
||||
e.printStackTrace();
|
||||
AppContext.setFirebaseCrashData();
|
||||
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||
DebugUtils.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);
|
||||
AppManager.runDebugCode(() -> errorWhile = false);
|
||||
DebugUtils.runDebugCode(() -> errorWhile = false);
|
||||
// return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,9 +119,9 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
setStatusBar();
|
||||
setContentView(R.layout.activity_launcher);
|
||||
EventBus.getDefault().register(this);
|
||||
// setStatusBar();
|
||||
mContext = this;
|
||||
mRoot = findViewById(R.id.root);
|
||||
mCover = findViewById(R.id.cover);
|
||||
@@ -131,7 +131,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
mBtnSkipVideo = findViewById(R.id.btn_skip_video);
|
||||
mBtnSkipImage.setOnClickListener(this);
|
||||
mBtnSkipVideo.setOnClickListener(this);
|
||||
ImgLoader.display(mContext, R.mipmap.screen, mCover);
|
||||
mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
@@ -145,6 +144,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
|
||||
try {
|
||||
LogUtil.uploadErrorLog(AppContext.sInstance);
|
||||
@@ -188,9 +188,11 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
* 获取Config信息
|
||||
*/
|
||||
private void getConfig() {
|
||||
// TODO 这里花了1.5s
|
||||
CommonHttpUtil.getConfig(mContext, new CommonCallback<ConfigBean>() {
|
||||
@Override
|
||||
public void callback(ConfigBean bean) {
|
||||
|
||||
if (bean != null) {
|
||||
L.e(TAG, "----------> getPaster360Url:" + bean.getBeautyKey() + " " + bean.getPaster360Url());
|
||||
CommonAppConfig.getInstance().setBeautySdkType(bean.getSproutType());
|
||||
@@ -220,7 +222,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
final String uid = uidAndToken[0];
|
||||
final String token = uidAndToken[1];
|
||||
if (!TextUtils.isEmpty(uid) && !TextUtils.isEmpty(token)) {
|
||||
playAD(obj.getIntValue("type") == 0);
|
||||
// playAD(obj.getIntValue("type") == 0);
|
||||
} else {
|
||||
releaseVideo();
|
||||
LauncherActivity.this.startActivity(new Intent(LauncherActivity.this, EntryActivity.class));
|
||||
@@ -235,6 +237,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
} else {
|
||||
checkUidAndToken();
|
||||
}
|
||||
|
||||
} else {
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
}
|
||||
@@ -423,6 +426,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
ImageView imageView = new ImageView(mContext);
|
||||
imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
// imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
imageView.setBackgroundColor(0xffffffff);
|
||||
imageView.setTransitionName("ad_img_" + i);
|
||||
mImageViewList.add(imageView);
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.shayu.phonelive.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import myname.pdlive.shayu.R;
|
||||
|
||||
|
||||
public class TestActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_test);
|
||||
ConstraintLayout constraintLayout = findViewById(R.id.root_view);
|
||||
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
);
|
||||
|
||||
ViewTreeObserver vto = constraintLayout.getViewTreeObserver();
|
||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
// 移除监听器,避免重复调用
|
||||
constraintLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
|
||||
int width = constraintLayout.getWidth();
|
||||
int height = constraintLayout.getHeight();
|
||||
Log.d("TestActivity", "Width: " + width + ", Height: " + height);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/res/drawable-xxhdpi/icon_new_splash.9.png
Normal file
|
After Width: | Height: | Size: 535 KiB |
BIN
app/src/main/res/drawable-xxhdpi/screen.9.png
Normal file
|
After Width: | Height: | Size: 228 KiB |
14
app/src/main/res/drawable/test.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@android:color/white"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:gravity="center"> <!-- 使用gravity属性来居中图像 -->
|
||||
<bitmap
|
||||
android:src="@mipmap/logo_middle"
|
||||
android:gravity="center"/> <!-- 尽管在<bitmap>中通常不需要这个,但在某些情况下可能有助于明确意图 -->
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -2,6 +2,8 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/root"
|
||||
android:background="@color/red"
|
||||
android:padding="1dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -52,13 +54,22 @@
|
||||
android:text="@string/recommend_skip"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp"
|
||||
android:visibility="invisible" />
|
||||
android:visibility="invisible"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/screen"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_width="84dp"
|
||||
android:src="@mipmap/logo"
|
||||
android:layout_marginBottom="56dp"
|
||||
android:layout_height="30dp"/>
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
20
app/src/main/res/layout/activity_test.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:id="@+id/root_view"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/logo_middle"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 508 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 508 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 508 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 1.3 MiB |
BIN
app/src/main/res/mipmap-xxxhdpi/logo.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/logo_middle.webp
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/new_logo.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/screen.9.png
Normal file
|
After Width: | Height: | Size: 228 KiB |
|
Before Width: | Height: | Size: 586 KiB |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">PDLIVE</string>
|
||||
<string name="app_name">PoYo</string>
|
||||
<string name="leak_canary_test_class_name">assertk.Assert</string>
|
||||
</resources>
|
||||
9
app/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="MySplashTheme" parent="Theme.AppCompat.Light.NoActionBar">">
|
||||
<!--正常-->
|
||||
<item name="android:windowBackground">@drawable/test</item>
|
||||
<item name="android:windowFullscreen">true</item>全屏
|
||||
</style>
|
||||
</resources>
|
||||
70
app/src/samsung_online/google-services.json
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "292494634914",
|
||||
"project_id": "pdlive-1631521064967",
|
||||
"storage_bucket": "pdlive-1631521064967.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:292494634914:android:d8db197d7e7a6c3a3a4cfb",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pdlive.shayu"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-8nuhhoeo061ki1jevbcsrl7dfdl6dlm0.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ctr3fptp5mkv2qqr4gkgjo9uluq2joqb.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ejtqvaj86a2lldv0di2pr3d5gngprahd.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDVnuGnQzjI_vDrxh20Hv_S1OMUD7Vp3zU"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-v9j4rei86q2pfh9as4seotb23vr2744a.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.live.pd"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
70
app/src/samsung_test/google-services.json
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "292494634914",
|
||||
"project_id": "pdlive-1631521064967",
|
||||
"storage_bucket": "pdlive-1631521064967.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:292494634914:android:d8db197d7e7a6c3a3a4cfb",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pdlive.shayu"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-8nuhhoeo061ki1jevbcsrl7dfdl6dlm0.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ctr3fptp5mkv2qqr4gkgjo9uluq2joqb.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ejtqvaj86a2lldv0di2pr3d5gngprahd.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "SSSSyDVnuGnQzjI_vDrxh20Hv_S1OMUD7Vp3zU"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-v9j4rei86q2pfh9as4seotb23vr2744a.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.live.pd"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -86,6 +86,7 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
api files('libs/jcc-bate-0.7.3.jar')
|
||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||
api 'androidx.activity:activity:1.9.1'
|
||||
api rootProject.ext.dependencies["appcompat-androidx"]
|
||||
api rootProject.ext.dependencies["recyclerview-androidx"]
|
||||
api rootProject.ext.dependencies["cardview-androidx"]
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "292494634914",
|
||||
"project_id": "pdlive-1631521064967",
|
||||
"storage_bucket": "pdlive-1631521064967.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:292494634914:android:d8db197d7e7a6c3a3a4cfb",
|
||||
"android_client_info": {
|
||||
"package_name": "com.pdlive.shayu"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-ctr3fptp5mkv2qqr4gkgjo9uluq2joqb.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ejtqvaj86a2lldv0di2pr3d5gngprahd.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.pdlive.shayu",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDVnuGnQzjI_vDrxh20Hv_S1OMUD7Vp3zU"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "292494634914-v9j4rei86q2pfh9as4seotb23vr2744a.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.live.pd"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.pdlive.shayu.fileprovider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
@@ -64,7 +64,9 @@
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.PreviewVideoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<service android:name="com.yunbao.common.server.DownloadService"
|
||||
|
||||
/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -39,7 +39,11 @@ public class CommonAppConfig {
|
||||
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
||||
public static final String BUILD_TIME = getMetaDataString("BUILD_TIME");
|
||||
public static final boolean IS_SW_RELEASE = getMetaDataBoolean("SW_RELEASE_MODEL");
|
||||
|
||||
public static final int LINE_CHANNEL_ID = getMetaDataInt("LINE_ID");
|
||||
public static final boolean IS_HIDE_GOOGLE_LOGIN = getMetaDataBoolean("HIDE_GOOGLE_LOGIN");
|
||||
public static final boolean IS_HIDE_FACEBOOK_LOGIN = getMetaDataBoolean("HIDE_FACEBOOK_LOGIN");
|
||||
public static final boolean IS_HIDE_LINE_LOGIN = getMetaDataBoolean("HIDE_LINE_LOGIN");
|
||||
public static final boolean IS_HIDE_TWITTER_LOGIN = getMetaDataBoolean("HIDE_TWITTER_LOGIN");
|
||||
//外部sd卡
|
||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||
//内部存储 /data/data/<application package>/files目录
|
||||
@@ -397,7 +401,7 @@ public class CommonAppConfig {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return mVersion;
|
||||
return "6.9.0";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -669,5 +673,7 @@ public class CommonAppConfig {
|
||||
public String getAnchorPkTime() {
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.ANCHOR_PK_TIME);
|
||||
}
|
||||
|
||||
public static boolean isTestEnv() {
|
||||
return CommonAppConfig.HOST.contains("ceshi");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@ package com.yunbao.common;
|
||||
public class HtmlConfig {
|
||||
|
||||
//登录即代表同意服务和隐私条款
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=3";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=Portal&m=Page&a=index&id=59";
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/h5/page/index.html?id=706";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/h5/page/index.html?id=705";
|
||||
|
||||
//注册用户协议
|
||||
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=2";
|
||||
public static final String REG_PRIVCAY2 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=3";
|
||||
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/h5/page/index.html?id=706";
|
||||
public static final String REG_PRIVCAY2 = CommonAppConfig.HOST + "/h5/page/index.html?id=705";
|
||||
|
||||
//直播间贡献榜
|
||||
public static final String LIVE_LIST = CommonAppConfig.HOST + "/index.php?g=Appapi&m=contribute&a=index&uid=";
|
||||
@@ -33,7 +33,7 @@ public class HtmlConfig {
|
||||
public static final String LUCK_GIFT_TIP = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=26";
|
||||
|
||||
//直播间玩家看到的心愿单
|
||||
public static final String WISHLIST_URL = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Wish&a=index";
|
||||
public static final String WISHLIST_URL = CommonAppConfig.HOST + "/h5/wish/index.html?1=1";
|
||||
|
||||
//直播间玩家看到的转盘
|
||||
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";
|
||||
@@ -48,7 +48,7 @@ public class HtmlConfig {
|
||||
public static final String PERSONAL = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ/Personal";
|
||||
|
||||
//我的徽章 右上角问号
|
||||
public static final String MEDAL_QUESTION = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Fans&a=rule&isfans=1";
|
||||
public static final String MEDAL_QUESTION = CommonAppConfig.HOST + "/h5/fans/rule.html?isfans=1";
|
||||
|
||||
//我的明细
|
||||
public static final String DETAIL = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Detail&a=index";
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
@@ -94,6 +95,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
String url = getIntent().getStringExtra(Constants.URL);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -9,12 +12,17 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.dialog.GiftWallMainTab2ClassicInfoDialog;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -27,8 +35,23 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
private boolean isLiveRoom;
|
||||
private boolean isStar;
|
||||
int giftStatus;
|
||||
int giftId;
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
private Context mContext;
|
||||
private OnItemClickListener<GiftWallTab2Bean.Gift> onItemClickListener;
|
||||
|
||||
public GiftWallGiftInfoListItemAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<GiftWallTab2Bean.Gift> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
public void setGiftId(int giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
public void setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
@@ -71,9 +94,20 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (isStar && (getItemCount() > 0) && data.get(0).getId() != -1 && list_type == 2) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (viewType == 1) {
|
||||
return new VH2(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_dialog_gift_wall_gift_info2, parent, false));
|
||||
}
|
||||
return new VH(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_dialog_gift_wall_gift_info, parent, false));
|
||||
}
|
||||
|
||||
@@ -156,4 +190,41 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class VH2 extends VH {
|
||||
View avatar2_layout;
|
||||
View tips2;
|
||||
|
||||
public VH2(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
avatar2_layout = itemView.findViewById(R.id.avatar2_layout);
|
||||
tips2 = itemView.findViewById(R.id.tips2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(GiftWallInfoBean.Data data, int position) {
|
||||
super.setData(data, position);
|
||||
ViewClicksAntiShake.clicksAntiShake(tips2, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
GiftWallTab2Bean.Gift giftData = new GiftWallTab2Bean.Gift();
|
||||
giftData.setGiftId(giftId);
|
||||
giftData.setSendType(-1);
|
||||
giftData.setNamingLiveId(Integer.parseInt(data.getLive_id()));
|
||||
giftData.setNamingLiveAvatar(data.getLive_avatar());
|
||||
giftData.setNamingLiveNicename(data.getLive_user_name());
|
||||
giftData.setGiftHallSendNum(data.getGift_hall_send_num());
|
||||
try {
|
||||
giftData.setNamingLiveId(Integer.parseInt(data.getLive_id()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
if(onItemClickListener!=null){
|
||||
onItemClickListener.onItemClick(giftData,position);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -8,29 +11,44 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.views.SudGameListViewHolder;
|
||||
import com.yunbao.common.views.NewSudGameListViewHolder;
|
||||
|
||||
public class SudGameListAdapter extends RefreshAdapter<SudRoomListModel> {
|
||||
private boolean isHome = false;
|
||||
|
||||
private final Drawable[] bgList = new Drawable[6];
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
public SudGameListAdapter(Context context, boolean isHome) {
|
||||
super(context);
|
||||
this.isHome = isHome;
|
||||
|
||||
bgList[0] = mContext.getDrawable(R.drawable.grid_item_bg_1);
|
||||
bgList[1] = mContext.getDrawable(R.drawable.grid_item_bg_2);
|
||||
bgList[2] = mContext.getDrawable(R.drawable.grid_item_bg_3);
|
||||
bgList[3] = mContext.getDrawable(R.drawable.grid_item_bg_4);
|
||||
bgList[4] = mContext.getDrawable(R.drawable.grid_item_bg_5);
|
||||
bgList[5] = mContext.getDrawable(R.drawable.grid_item_bg_6);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (isHome){
|
||||
/*if (isHome){
|
||||
return new SudGameListViewHolder(mInflater.inflate(R.layout.item_home_sud_game_list, parent, false));
|
||||
}else {
|
||||
return new SudGameListViewHolder(mInflater.inflate(R.layout.item_sud_game_list, parent, false));
|
||||
}
|
||||
}*/
|
||||
|
||||
return new NewSudGameListViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_new_game_room, parent, false));
|
||||
// return new NewSudGameListViewHolder(mInflater.inflate(R.layout.item_new_game_room, parent, false));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
SudGameListViewHolder sudGameListViewHolder = (SudGameListViewHolder) holder;
|
||||
NewSudGameListViewHolder sudGameListViewHolder = (NewSudGameListViewHolder) holder;
|
||||
sudGameListViewHolder.itemView.setBackground(bgList[position % 6]);
|
||||
sudGameListViewHolder.setData(mList.get(position),isHome);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class BallClearanceTableJoinRoomBean extends BaseModel{
|
||||
@SerializedName("room_id")
|
||||
private String room_id;
|
||||
@SerializedName("room_name")
|
||||
private String roomName;
|
||||
@SerializedName("sud_game_id")
|
||||
private String gameId;
|
||||
|
||||
public BallClearanceTableJoinRoomBean() {
|
||||
}
|
||||
|
||||
public String getRoom_id() {
|
||||
return room_id;
|
||||
}
|
||||
|
||||
public void setRoom_id(String room_id) {
|
||||
this.room_id = room_id;
|
||||
}
|
||||
|
||||
public String getRoomName() {
|
||||
return roomName;
|
||||
}
|
||||
|
||||
public void setRoomName(String roomName) {
|
||||
this.roomName = roomName;
|
||||
}
|
||||
|
||||
public String getGameId() {
|
||||
return gameId;
|
||||
}
|
||||
|
||||
public void setGameId(String gameId) {
|
||||
this.gameId = gameId;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ public class CreateSudRoomModel extends BaseModel {
|
||||
private String mgId;
|
||||
@SerializedName("sud_game_icon")
|
||||
private String sudGameIcon;
|
||||
private boolean isActivity;//活动游戏
|
||||
|
||||
public String getSudGameRoomId() {
|
||||
return sudGameRoomId;
|
||||
@@ -161,4 +162,12 @@ public class CreateSudRoomModel extends BaseModel {
|
||||
this.sudGameIcon = sudGameIcon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setActivity(boolean isActivity) {
|
||||
this.isActivity=isActivity;
|
||||
}
|
||||
|
||||
public boolean isActivity() {
|
||||
return isActivity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,16 @@ public class CustomSidebarChildModel extends BaseModel {
|
||||
private String isShow;
|
||||
@SerializedName("sud_game_is_new")
|
||||
private String sudGameIsNew;
|
||||
@SerializedName("is_click")
|
||||
private boolean isClick;
|
||||
|
||||
public boolean isClick() {
|
||||
return isClick;
|
||||
}
|
||||
|
||||
public void setClick(boolean click) {
|
||||
isClick = click;
|
||||
}
|
||||
|
||||
public String getSudGameIsNew() {
|
||||
return sudGameIsNew;
|
||||
|
||||
@@ -89,6 +89,36 @@ public class GiftWallInfoBean extends BaseModel {
|
||||
private int gift_status;
|
||||
@SerializedName("sendtype")
|
||||
private int sendtype;//0默认钻石购买,1金币购买
|
||||
@SerializedName("live_nicename")
|
||||
private String live_nicename;
|
||||
@SerializedName("live_avatar")
|
||||
private String live_avatar;
|
||||
@SerializedName("live_sort")
|
||||
private int live_sort;
|
||||
|
||||
public int getLive_sort() {
|
||||
return live_sort;
|
||||
}
|
||||
|
||||
public void setLive_sort(int live_sort) {
|
||||
this.live_sort = live_sort;
|
||||
}
|
||||
|
||||
public String getLive_nicename() {
|
||||
return live_nicename;
|
||||
}
|
||||
|
||||
public void setLive_nicename(String live_nicename) {
|
||||
this.live_nicename = live_nicename;
|
||||
}
|
||||
|
||||
public String getLive_avatar() {
|
||||
return live_avatar;
|
||||
}
|
||||
|
||||
public void setLive_avatar(String live_avatar) {
|
||||
this.live_avatar = live_avatar;
|
||||
}
|
||||
|
||||
public int getSendtype() {
|
||||
return sendtype;
|
||||
@@ -327,5 +357,21 @@ public class GiftWallInfoBean extends BaseModel {
|
||||
public void setCreate_time(String create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Data{" +
|
||||
"gift_hall_send_num=" + gift_hall_send_num +
|
||||
", user_name='" + user_name + '\'' +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", user_id='" + user_id + '\'' +
|
||||
", id=" + id +
|
||||
", gift_hall_rank_hide=" + gift_hall_rank_hide +
|
||||
", create_time='" + create_time + '\'' +
|
||||
", live_id='" + live_id + '\'' +
|
||||
", live_user_name='" + live_user_name + '\'' +
|
||||
", live_avatar='" + live_avatar + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yunbao.common.bean;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWallMainTab2ClassicInfoBean extends BaseModel{
|
||||
@@ -41,6 +42,36 @@ public class GiftWallMainTab2ClassicInfoBean extends BaseModel{
|
||||
this.isMe = isMe;
|
||||
}
|
||||
|
||||
public void setWallInfoGiftInfo(GiftWallInfoBean.GiftInfo info,GiftWallTab2Bean.Gift gift) {
|
||||
giftInfo=new GiftInfo();
|
||||
giftInfo.setGiftId(info.getGift_id());
|
||||
giftInfo.setSendType(info.getSendtype());
|
||||
giftInfo.setGiftName(info.getGiftname());
|
||||
giftInfo.setGiftIcon(info.getGifticon());
|
||||
giftInfo.setIlluminateNum(info.getIlluminate_num());
|
||||
giftInfo.setNamingLiveAvatar(info.getLive_avatar());
|
||||
giftInfo.setNamingLiveId(gift.getNamingLiveId());
|
||||
giftInfo.setNamingLiveNicename(info.getLive_nicename());
|
||||
giftInfo.setGiftHallSendNum(Integer.parseInt(info.getGift_hall_send_num()));
|
||||
}
|
||||
|
||||
public void setWallInfoData(List<GiftWallInfoBean.Data> list) {
|
||||
data=new ArrayList<>();
|
||||
for (GiftWallInfoBean.Data item : list) {
|
||||
GiftData gift=new GiftData();
|
||||
gift.setUserId(item.user_id);
|
||||
gift.setAvatar(item.getAvatar());
|
||||
gift.setCreateTime(item.getCreate_time());
|
||||
gift.setLiveAvatar(item.getLive_avatar());
|
||||
gift.setActiveRankHide(item.getGift_hall_rank_hide());
|
||||
gift.setLiveUserName(item.getLive_user_name());
|
||||
gift.setGiftHallSendNum(item.getGift_hall_send_num());
|
||||
gift.setNaming_user_gift_hall_rank_hide(item.getGift_hall_rank_hide());
|
||||
gift.setUserName(item.getUser_name());
|
||||
data.add(gift);
|
||||
}
|
||||
}
|
||||
|
||||
// 内部类:GiftInfo
|
||||
public static class GiftInfo {
|
||||
|
||||
|
||||
@@ -493,6 +493,9 @@ public class IMLoginModel extends BaseModel {
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
public String getUid(){
|
||||
return id+"";
|
||||
}
|
||||
|
||||
public IMLoginModel setId(long id) {
|
||||
this.id = id;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
//处罚消息的对象
|
||||
public class PunishBean {
|
||||
|
||||
public String id;
|
||||
public String title, content;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class SudActivityGameInfoBean extends BaseModel {
|
||||
private int id;
|
||||
private int uid;//用户id
|
||||
private int userType;//用户类型 1.主播 2.用户
|
||||
private int score;//对局获得的积分
|
||||
private int hot_num;//对局获得的热度
|
||||
private int is_win;//对局结果 0.无结果 1.输 2.赢 3.平局
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getUserType() {
|
||||
return userType;
|
||||
}
|
||||
|
||||
public void setUserType(int userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
public int getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public void setScore(int score) {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public int getHot_num() {
|
||||
return hot_num;
|
||||
}
|
||||
|
||||
public void setHot_num(int hot_num) {
|
||||
this.hot_num = hot_num;
|
||||
}
|
||||
|
||||
public int getIs_win() {
|
||||
return is_win;
|
||||
}
|
||||
|
||||
public void setIs_win(int is_win) {
|
||||
this.is_win = is_win;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class SudGameActivityInfoRoomBean extends BaseModel{
|
||||
@SerializedName("id")
|
||||
private long id;
|
||||
@SerializedName("room_holder_id")
|
||||
private long roomHolderID;
|
||||
@SerializedName("room_name")
|
||||
private String roomName;
|
||||
@SerializedName("room_holder_type")
|
||||
private long roomHolderType;
|
||||
@SerializedName("sud_game_id")
|
||||
private long sudGameID;
|
||||
@SerializedName("currency_type")
|
||||
private long currencyType;
|
||||
@SerializedName("golden_bean_number")
|
||||
private long goldenBeanNumber;
|
||||
@SerializedName("room_status")
|
||||
private long roomStatus;
|
||||
@SerializedName("is_activity")
|
||||
private long isActivity;
|
||||
@SerializedName("create_time")
|
||||
private String createTime;
|
||||
@SerializedName("end_time")
|
||||
private String endTime;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public long getRoomHolderID() {
|
||||
return roomHolderID;
|
||||
}
|
||||
|
||||
public void setRoomHolderID(long roomHolderID) {
|
||||
this.roomHolderID = roomHolderID;
|
||||
}
|
||||
|
||||
public String getRoomName() {
|
||||
return roomName;
|
||||
}
|
||||
|
||||
public void setRoomName(String roomName) {
|
||||
this.roomName = roomName;
|
||||
}
|
||||
|
||||
public long getRoomHolderType() {
|
||||
return roomHolderType;
|
||||
}
|
||||
|
||||
public void setRoomHolderType(long roomHolderType) {
|
||||
this.roomHolderType = roomHolderType;
|
||||
}
|
||||
|
||||
public long getSudGameID() {
|
||||
return sudGameID;
|
||||
}
|
||||
|
||||
public void setSudGameID(long sudGameID) {
|
||||
this.sudGameID = sudGameID;
|
||||
}
|
||||
|
||||
public long getCurrencyType() {
|
||||
return currencyType;
|
||||
}
|
||||
|
||||
public void setCurrencyType(long currencyType) {
|
||||
this.currencyType = currencyType;
|
||||
}
|
||||
|
||||
public long getGoldenBeanNumber() {
|
||||
return goldenBeanNumber;
|
||||
}
|
||||
|
||||
public void setGoldenBeanNumber(long goldenBeanNumber) {
|
||||
this.goldenBeanNumber = goldenBeanNumber;
|
||||
}
|
||||
|
||||
public long getRoomStatus() {
|
||||
return roomStatus;
|
||||
}
|
||||
|
||||
public void setRoomStatus(long roomStatus) {
|
||||
this.roomStatus = roomStatus;
|
||||
}
|
||||
|
||||
public long getIsActivity() {
|
||||
return isActivity;
|
||||
}
|
||||
|
||||
public void setIsActivity(long isActivity) {
|
||||
this.isActivity = isActivity;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudGameAiInfo extends BaseModel{
|
||||
@SerializedName("uids")
|
||||
private List<String> uids;
|
||||
|
||||
public SudGameAiInfo() {
|
||||
}
|
||||
|
||||
public List<String> getUids() {
|
||||
if(uids==null)
|
||||
uids=new ArrayList<>();
|
||||
return uids;
|
||||
}
|
||||
|
||||
public void setUids(List<String> uids) {
|
||||
this.uids = uids;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SudGameRoomInfoBean extends BaseModel{
|
||||
public static final String STATUS_WAITING = "WATING";
|
||||
public static final String STATUS_PLAYING = "PLAYING";
|
||||
@SerializedName("status")
|
||||
private String status="";
|
||||
|
||||
@SerializedName("captain_uid")
|
||||
private String captainUid;
|
||||
|
||||
@SerializedName("player")
|
||||
private List<Player> players;
|
||||
|
||||
// 注意:这里没有getter和setter方法
|
||||
// 可以添加一个构造方法或其他方法来初始化对象(如果需要)
|
||||
|
||||
public SudGameRoomInfoBean() {
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCaptainUid() {
|
||||
return captainUid;
|
||||
}
|
||||
|
||||
public void setCaptainUid(String captainUid) {
|
||||
this.captainUid = captainUid;
|
||||
}
|
||||
|
||||
public List<Player> getPlayers() {
|
||||
return players;
|
||||
}
|
||||
|
||||
public void setPlayers(List<Player> players) {
|
||||
this.players = players;
|
||||
}
|
||||
|
||||
// 嵌套类来表示游戏位玩家
|
||||
public static class Player {
|
||||
public static final String PLAYER_STATUS_READY = "READY";
|
||||
public static final String PLAYER_STATUS_IDLE = "IDLE";
|
||||
@SerializedName("uid")
|
||||
private String uid;
|
||||
|
||||
@SerializedName("seat_index")
|
||||
private int seatIndex;
|
||||
|
||||
@SerializedName("status")
|
||||
private String status="";
|
||||
|
||||
@SerializedName("is_ai")
|
||||
private int isAi;
|
||||
|
||||
@SerializedName("ai_level")
|
||||
private int aiLevel;
|
||||
|
||||
// 同样,这里没有getter和setter方法
|
||||
|
||||
// 可以根据需要添加构造方法或其他方法
|
||||
|
||||
public Player() {
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getSeatIndex() {
|
||||
return seatIndex;
|
||||
}
|
||||
|
||||
public void setSeatIndex(int seatIndex) {
|
||||
this.seatIndex = seatIndex;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getIsAi() {
|
||||
return isAi;
|
||||
}
|
||||
|
||||
public void setIsAi(int isAi) {
|
||||
this.isAi = isAi;
|
||||
}
|
||||
|
||||
public int getAiLevel() {
|
||||
return aiLevel;
|
||||
}
|
||||
|
||||
public void setAiLevel(int aiLevel) {
|
||||
this.aiLevel = aiLevel;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果需要,可以添加其他方法来操作这些数据
|
||||
}
|
||||
@@ -44,6 +44,16 @@ public class SudRoomListModel extends BaseModel {
|
||||
private String sudgameicon;
|
||||
@SerializedName("currency_type")
|
||||
private String currencyType;
|
||||
@SerializedName("is_activity")
|
||||
private String isActivity;
|
||||
|
||||
public String getIsActivity() {
|
||||
return isActivity;
|
||||
}
|
||||
|
||||
public void setIsActivity(String isActivity) {
|
||||
this.isActivity = isActivity;
|
||||
}
|
||||
|
||||
public String getCurrencyType() {
|
||||
return currencyType;
|
||||
|
||||
@@ -412,6 +412,10 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
|
||||
public void addItemDecoration(RecyclerView.ItemDecoration gridSpacingItemDecoration) {
|
||||
mRecyclerView.addItemDecoration(gridSpacingItemDecoration);
|
||||
}
|
||||
|
||||
public interface DataHelperNew {
|
||||
void loadData(int p);
|
||||
|
||||
|
||||
@@ -26,6 +26,6 @@ public class MyRelativeLayout5 extends RelativeLayout {
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
|
||||
heightMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, MeasureSpec.EXACTLY);
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec+150);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,16 @@ package com.yunbao.common.dialog;
|
||||
import static androidx.core.content.ContextCompat.getSystemService;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ImageSpan;
|
||||
import android.view.View;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
@@ -16,6 +21,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
@@ -32,7 +38,9 @@ import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.RandomSudGameManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -95,6 +103,7 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
|
||||
private String userName;
|
||||
private boolean isYuanbao;
|
||||
private CheckCurrencyModel currencyModel;
|
||||
|
||||
private void initDate() {
|
||||
currencyTypeName = getContext().getString(R.string.golden_bean);
|
||||
@@ -108,6 +117,7 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
@Override
|
||||
public void onSuccess(CheckCurrencyModel data) {
|
||||
isYuanbao = TextUtils.equals(data.getIsYuanbao(), "1") || TextUtils.equals(data.getIsYuanbao(), "true");
|
||||
currencyModel = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -213,7 +223,8 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||
} else {
|
||||
ToastUtil.show("Currency quantity range [10-1000]");
|
||||
} }
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -245,7 +256,7 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (!TextUtils.equals(currencyType, "4")) {
|
||||
if (sill.length() > 4) {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||
@@ -274,17 +285,28 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (TextUtils.equals(currencyType, "4") && currencyModel.getZqTicketNumberInt() < 1) {
|
||||
RandomSudGameManager.getManager().showNotActivityTicketDialog(getContext());
|
||||
return;
|
||||
}
|
||||
LiveNetManager.get(getContext())
|
||||
.createSudRoom(name, sill, currencyType, id, new HttpCallback<CreateSudRoomModel>() {
|
||||
.createSudRoom(name, sill, currencyType, id, TextUtils.equals(currencyType, "4"), new HttpCallback<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (TextUtils.equals(currencyType, "4")) {
|
||||
RandomSudGameManager.getManager().start(data, isHome, false);
|
||||
dialog.dismiss();
|
||||
if (!isHome) {
|
||||
Bus.get().post(new SudGameListDissMissEvent());
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (isHome) {
|
||||
dialog.dismiss();
|
||||
if(CommonAppConfig.getInstance().getConfig().isSw()){
|
||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data),true,isHome);
|
||||
}else{
|
||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(data),true,isHome);
|
||||
if (CommonAppConfig.getInstance().getConfig().isSw()) {
|
||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data), false, false, isHome);
|
||||
} else {
|
||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(data), true, isHome);
|
||||
}
|
||||
} else {
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||
@@ -299,6 +321,15 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error, int code) {
|
||||
if (code != 501) {
|
||||
super.onError(error, code);
|
||||
} else {
|
||||
RandomSudGameManager.getManager().showNotActivityTicketDialog(getContext());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -332,7 +363,7 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName, isYuanbao, id, currencyModel)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
@@ -343,13 +374,13 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
.show();
|
||||
}
|
||||
}, 500);
|
||||
}else {
|
||||
} else {
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
||||
builder.hasShadowBg(false)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isLightStatusBar(false)
|
||||
.popupPosition(PopupPosition.Bottom)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName, isYuanbao, id, currencyModel)
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
@@ -361,11 +392,11 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void closeAnimSudGameListEvent() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 90f, 0f);
|
||||
animator.setDuration(animDuration);
|
||||
@@ -384,7 +415,14 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
interactionID = event.getInteractionID();
|
||||
createGameType.setText(event.getTitle());
|
||||
id = event.getId();
|
||||
|
||||
gameSill.setEnabled(true);
|
||||
gameSill.setText("");
|
||||
LogUtils.e(id,currencyType);
|
||||
if (!currencyModel.getActivityList().contains(id) && "4".equals(currencyType)) {
|
||||
currencyType = "3";
|
||||
currencyTypeName = WordUtil.getNewString(R.string.golden_bean);
|
||||
selectCurrencyType.setText(currencyTypeName);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -397,5 +435,12 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
} else {
|
||||
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
|
||||
}
|
||||
if (TextUtils.equals(currencyType, "4")) {
|
||||
gameSill.setText("1");
|
||||
gameSill.setEnabled(false);
|
||||
} else {
|
||||
gameSill.setEnabled(true);
|
||||
gameSill.setText("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftWallGiftInfoListItemAdapter;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.bean.JsWishBean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.event.ClosePopupDialogEvent;
|
||||
@@ -37,6 +38,7 @@ import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ViewUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
@@ -67,6 +69,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
View bottom_layout;
|
||||
View gift_schedule;
|
||||
ImageView diamond_icon;
|
||||
View titleLayout, titleLayout2;
|
||||
|
||||
GiftWallGiftInfoListItemAdapter adapter;
|
||||
RecyclerView recyclerView;
|
||||
@@ -167,10 +170,28 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
tab_layout = findViewById(R.id.tab_layout);
|
||||
bottom_layout = findViewById(R.id.bottom_layout);
|
||||
gift_schedule = findViewById(R.id.gift_schedule);
|
||||
adapter = new GiftWallGiftInfoListItemAdapter();
|
||||
titleLayout = findViewById(R.id.list_title);
|
||||
titleLayout2 = findViewById(R.id.list_title2);
|
||||
adapter = new GiftWallGiftInfoListItemAdapter(mContext);
|
||||
adapter.setAnchor(isAnchor);
|
||||
adapter.setLiveRoom(isLiveRoom);
|
||||
adapter.setStar(isStar);
|
||||
adapter.setOnItemClickListener(new OnItemClickListener<GiftWallTab2Bean.Gift>() {
|
||||
@Override
|
||||
public void onItemClick(GiftWallTab2Bean.Gift bean, int position) {
|
||||
new GiftWallMainTab2ClassicInfoDialog(mContext, bean, isAnchor)
|
||||
.setFullWindows(!isLiveRoom)
|
||||
.setRank(position+1)
|
||||
.setGiftWallGiftInfoDialog(new GiftWallGiftInfoDialog(mContext, giftId, toUserId, isAnchor)
|
||||
.setFullWindows(isFullWindows)
|
||||
.setAnchorId(anchorId)
|
||||
.setTab2Enter(isTab2Enter)
|
||||
.setLiveRoom(isLiveRoom)
|
||||
.setStar(isStar))
|
||||
.showDialog();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.addItemDecoration(new ItemDecoration(mContext, 0x00000000, 0, 10));
|
||||
|
||||
@@ -191,11 +212,13 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
adapter.setList_type(list_type);
|
||||
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_assistance_user));
|
||||
((TextView) findViewById(R.id.tv_rename)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_assistance_star));
|
||||
|
||||
titleLayout2.setVisibility(View.GONE);
|
||||
titleLayout.setVisibility(View.VISIBLE);
|
||||
user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename());
|
||||
initData();
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(tab2, () -> {
|
||||
btn_one.setVisibility(View.VISIBLE);
|
||||
btn_one_tips.setVisibility(View.VISIBLE);
|
||||
|
||||
tab2.setBackgroundResource(R.drawable.gift_wall_gift_info_list_btn_up);
|
||||
tab2.setTextColor(Color.parseColor("#31326D"));
|
||||
@@ -204,7 +227,19 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
tab1.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
list_type = 2;
|
||||
adapter.setList_type(list_type);
|
||||
if (isStar && list_type == 2) {
|
||||
btn_one.setVisibility(View.GONE);
|
||||
btn_one_tips.setVisibility(View.GONE);
|
||||
titleLayout.setVisibility(View.GONE);
|
||||
titleLayout2.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
btn_one.setVisibility(View.VISIBLE);
|
||||
btn_one_tips.setVisibility(View.VISIBLE);
|
||||
titleLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
initTabText();
|
||||
|
||||
initData();
|
||||
});
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext())
|
||||
@@ -251,6 +286,9 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
mIvBack.setLayoutParams(params);
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss);
|
||||
resetWindows();
|
||||
if (isStar && list_type == 2) {
|
||||
findViewById(R.id.anchorTips).setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void initTabText() {
|
||||
@@ -259,7 +297,11 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename1));
|
||||
((TextView) findViewById(R.id.tv_rename)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename_value1));
|
||||
tv_list_title.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_star));
|
||||
titleLayout.setVisibility(View.GONE);
|
||||
titleLayout2.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
titleLayout.setVisibility(VISIBLE);
|
||||
titleLayout2.setVisibility(View.GONE);
|
||||
tab2.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_champion));
|
||||
tv_list_title.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_champion));
|
||||
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename));
|
||||
@@ -277,7 +319,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
|
||||
void initData() {
|
||||
adapter.setList_type(list_type);
|
||||
if (isAnchor) {
|
||||
if (isAnchor || (isTab2Enter && isStar)) {
|
||||
if (isStar) {
|
||||
gift_hall_type = 2;
|
||||
} else {
|
||||
@@ -336,6 +378,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
btn_lighten.setBackgroundResource(R.drawable.gift_wall_gift_info_un_lighten);
|
||||
}
|
||||
adapter.setGiftStatus(giftBean.getGift_info().getIlluminate_status());
|
||||
adapter.setGiftId(giftBean.getGift_info().getGift_id());
|
||||
/**
|
||||
* 如果对方是主播,要有点亮标记。
|
||||
* 如果对方是用户,不要有点亮标记
|
||||
@@ -371,12 +414,34 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
adapter.setData(giftBean.getData());
|
||||
time = (WordUtil.isNewZh() ? "榜單結算時間:" : "Settlement time:") + giftBean.getGift_info().getGift_hall_start() + " - " + giftBean.getGift_info().getGift_hall_end();
|
||||
ImgLoader.display(mContext, IMLoginManager.get(mContext).getUserInfo().getAvatar(), avatar);
|
||||
user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename());
|
||||
send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getUser_gift_hall_send_num()));
|
||||
|
||||
if (isStar && list_type == 2) {
|
||||
user_name.setText(giftBean.getGift_info().getLive_nicename());
|
||||
send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getGift_hall_send_num()));
|
||||
ImgLoader.display(mContext, giftBean.getGift_info().getLive_avatar(), avatar);
|
||||
findViewById(R.id.anchorTips).setVisibility(View.VISIBLE);
|
||||
ViewUtils.findViewById(this, R.id.textView7, TextView.class).setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_tips3));
|
||||
if (giftBean.getGift_info().getLive_sort() == 0) {
|
||||
ViewUtils.findViewById(this, R.id.bottom_rank_value, TextView.class).setText(WordUtil.isNewZh() ? "未上榜" : "Not listed");
|
||||
} else {
|
||||
ViewUtils.findViewById(this, R.id.bottom_rank_value, TextView.class).setText(String.valueOf(giftBean.getGift_info().getLive_sort()));
|
||||
}
|
||||
findViewById(R.id.bottom_rank_layout).setVisibility(View.VISIBLE);
|
||||
|
||||
} else {
|
||||
ImgLoader.display(mContext, IMLoginManager.get(mContext).getUserInfo().getAvatar(), avatar);
|
||||
user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename());
|
||||
send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getUser_gift_hall_send_num()));
|
||||
findViewById(R.id.anchorTips).setVisibility(View.GONE);
|
||||
ViewUtils.findViewById(this, R.id.textView7, TextView.class).setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_send));
|
||||
findViewById(R.id.bottom_rank_layout).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
String tmp = "";
|
||||
if (giftBean.getGift_info().getIlluminate_status() != 1) {//未點亮
|
||||
if(list_type==2) {
|
||||
btn_one.setVisibility(View.VISIBLE);
|
||||
}
|
||||
btn_one.setText(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_light);
|
||||
tmp = String.format(Locale.getDefault(), "%s", (giftBean.getGift_info().getIlluminate_num() - Integer.parseInt(giftBean.getGift_info().getGift_hall_send_num())));
|
||||
setTips(tmp);
|
||||
@@ -392,7 +457,14 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
private void setTips(String tmp) {
|
||||
btn_one_tips.setVisibility(View.VISIBLE);
|
||||
if (isStar && list_type == 2) {
|
||||
btn_one.setVisibility(View.GONE);
|
||||
btn_one_tips.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
if (btn_one.getVisibility() == VISIBLE) {
|
||||
btn_one_tips.setVisibility(View.VISIBLE);
|
||||
}
|
||||
btn_one_tips.setText(String.format(Locale.getDefault(), "%s%s%s"
|
||||
, WordUtil.isNewZh() ? "需 " : "Need ",
|
||||
tmp,
|
||||
@@ -410,6 +482,9 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get));
|
||||
btn_one_tips.setVisibility(View.GONE);
|
||||
} else {
|
||||
if(list_type==2) {
|
||||
btn_one.setVisibility(View.VISIBLE);
|
||||
}
|
||||
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion));
|
||||
setTips(String.valueOf(tmp));
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftWallTab2GiftInfoListItemAdapter;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallMainTab2ClassicInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
@@ -35,6 +36,7 @@ import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.ViewUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.CustomEllipsizeTextView;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
@@ -67,6 +69,8 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
|
||||
GiftWallTab2Bean.Gift gift;
|
||||
String userName;
|
||||
boolean isAnchor;
|
||||
GiftWallGiftInfoDialog giftWallGiftInfoDialog;
|
||||
int rank;
|
||||
|
||||
public GiftWallMainTab2ClassicInfoDialog(@NonNull Context context, GiftWallTab2Bean.Gift gift, boolean isAnchor) {
|
||||
super(context);
|
||||
@@ -80,6 +84,24 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallMainTab2ClassicInfoDialog setRank(int rank) {
|
||||
this.rank = rank;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallMainTab2ClassicInfoDialog setGiftWallGiftInfoDialog(GiftWallGiftInfoDialog giftWallGiftInfoDialog) {
|
||||
this.giftWallGiftInfoDialog = giftWallGiftInfoDialog;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
if (giftWallGiftInfoDialog != null) {
|
||||
giftWallGiftInfoDialog.showDialog();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
@@ -100,17 +122,37 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
void initData() {
|
||||
LiveNetManager.get(mContext).lastAllGiftHallWeekStarDetail(gift.getGiftId() + "", gift.getNamingLiveId() + "", new HttpCallback<GiftWallMainTab2ClassicInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallMainTab2ClassicInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
if (gift.getSendType() == -1) {
|
||||
LiveNetManager.get(mContext)
|
||||
.liveGiftHallDetail(gift.getNamingLiveId() + "", gift.getGiftId() + "", 2, 1, new HttpCallback<GiftWallInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallInfoBean data) {
|
||||
GiftWallMainTab2ClassicInfoBean infoBean = new GiftWallMainTab2ClassicInfoBean();
|
||||
infoBean.setIsMe(data.getIs_me());
|
||||
infoBean.setWallInfoGiftInfo(data.getGift_info(), gift);
|
||||
infoBean.setWallInfoData(data.getData());
|
||||
initData(infoBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
LiveNetManager.get(mContext).lastAllGiftHallWeekStarDetail(gift.getGiftId() + "",
|
||||
gift.getNamingLiveId() + "", new HttpCallback<GiftWallMainTab2ClassicInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallMainTab2ClassicInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void initData(GiftWallMainTab2ClassicInfoBean data) {
|
||||
@@ -149,6 +191,12 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
}
|
||||
});
|
||||
if (giftWallGiftInfoDialog == null) {
|
||||
ViewUtils.findViewById(this, R.id.tv_rank, TextView.class).setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_tips4));
|
||||
ViewUtils.findViewById(this, R.id.rank_value, TextView.class).setText("1");
|
||||
} else {
|
||||
ViewUtils.findViewById(this, R.id.rank_value, TextView.class).setText(String.valueOf(rank));
|
||||
}
|
||||
}
|
||||
|
||||
void setTopData(GiftWallMainTab2ClassicInfoBean.GiftData data, ImageView avatar, TextView name, TextView value) {
|
||||
|
||||
@@ -2,8 +2,14 @@ package com.yunbao.common.dialog;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.CountDownTimer;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
@@ -14,36 +20,46 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 双人小游戏结算弹窗
|
||||
*/
|
||||
public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
public SudGameDoubleDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_sub_double;
|
||||
}
|
||||
|
||||
private AppCompatImageView sub_win_hat,sub_leave,sub_again,sub_title;
|
||||
private RoundedImageView sub_win_head,sub_loss_head;
|
||||
private AppCompatTextView sub_win_name,sub_win_score,sub_loss_name,sub_loss_score,sub_time;
|
||||
private AppCompatImageView sub_win_hat, sub_leave, sub_again, sub_title;
|
||||
private RoundedImageView sub_win_head, sub_loss_head;
|
||||
private AppCompatTextView sub_win_name, sub_win_score, sub_loss_name, sub_loss_score, sub_time;
|
||||
private CountDownTimer countDownTimer;
|
||||
private TextView activityGameAchievement;
|
||||
private ImageView lossActivityIcon, winActivityIcon;
|
||||
private List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||
private boolean containMe;
|
||||
private boolean isActivityGame;
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
@@ -64,21 +80,23 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
sub_loss_name = findViewById(R.id.sub_loss_name);//失败方昵称
|
||||
sub_loss_score = findViewById(R.id.sub_loss_score);//失败方分数
|
||||
sub_time = findViewById(R.id.sub_time);//关闭倒计时
|
||||
|
||||
lossActivityIcon = findViewById(R.id.lossActivityIcon);
|
||||
winActivityIcon = findViewById(R.id.winActivityIcon);
|
||||
activityGameAchievement = findViewById(R.id.activityGameAchievement);
|
||||
|
||||
initData();
|
||||
|
||||
if (WordUtil.isNewZh()){
|
||||
if (WordUtil.isNewZh()) {
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_zh);
|
||||
}else {
|
||||
} else {
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_en);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_en);
|
||||
}
|
||||
|
||||
sub_leave.setOnClickListener(v-> destroyDialog());
|
||||
sub_again.setOnClickListener(v-> {
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
sub_leave.setOnClickListener(v -> destroyDialog());
|
||||
sub_again.setOnClickListener(v -> {
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
destroyDialog();
|
||||
});
|
||||
|
||||
@@ -86,32 +104,60 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void initData() {
|
||||
if (settleBeans.size() == 2){
|
||||
sub_win_score.setVisibility(View.VISIBLE);
|
||||
sub_win_name.setVisibility(View.VISIBLE);
|
||||
sub_loss_score.setVisibility(View.VISIBLE);
|
||||
sub_loss_name.setVisibility(View.VISIBLE);
|
||||
winActivityIcon.setVisibility(View.VISIBLE);
|
||||
lossActivityIcon.setVisibility(View.VISIBLE);
|
||||
boolean isFirstMe=false;
|
||||
if (settleBeans.size() == 2) {
|
||||
sortByWinNum(settleBeans);
|
||||
SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名
|
||||
SudSettleBean sudSettleBean2 = settleBeans.get(1); // 第二名
|
||||
checkMe(sudSettleBean1.getUid(),sudSettleBean2.getUid());//判断这场对局是不是包含自己
|
||||
|
||||
checkMe(sudSettleBean1.getUid(), sudSettleBean2.getUid());//判断这场对局是不是包含自己
|
||||
LogUtils.e("第一名:" + sudSettleBean1.getNick_name());
|
||||
LogUtils.e("第二名:" + sudSettleBean2.getNick_name());
|
||||
// 检查是否是当前用户
|
||||
boolean isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid());
|
||||
boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num();
|
||||
isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid());
|
||||
boolean isDraw = sudSettleBean1.getRank() == sudSettleBean2.getRank();
|
||||
boolean isZh = WordUtil.isNewZh();
|
||||
|
||||
String myUid = CommonAppConfig.getInstance().getUid();
|
||||
LogUtils.e("isFirstMe:" + isFirstMe);
|
||||
if (isActivityGame) {
|
||||
findViewById(R.id.tips).setVisibility(View.INVISIBLE);
|
||||
}
|
||||
if (containMe) {
|
||||
// 当前用户在游戏中
|
||||
SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2;
|
||||
SudSettleBean lossBean = isFirstMe ? sudSettleBean2 : sudSettleBean1;
|
||||
// SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2;
|
||||
// SudSettleBean lossBean = isFirstMe ? sudSettleBean2 : sudSettleBean1;
|
||||
SudSettleBean winBean = sudSettleBean1;
|
||||
SudSettleBean lossBean = sudSettleBean2;
|
||||
|
||||
|
||||
if (isActivityGame) {
|
||||
Map<String, Integer> map = showActivityGameScore();
|
||||
if (!map.isEmpty()) {
|
||||
//isDraw = map.get("win").intValue() == map.get("loss").intValue();
|
||||
// isFirstMe = IMLoginManager.get(mContext).getUserInfo().getUid().equals(String.valueOf(map.get("win_uid")));
|
||||
if (lossBean.getUid().equals(map.get("win_uid").toString())) {
|
||||
SudSettleBean tmp = lossBean;
|
||||
lossBean = winBean;
|
||||
winBean = tmp;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sub_win_score.setText(winBean.getWin_num() > 0 ? "+" + winBean.getWin_num() : String.valueOf(winBean.getWin_num()));
|
||||
sub_loss_score.setText(String.valueOf(lossBean.getWin_num()));
|
||||
System.out.println("胜者名字:" + winBean.getNick_name() + "|败者名字:" + lossBean.getNick_name());
|
||||
}
|
||||
ImgLoader.display(mContext, winBean.getAvatar_url(), sub_win_head);
|
||||
ImgLoader.display(mContext, lossBean.getAvatar_url(), sub_loss_head);
|
||||
sub_win_name.setText(winBean.getNick_name());
|
||||
sub_loss_name.setText(lossBean.getNick_name());
|
||||
|
||||
sub_win_score.setText(winBean.getWin_num() > 0 ? "+" + winBean.getWin_num() : String.valueOf(winBean.getWin_num()));
|
||||
sub_loss_score.setText(String.valueOf(lossBean.getWin_num()));
|
||||
|
||||
if (isDraw) {
|
||||
// 平局
|
||||
LogUtils.e("玩家平局",isActivityGame,showActivityGameScore(),gameSettle.activityGameInfoBean);
|
||||
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
|
||||
sub_win_hat.setVisibility(View.GONE);
|
||||
} else {
|
||||
@@ -119,18 +165,33 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
sub_title.setImageResource(isZh ? (isFirstMe ? R.mipmap.sub_win_zh : R.mipmap.sub_loss_zh) : (isFirstMe ? R.mipmap.sub_win_en : R.mipmap.sub_loss_en));
|
||||
sub_win_hat.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (isActivityGame) {
|
||||
if (sudSettleBean1.getUid().equals(myUid)) {
|
||||
sub_loss_score.setVisibility(View.INVISIBLE);
|
||||
lossActivityIcon.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
sub_win_score.setVisibility(View.INVISIBLE);
|
||||
winActivityIcon.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 当前用户不在游戏中
|
||||
ImgLoader.display(mContext, sudSettleBean1.getAvatar_url(), sub_win_head);
|
||||
ImgLoader.display(mContext, sudSettleBean2.getAvatar_url(), sub_loss_head);
|
||||
sub_win_name.setText(sudSettleBean1.getNick_name());
|
||||
sub_loss_name.setText(sudSettleBean2.getNick_name());
|
||||
|
||||
sub_win_score.setText(sudSettleBean1.getWin_num() > 0 ? "+" + sudSettleBean1.getWin_num() : String.valueOf(sudSettleBean1.getWin_num()));
|
||||
sub_loss_score.setText(String.valueOf(sudSettleBean2.getWin_num()));
|
||||
|
||||
if (isActivityGame) {
|
||||
Map<String, Integer> map = showActivityGameScore();
|
||||
if (!map.isEmpty()) {
|
||||
// isDraw = map.get("win").intValue() == map.get("loss").intValue();
|
||||
}
|
||||
} else {
|
||||
sub_win_score.setText(sudSettleBean1.getWin_num() > 0 ? "+" + sudSettleBean1.getWin_num() : String.valueOf(sudSettleBean1.getWin_num()));
|
||||
sub_loss_score.setText(String.valueOf(sudSettleBean2.getWin_num()));
|
||||
}
|
||||
if (isDraw) {
|
||||
// 平局
|
||||
LogUtils.e("观众平局",isActivityGame,showActivityGameScore(),gameSettle.activityGameInfoBean);
|
||||
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
|
||||
sub_win_hat.setVisibility(View.GONE);
|
||||
} else {
|
||||
@@ -138,11 +199,85 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
sub_title.setImageResource(isZh ? R.mipmap.sub_win_zh : R.mipmap.sub_win_en);
|
||||
sub_win_hat.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (isActivityGame) {
|
||||
sub_win_score.setVisibility(View.INVISIBLE);
|
||||
winActivityIcon.setVisibility(View.INVISIBLE);
|
||||
sub_loss_score.setVisibility(View.INVISIBLE);
|
||||
lossActivityIcon.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("是否为活动游戏" + isActivityGame + " 成就内容:" + gameSettle.achievement);
|
||||
if (isActivityGame) {
|
||||
if (!StringUtil.isEmpty(gameSettle.achievement)) {
|
||||
if(!isFirstMe){
|
||||
switch (gameSettle.achievementValue) {
|
||||
case 1:
|
||||
gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_1);
|
||||
break;
|
||||
case 2:
|
||||
gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_2);
|
||||
break;
|
||||
case 3:
|
||||
gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_3);
|
||||
break;
|
||||
case 4:
|
||||
gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_4);
|
||||
break;
|
||||
case 5:
|
||||
gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_5);
|
||||
break;
|
||||
case 6:
|
||||
gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_6);
|
||||
break;
|
||||
case 7:
|
||||
gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
String activityGameAchievementText = WordUtil.getNewString(R.string.game_dialog_activity_achievements_title);
|
||||
String activityGameAchievementContent = gameSettle.achievement;
|
||||
activityGameAchievement.setVisibility(View.VISIBLE);
|
||||
SpannableString ss = new SpannableString(activityGameAchievementText + activityGameAchievementContent);
|
||||
ss.setSpan(new ForegroundColorSpan(Color.parseColor("#FFBA6A")), activityGameAchievementText.length(), ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
activityGameAchievement.setText(ss);
|
||||
}else{
|
||||
activityGameAchievement.setVisibility(View.GONE);
|
||||
}
|
||||
if (sub_loss_score.getVisibility() == View.VISIBLE) {
|
||||
lossActivityIcon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (sub_win_score.getVisibility() == View.VISIBLE) {
|
||||
winActivityIcon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if(!containMe){
|
||||
sub_win_score.setVisibility(View.INVISIBLE);
|
||||
winActivityIcon.setVisibility(View.INVISIBLE);
|
||||
sub_loss_score.setVisibility(View.INVISIBLE);
|
||||
lossActivityIcon.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void checkMe(String id1,String id2){
|
||||
@SuppressLint("SetTextI18n")
|
||||
private Map<String, Integer> showActivityGameScore() {
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
if (gameSettle.activityGameInfoBean == null) return map;
|
||||
for (SudActivityGameInfoBean infoBean : gameSettle.activityGameInfoBean) {
|
||||
if (infoBean.getIs_win() == 1) {
|
||||
sub_loss_score.setText("+" + infoBean.getScore());
|
||||
map.put("loss", infoBean.getScore());
|
||||
} else if (infoBean.getIs_win() == 2) {
|
||||
sub_win_score.setText("+" + infoBean.getScore());
|
||||
map.put("win", infoBean.getScore());
|
||||
map.put("win_uid", infoBean.getUid());
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private void checkMe(String id1, String id2) {
|
||||
containMe = CommonAppConfig.getInstance().getUid().equals(id1) || CommonAppConfig.getInstance().getUid().equals(id2);
|
||||
}
|
||||
|
||||
@@ -150,11 +285,11 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
//关闭倒计时
|
||||
countDownTimer = new CountDownTimer(10000, 1000){
|
||||
countDownTimer = new CountDownTimer(10000, 1000) {
|
||||
|
||||
@Override
|
||||
public void onTick(long l) {
|
||||
sub_time.setText(String.valueOf((l+500)/1000));
|
||||
sub_time.setText(String.valueOf((l + 500) / 1000));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -165,23 +300,43 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
initData();
|
||||
}
|
||||
|
||||
public void setSudSettleList(List<SudSettleBean> data){
|
||||
SudMGPMGState.MGCommonGameSettle gameSettle;
|
||||
|
||||
public void setSudSettleList(SudMGPMGState.MGCommonGameSettle data) {
|
||||
gameSettle = data;
|
||||
settleBeans.clear();
|
||||
settleBeans.addAll(data);
|
||||
LogUtils.e("yqw=====>"+settleBeans);
|
||||
settleBeans.addAll(data.sudSettleBeans);
|
||||
LogUtils.e("yqw=====>" + settleBeans);
|
||||
}
|
||||
|
||||
private void sortByWinNum(List<SudSettleBean> list){
|
||||
private void sortByWinNum(List<SudSettleBean> list) {
|
||||
// 按照胜利数排序 settleBeans 列表
|
||||
if (isActivityGame) {
|
||||
for (SudActivityGameInfoBean infoBean : gameSettle.activityGameInfoBean) {
|
||||
for (SudSettleBean bean : list) {
|
||||
if (bean.getUid().equals(infoBean.getUid() + "")) {
|
||||
bean.setWin_num(infoBean.getScore());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Collections.sort(list, (bean1, bean2) -> {
|
||||
return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序
|
||||
//return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序
|
||||
return bean1.getRank()-bean2.getRank(); // 从大到小排序
|
||||
});
|
||||
LogUtils.e("排序后=====>" + settleBeans);
|
||||
}
|
||||
|
||||
private void destroyDialog(){
|
||||
private void destroyDialog() {
|
||||
dismiss();
|
||||
countDownTimer.cancel();
|
||||
if(countDownTimer!=null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
countDownTimer = null;
|
||||
}
|
||||
|
||||
public void setActivityGame() {
|
||||
isActivityGame = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.SudTitleSelectAdapter;
|
||||
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.LiveSudGameHistoryEvent;
|
||||
@@ -21,6 +22,7 @@ import com.yunbao.common.event.SudGameListEvent;
|
||||
import com.yunbao.common.event.SudGameListSillEvent;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -42,6 +44,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
private DialogInterface.OnDismissListener onDismissListener;
|
||||
private String mSill;
|
||||
private boolean isYuanbao;
|
||||
private String gameId = null;
|
||||
private CheckCurrencyModel currencyModel = null;
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, int type, List<CustomSidebarChildModel> child, long interactionID) {
|
||||
super(context);
|
||||
@@ -68,6 +72,15 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
this.isYuanbao = isYuanbao;
|
||||
}
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, int mType, String sill, boolean isYuanbao, String gameId, CheckCurrencyModel data) {
|
||||
super(context);
|
||||
this.mType = mType;
|
||||
mSill = sill;
|
||||
this.isYuanbao = isYuanbao;
|
||||
this.gameId = gameId;
|
||||
this.currencyModel = data;
|
||||
}
|
||||
|
||||
public SudGameListSelectPopup(@NonNull Context context, String sill, List<CustomSidebarChildModel> child) {
|
||||
super(context);
|
||||
this.mType = 8;
|
||||
@@ -160,7 +173,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
} else if (mType == 2) {
|
||||
}
|
||||
else if (mType == 2) {
|
||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||
selectString.add(getContext().getString(R.string.live_anchor));
|
||||
selectString.add(getContext().getString(R.string.interactive_game_player));
|
||||
@@ -195,6 +209,10 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
if (isYuanbao) {
|
||||
selectSill.put(getContext().getString(R.string.coins), "2");
|
||||
}
|
||||
if (currencyModel != null && currencyModel.isActivityGame(gameId)) {
|
||||
selectString.add(WordUtil.getNewString(R.string.game_create_coid_ticket));
|
||||
selectSill.put(WordUtil.getNewString(R.string.game_create_coid_ticket), "4");
|
||||
}
|
||||
|
||||
index = 0;
|
||||
for (int i = 0; i < selectString.size(); i++) {
|
||||
@@ -247,7 +265,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (mType == 7) {
|
||||
}
|
||||
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));
|
||||
@@ -278,7 +297,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (mType == 8) {
|
||||
}
|
||||
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++) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class SudGameMultipleDialog extends AbsDialogCenterPopupWindow{
|
||||
|
||||
sub_leave.setOnClickListener(v-> destroyDialog());
|
||||
sub_again.setOnClickListener(v-> {
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
destroyDialog();
|
||||
});
|
||||
|
||||
@@ -97,9 +97,9 @@ public class SudGameMultipleDialog extends AbsDialogCenterPopupWindow{
|
||||
// limitItem();
|
||||
}
|
||||
|
||||
public void setSudSettleList(List<SudSettleBean> data){
|
||||
public void setSudSettleList(SudMGPMGState.MGCommonGameSettle data){
|
||||
settleBeans.clear();
|
||||
settleBeans.addAll(data);
|
||||
settleBeans.addAll(data.sudSettleBeans);
|
||||
}
|
||||
|
||||
//设置最多显示的高度
|
||||
|
||||
@@ -56,7 +56,6 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
Bus.getOff(this);
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
@@ -78,7 +77,6 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
editSearch = findViewById(R.id.edit_search);
|
||||
// listHistory = findViewById(R.id.list_history);
|
||||
listRoom = findViewById(R.id.list_room);
|
||||
|
||||
@@ -1,24 +1,28 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class SudLoadDialog extends AbsDialogCenterPopupWindow{
|
||||
public class SudLoadDialog extends AbsDialogCenterPopupWindow {
|
||||
public SudLoadDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
private LinearLayoutCompat sud_load_bg;
|
||||
private AppCompatImageView sud_load,sud_load_skip,sud_load_again;
|
||||
private ProgressBar sud_load_bar_double,sud_load_bar_multiple;
|
||||
private AppCompatImageView sud_load, sud_load_skip, sud_load_again;
|
||||
private ProgressBar sud_load_bar_double, sud_load_bar_multiple;
|
||||
private int isDouble = 0;//游戏模式 1:双人对战 2:多人游戏
|
||||
private int clickStatus = 0;//0:什么都不点击 1:点击跳过 2:点击再来一局
|
||||
|
||||
@@ -50,36 +54,39 @@ public class SudLoadDialog extends AbsDialogCenterPopupWindow{
|
||||
sud_load_bar_double = findViewById(R.id.sud_load_bar_double);
|
||||
sud_load_bar_multiple = findViewById(R.id.sud_load_bar_multiple);
|
||||
|
||||
if (WordUtil.isNewZh()){
|
||||
if (WordUtil.isNewZh()) {
|
||||
sud_load.setImageResource(R.mipmap.sud_load_zh);
|
||||
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_zh);
|
||||
sud_load_again.setImageResource(R.mipmap.sub_again_zh);
|
||||
}else {
|
||||
} else {
|
||||
sud_load.setImageResource(R.mipmap.sud_load_en);
|
||||
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_en);
|
||||
sud_load_again.setImageResource(R.mipmap.sub_again_en);
|
||||
}
|
||||
|
||||
sud_load_skip.setOnClickListener(v->{
|
||||
sud_load_skip.setOnClickListener(v -> {
|
||||
clickStatus = 1;
|
||||
dismiss();
|
||||
});
|
||||
|
||||
sud_load_again.setOnClickListener(v->{
|
||||
sud_load_again.setOnClickListener(v -> {
|
||||
clickStatus = 2;
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
Handler activityGameTipsHandler = null;
|
||||
Runnable activityGameTipsRunnable = () -> {
|
||||
findViewById(R.id.sud_activity_tips_text).setVisibility(View.VISIBLE);
|
||||
};
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
if (isDouble == 1){
|
||||
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_double));
|
||||
if (isDouble == 1) {
|
||||
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext, R.mipmap.sud_load_bg_double));
|
||||
sud_load_bar_double.setVisibility(View.VISIBLE);
|
||||
sud_load_bar_multiple.setVisibility(View.GONE);
|
||||
}else {
|
||||
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_multiple));
|
||||
} else {
|
||||
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext, R.mipmap.sud_load_bg_multiple));
|
||||
sud_load_bar_double.setVisibility(View.GONE);
|
||||
sud_load_bar_multiple.setVisibility(View.VISIBLE);
|
||||
}
|
||||
@@ -88,9 +95,25 @@ public class SudLoadDialog extends AbsDialogCenterPopupWindow{
|
||||
// dismiss();
|
||||
// }
|
||||
// },10000);
|
||||
activityGameTipsHandler=new Handler(Looper.getMainLooper());
|
||||
activityGameTipsHandler.postDelayed(activityGameTipsRunnable,5000);
|
||||
}
|
||||
|
||||
public void setDouble(int isDouble){
|
||||
public void setDouble(int isDouble) {
|
||||
this.isDouble = isDouble;
|
||||
}
|
||||
|
||||
private boolean isActivityGame = false;
|
||||
|
||||
public void setActivityGame() {
|
||||
isActivityGame = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
if(activityGameTipsHandler!=null){
|
||||
activityGameTipsHandler.removeCallbacks(activityGameTipsRunnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,47 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CheckCurrencyModel extends BaseModel {
|
||||
|
||||
@SerializedName("is_yuanbao")
|
||||
private String isYuanbao;
|
||||
private String isYuanbao;//是否开启星币 0.否 1.是
|
||||
|
||||
@SerializedName("zq_game_status")
|
||||
private String zqGameStatus="1";//一杆清台活动开启状态 0.未开启 1.开启
|
||||
|
||||
@SerializedName("zq_ticket_number")
|
||||
private String zqTicketNumber;//一杆清台活动门票余额
|
||||
|
||||
private List<String> activityList;//活动列表 **本地注册,接口本身没这个字段
|
||||
|
||||
public CheckCurrencyModel() {
|
||||
activityList = new ArrayList<>();
|
||||
if(CommonAppConfig.isTestEnv()) {
|
||||
activityList.add("24");//测试服-台球
|
||||
}else {
|
||||
activityList.add("38");//正式服-台球
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getActivityList() {
|
||||
return activityList;
|
||||
}
|
||||
|
||||
public boolean isActivityGame(String gameId){
|
||||
if(StringUtil.isEmpty(gameId))return false;
|
||||
if(TextUtils.equals(zqGameStatus,"0")) return false;
|
||||
return activityList.contains(gameId);
|
||||
}
|
||||
|
||||
public String getIsYuanbao() {
|
||||
return isYuanbao;
|
||||
@@ -16,4 +51,27 @@ public class CheckCurrencyModel extends BaseModel {
|
||||
this.isYuanbao = isYuanbao;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getZqGameStatus() {
|
||||
return zqGameStatus;
|
||||
}
|
||||
|
||||
public void setZqGameStatus(String zqGameStatus) {
|
||||
this.zqGameStatus = zqGameStatus;
|
||||
}
|
||||
|
||||
public String getZqTicketNumber() {
|
||||
return zqTicketNumber;
|
||||
}
|
||||
public int getZqTicketNumberInt() {
|
||||
try {
|
||||
return Integer.parseInt(zqTicketNumber);
|
||||
}catch (Exception e){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void setZqTicketNumber(String zqTicketNumber) {
|
||||
this.zqTicketNumber = zqTicketNumber;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,74 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CheckRemainingBalanceEvent extends BaseModel {
|
||||
public int seatIndex=0;
|
||||
public int seatIndex = 0;
|
||||
private String SudMGPMGState;
|
||||
private boolean subReady = false;//是否直接自动准备
|
||||
private SudMGPMGState.MGCommonGameSettle mgCommonGameSettle;//结算数据
|
||||
private boolean isActivityGame;
|
||||
private SudMGPMGState.MGCommonPlayerIn playerIn;
|
||||
private String uid;
|
||||
private Object object;
|
||||
|
||||
public boolean isSubReady() {
|
||||
return subReady;
|
||||
}
|
||||
|
||||
public boolean isActivityGame() {
|
||||
return isActivityGame;
|
||||
}
|
||||
|
||||
public Object getObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public void setObject(Object object) {
|
||||
this.object = object;
|
||||
}
|
||||
|
||||
public com.yunbao.common.sud.state.SudMGPMGState.MGCommonPlayerIn getPlayerIn() {
|
||||
return playerIn;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent setPlayerIn(com.yunbao.common.sud.state.SudMGPMGState.MGCommonPlayerIn playerIn) {
|
||||
this.playerIn = playerIn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent setActivityGame(boolean activityGame) {
|
||||
isActivityGame = activityGame;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle() {
|
||||
return mgCommonGameSettle;
|
||||
}
|
||||
|
||||
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle(List<SudActivityGameInfoBean> data) {
|
||||
if(data==null) {
|
||||
LogUtils.e("数据为空");
|
||||
DebugUtils.showStackTrace();
|
||||
}
|
||||
mgCommonGameSettle.activityGameInfoBean = data;
|
||||
return mgCommonGameSettle;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent setMgCommonGameSettle(SudMGPMGState.MGCommonGameSettle mgCommonGameSettle) {
|
||||
this.mgCommonGameSettle = mgCommonGameSettle;
|
||||
return this;
|
||||
@@ -36,12 +92,23 @@ public class CheckRemainingBalanceEvent extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent setSubReady(boolean subReady){
|
||||
public CheckRemainingBalanceEvent setSubReady(boolean subReady) {
|
||||
this.subReady = subReady;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getSubReady(){
|
||||
public boolean getSubReady() {
|
||||
return subReady;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CheckRemainingBalanceEvent{" +
|
||||
"seatIndex=" + seatIndex +
|
||||
", SudMGPMGState='" + SudMGPMGState + '\'' +
|
||||
", subReady=" + subReady +
|
||||
", mgCommonGameSettle=" + mgCommonGameSettle +
|
||||
", isActivityGame=" + isActivityGame +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,10 @@ import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
|
||||
public class LiveOpenSudRoomEvent extends BaseModel {
|
||||
private CreateSudRoomModel createSudRoomModel = null;
|
||||
private boolean isActivity;
|
||||
|
||||
public CreateSudRoomModel getCreateSudRoomModel() {
|
||||
createSudRoomModel.setActivity(isActivity);
|
||||
return createSudRoomModel;
|
||||
}
|
||||
|
||||
@@ -14,4 +16,9 @@ public class LiveOpenSudRoomEvent extends BaseModel {
|
||||
this.createSudRoomModel = createSudRoomModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LiveOpenSudRoomEvent setActivity(boolean activity) {
|
||||
isActivity = activity;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
|
||||
public class LiveSudGamePopupShowOrHideEvent {
|
||||
private int type = 0;//0展示,1hide隱藏,2dismiss關閉
|
||||
private CreateSudRoomModel createSudRoomModel;
|
||||
private boolean isActivityGame;
|
||||
|
||||
public boolean isActivityGame() {
|
||||
return isActivityGame;
|
||||
}
|
||||
|
||||
public LiveSudGamePopupShowOrHideEvent setActivityGame(boolean activityGame) {
|
||||
isActivityGame = activityGame;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel getCreateSudRoomModel() {
|
||||
return createSudRoomModel;
|
||||
@@ -20,6 +32,8 @@ public class LiveSudGamePopupShowOrHideEvent {
|
||||
}
|
||||
|
||||
public LiveSudGamePopupShowOrHideEvent setType(int type) {
|
||||
LogUtils.e("调用游戏显示",isActivityGame);
|
||||
DebugUtils.showStackTrace();
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class API extends BaseApi {
|
||||
.addInterceptor(initQuery(isNeedUid, isNeedToken, CommonAppContext.sInstance.getApplicationContext()))
|
||||
.addInterceptor(loggingInterceptor);
|
||||
return create(builder.build(),
|
||||
GsonConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class);
|
||||
JavaConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class);
|
||||
}
|
||||
|
||||
//公共参数
|
||||
|
||||
@@ -20,8 +20,8 @@ public class CommonHttpConsts {
|
||||
public static final String DOWNLOAD_GIF = "downloadGif";
|
||||
public static final String GET_BALANCE = "getBalance";
|
||||
public static final String CHECK_TOKEN_INVALID = "checkTokenInvalid";
|
||||
public static final String NOTIFY_GOOGLE = "Charge.google_pay";
|
||||
public static final String COMMUNITY_SETREPORT = "Community.setReport";
|
||||
public static final String NOTIFY_GOOGLE = "gugezhifuhuidiao";
|
||||
public static final String COMMUNITY_SETREPORT = "yonghushequdongtaijubao";
|
||||
|
||||
public static final String GET_USER_HOME = "getUserHome";
|
||||
public static final String GET_USER_BASEINFO = "getUserBaseinfo";
|
||||
|
||||
@@ -175,7 +175,7 @@ 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() {
|
||||
HttpClient.getInstance().get("huoquzhuyepeizhixinxi", 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) {
|
||||
@@ -305,7 +305,7 @@ 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() {
|
||||
HttpClient.getInstance().get("caozuoguanzhuzhuangtaiv2", 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) {
|
||||
@@ -340,7 +340,7 @@ public class CommonHttpUtil {
|
||||
} else {
|
||||
isGoogle = "-1";
|
||||
}
|
||||
HttpClient.getInstance().get("User.getBalance", CommonHttpConsts.GET_BALANCE).params("type", 0).params("isGooglePay", isGoogle).execute(callback);
|
||||
HttpClient.getInstance().get("huoquwodezuanshi", CommonHttpConsts.GET_BALANCE).params("type", 0).params("isGooglePay", isGoogle).execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -389,7 +389,7 @@ public class CommonHttpUtil {
|
||||
* 检查token是否失效
|
||||
*/
|
||||
public static void checkTokenInvalid() {
|
||||
HttpClient.getInstance().get("User.ifToken", CommonHttpConsts.CHECK_TOKEN_INVALID).execute(NO_CALLBACK);
|
||||
HttpClient.getInstance().get("shezhijiaoyouzhaopianzhuangtai", CommonHttpConsts.CHECK_TOKEN_INVALID).execute(NO_CALLBACK);
|
||||
}
|
||||
|
||||
|
||||
@@ -397,19 +397,19 @@ 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", AppManager.getInstance().getMainActivity().getPackageName()).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", AppManager.getInstance().getMainActivity().getPackageName()).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("gugedingdanyanzheng", "gugedingdanyanzheng").params("purchaseToken", purchaseToken).params("orderno", orderNo).params("trade_no", tradeNo).params("package_name", AppManager.getInstance().getMainActivity().getPackageName()).execute(callback);
|
||||
}
|
||||
|
||||
public static void notifySamsung(String purchaseId, String selfOrderId,HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Charge.SamsungNotify", "Charge.SamsungNotify")
|
||||
HttpClient.getInstance().get("sanxingzhifuhuidiao", "sanxingzhifuhuidiao")
|
||||
.params("purchaseID", purchaseId)
|
||||
.params("SelfOrderId", selfOrderId)
|
||||
.params("PackageName", "pd")
|
||||
@@ -450,13 +450,13 @@ 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("huoquyonghujichuxinxi", CommonHttpConsts.GET_USER_BASEINFO).params("touid", touid).execute(callback);
|
||||
}
|
||||
/**
|
||||
* 上传文件 获取七牛云token的接口
|
||||
*/
|
||||
public static void getUploadQiNiuToken(HttpCallback callback, boolean isImg) {
|
||||
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken2", "Pdluserhome.getQiNiuToken2")
|
||||
HttpClient.getInstance().get("huoquqiniushangchuanlingpaiv2", "huoquqiniushangchuanlingpaiv2")
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.params("ext", isImg ? ".jpeg" : ".mp4")
|
||||
@@ -469,7 +469,7 @@ public class CommonHttpUtil {
|
||||
if(StringUtil.isEmpty(uid)){
|
||||
uid="NotLogin_"+ DeviceUtils.getUniqueDeviceId();
|
||||
}
|
||||
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken3", "Pdluserhome.getQiNiuToken3")
|
||||
HttpClient.getInstance().get("huoquqiniushangchuanlingpaiv3", "huoquqiniushangchuanlingpaiv3")
|
||||
.params("uid",uid)
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.params("file_name", fileName)
|
||||
|
||||
@@ -36,6 +36,7 @@ public abstract class HttpCallback extends AbsCallback<JsonBean> {
|
||||
public void onSuccess(Response<JsonBean> response) {
|
||||
JsonBean bean = response.body();
|
||||
String gson = new Gson().toJson(bean);
|
||||
L.e("gson:" + gson);
|
||||
if (bean != null) {
|
||||
if (200 == bean.getRet()) {
|
||||
Data data = bean.getData();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class HttpClient {
|
||||
private String mUrl;
|
||||
|
||||
private HttpClient() {
|
||||
mUrl = CommonAppConfig.HOST + "/api/public/?service=";
|
||||
mUrl = CommonAppConfig.HOST + "/";
|
||||
}
|
||||
|
||||
public static HttpClient getInstance() {
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.yunbao.common.http;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.yunbao.common.utils.AesUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Base64;
|
||||
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Converter;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public final class JavaConverterFactory extends Converter.Factory {
|
||||
/**
|
||||
* Create an instance using a default {@link Gson} instance for conversion. Encoding to JSON and
|
||||
* decoding from JSON (when no charset is specified by a header) will use UTF-8.
|
||||
*/
|
||||
public static JavaConverterFactory create() {
|
||||
return create(new Gson());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance using {@code gson} for conversion. Encoding to JSON and
|
||||
* decoding from JSON (when no charset is specified by a header) will use UTF-8.
|
||||
*/
|
||||
public static JavaConverterFactory create(Gson gson) {
|
||||
return new JavaConverterFactory(gson);
|
||||
}
|
||||
|
||||
private final Gson gson;
|
||||
|
||||
private JavaConverterFactory(Gson gson) {
|
||||
if (gson == null) throw new NullPointerException("gson == null");
|
||||
this.gson = gson;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
|
||||
TypeAdapter<?> adapter = gson.getAdapter(TypeToken.get(type));
|
||||
return new JsonResponseBodyConverter<>(gson, adapter);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
|
||||
return super.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit);
|
||||
}
|
||||
|
||||
final class JsonResponseBodyConverter<T> implements Converter<ResponseBody, T> {
|
||||
private final Gson gson;
|
||||
private final TypeAdapter<T> adapter;
|
||||
|
||||
JsonResponseBodyConverter(Gson gson, TypeAdapter<T> adapter) {
|
||||
this.gson = gson;
|
||||
this.adapter = adapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T convert(ResponseBody value) throws IOException {
|
||||
String response = value.string();
|
||||
String allResponseData;
|
||||
L.e("解密前::" + response);
|
||||
JSONObject jsonObject = JSONObject.parseObject(response);
|
||||
allResponseData = jsonObject.getString("data");
|
||||
if (allResponseData.indexOf(":") <= 0) {
|
||||
byte[] decodedData = null;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
decodedData = Base64.getDecoder().decode(allResponseData);
|
||||
}
|
||||
response = AesUtils.decryptToString(decodedData);
|
||||
jsonObject.put("data", JSONObject.parseObject(response));
|
||||
|
||||
response = JSON.toJSONString(jsonObject);
|
||||
L.e("解密后::" + response);
|
||||
//获取加密数据,解密,之后再让adapter去处理json串,解析具体的数据就可以了
|
||||
try {
|
||||
return adapter.fromJson(response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
value.close();
|
||||
}
|
||||
} else {
|
||||
return adapter.fromJson(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,18 @@
|
||||
package com.yunbao.common.http;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.bean.AdBean;
|
||||
import com.yunbao.common.utils.AesUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/5.
|
||||
*/
|
||||
@@ -7,7 +20,7 @@ package com.yunbao.common.http;
|
||||
public class JsonBean {
|
||||
private int ret;
|
||||
private String msg;
|
||||
private Data data;
|
||||
private String data;
|
||||
|
||||
public int getRet() {
|
||||
return ret;
|
||||
@@ -26,10 +39,47 @@ public class JsonBean {
|
||||
}
|
||||
|
||||
public Data getData() {
|
||||
return data;
|
||||
L.e("data:" + data);
|
||||
if (data.indexOf(":") > 0) {
|
||||
L.e("未加密::" + data);
|
||||
return JSON.parseObject(data, Data.class);
|
||||
//return GsonUtils.fromJson(data, Data.class);
|
||||
} else {
|
||||
Data resultData = new Data();
|
||||
byte[] decodedData = null;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
decodedData = Base64.getDecoder().decode(data);
|
||||
}
|
||||
String decryptedText = AesUtils.decryptToString(decodedData);
|
||||
L.e("解码前:" + data);
|
||||
L.e("解码前-转成base64:" + decodedData);
|
||||
L.e("解码前-解密後:" + decryptedText);
|
||||
JSONObject object = JSON.parseObject(decryptedText);
|
||||
try {
|
||||
JSONArray jsonArray = object.getJSONArray("info");
|
||||
String[] array = new String[jsonArray.size()];
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
array[i] = jsonArray.getString(i);
|
||||
}
|
||||
resultData.setInfo(array);
|
||||
resultData.setCode(object.getInteger("code"));
|
||||
resultData.setMsg(object.getString("msg"));
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
String[] array = new String[1];
|
||||
array[0] = object.getString("info");
|
||||
resultData.setInfo(array);
|
||||
resultData.setCode(object.getInteger("code"));
|
||||
resultData.setMsg(object.getString("msg"));
|
||||
} catch (JSONException ex) {
|
||||
L.e("字符串格式错误");
|
||||
}
|
||||
}
|
||||
return resultData;
|
||||
}
|
||||
}
|
||||
|
||||
public void setData(Data data) {
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class LiveHttpUtil {
|
||||
* 获取当前直播间的用户列表
|
||||
*/
|
||||
public static void getUserList(String liveuid, String stream, String type, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getUserLists", LiveHttpConsts.GET_USER_LIST)
|
||||
HttpClient.getInstance().get("zhibojianyonghuliebiao", LiveHttpConsts.GET_USER_LIST)
|
||||
.params("liveuid", liveuid)
|
||||
.params("stream", stream)
|
||||
.params("type", type)
|
||||
@@ -51,7 +51,7 @@ public class LiveHttpUtil {
|
||||
* @param callback 回调
|
||||
*/
|
||||
public static void getUserRankList(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Contribute.index", LiveHttpConsts.GET_USER_LIST)
|
||||
HttpClient.getInstance().get("xiaofeitongji", LiveHttpConsts.GET_USER_LIST)
|
||||
.params("uid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class LiveHttpUtil {
|
||||
* 获取当前直播间的连麦用户列表
|
||||
*/
|
||||
public static void getMicList(String liveuid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getDrLm", "Live.getDrLm")
|
||||
HttpClient.getInstance().get("huoqulianmaizhuangtai", "huoqulianmaizhuangtai")
|
||||
.params("uid", liveuid, true)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class LiveHttpUtil {
|
||||
* 获取活动列表
|
||||
*/
|
||||
public static void getHDList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Active.getActiveList", "Active.getActiveList")
|
||||
HttpClient.getInstance().get("huoquhuodongliebiao", "huoquhuodongliebiao")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class LiveHttpUtil {
|
||||
* @param stream 主播的stream
|
||||
*/
|
||||
public static void roomCharge(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.roomCharge", LiveHttpConsts.ROOM_CHARGE)
|
||||
HttpClient.getInstance().get("fangjiankoufei", LiveHttpConsts.ROOM_CHARGE)
|
||||
.params("stream", stream)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
@@ -94,7 +94,7 @@ public class LiveHttpUtil {
|
||||
* @param stream 主播的stream
|
||||
*/
|
||||
public static void timeCharge(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.timeCharge", LiveHttpConsts.TIME_CHARGE)
|
||||
HttpClient.getInstance().get("fangjianjishikoufei", LiveHttpConsts.TIME_CHARGE)
|
||||
.params("stream", stream)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
@@ -105,7 +105,7 @@ public class LiveHttpUtil {
|
||||
* 获取用户余额
|
||||
*/
|
||||
public static void getCoin(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getCoin", LiveHttpConsts.GET_COIN)
|
||||
HttpClient.getInstance().get("zhibojianhuoquyonghuyue", LiveHttpConsts.GET_COIN)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class LiveHttpUtil {
|
||||
* @param touid 对方的uid
|
||||
*/
|
||||
public static void getLiveRecord(String touid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getLiverecord", LiveHttpConsts.GET_LIVE_RECORD)
|
||||
HttpClient.getInstance().get("huoquzhibojilu", LiveHttpConsts.GET_LIVE_RECORD)
|
||||
.params("touid", touid)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
@@ -127,7 +127,7 @@ public class LiveHttpUtil {
|
||||
* @param recordId 视频的id
|
||||
*/
|
||||
public static void getAliCdnRecord(String recordId, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getAliCdnRecord", LiveHttpConsts.GET_ALI_CDN_RECORD)
|
||||
HttpClient.getInstance().get("huoqulubojilu", LiveHttpConsts.GET_ALI_CDN_RECORD)
|
||||
.params("id", recordId)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public class LiveHttpUtil {
|
||||
* 获取主播印象列表
|
||||
*/
|
||||
public static void getAllImpress(String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getUserLabel", LiveHttpConsts.GET_ALL_IMPRESS)
|
||||
HttpClient.getInstance().get("huoquyonghuyingxiangbiaoqian", LiveHttpConsts.GET_ALL_IMPRESS)
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ public class LiveHttpUtil {
|
||||
* 给主播设置印象
|
||||
*/
|
||||
public static void setImpress(String touid, String ImpressIDs, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.setUserLabel", LiveHttpConsts.SET_IMPRESS)
|
||||
HttpClient.getInstance().get("shezhiyonghuyingxiangbiaoqian", LiveHttpConsts.SET_IMPRESS)
|
||||
.params("touid", touid)
|
||||
.params("labels", ImpressIDs)
|
||||
.execute(callback);
|
||||
@@ -157,7 +157,7 @@ public class LiveHttpUtil {
|
||||
* 获取当前直播间的管理员列表
|
||||
*/
|
||||
public static void getAdminList(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getAdminList", LiveHttpConsts.GET_ADMIN_LIST)
|
||||
HttpClient.getInstance().get("huoquguanliyuanliebiao", LiveHttpConsts.GET_ADMIN_LIST)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class LiveHttpUtil {
|
||||
* 主播设置或取消直播间的管理员
|
||||
*/
|
||||
public static void setAdmin(String liveUid, String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.setAdmin", LiveHttpConsts.SET_ADMIN)
|
||||
HttpClient.getInstance().get("shezhiguanliyuanzhuangtai", LiveHttpConsts.SET_ADMIN)
|
||||
.params("liveuid", liveUid)
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
@@ -176,7 +176,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间的禁言列表
|
||||
*/
|
||||
public static void getLiveShutUpList(String liveUid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Livemanage.getShutList", LiveHttpConsts.GET_LIVE_SHUT_UP_LIST)
|
||||
HttpClient.getInstance().get("jinyanyonghu", LiveHttpConsts.GET_LIVE_SHUT_UP_LIST)
|
||||
.params("liveuid", liveUid)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
@@ -186,7 +186,7 @@ public class LiveHttpUtil {
|
||||
* 直播间解除禁言
|
||||
*/
|
||||
public static void liveCancelShutUp(String liveUid, String toUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Livemanage.cancelShut", LiveHttpConsts.LIVE_CANCEL_SHUT_UP)
|
||||
HttpClient.getInstance().get("jiechujinyan", LiveHttpConsts.LIVE_CANCEL_SHUT_UP)
|
||||
.params("liveuid", liveUid)
|
||||
.params("touid", toUid)
|
||||
.execute(callback);
|
||||
@@ -196,7 +196,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间的拉黑列表
|
||||
*/
|
||||
public static void getLiveBlackList(String liveUid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Livemanage.getKickList", LiveHttpConsts.GET_LIVE_BLACK_LIST)
|
||||
HttpClient.getInstance().get("tichuyonghu", LiveHttpConsts.GET_LIVE_BLACK_LIST)
|
||||
.params("liveuid", liveUid)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
@@ -206,7 +206,7 @@ public class LiveHttpUtil {
|
||||
* 直播间解除拉黑
|
||||
*/
|
||||
public static void liveCancelBlack(String liveUid, String toUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Livemanage.cancelKick", LiveHttpConsts.LIVE_CANCEL_BLACK)
|
||||
HttpClient.getInstance().get("jiechutichu", LiveHttpConsts.LIVE_CANCEL_BLACK)
|
||||
.params("liveuid", liveUid)
|
||||
.params("touid", toUid)
|
||||
.execute(callback);
|
||||
@@ -217,7 +217,7 @@ public class LiveHttpUtil {
|
||||
* 直播结束后,获取直播收益,观看人数,时长等信息
|
||||
*/
|
||||
public static void getLiveEndInfo(String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.stopInfo", LiveHttpConsts.GET_LIVE_END_INFO)
|
||||
HttpClient.getInstance().get("zhibojieshuxinxi", LiveHttpConsts.GET_LIVE_END_INFO)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间举报内容列表
|
||||
*/
|
||||
public static void getLiveReportList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getReportClass", LiveHttpConsts.GET_LIVE_REPORT_LIST)
|
||||
HttpClient.getInstance().get("huoqujubaopeizhixinxi", LiveHttpConsts.GET_LIVE_REPORT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ public class LiveHttpUtil {
|
||||
* 举报用户
|
||||
*/
|
||||
public static void setReport(String touid, String content, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.setReport", LiveHttpConsts.SET_REPORT)
|
||||
HttpClient.getInstance().get("yonghujubao", LiveHttpConsts.SET_REPORT)
|
||||
.params("touid", touid)
|
||||
.params("content", content)
|
||||
.execute(callback);
|
||||
@@ -244,7 +244,7 @@ public class LiveHttpUtil {
|
||||
* 举报用户 + 图片
|
||||
*/
|
||||
public static void setReport(String touid,String report_argument, String content, File file1, File file2, File file3, String videoId, HttpCallback callback) {
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.setReport", LiveHttpConsts.SET_REPORT)
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("yonghujubao", LiveHttpConsts.SET_REPORT)
|
||||
.isMultipart(true)
|
||||
.params("touid", touid)
|
||||
.params("report_argument", report_argument)
|
||||
@@ -268,7 +268,7 @@ public class LiveHttpUtil {
|
||||
* 直播间点击聊天列表和头像出现的弹窗
|
||||
*/
|
||||
public static void getLiveUser(String touid, String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getPop", LiveHttpConsts.GET_LIVE_USER)
|
||||
HttpClient.getInstance().get("zhibojiantanchuangxinxi", LiveHttpConsts.GET_LIVE_USER)
|
||||
.params("touid", touid)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
@@ -278,7 +278,7 @@ public class LiveHttpUtil {
|
||||
* 主播或管理员踢人
|
||||
*/
|
||||
public static void kicking(String liveUid, String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.kicking", LiveHttpConsts.KICKING)
|
||||
HttpClient.getInstance().get("zhibojiantiren", LiveHttpConsts.KICKING)
|
||||
.params("liveuid", liveUid)
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
@@ -294,7 +294,7 @@ public class LiveHttpUtil {
|
||||
* @param time 禁言时间 (分)
|
||||
*/
|
||||
public static void setShutUp(String liveUid, String stream, int type, String touid, String time, HttpCallback callback) {
|
||||
GetRequest<JsonBean> request = HttpClient.getInstance().get("Live.setShutUp", LiveHttpConsts.SET_SHUT_UP)
|
||||
GetRequest<JsonBean> request = HttpClient.getInstance().get("zhibojianjinyan", LiveHttpConsts.SET_SHUT_UP)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("type", type)
|
||||
@@ -312,7 +312,7 @@ public class LiveHttpUtil {
|
||||
* @param type 0表示关闭当前直播 1表示禁播,2表示封禁账号
|
||||
*/
|
||||
public static void superCloseRoom(String liveUid, int type, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.superStopRoom", LiveHttpConsts.SUPER_CLOSE_ROOM)
|
||||
HttpClient.getInstance().get("chaoguanguanbo", LiveHttpConsts.SUPER_CLOSE_ROOM)
|
||||
.params("liveuid", liveUid)
|
||||
.params("type", type)
|
||||
.execute(callback);
|
||||
@@ -323,7 +323,7 @@ public class LiveHttpUtil {
|
||||
* 守护商品类型列表
|
||||
*/
|
||||
public static void getGuardBuyList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Guard.getList", LiveHttpConsts.GET_GUARD_BUY_LIST)
|
||||
HttpClient.getInstance().get("shouhuliebiaov2", LiveHttpConsts.GET_GUARD_BUY_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ public class LiveHttpUtil {
|
||||
* 购买守护接口
|
||||
*/
|
||||
public static void buyGuard(String liveUid, String stream, int guardId, int cid, HttpCallback callback) {
|
||||
GetRequest<JsonBean> request = HttpClient.getInstance().get("Guard.buyGuard", LiveHttpConsts.BUY_GUARD)
|
||||
GetRequest<JsonBean> request = HttpClient.getInstance().get("goumaishouhu", LiveHttpConsts.BUY_GUARD)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("guardid", guardId);
|
||||
@@ -347,13 +347,13 @@ public class LiveHttpUtil {
|
||||
* 查看主播的守护列表
|
||||
*/
|
||||
public static void getGuardList(String liveUid, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Guard.getGuardList", LiveHttpConsts.GET_GUARD_LIST)
|
||||
HttpClient.getInstance().get("shouhuliebiao", LiveHttpConsts.GET_GUARD_LIST)
|
||||
.params("liveuid", liveUid)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
public static void getContactMsg(int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getContactMsg", "getContactMsg")
|
||||
HttpClient.getInstance().get("huoqulianxifangshixiaoxi", "huoqulianxifangshixiaoxi")
|
||||
.params("p", page)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -362,7 +362,7 @@ public class LiveHttpUtil {
|
||||
* 观众跟主播连麦时,获取自己的流地址
|
||||
*/
|
||||
public static void getLinkMicStream(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Linkmic.requestLVBAddrForLinkMic", LiveHttpConsts.GET_LINK_MIC_STREAM)
|
||||
HttpClient.getInstance().get("lianmaituilaliudizhi", LiveHttpConsts.GET_LINK_MIC_STREAM)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ public class LiveHttpUtil {
|
||||
* @param pull_url 连麦用户播流地址
|
||||
*/
|
||||
public static void linkMicShowVideo(String touid, String pull_url) {
|
||||
HttpClient.getInstance().get("Live.showVideo", LiveHttpConsts.LINK_MIC_SHOW_VIDEO)
|
||||
HttpClient.getInstance().get("lianmaixinxi", LiveHttpConsts.LINK_MIC_SHOW_VIDEO)
|
||||
.params("liveuid", CommonAppConfig.getInstance().getUid())
|
||||
.params("touid", touid)
|
||||
.params("pull_url", pull_url)
|
||||
@@ -389,7 +389,7 @@ public class LiveHttpUtil {
|
||||
* 主播设置是否允许观众发起连麦
|
||||
*/
|
||||
public static void setLinkMicEnable(boolean linkMicEnable, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Linkmic.setMic", LiveHttpConsts.SET_LINK_MIC_ENABLE)
|
||||
HttpClient.getInstance().get("shezhilianmaikaiguan", LiveHttpConsts.SET_LINK_MIC_ENABLE)
|
||||
.params("ismic", linkMicEnable ? 1 : 0)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -399,7 +399,7 @@ public class LiveHttpUtil {
|
||||
* 观众检查主播是否允许连麦
|
||||
*/
|
||||
public static void checkLinkMicEnable(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Linkmic.isMic", LiveHttpConsts.CHECK_LINK_MIC_ENABLE)
|
||||
HttpClient.getInstance().get("panduanzhubaoshifoukaiqilianmai", LiveHttpConsts.CHECK_LINK_MIC_ENABLE)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -408,7 +408,7 @@ public class LiveHttpUtil {
|
||||
* 连麦pk检查对方主播在线状态
|
||||
*/
|
||||
public static void livePkCheckLive(String liveUid, String stream, String uidStream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Home.getisPk", "Home.getisPk")
|
||||
HttpClient.getInstance().get("huoqupkzhuangtai", "huoqupkzhuangtai")
|
||||
.params("uid", liveUid, true)
|
||||
// .params("token", CommonAppConfig.getInstance().getToken())
|
||||
// .params("liveuid", liveUid)
|
||||
@@ -473,7 +473,7 @@ public class LiveHttpUtil {
|
||||
* 发送弹幕
|
||||
*/
|
||||
public static void sendDanmu(String content, String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.sendBarrage", LiveHttpConsts.SEND_DANMU)
|
||||
HttpClient.getInstance().get("fasongdanmu", LiveHttpConsts.SEND_DANMU)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", "1")
|
||||
@@ -489,7 +489,7 @@ public class LiveHttpUtil {
|
||||
* @param stream 主播的stream
|
||||
*/
|
||||
public static void checkLive(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.checkLive", LiveHttpConsts.CHECK_LIVE)
|
||||
HttpClient.getInstance().get("jianchazhibo", LiveHttpConsts.CHECK_LIVE)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
@@ -500,33 +500,13 @@ public class LiveHttpUtil {
|
||||
* 观众进入直播间
|
||||
*/
|
||||
public static void enterRoom(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.enterRoom", LiveHttpConsts.ENTER_ROOM)
|
||||
HttpClient.getInstance().get("jinruzhibojian", LiveHttpConsts.ENTER_ROOM)
|
||||
.params("city", CommonAppConfig.getInstance().getCity())
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众进入直播间后,还要请求一次
|
||||
*/
|
||||
public static void enterBackRoom(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Tx.userjoinroom", "Tx.userjoinroom")
|
||||
.params("GroupId", "g" + liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众退出直播间后,还要请求一次
|
||||
*/
|
||||
public static void qBackRoom(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Tx.leave_room", "Tx.leave_room")
|
||||
.params("GroupId", "g" + liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼物列表,同时会返回剩余的钱
|
||||
*/
|
||||
@@ -539,7 +519,14 @@ public class LiveHttpUtil {
|
||||
* 获取礼物列表,同时会返回剩余的钱(新版)
|
||||
*/
|
||||
public static void getNewGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getGiftListApp", LiveHttpConsts.GET_GIFT_LIST)
|
||||
HttpClient.getInstance().get("zhibojianliwuxinxi", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
/**
|
||||
* 获取礼物列表,同时会返回剩余的钱(新版) -用于获取联系方式时的礼物设置
|
||||
*/
|
||||
public static void getHotGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("huoqusuoyouremenliwu", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -547,7 +534,7 @@ public class LiveHttpUtil {
|
||||
* 获取包裹列表
|
||||
*/
|
||||
public static void getWrapList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getPackList", LiveHttpConsts.GET_WRAP_LIST)
|
||||
HttpClient.getInstance().get("zhibojianbaoguoxinxi", LiveHttpConsts.GET_WRAP_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -555,7 +542,7 @@ public class LiveHttpUtil {
|
||||
* 主播获取心愿单列表
|
||||
*/
|
||||
public static void getWishList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Guide.getWishlist", LiveHttpConsts.GET_WISH_LIST)
|
||||
HttpClient.getInstance().get("huoquxinyuandan", LiveHttpConsts.GET_WISH_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -563,7 +550,7 @@ public class LiveHttpUtil {
|
||||
* 用户获取主播的心愿单列表
|
||||
*/
|
||||
public static void getWishList(String liveId, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Guide.getWishlist", LiveHttpConsts.GET_WISH_LIST)
|
||||
HttpClient.getInstance().get("huoquxinyuandan", LiveHttpConsts.GET_WISH_LIST)
|
||||
.params("uid", liveId, true)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -574,7 +561,7 @@ public class LiveHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getFrontTask(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getFrontTask", "User.getFrontTask")
|
||||
HttpClient.getInstance().get("huoquxinshouyindaozhuangtai", "huoquxinshouyindaozhuangtai")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -584,7 +571,7 @@ public class LiveHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getFrontTask(String Token, String uid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getFrontTask", "User.getFrontTask")
|
||||
HttpClient.getInstance().get("huoquxinshouyindaozhuangtai", "huoquxinshouyindaozhuangtai")
|
||||
.params("token", Token, true)
|
||||
.params("uid", uid, true)
|
||||
.execute(callback);
|
||||
@@ -594,7 +581,7 @@ public class LiveHttpUtil {
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
|
||||
HttpClient.getInstance().get("shezhixinshouyindaozhuangtai", "shezhixinshouyindaozhuangtai")
|
||||
.params("type", type)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -603,7 +590,7 @@ public class LiveHttpUtil {
|
||||
* 完成新手任務
|
||||
*/
|
||||
public static void setFrontTask(String type, String liveuid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.setFrontTask", "User.setFrontTask")
|
||||
HttpClient.getInstance().get("shezhixinshouyindaozhuangtai", "shezhixinshouyindaozhuangtai")
|
||||
.params("type", type)
|
||||
.params("liveuid", liveuid)
|
||||
.execute(callback);
|
||||
@@ -613,7 +600,7 @@ public class LiveHttpUtil {
|
||||
* 修改心愿单列表
|
||||
*/
|
||||
public static void modifyWishList(String list, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Guide.setWishlist", LiveHttpConsts.SET_WISH_LIST)
|
||||
HttpClient.getInstance().get("shezhixinyuandan", LiveHttpConsts.SET_WISH_LIST)
|
||||
.params("list", list)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -635,7 +622,7 @@ public class LiveHttpUtil {
|
||||
* @param isContactGift 是否为联系方式礼物
|
||||
*/
|
||||
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.sendGift", LiveHttpConsts.SEND_GIFT)
|
||||
HttpClient.getInstance().get("zhibojianzengsongliwu", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", giftId)
|
||||
@@ -652,7 +639,7 @@ public class LiveHttpUtil {
|
||||
* @param isContactGift 是否为联系方式礼物
|
||||
*/
|
||||
public static void sendGiftForPage(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.sendPackGift", LiveHttpConsts.SEND_GIFT)
|
||||
HttpClient.getInstance().get("zhibojianzengsongbaoguoliwu", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", giftId)
|
||||
@@ -669,7 +656,7 @@ public class LiveHttpUtil {
|
||||
* @param isContactGift 是否为联系方式礼物
|
||||
*/
|
||||
public static void sendGiftForFansGroup(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.fansExclusivePack", LiveHttpConsts.SEND_GIFT)
|
||||
HttpClient.getInstance().get("zengsongfensituanbaoguoliwu", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", giftId)
|
||||
@@ -681,7 +668,7 @@ public class LiveHttpUtil {
|
||||
.execute(callback);
|
||||
}
|
||||
public static void sendBlindBoxTicket(String by, String liveUid, String stream, int giftId, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.sendBlindBoxTicket", LiveHttpConsts.SEND_GIFT)
|
||||
HttpClient.getInstance().get("mangheshiyongquan", LiveHttpConsts.SEND_GIFT)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.params("giftid", giftId)
|
||||
@@ -710,7 +697,7 @@ public class LiveHttpUtil {
|
||||
* 点亮發IM
|
||||
*/
|
||||
public static void sendZAN(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Fans.doubleClickLight", "Fans.DoubleClickLight")
|
||||
HttpClient.getInstance().get("shuangjidianliang", "shuangjidianliang")
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -719,7 +706,7 @@ public class LiveHttpUtil {
|
||||
* 连麦pk搜索主播
|
||||
*/
|
||||
public static void livePkSearchAnchor(String key, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Livepk.search", LiveHttpConsts.LIVE_PK_SEARCH_ANCHOR)
|
||||
HttpClient.getInstance().get("sousuozhiboyonghu", LiveHttpConsts.LIVE_PK_SEARCH_ANCHOR)
|
||||
.params("key", key)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
@@ -730,7 +717,7 @@ public class LiveHttpUtil {
|
||||
* 获取主播连麦pk列表
|
||||
*/
|
||||
public static void getLivePkList(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Livepk.getLiveList", LiveHttpConsts.GET_LIVE_PK_LIST)
|
||||
HttpClient.getInstance().get("huoquzhiboyonghuliebiao", LiveHttpConsts.GET_LIVE_PK_LIST)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -767,7 +754,7 @@ public class LiveHttpUtil {
|
||||
*/
|
||||
public static void newcreateRoom(String title, int liveClassId, int type, int typeVal, File file, int clarityType,boolean isSw, HttpCallback callback) {
|
||||
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.createRoom2", LiveHttpConsts.CREATE_ROOM)
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("chuangjianzhibov2", LiveHttpConsts.CREATE_ROOM)
|
||||
.params("title", title)
|
||||
.params("liveclassid", liveClassId)
|
||||
.params("type", type)
|
||||
@@ -786,7 +773,7 @@ public class LiveHttpUtil {
|
||||
* 修改直播状态
|
||||
*/
|
||||
public static void changeLive(String stream) {
|
||||
HttpClient.getInstance().get("Live.changeLive", LiveHttpConsts.CHANGE_LIVE)
|
||||
HttpClient.getInstance().get("xiugaizhibozhuangtai", LiveHttpConsts.CHANGE_LIVE)
|
||||
.params("stream", stream)
|
||||
.params("status", "1")
|
||||
.execute(new HttpCallback() {
|
||||
@@ -801,7 +788,7 @@ public class LiveHttpUtil {
|
||||
* 主播结束直播
|
||||
*/
|
||||
public static void stopLive(String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.stopRoom", LiveHttpConsts.STOP_LIVE)
|
||||
HttpClient.getInstance().get("guanbizhibo", LiveHttpConsts.STOP_LIVE)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -810,12 +797,12 @@ public class LiveHttpUtil {
|
||||
* 主播开播前获取sdk类型 0金山 1腾讯
|
||||
*/
|
||||
public static void getLiveSdk(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getSDK", LiveHttpConsts.GET_LIVE_SDK)
|
||||
HttpClient.getInstance().get("huoqusdk", LiveHttpConsts.GET_LIVE_SDK)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
public static void getisRong(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.isRong", "Live.isRong")
|
||||
HttpClient.getInstance().get("shifouweirongyunzhubo", "shifouweirongyunzhubo")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -824,7 +811,7 @@ public class LiveHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void getIsSw(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Tx.setRtcFirm", "Tx.setRtcFirm")
|
||||
HttpClient.getInstance().get("shezhiyuanshengduanshengwangpeizhi", "shezhiyuanshengduanshengwangpeizhi")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -832,7 +819,7 @@ public class LiveHttpUtil {
|
||||
* 腾讯sdk 跟主播连麦时,获取主播的低延时流
|
||||
*/
|
||||
public static void getTxLinkMicAccUrl(String originStreamUrl, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Linkmic.requestPlayUrlWithSignForLinkMic", LiveHttpConsts.GET_TX_LINK_MIC_ACC_URL)
|
||||
HttpClient.getInstance().get("jianquanliudizhi", LiveHttpConsts.GET_TX_LINK_MIC_ACC_URL)
|
||||
.params("originStreamUrl", originStreamUrl)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -842,7 +829,7 @@ public class LiveHttpUtil {
|
||||
* 连麦时候 主播混流
|
||||
*/
|
||||
public static void linkMicTxMixStream(String mergeparams) {
|
||||
HttpClient.getInstance().get("Linkmic.mergeVideoStream", LiveHttpConsts.LINK_MIC_TX_MIX_STREAM)
|
||||
HttpClient.getInstance().get("lianmaihunliu", LiveHttpConsts.LINK_MIC_TX_MIX_STREAM)
|
||||
.params("mergeparams", mergeparams)
|
||||
.execute(CommonHttpUtil.NO_CALLBACK);
|
||||
}
|
||||
@@ -852,7 +839,7 @@ public class LiveHttpUtil {
|
||||
* 我是哪些直播间的管理员,返回这些直播间列表
|
||||
*/
|
||||
public static void getMyAdminRoomList(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Livemanage.getRoomList", LiveHttpConsts.GET_MY_ADMIN_ROOM_LIST)
|
||||
HttpClient.getInstance().get("huoquwodefangjian", LiveHttpConsts.GET_MY_ADMIN_ROOM_LIST)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -862,7 +849,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间奖池等级
|
||||
*/
|
||||
public static void getLiveGiftPrizePool(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Jackpot.getJackpot", LiveHttpConsts.GET_LIVE_GIFT_PRIZE_POOL)
|
||||
HttpClient.getInstance().get("huoquyindaoyexinxi", LiveHttpConsts.GET_LIVE_GIFT_PRIZE_POOL)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
@@ -872,7 +859,7 @@ public class LiveHttpUtil {
|
||||
* 主播checkLive
|
||||
*/
|
||||
public static void anchorCheckLive(String liveUid, String stream, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.checkLiveing", LiveHttpConsts.ANCHOR_CHECK_LIVE)
|
||||
HttpClient.getInstance().get("jiancefangjiangzhuangtai", LiveHttpConsts.ANCHOR_CHECK_LIVE)
|
||||
.params("liveuid", liveUid)
|
||||
.params("stream", stream)
|
||||
.execute(callback);
|
||||
@@ -883,7 +870,7 @@ public class LiveHttpUtil {
|
||||
* 获取直播间信息
|
||||
*/
|
||||
public static void getLiveInfo(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getLiveInfo", LiveHttpConsts.GET_LIVE_INFO)
|
||||
HttpClient.getInstance().get("huoquzhiboxinxi", LiveHttpConsts.GET_LIVE_INFO)
|
||||
.params("liveuid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -894,7 +881,7 @@ public class LiveHttpUtil {
|
||||
*/
|
||||
|
||||
public static void getHcGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getSvgaList", LiveHttpConsts.GET_GIFT_LIST)
|
||||
HttpClient.getInstance().get("huoquliwudonghualiebiao", LiveHttpConsts.GET_GIFT_LIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -904,7 +891,7 @@ public class LiveHttpUtil {
|
||||
*/
|
||||
|
||||
public static void getHczGiftList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Home.aoto_load", "Home.aoto_load")
|
||||
HttpClient.getInstance().get("yuxiazai", "yuxiazai")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -913,29 +900,21 @@ public class LiveHttpUtil {
|
||||
* 获取活动
|
||||
*/
|
||||
public static void geteEvent(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Rank.isActivity", LiveHttpConsts.GET_EVENT)
|
||||
HttpClient.getInstance().get("huodongpeizhixinxi", LiveHttpConsts.GET_EVENT)
|
||||
.params("anchorUid", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
public static void getAnchorActiveImgStatus(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.getAnchorActiveImgStatus", LiveHttpConsts.GET_EVENT)
|
||||
HttpClient.getInstance().get("huoquzhuboxunfuchuangzhuangtai", LiveHttpConsts.GET_EVENT)
|
||||
.params("anchorUid", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
/**
|
||||
* 重置活动
|
||||
*/
|
||||
public static void setEvent(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Rank.crystalTimeEnd", LiveHttpConsts.GET_EVENT)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 整蛊转盘拯救主播
|
||||
*/
|
||||
public static void userHopePrankTurntable(String anchor_id, String prankid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Prank.userHopePrankTurntable", LiveHttpConsts.USERHOPEPRANKTURNTABLE)
|
||||
HttpClient.getInstance().get("yonghuzhengjiuzhubo", LiveHttpConsts.USERHOPEPRANKTURNTABLE)
|
||||
.params("prankid", prankid)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
@@ -945,7 +924,7 @@ public class LiveHttpUtil {
|
||||
* 倒计时结束
|
||||
*/
|
||||
public static void endPrankTurntable(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Prank.endPrankTurntable", LiveHttpConsts.ENDPRANKTURNTABLE)
|
||||
HttpClient.getInstance().get("zhenggudaojishijieshu", LiveHttpConsts.ENDPRANKTURNTABLE)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -954,7 +933,7 @@ public class LiveHttpUtil {
|
||||
* 周星榜数据
|
||||
*/
|
||||
public static void getAnchorLastWeekList(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("WeekStar.getAnchorLastWeekList", LiveHttpConsts.GETANCHORLASTWEEKLIST)
|
||||
HttpClient.getInstance().get("huoqushangzhouzhouxingbangzhubo", LiveHttpConsts.GETANCHORLASTWEEKLIST)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -962,7 +941,7 @@ public class LiveHttpUtil {
|
||||
* 热度加成列表
|
||||
*/
|
||||
public static void useHotCardUserList(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.useHotCardUserList", LiveHttpConsts.USEHOTCARDUSERLIST)
|
||||
HttpClient.getInstance().get("redukayonghuliebiao", LiveHttpConsts.USEHOTCARDUSERLIST)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -971,7 +950,7 @@ public class LiveHttpUtil {
|
||||
* 是否有热度加成
|
||||
*/
|
||||
public static void isHotCard(String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Live.isHotCard", LiveHttpConsts.ISHOTCARD)
|
||||
HttpClient.getInstance().get("zhibozhongshifoushiyongreduka", LiveHttpConsts.ISHOTCARD)
|
||||
.params("anchor_id", anchor_id)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -980,7 +959,7 @@ public class LiveHttpUtil {
|
||||
* 修改im备注信息
|
||||
*/
|
||||
public static void setInstructorRemark(String touid, String remark, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.setInstructorRemark", LiveHttpConsts.SETINSTRUCTORREMARK)
|
||||
HttpClient.getInstance().get("shezhiyonghubeizhuming", LiveHttpConsts.SETINSTRUCTORREMARK)
|
||||
.params("touid", touid)
|
||||
.params("remark", remark)
|
||||
.execute(callback);
|
||||
@@ -990,7 +969,7 @@ public class LiveHttpUtil {
|
||||
* 获取用户贵族喇叭的数量
|
||||
*/
|
||||
public static void getNobleTrumpetNum(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Noble.getNobleTrumpetNum", "getNobleTrumpetNum")
|
||||
HttpClient.getInstance().get("huoquguizulabashuliang", "huoquguizulabashuliang")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -998,7 +977,7 @@ public class LiveHttpUtil {
|
||||
* 获取用户贵族喇叭的数量
|
||||
*/
|
||||
public static void nobleUseTrumpet(String trumpet_msg, String anchor_id, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Noble.nobleUseTrumpet", "nobleUseTrumpet")
|
||||
HttpClient.getInstance().get("guizushiyonglaba", "guizushiyonglaba")
|
||||
.params("", trumpet_msg)
|
||||
.params("", anchor_id)
|
||||
.execute(callback);
|
||||
@@ -1008,7 +987,7 @@ public class LiveHttpUtil {
|
||||
* 获取用户贵族喇叭的数量
|
||||
*/
|
||||
public static void getStarChallengeStatus(String liveUid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("StarChallenge.getStarChallengeStatus", "StarChallengeStatus")
|
||||
HttpClient.getInstance().get("huoquxingjitiaozhanzhuangtai", "huoquxingjitiaozhanzhuangtai")
|
||||
.params("liveUid", liveUid)
|
||||
.execute(callback);
|
||||
}
|
||||
@@ -1017,14 +996,14 @@ public class LiveHttpUtil {
|
||||
* 首页关注直播
|
||||
*/
|
||||
public static void getHomeFollow(int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Home.getFollow", "Home.getFollow")
|
||||
HttpClient.getInstance().get("huoquguanzhuzhuboliebiao", "huoquguanzhuzhuboliebiao")
|
||||
.params("p", p)
|
||||
.execute(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")
|
||||
HttpClient.getInstance().get("huoquyouxiliebiao", "huoquyouxiliebiao")
|
||||
.params("sud_game_id", sudGameId)
|
||||
.params("threshold", threshold)
|
||||
.params("room_holder_type", roomHolderType)
|
||||
@@ -1044,7 +1023,7 @@ public class LiveHttpUtil {
|
||||
* @param callback
|
||||
*/
|
||||
public static void gameRecord(String sudGameId, String currencyType, String dateType, int page, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Sudgameserver.gameRecord", "Sudgameserver.gameRecord")
|
||||
HttpClient.getInstance().get("chaxunyouxijilu", "chaxunyouxijilu")
|
||||
.params("sud_game_id", sudGameId)
|
||||
.params("currency_type", currencyType)
|
||||
.params("date_type", dateType)
|
||||
@@ -1056,7 +1035,7 @@ public class LiveHttpUtil {
|
||||
* 获取短剧Url
|
||||
*/
|
||||
public static void getCoolydrama(HttpCallback callback){
|
||||
HttpClient.getInstance().get("cool.register", "Home.getFollow")
|
||||
HttpClient.getInstance().get("duanjuzhanghaozhuce", "duanjuzhanghaozhuce")
|
||||
.params("lang", WordUtil.isNewZh()?"zh_CN":"en")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
@@ -3,18 +3,21 @@ package com.yunbao.common.http.base;
|
||||
/**
|
||||
* maim的请求回调接口
|
||||
*/
|
||||
public interface HttpCallback<T> {
|
||||
public abstract class HttpCallback<T> {
|
||||
/**
|
||||
* 请求成功
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
void onSuccess(T data);
|
||||
public abstract void onSuccess(T data);
|
||||
|
||||
/**
|
||||
* 请求失败
|
||||
*
|
||||
* @param error
|
||||
*/
|
||||
void onError(String error);
|
||||
public abstract void onError(String error);
|
||||
public void onError(String error,int code){
|
||||
onError(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AvatarBean;
|
||||
import com.yunbao.common.bean.BallClearanceTableJoinRoomBean;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
@@ -72,7 +73,11 @@ import com.yunbao.common.bean.RoomMicStatusModel;
|
||||
import com.yunbao.common.bean.SendMoneyLongModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameActivityInfoRoomBean;
|
||||
import com.yunbao.common.bean.SudGameAiInfo;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameRoomInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
import com.yunbao.common.bean.SudGameUserModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
@@ -91,6 +96,8 @@ import com.yunbao.common.http.base.CheckLiveCallBack;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -2301,20 +2308,21 @@ public class LiveNetManager {
|
||||
|
||||
/**
|
||||
* 获取房间金豆门槛和赢家获得的金豆
|
||||
*
|
||||
* @param roomId
|
||||
* @param callback
|
||||
*/
|
||||
public void getScore(String roomId,HttpCallback<SudGameScoreBean> callback){
|
||||
public void getScore(String roomId, HttpCallback<SudGameScoreBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getScore(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(sudGameScoreBeanResponseModel -> {
|
||||
if (callback != null){
|
||||
if (callback != null) {
|
||||
callback.onSuccess(sudGameScoreBeanResponseModel.getData().getInfo());
|
||||
}
|
||||
}, throwable -> {
|
||||
if (callback != null){
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}).isDisposed();
|
||||
@@ -2322,28 +2330,43 @@ public class LiveNetManager {
|
||||
|
||||
/**
|
||||
* 获取游戏中所有玩家的信息
|
||||
*
|
||||
* @param roomId
|
||||
* @param callback
|
||||
*/
|
||||
public void getSudGameInfo(String roomId,HttpCallback<List<SudGameInfoBean>> callback){
|
||||
public void getSudGameInfo(String roomId, HttpCallback<List<SudGameInfoBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getSudGameInfo(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(infoModel->{
|
||||
if (callback != null){
|
||||
.subscribe(infoModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(infoModel.getData().getInfo());
|
||||
}
|
||||
},throwable -> {
|
||||
if (callback != null){
|
||||
}, throwable -> {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
||||
createSudRoom(roomName, goldenBeanNumber, currencyType, gameId, false, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建游戏房
|
||||
*
|
||||
* @param roomName 房间名称
|
||||
* @param goldenBeanNumber 游戏豆数量
|
||||
* @param currencyType 货币类型
|
||||
* @param gameId 游戏ID
|
||||
* @param isActivityGame 是否是活动游戏
|
||||
* @param callback 回调
|
||||
*/
|
||||
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, boolean isActivityGame, HttpCallback<CreateSudRoomModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
|
||||
.createSudRoom(roomName, goldenBeanNumber, currencyType, isActivityGame ? "1" : "0", gameId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {
|
||||
@@ -2353,7 +2376,7 @@ public class LiveNetManager {
|
||||
if (createSudRoomModelResponseModel.getData().getCode() == 0) {
|
||||
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
||||
} else {
|
||||
callback.onError(createSudRoomModelResponseModel.getData().getMsg());
|
||||
callback.onError(createSudRoomModelResponseModel.getData().getMsg(), createSudRoomModelResponseModel.getData().getCode());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3061,9 +3084,9 @@ public class LiveNetManager {
|
||||
|
||||
}
|
||||
|
||||
public void openGuard(String liveUid, String guardType, String priceKey, String stream,String coupon_type,String couponId, HttpCallback<String> callback) {
|
||||
public void openGuard(String liveUid, String guardType, String priceKey, String stream, String coupon_type, String couponId, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.openGuard(liveUid, guardType, priceKey, stream,coupon_type,couponId)
|
||||
.openGuard(liveUid, guardType, priceKey, stream, coupon_type, couponId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@@ -3572,9 +3595,9 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void userUseDress( String usersDressId, HttpCallback<HttpCallbackModel> callback) {
|
||||
public void userUseDress(String usersDressId, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.userUseDress(usersDressId,3)
|
||||
.userUseDress(usersDressId, 3)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||
@@ -3596,12 +3619,161 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void ballClearanceTableStatus( String roomId, HttpCallback<BaseModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.ballClearanceTableStatus(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void ballClearanceTableGetResultScore( String roomId, HttpCallback<List<SudActivityGameInfoBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.ballClearanceTableGetResultScore(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void ballClearanceTableAiAdd( String roomId, HttpCallback<SudGameAiInfo> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.ballClearanceTableAiAdd(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void ballClearanceTableGetRoomInfo( String roomId, HttpCallback<SudGameRoomInfoBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.ballClearanceTableGetRoomInfo(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void ballClearanceTableJoinRoom( HttpCallback<BallClearanceTableJoinRoomBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.ballClearanceTableJoinRoom()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void checkGameForActivity(String gameRoomId, HttpCallback<SudGameActivityInfoRoomBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.checkGameForActivity(gameRoomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
private MultipartBody.Part createUploadFile(File file) {
|
||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||
}
|
||||
|
||||
public void getPenalizeStatus(HttpCallback<ResponseModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getPenalizeStatus()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel>() {
|
||||
@Override
|
||||
public void accept(ResponseModel responseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
if (responseModel.getData().getCode() == 0) {
|
||||
String s = responseModel.getData().getInfo().toString();
|
||||
try {
|
||||
JSONObject ob = new JSONObject(s);
|
||||
if (ob.getInt("unread_num") > 0) {
|
||||
callback.onSuccess(responseModel);
|
||||
} else {
|
||||
callback.onError("");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
callback.onError("");
|
||||
}
|
||||
} else {
|
||||
callback.onError("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -447,7 +447,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
private Runnable isInstructorRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
HttpClient.getInstance().get("User.isInstructor", "isInstructor")
|
||||
HttpClient.getInstance().get("shifouweituiguangzhanghao", "isInstructor")
|
||||
.params("uid", userInfo.getId(), true)
|
||||
.params("token", userInfo.getToken(), true)
|
||||
.execute(new HttpCallback() {
|
||||
@@ -518,7 +518,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
String uid = uidAndToken[0];
|
||||
String token = uidAndToken[1];
|
||||
if (TextUtils.isEmpty(token)) return;
|
||||
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
|
||||
HttpClient.getInstance().get("huoquyonghujibenxinxiv2", "getBaseInfo")
|
||||
.params("uid", uid)
|
||||
.params("token", token)
|
||||
.execute(new HttpCallback() {
|
||||
@@ -539,7 +539,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
}
|
||||
|
||||
public void updateUserCoin() {
|
||||
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
||||
HttpClient.getInstance().get("chaxunyonghuyue", "chaxunyonghuyue")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -557,7 +557,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
}
|
||||
|
||||
public void updateUserCoin(OnItemClickListener<JSONObject> listener) {
|
||||
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
||||
HttpClient.getInstance().get("chaxunyonghuyue", "chaxunyonghuyue")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
@@ -102,7 +102,7 @@ public class InstructorRemarkManager extends BaseCacheManager {
|
||||
@Override
|
||||
public void run() {
|
||||
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
||||
HttpClient.getInstance().get("User.getInstructorRemark", "getInstructorRemark")
|
||||
HttpClient.getInstance().get("huoqutuiguangbeizhumingliebiao", "huoqutuiguangbeizhumingliebiao")
|
||||
.params("uid", userInfo.getId(),true)
|
||||
.params("token", userInfo.getToken(),true)
|
||||
.execute(new HttpCallback() {
|
||||
|
||||
@@ -116,7 +116,7 @@ public class NoviceInstructorManager extends BaseCacheManager {
|
||||
IMLoginModel userModel = new Gson().fromJson(model1.getExtra(), IMLoginModel.class);
|
||||
if (userModel != null && TextUtils.equals(userModel.getIsAdmin(), "1")) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
||||
HttpClient.getInstance().get("Message.setZdyMsg", "setZdyMsg")
|
||||
HttpClient.getInstance().get("shezhizhidaoyuanxiaoxizhuangtai", "shezhizhidaoyuanxiaoxizhuangtai")
|
||||
.params("uid", userInfo.getId(), true)
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ImageSpan;
|
||||
import android.view.View;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.BallClearanceTableJoinRoomBean;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.game.AbsRandomGameManager;
|
||||
import com.yunbao.common.manager.game.BilliardsRandomManager;
|
||||
import com.yunbao.common.sud.QuickStartGameViewModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class RandomSudGameManager {
|
||||
private static RandomSudGameManager manager;
|
||||
private AbsRandomGameManager gameManager;
|
||||
private CreateSudRoomModel sudRoomModel;
|
||||
private boolean isRandom = false;
|
||||
|
||||
public static RandomSudGameManager getManager() {
|
||||
if (manager == null) {
|
||||
manager = new RandomSudGameManager();
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
private RandomSudGameManager() {
|
||||
|
||||
}
|
||||
|
||||
public void start(CreateSudRoomModel data, boolean isHome, boolean isRandom) {
|
||||
//TODO 等待五秒调用接口获取可以匹配的玩家
|
||||
//TODO 五秒内没有玩家就自己创建
|
||||
sudRoomModel = data;
|
||||
this.isRandom = isRandom;
|
||||
createRoom(data, isHome, isRandom);
|
||||
}
|
||||
|
||||
|
||||
private void createRoom(CreateSudRoomModel data, boolean isHome, boolean isRandom) {
|
||||
//TODO 创建房间五秒内没有其他玩家就上AI
|
||||
LiveNetManager.get(AppManager.getInstance().getMainActivity())
|
||||
.checkCurrency(new HttpCallback<CheckCurrencyModel>() {
|
||||
@Override
|
||||
public void onSuccess(CheckCurrencyModel currencyModel) {
|
||||
gameManager = new BilliardsRandomManager();
|
||||
gameManager.setRandom(isRandom);
|
||||
gameManager.onStart(currencyModel, data, isHome, isRandom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void createRoom(Context mContext) {
|
||||
if(gameManager==null){
|
||||
gameManager = new BilliardsRandomManager();
|
||||
gameManager.setRandom(isRandom);
|
||||
}
|
||||
gameManager.randomCreateRoom(mContext, new OnItemClickListener<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onItemClick(CreateSudRoomModel bean, int position) {
|
||||
start(bean, true, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
if (gameManager != null) {
|
||||
gameManager.reset();
|
||||
}
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
if (gameManager != null) {
|
||||
gameManager.destroy();
|
||||
gameManager = null;
|
||||
}
|
||||
sudRoomModel = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏结算
|
||||
*
|
||||
* @return 返回true则用默认的结算弹框
|
||||
*/
|
||||
public boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model) {
|
||||
if (gameManager == null) return true;
|
||||
return gameManager.onGameMGCommonGameSettle(model);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 台球状态
|
||||
*/
|
||||
public void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model) {
|
||||
if (gameManager != null) {
|
||||
gameManager.onGameMGCommonGameBilliardsHitState(model);
|
||||
}
|
||||
}
|
||||
|
||||
public void showNotActivityTicketDialog(Context mContext) {
|
||||
showNotActivityTicketDialog(mContext, false, null);
|
||||
}
|
||||
|
||||
public void showNotActivityTicketDialog(Context mContext, boolean isAudience, DialogUitl.SimpleCallback2 simpleCallback) {
|
||||
String text = WordUtil.isNewZh() ? "您還未用有門票$立即前往獲取吧~" : "You don’ thave a ticket yet$Go get it now~";
|
||||
SpannableString ss = new SpannableString(text);
|
||||
ImageSpan image = new ImageSpan(mContext, R.mipmap.ic_game_ticket);
|
||||
ss.setSpan(image, text.indexOf("$"), text.indexOf("$") + 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(mContext)
|
||||
.setTitle(WordUtil.isNewZh() ? "提示" : "Hint")
|
||||
.setHtmlCode(ss)
|
||||
.setCancelable(true)
|
||||
.setShowConfirmButton(true)
|
||||
.setShowCancelButton(true);
|
||||
if (isAudience) {
|
||||
builder.setConfirmString(WordUtil.isNewZh() ? "僅觀戰" : "Watch the game");
|
||||
builder.setCancelString(WordUtil.isNewZh() ? "獲取" : "Obtain");
|
||||
text = WordUtil.isNewZh() ? "您還未擁有門票$是否前往獲取?" : "You don’ t have the tickets yet $ Do you want to get them?";
|
||||
ss = new SpannableString(text);
|
||||
ss.setSpan(image, text.indexOf("$"), text.indexOf("$") + 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
|
||||
builder.setHtmlCode(ss);
|
||||
}else {
|
||||
builder.setConfirmString(WordUtil.isNewZh() ? "獲取" : "Obtain");
|
||||
}
|
||||
builder.setSimpleCallbackView(new DialogUitl.SimpleCallbackView() {
|
||||
|
||||
@Override
|
||||
public void onShow(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
|
||||
dialog.dismiss();
|
||||
if(!isAudience){
|
||||
openTicketWeb(mContext);
|
||||
}
|
||||
if (simpleCallback != null) {
|
||||
simpleCallback.onConfirmClick(dialog, "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
|
||||
dialog.dismiss();
|
||||
if(isAudience){
|
||||
openTicketWeb(mContext);
|
||||
}
|
||||
if (simpleCallback != null) {
|
||||
simpleCallback.onCancelClick();
|
||||
}
|
||||
}
|
||||
})
|
||||
.build()
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
public void onInitGame(CreateSudRoomModel mCreateSudRoomModel) {
|
||||
if (gameManager == null) {
|
||||
gameManager = new BilliardsRandomManager();
|
||||
gameManager.setRandom(isRandom);
|
||||
gameManager.onStart(null, mCreateSudRoomModel, false, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onGameState(CheckRemainingBalanceEvent event) {
|
||||
if (gameManager != null) {
|
||||
gameManager.onGameState(event);
|
||||
}
|
||||
}
|
||||
|
||||
public void random(Context mContext) {
|
||||
LiveNetManager.get(mContext)
|
||||
.ballClearanceTableJoinRoom(new HttpCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(BallClearanceTableJoinRoomBean data) {
|
||||
if (data != null) {
|
||||
if ("0".equals(data.getRoom_id()) || StringUtil.isEmpty(data.getRoom_id())) {
|
||||
createRoom(mContext);
|
||||
return;
|
||||
}
|
||||
check(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
|
||||
private void check(BallClearanceTableJoinRoomBean data) {
|
||||
LiveNetManager.get(mContext).checkRoomStatus(data.getRoom_id(), new HttpCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel model) {
|
||||
if (TextUtils.equals(model.getRoomStatus(), "0")) {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("房间不存在");
|
||||
} else {
|
||||
ToastUtil.show("The room does not exist");
|
||||
}
|
||||
} else {
|
||||
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
|
||||
createSudRoomModel.setSudGameId(data.getGameId());
|
||||
createSudRoomModel.setSudGameRoomId(data.getRoom_id());
|
||||
createSudRoomModel.setRoomName(data.getRoomName());
|
||||
start(createSudRoomModel, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setGameViewModel(QuickStartGameViewModel gameViewModel) {
|
||||
if (gameManager != null) {
|
||||
gameManager.setGameViewModel(gameViewModel);
|
||||
}
|
||||
}
|
||||
|
||||
public void openTicketWeb(Context mContext) {
|
||||
String url = String.format(Locale.getDefault(), "%s/h5/monthlyActivities/20240822/index.html?type=1&uid=%s&token=%s&isZh=%s",
|
||||
CommonAppConfig.HOST,
|
||||
IMLoginManager.get(mContext).getUserInfo().getId(),
|
||||
IMLoginManager.get(mContext).getUserInfo().getToken(),
|
||||
WordUtil.isNewZh() ? "1" : "0"
|
||||
);
|
||||
WebViewActivity.forward(mContext, url, true, false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.yunbao.common.manager.game;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.SudGameRoomInfoBean;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.sud.QuickStartGameViewModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
|
||||
public abstract class AbsRandomGameManager {
|
||||
protected CreateSudRoomModel data;
|
||||
protected QuickStartGameViewModel gameViewModel;
|
||||
protected boolean isRandom;
|
||||
protected boolean isCaptain = false;
|
||||
|
||||
public void setRandom(boolean random) {
|
||||
isRandom = random;
|
||||
}
|
||||
|
||||
public void setGameViewModel(QuickStartGameViewModel gameViewModel) {
|
||||
this.gameViewModel = gameViewModel;
|
||||
}
|
||||
|
||||
public abstract void onStart(CheckCurrencyModel currencyModel, CreateSudRoomModel data, boolean isHome, boolean isRandom);
|
||||
|
||||
public abstract void reset();
|
||||
public abstract void randomCreateRoom(Context mContext, OnItemClickListener<CreateSudRoomModel> onClickListener);
|
||||
|
||||
public abstract void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model);
|
||||
|
||||
public abstract boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model);
|
||||
|
||||
public void onGameState(CheckRemainingBalanceEvent event) {
|
||||
if (event.getSudMGPMGState().equals(SudMGPMGState.MG_COMMON_PLAYER_CAPTAIN)) {
|
||||
isCaptain = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected int getPlayerSize() {
|
||||
if (gameViewModel == null) return 0;
|
||||
return gameViewModel.getSudFSMMGCache().getPlayerInSet().size();
|
||||
}
|
||||
|
||||
public abstract void destroy();
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
package com.yunbao.common.manager.game;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.lzf.easyfloat.enums.ShowPattern;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.SudGameAiInfo;
|
||||
import com.yunbao.common.bean.SudGameRoomInfoBean;
|
||||
import com.yunbao.common.dialog.DebugDialog;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.RandomSudGameManager;
|
||||
import com.yunbao.common.sud.QuickStartGameViewModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||
int isOneOverForMy = -1;//自己是否一杆清台
|
||||
int isOneOverForOther = -1;//对方是否一杆清台
|
||||
int comboNumberForMy = 0;//自己连杆数
|
||||
int comboNumberForOther = 0;//对方连杆数
|
||||
private SudGameAiInfo aiInfo;
|
||||
private boolean isAddRobot = true;
|
||||
private OnItemClickListener<String> onItemClickListener;
|
||||
|
||||
|
||||
Handler autoJoinRobotHandler = null;
|
||||
Runnable autoJoinRobotRunnable = () -> {
|
||||
if (gameViewModel != null && gameViewModel.getSudFSMMGCache().getPlayerInSet().size() <= 2) {
|
||||
if (isCaptain) {
|
||||
onAddAiPlayer();
|
||||
}
|
||||
}
|
||||
};
|
||||
private boolean isInitDebug = false;
|
||||
|
||||
@Override
|
||||
public void onStart(CheckCurrencyModel currencyModel, CreateSudRoomModel data, boolean isHome, boolean isRandom) {
|
||||
this.data = data;
|
||||
if (isInitDebug) {
|
||||
isInitDebug = false;
|
||||
new Handler(Looper.getMainLooper())
|
||||
.postDelayed(() -> {
|
||||
DebugDialog.getInstance(new DebugDialog.DebugDialogRunnable() {
|
||||
@Override
|
||||
public void run(DebugDialog dialog) {
|
||||
dialog.setShowPattern(ShowPattern.ALL_TIME);
|
||||
onItemClickListener = (bean, position) -> {
|
||||
dialog.setParams("AI状态", isAddRobot + "");
|
||||
dialog.setParams("清杆状态", isOneOverForMy + "");
|
||||
dialog.setParams("连击", comboNumberForMy + "");
|
||||
|
||||
if (position == -1) {
|
||||
dialog.setParams("参数", bean);
|
||||
}
|
||||
dialog.setView("关闭", new Button(AppManager.getInstance().getMainActivity()), new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
};
|
||||
dialog.show();
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
}
|
||||
if (currencyModel == null) return;
|
||||
if (isHome) {
|
||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data), true, isRandom, true);
|
||||
} else {
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data).setActivityGame(true));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
isOneOverForMy = -1;
|
||||
isOneOverForOther = -1;
|
||||
comboNumberForMy = 0;
|
||||
comboNumberForOther = 0;
|
||||
if (autoJoinRobotHandler != null) {
|
||||
LogUtils.e("终止机器人");
|
||||
DebugUtils.showStackTrace();
|
||||
autoJoinRobotHandler.removeCallbacks(autoJoinRobotRunnable);
|
||||
autoJoinRobotHandler = null;
|
||||
}
|
||||
aiInfo = null;
|
||||
if (onItemClickListener != null)
|
||||
onItemClickListener.onItemClick("", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomCreateRoom(Context mContext, OnItemClickListener<CreateSudRoomModel> onClickListener) {
|
||||
//name = 三大风扇史蒂夫史蒂夫的房间 sill = 1 currencyType = 4 id = 24 isTicket = true
|
||||
String userName = IMLoginManager.get(mContext).getUserInfo().getUserNicename();
|
||||
String name = WordUtil.isNewZh() ? userName + "的房间 " : userName + "‘s room";
|
||||
String sill = "1";
|
||||
String currencyType = "4";
|
||||
String id;
|
||||
if (CommonAppConfig.isTestEnv()) {
|
||||
id = "24";
|
||||
} else {
|
||||
id = "38";
|
||||
}
|
||||
LiveNetManager.get(mContext).createSudRoom(name, sill, currencyType, id, true, new HttpCallback<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
BilliardsRandomManager.this.data = data;
|
||||
onClickListener.onItemClick(data, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGameState(CheckRemainingBalanceEvent event) {
|
||||
super.onGameState(event);
|
||||
if (event.getSudMGPMGState().equals(SudMGPMGState.MG_GAME_LOAD_OVER)) {
|
||||
joinAiRobot();
|
||||
}
|
||||
if(SudMGPMGState.MG_COMMON_GAME_STATE.equals(event.getSudMGPMGState())){
|
||||
reset();
|
||||
}
|
||||
if (event.getSudMGPMGState().equals(SudMGPMGState.MG_COMMON_PLAYER_IN)) {
|
||||
LogUtils.e("收到的回调: AI uid = " + getAiUid() + "| kickUid = " + event.getPlayerIn().kickUID + "|" + getPlayerSize());
|
||||
if (event.getPlayerIn().reason == 1 && aiInfo != null) {
|
||||
reset();
|
||||
isAddRobot = false;
|
||||
} else if (event.getPlayerIn().isIn && getPlayerSize() < 2) {
|
||||
reset();
|
||||
joinAiRobot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getAiUid() {
|
||||
if (aiInfo == null) {
|
||||
return "";
|
||||
}
|
||||
if (aiInfo.getUids().isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return aiInfo.getUids().get(0);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void joinAiRobot() {
|
||||
if (!isAddRobot) return;
|
||||
if (!isRandom) return;
|
||||
if (getPlayerSize() == 2) return;
|
||||
if (autoJoinRobotHandler != null) {
|
||||
autoJoinRobotHandler.removeCallbacks(autoJoinRobotRunnable);
|
||||
}
|
||||
autoJoinRobotHandler = new Handler(Looper.getMainLooper());
|
||||
autoJoinRobotHandler.postDelayed(autoJoinRobotRunnable, 5000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model) {
|
||||
LogUtils.e("uid:"+model.uid,"state:"+model.state,"isOneOverForMy:"+isOneOverForMy,"isOneOverForOther:"+isOneOverForOther);
|
||||
if (Integer.parseInt(model.uid) == IMLoginManager.get(AppManager.getInstance().getMainActivity()).getUserInfo().getId()) {
|
||||
if (isOneOverForMy == -1) {
|
||||
isOneOverForMy = 1;
|
||||
}
|
||||
if (model.state == 13 && comboNumberForMy == 0) {
|
||||
comboNumberForMy = 1;
|
||||
} else if (model.state >= 2 && model.state <= 7) {
|
||||
if (model.state > comboNumberForMy) {
|
||||
comboNumberForMy = model.state;
|
||||
}
|
||||
}
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(model.state + "", -1);
|
||||
}
|
||||
} else {
|
||||
if (isOneOverForMy == 1) {
|
||||
isOneOverForMy = 0;
|
||||
onSendNotOneOver();
|
||||
}
|
||||
if (isOneOverForOther == -1) {
|
||||
isOneOverForOther = 1;
|
||||
}
|
||||
if (model.state == 13 && comboNumberForOther == 0) {
|
||||
comboNumberForOther = 1;
|
||||
} else if (model.state >= 2 && model.state <= 7) {
|
||||
if (model.state > comboNumberForOther) {
|
||||
comboNumberForOther = model.state;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model) {
|
||||
System.out.println("游戏结束 :" + isOneOverForMy + "|" + comboNumberForMy);
|
||||
model.achievementValue=comboNumberForMy;
|
||||
if (isOneOverForMy == 1 && comboNumberForMy > 1) {
|
||||
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_0);
|
||||
} else if (comboNumberForMy > 0) {
|
||||
switch (comboNumberForMy) {
|
||||
case 1:
|
||||
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_1);
|
||||
break;
|
||||
case 2:
|
||||
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_2);
|
||||
break;
|
||||
case 3:
|
||||
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_3);
|
||||
break;
|
||||
case 4:
|
||||
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_4);
|
||||
break;
|
||||
case 5:
|
||||
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_5);
|
||||
break;
|
||||
case 6:
|
||||
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_6);
|
||||
break;
|
||||
case 7:
|
||||
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null)
|
||||
.setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE)
|
||||
.setActivityGame(true)
|
||||
.setMgCommonGameSettle(model));
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
isAddRobot = true;
|
||||
reset();
|
||||
}
|
||||
|
||||
public void onAddAiPlayer() {
|
||||
if (isAddRobot && getPlayerSize() == 1) {
|
||||
LiveNetManager.get(AppManager.getInstance().getMainActivity())
|
||||
.ballClearanceTableAiAdd(data.getSudGameRoomId(), new HttpCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(SudGameAiInfo data) {
|
||||
if (data != null) {
|
||||
aiInfo = data;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void onSendNotOneOver() {
|
||||
ToastUtil.showDebug("标记丢失一杆清台");
|
||||
LiveNetManager.get(AppManager.getInstance().getMainActivity())
|
||||
.ballClearanceTableStatus(data.getSudGameRoomId(), new HttpCallback<BaseModel>() {
|
||||
@Override
|
||||
public void onSuccess(BaseModel data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class MessageIMManager {
|
||||
if (userInfo == null) {
|
||||
return;
|
||||
}
|
||||
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
||||
HttpClient.getInstance().get("huoquxitongxiaoxiliebiaov2", "huoquxitongxiaoxiliebiaov2")
|
||||
.params("uid", userInfo.getId())
|
||||
.params("token", userInfo.getToken())
|
||||
.execute(new HttpCallback() {
|
||||
@@ -164,7 +164,7 @@ public class MessageIMManager {
|
||||
public void getSystemMessages(SystemMessagesHttpCallback callback) {
|
||||
systemNumber = 0;
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
||||
HttpClient.getInstance().get("huoquxitongxiaoxiliebiaov2", "huoquxitongxiaoxiliebiaov2")
|
||||
.params("uid", userInfo.getId())
|
||||
.params("token", userInfo.getToken())
|
||||
.execute(new HttpCallback() {
|
||||
|
||||
@@ -137,7 +137,7 @@ public class PayPresenter {
|
||||
initGooglePay();
|
||||
}
|
||||
|
||||
String newParm = StringUtil.contact("Charge.getGoogleOrder", orderParams, "&type=android",
|
||||
String newParm = StringUtil.contact("gugeshangpindingdan", orderParams, "&type=android",
|
||||
"&appname=", mActivity.getString(R.string.app_name),
|
||||
"&desc=" + mActivity.getPackageName() + "&source=android"
|
||||
);
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
package com.yunbao.common.server;
|
||||
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.APKDownloadUtil;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.util.Locale;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class DownloadService extends Service {
|
||||
public static final String DOWNLOAD_TAG = "downloadProgress";
|
||||
public static final String DOWNLOAD_TOTAL = "downloadTotal";
|
||||
private Context mContext;
|
||||
private int progress;
|
||||
private boolean isDownload = false;
|
||||
private boolean isDownloading;
|
||||
private boolean isForceInstall;
|
||||
|
||||
ServiceBinder binder = new ServiceBinder();
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return binder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
mContext = this;
|
||||
}
|
||||
|
||||
public class ServiceBinder extends Binder {
|
||||
public void startDownload(String url, boolean isForceInstall, APKDownloadUtil.OnUpdateListener listener) {
|
||||
if (isDownloading) return;
|
||||
DownloadService.this.isForceInstall = isForceInstall;
|
||||
downloadAPK(DownloadService.this, url, listener, 3);
|
||||
}
|
||||
|
||||
public void install() {
|
||||
LogUtils.e("文件大小:" + downloadFile.length(), "总大小:" + SpUtil.getLongValue(DOWNLOAD_TAG));
|
||||
if (SpUtil.getLongValue(DOWNLOAD_TAG) == -1 && downloadFile.exists()) {
|
||||
installApk(mContext, downloadFile, mContext.getPackageName() + ".fileprovider");
|
||||
if (!isForceInstall) {
|
||||
isDownload = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDownloadOK() {
|
||||
if (downloadFile == null) {
|
||||
return false;
|
||||
}
|
||||
if (SpUtil.getLongValue(DOWNLOAD_TAG) == -1) {
|
||||
return true;
|
||||
}
|
||||
return downloadFile.exists() && checkApk();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File downloadFile;
|
||||
|
||||
public void downloadAPK(Context context, final String url, APKDownloadUtil.OnUpdateListener listener, final int replay) {
|
||||
if (replay <= 0) {
|
||||
listener.updateFailure(-2, "DownloadError");
|
||||
return;
|
||||
}
|
||||
downloadFile = new File(context.getCacheDir(), "update_app.apk");
|
||||
if (SpUtil.getLongValue(DOWNLOAD_TAG) == -1 && checkApk()) {
|
||||
installApk(mContext, downloadFile, mContext.getPackageName() + ".fileprovider");
|
||||
return;
|
||||
}
|
||||
isDownloading = true;
|
||||
Request.Builder builder = new Request.Builder().url(url).addHeader("Accept-Encoding", "identity");
|
||||
if (SpUtil.getLongValue(DOWNLOAD_TAG) > 0) {
|
||||
builder.addHeader("Range", "bytes=" + SpUtil.getLongValue(DOWNLOAD_TAG) + "-");
|
||||
}
|
||||
Request request = builder.build();
|
||||
LogUtils.e("保存路径:" + downloadFile.getAbsolutePath());
|
||||
try {
|
||||
if (!downloadFile.exists() && !downloadFile.createNewFile()) {
|
||||
isDownload = false;
|
||||
return;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
createNotification();
|
||||
new OkHttpClient().newCall(request).enqueue(new Callback() {
|
||||
private Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
// 下载失败
|
||||
handler.post(() -> {
|
||||
listener.updateFailure(-1, e.getMessage());
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) {
|
||||
Looper.prepare();
|
||||
byte[] buf = new byte[2048];
|
||||
int len;
|
||||
|
||||
long downloadProgress = SpUtil.getLongValue(DOWNLOAD_TAG);
|
||||
long total = response.body().contentLength();
|
||||
try (InputStream inputStream = response.body().byteStream(); RandomAccessFile outputStream = new RandomAccessFile(downloadFile, "rw")) {
|
||||
long sum = 0;
|
||||
if (downloadProgress > 0) {
|
||||
LogUtils.e("断点续传:" + downloadProgress);
|
||||
}
|
||||
if (downloadProgress > 0) {
|
||||
sum = downloadProgress;
|
||||
outputStream.seek(downloadProgress);
|
||||
total = downloadProgress + total + 2048;
|
||||
} else {
|
||||
outputStream.setLength(total);
|
||||
SpUtil.setLongValue(DOWNLOAD_TOTAL, total);
|
||||
}
|
||||
int tmp = 0;
|
||||
while ((len = inputStream.read(buf)) != -1) {
|
||||
outputStream.write(buf, 0, len);
|
||||
SpUtil.setLongValue(DOWNLOAD_TAG, outputStream.getFilePointer());
|
||||
sum += len;
|
||||
progress = (int) (sum * 1.0f / total * 100);
|
||||
if (tmp != progress) {
|
||||
tmp = progress;
|
||||
updateNotification(progress, 100);
|
||||
}
|
||||
listener.onProgress(progress);
|
||||
}
|
||||
progress = 100;
|
||||
outputStream.close();
|
||||
inputStream.close();
|
||||
SpUtil.setLongValue(DOWNLOAD_TAG, -1);
|
||||
//启动安装app
|
||||
LogUtils.e("开始下载:" + "下载完成", "文件路径:" + downloadFile.getAbsolutePath(), "文件是否存在:" + downloadFile.exists(), "已下载大小:" + sum, "文件大小:" + total);
|
||||
isDownload = true;
|
||||
updateNotification(progress, 100);
|
||||
listener.onProgress(progress);
|
||||
installApk(context, downloadFile, context.getPackageName() + ".fileprovider");
|
||||
isDownloading = false;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.e("下载失败:" + e.getMessage(), "重试次数:" + replay);
|
||||
downloadAPK(mContext, url, listener, replay - 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean checkApk() {
|
||||
long apkTotal = SpUtil.getLongValue(DOWNLOAD_TOTAL);
|
||||
if (apkTotal == 0) return false;
|
||||
if (downloadFile == null || !downloadFile.exists()) return false;
|
||||
try {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
PackageInfo info = pm.getPackageArchiveInfo(downloadFile.getAbsolutePath(), PackageManager.GET_ACTIVITIES);
|
||||
if (info == null) return false;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
LogUtils.e("文件大小:" + downloadFile.length(), "已下载大小:" + apkTotal);
|
||||
return apkTotal == downloadFile.length();
|
||||
}
|
||||
|
||||
private NotificationChannel channel;
|
||||
NotificationCompat.Builder builder;
|
||||
|
||||
private void createNotification() {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
Intent intent = new Intent(this, AppManager.getInstance().getMainActivity().getClass());
|
||||
intent.putExtra("updateApk", true);
|
||||
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
} else {
|
||||
pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
|
||||
channel = new NotificationChannel("Download_channel", "pd_download", NotificationManager.IMPORTANCE_HIGH);
|
||||
NotificationManager manager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
manager.createNotificationChannel(channel);
|
||||
builder = new NotificationCompat.Builder(mContext, "Download_channel")
|
||||
.setChannelId(channel.getId())
|
||||
.setSmallIcon(R.mipmap.ic_launcher)
|
||||
.setContentTitle(WordUtil.isNewZh() ? "正在下载" : "Downloading")
|
||||
.setContentText(WordUtil.isNewZh() ? "下载中" : "Downloading")
|
||||
.setProgress(100, 0, true)
|
||||
.setOnlyAlertOnce(true)
|
||||
.setContentIntent(pendingIntent)
|
||||
.setPriority(NotificationCompat.PRIORITY_MAX);
|
||||
manager.notify(114514, builder.build());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateNotification(int downloadProgress, int total) {
|
||||
if (channel != null && builder != null) {
|
||||
builder.setProgress(total, downloadProgress, false);
|
||||
if (downloadProgress != total) {
|
||||
builder.setContentText(String.format(Locale.getDefault(), "(%d/%d)", downloadProgress, total));
|
||||
} else {
|
||||
builder.setContentText(WordUtil.isNewZh() ? "完成" : "Over");
|
||||
}
|
||||
NotificationManager manager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
manager.notify(114514, builder.build());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 安装apk
|
||||
*
|
||||
* @param context
|
||||
* @param file
|
||||
*/
|
||||
public void installApk(Context context, File file, String authority) {
|
||||
if (!checkApk()) return;
|
||||
Intent intent = getInstallIntent(context, file, authority);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取安装Intent
|
||||
*
|
||||
* @param context
|
||||
* @param file
|
||||
* @param authority
|
||||
* @return
|
||||
*/
|
||||
public Intent getInstallIntent(Context context, File file, String authority) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
Uri uriData;
|
||||
String type = "application/vnd.android.package-archive";
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
uriData = FileProvider.getUriForFile(context, authority, file);
|
||||
} else {
|
||||
uriData = Uri.fromFile(file);
|
||||
}
|
||||
intent.setDataAndType(uriData, type);
|
||||
return intent;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,8 @@ import android.widget.Toast;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.manager.RandomSudGameManager;
|
||||
import com.yunbao.common.sud.decorator.SudFSMMGCache;
|
||||
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
|
||||
import com.yunbao.common.sud.decorator.SudFSMMGListener;
|
||||
@@ -19,6 +21,7 @@ import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||
import com.yunbao.common.sud.state.MGStateResponse;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.SudJsonUtils;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@@ -127,7 +130,8 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
||||
public void onFailure(int errCode, String errMsg) {
|
||||
// TODO: 2022/6/13 下面toast可以根据业务需要决定是否保留
|
||||
if (isTestEnv()) {
|
||||
Toast.makeText(activity, "initSDK onFailure:" + errMsg + "(" + errCode + ")", Toast.LENGTH_LONG).show();
|
||||
//Toast.makeText(activity, "initSDK onFailure:" + errMsg + "(" + errCode + ")", Toast.LENGTH_LONG).show();
|
||||
ToastUtil.show("initSDK onFailure:" + errMsg + "(" + errCode + ")");
|
||||
}
|
||||
|
||||
delayLoadGame(activity, gameId);
|
||||
@@ -491,7 +495,17 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
||||
@Override
|
||||
public void onGameMGCommonGameSettle(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameSettle model) {
|
||||
LogUtils.e("yqw=====>"+model);
|
||||
if(RandomSudGameManager.getManager().onGameMGCommonGameSettle(model)){
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE).setMgCommonGameSettle(model));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 台球回调
|
||||
*/
|
||||
@Override
|
||||
public void onGameMGCommonGameBilliardsHitState(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameBilliardsHitState model) {
|
||||
SudFSMMGListener.super.onGameMGCommonGameBilliardsHitState(handle, model);
|
||||
RandomSudGameManager.getManager().onGameMGCommonGameBilliardsHitState(model);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -74,7 +75,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
||||
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
||||
private SudGameScoreBean sudGameScoreBean;//房间金豆的门槛和赢家奖励
|
||||
private List<SudGameInfoBean> sudGameInfoBeanList = new ArrayList<>();//玩家信息
|
||||
public final MutableLiveData<List<SudSettleBean>> listMutableLiveData = new MutableLiveData<>();//玩家排名信息
|
||||
public final MutableLiveData<SudMGPMGState.MGCommonGameSettle> listMutableLiveData = new MutableLiveData<>();//玩家排名信息
|
||||
|
||||
public void setSudGameInfoBeanList(List<SudGameInfoBean> sudGameInfoBeanList) {
|
||||
this.sudGameInfoBeanList = sudGameInfoBeanList;
|
||||
@@ -94,7 +95,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
||||
*/
|
||||
@Override
|
||||
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
||||
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
if (WordUtil.isNewZh()) {
|
||||
languageCode = "zh-TW";
|
||||
} else {
|
||||
languageCode = "en-US";
|
||||
@@ -203,27 +204,29 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
||||
String uid = playerResult.uid;
|
||||
int rank = playerResult.rank;
|
||||
SudGameInfoBean sudGameInfoBean = findGameInfoBean(uid);
|
||||
System.out.println("查找游戏信息" + sudGameInfoBean);
|
||||
if (sudGameInfoBean == null) return;
|
||||
|
||||
if (sudGameScoreBean.getGame_mode() == 1) {
|
||||
//双人游戏
|
||||
if (winnerNUm == 1){
|
||||
if (winnerNUm == 1) {
|
||||
winNum = (rank == 1) ? (int) (sudGameScoreBean.getRoom_sill() * 0.8) : -sudGameScoreBean.getRoom_sill();
|
||||
}else {
|
||||
} else {
|
||||
winNum = -sudGameScoreBean.getRoom_ticket();
|
||||
}
|
||||
} else {
|
||||
//多人游戏
|
||||
if (rank == 1){
|
||||
winNum = (playerNum*sudGameScoreBean.getRoom_win_num()-winnerNUm*sudGameScoreBean.getRoom_sill())/winnerNUm;
|
||||
}else {
|
||||
if (rank == 1) {
|
||||
winNum = (playerNum * sudGameScoreBean.getRoom_win_num() - winnerNUm * sudGameScoreBean.getRoom_sill()) / winnerNUm;
|
||||
} else {
|
||||
winNum = -sudGameScoreBean.getRoom_sill();
|
||||
}
|
||||
}
|
||||
settleBeans.add(new SudSettleBean(uid,sudGameInfoBean.getNick_name(),sudGameInfoBean.getAvatar_url(),rank,winNum));
|
||||
settleBeans.add(new SudSettleBean(uid, sudGameInfoBean.getNick_name(), sudGameInfoBean.getAvatar_url(), rank, winNum));
|
||||
}
|
||||
mgCommonGameSettle.sudSettleBeans = settleBeans;
|
||||
// 更新LiveData
|
||||
listMutableLiveData.setValue(settleBeans);
|
||||
listMutableLiveData.setValue(mgCommonGameSettle);
|
||||
}
|
||||
|
||||
// 统计第一名的玩家数量
|
||||
|
||||
@@ -10,8 +10,11 @@ import android.util.Log;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.manager.RandomSudGameManager;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
||||
import com.yunbao.common.utils.SudJsonUtils;
|
||||
|
||||
@@ -80,6 +83,9 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
if (listener != null) {
|
||||
listener.onGameStarted();
|
||||
}
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null)
|
||||
.setSudMGPMGState(SudMGPMGState.MG_GAME_LOAD_OVER)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,11 +184,10 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
} else {
|
||||
listener.onGameMGCommonGameSettle(handle, mgCommonGameSettle);
|
||||
}
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE).setMgCommonGameSettle(mgCommonGameSettle));
|
||||
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).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN).setSubReady(false));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null).setSeatIndex(mgCommonSelfClickJoinBtn.seatIndex).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN).setSubReady(false));
|
||||
// if (listener == null) {
|
||||
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
// } else {
|
||||
@@ -216,7 +221,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN: // 8. 开始游戏按钮点击状态
|
||||
SudMGPMGState.MGCommonSelfClickStartBtn mgCommonSelfClickStartBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickStartBtn.class);
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN));
|
||||
// if (listener == null) {
|
||||
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
// } else {
|
||||
@@ -236,7 +241,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
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));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
|
||||
}
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
@@ -259,7 +264,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
// } else {
|
||||
// listener.onGameMGCommonSelfClickGameSettleAgainBtn(handle, mgCommonSelfClickGameSettleAgainBtn);
|
||||
// }
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SOUND_LIST: // 13. 游戏上报游戏中的声音列表(2021-12-30新增,现在只支持碰碰我最强)
|
||||
SudMGPMGState.MGCommonGameSoundList mgCommonGameSoundList = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSoundList.class);
|
||||
@@ -533,6 +538,102 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
listener.onGameMGCommonHideGameScene(handle, mgCommonHideGameScene);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GOLD_BTN: // 46. 通知app点击了游戏的金币按钮(赛车)
|
||||
SudMGPMGState.MGCommonSelfClickGoldBtn mgCommonSelfClickGoldBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickGoldBtn.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonSelfClickGoldBtn(handle, mgCommonSelfClickGoldBtn);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_PIECE_ARRIVE_END: // 47. 通知app棋子到达终点(ludo)
|
||||
SudMGPMGState.MGCommonGamePieceArriveEnd mgCommonGamePieceArriveEnd = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePieceArriveEnd.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGamePieceArriveEnd(handle, mgCommonGamePieceArriveEnd);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_PLAYER_MANAGED_STATE: // 48. 通知app玩家是否托管
|
||||
SudMGPMGState.MGCommonGamePlayerManagedState mgCommonGamePlayerManagedState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerManagedState.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGamePlayerManagedState(handle, mgCommonGamePlayerManagedState);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SEND_BURST_WORD: // 49. 游戏向app发送爆词
|
||||
SudMGPMGState.MGCommonGameSendBurstWord mgCommonGameSendBurstWord = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSendBurstWord.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGameSendBurstWord(handle, mgCommonGameSendBurstWord);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_PLAYER_RANKS: // 50. 游戏向app发送玩家实时排名(只支持怪物消消乐)
|
||||
SudMGPMGState.MGCommonGamePlayerRanks mgCommonGamePlayerRanks = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerRanks.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGamePlayerRanks(handle, mgCommonGamePlayerRanks);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_PLAYER_PAIR_SINGULAR: // 51. 游戏向app发送玩家即时变化的单双牌(只支持okey101)
|
||||
SudMGPMGState.MGCommonGamePlayerPairSingular mgCommonGamePlayerPairSingular = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerPairSingular.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGamePlayerPairSingular(handle, mgCommonGamePlayerPairSingular);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_PLAYER_MONOPOLY_CARDS: // 52. 游戏向app发送获取玩家持有的道具卡(只支持大富翁)
|
||||
SudMGPMGState.MGCommonGamePlayerMonopolyCards mgCommonGamePlayerMonopolyCards = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerMonopolyCards.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGamePlayerMonopolyCards(handle, mgCommonGamePlayerMonopolyCards);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_PLAYER_SCORES: // 53. 游戏向app发送玩家实时积分(只支持怪物消消乐)
|
||||
SudMGPMGState.MGCommonGamePlayerScores mgCommonGamePlayerScores = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerScores.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGamePlayerScores(handle, mgCommonGamePlayerScores);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_DESTROY_GAME_SCENE: // 54. 游戏通知app销毁游戏(只支持部分概率类游戏)
|
||||
SudMGPMGState.MGCommonDestroyGameScene mgCommonDestroyGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonDestroyGameScene.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonDestroyGameScene(handle, mgCommonDestroyGameScene);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_BILLIARDS_HIT_STATE: // 55. 游戏通知app击球状态(只支持桌球)
|
||||
SudMGPMGState.MGCommonGameBilliardsHitState mgCommonGameBilliardsHitState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameBilliardsHitState.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGameBilliardsHitState(handle, mgCommonGameBilliardsHitState);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_PLAYER_PROPS_CARDS: // 56. 游戏向app发送获取玩家持有的指定点数道具卡(只支持飞行棋)
|
||||
SudMGPMGState.MGCommonGamePlayerPropsCards mgCommonGamePlayerPropsCards = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerPropsCards.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGamePlayerPropsCards(handle, mgCommonGamePlayerPropsCards);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_INFO_X: // 57. 游戏向app发送获游戏通用数据
|
||||
SudMGPMGState.MGCommonGameInfoX mgCommonGameInfoX = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameInfoX.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCommonGameInfoX(handle, mgCommonGameInfoX);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_DISCO_ACTION: // 1. 元宇宙砂砂舞指令回调
|
||||
SudMGPMGState.MGCommonGameDiscoAction mgCommonGameDiscoAction = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameDiscoAction.class);
|
||||
if (listener == null) {
|
||||
@@ -749,39 +850,15 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
listener.onGameMGCustomRocketSaveSignColor(handle, mgCustomRocketSaveSignColor);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_RANKING: // 1. 查询排行榜数据(棒球)
|
||||
SudMGPMGState.MGBaseballRanking mgBaseballRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRanking.class);
|
||||
case SudMGPMGState.MG_BASEBALL_DEFUALT_STATE: // 1. 设置界面默认状态(棒球)
|
||||
SudMGPMGState.MGBaseballDefaultState mgBaseballDefaultState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballDefaultState.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGBaseballRanking(handle, mgBaseballRanking);
|
||||
listener.onGameMGBaseballDefaultState(handle, mgBaseballDefaultState);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_MY_RANKING: // 2. 查询我的排名(棒球)
|
||||
SudMGPMGState.MGBaseballMyRanking mgBaseballMyRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballMyRanking.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGBaseballMyRanking(handle, mgBaseballMyRanking);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_RANGE_INFO: // 3. 查询当前距离我的前后玩家数据(棒球)
|
||||
SudMGPMGState.MGBaseballRangeInfo mgBaseballRangeInfo = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRangeInfo.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGBaseballRangeInfo(handle, mgBaseballRangeInfo);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_SET_CLICK_RECT: // 4. 设置app提供给游戏可点击区域(棒球)
|
||||
SudMGPMGState.MGBaseballSetClickRect mgBaseballSetClickRect = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballSetClickRect.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGBaseballSetClickRect(handle, mgBaseballSetClickRect);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_PREPARE_FINISH: // 5. 前期准备完成(棒球)
|
||||
case SudMGPMGState.MG_BASEBALL_PREPARE_FINISH: // 2. 前期准备完成(棒球)
|
||||
SudMGPMGState.MGBaseballPrepareFinish mgBaseballPrepareFinish = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballPrepareFinish.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
@@ -789,7 +866,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
listener.onGameMGBaseballPrepareFinish(handle, mgBaseballPrepareFinish);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_SHOW_GAME_SCENE: // 6. 主界面已显示(棒球)
|
||||
case SudMGPMGState.MG_BASEBALL_SHOW_GAME_SCENE: // 3. 主界面已显示(棒球)
|
||||
SudMGPMGState.MGBaseballShowGameScene mgBaseballShowGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballShowGameScene.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
@@ -797,7 +874,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
listener.onGameMGBaseballShowGameScene(handle, mgBaseballShowGameScene);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_HIDE_GAME_SCENE: // 7. 主界面已隐藏(棒球)
|
||||
case SudMGPMGState.MG_BASEBALL_HIDE_GAME_SCENE: // 4. 主界面已隐藏(棒球)
|
||||
SudMGPMGState.MGBaseballHideGameScene mgBaseballHideGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballHideGameScene.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
@@ -805,7 +882,39 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
listener.onGameMGBaseballHideGameScene(handle, mgBaseballHideGameScene);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_TEXT_CONFIG: // 8. 获取文本配置数据(棒球)
|
||||
case SudMGPMGState.MG_BASEBALL_RANKING: // 5. 查询排行榜数据(棒球)
|
||||
SudMGPMGState.MGBaseballRanking mgBaseballRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRanking.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGBaseballRanking(handle, mgBaseballRanking);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_MY_RANKING: // 6. 查询我的排名(棒球)
|
||||
SudMGPMGState.MGBaseballMyRanking mgBaseballMyRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballMyRanking.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGBaseballMyRanking(handle, mgBaseballMyRanking);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_RANGE_INFO: // 7. 查询当前距离我的前后玩家数据(棒球)
|
||||
SudMGPMGState.MGBaseballRangeInfo mgBaseballRangeInfo = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRangeInfo.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGBaseballRangeInfo(handle, mgBaseballRangeInfo);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_SET_CLICK_RECT: // 8. 设置app提供给游戏可点击区域(棒球)
|
||||
SudMGPMGState.MGBaseballSetClickRect mgBaseballSetClickRect = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballSetClickRect.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGBaseballSetClickRect(handle, mgBaseballSetClickRect);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_TEXT_CONFIG: // 9. 获取文本配置数据(棒球)
|
||||
SudMGPMGState.MGBaseballTextConfig mgBaseballTextConfig = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballTextConfig.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
@@ -813,6 +922,30 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
listener.onGameMGBaseballTextConfig(handle, mgBaseballTextConfig);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_BASEBALL_SEND_DISTANCE: // 10. 球落地, 通知距离(棒球)
|
||||
SudMGPMGState.MGBaseballSendDistance mgBaseballSendDistance = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballSendDistance.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGBaseballSendDistance(handle, mgBaseballSendDistance);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_CUSTOM_CR_ROOM_INIT_DATA: // 1. 请求房间数据
|
||||
SudMGPMGState.MGCustomCrRoomInitData mgCustomCrRoomInitData = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCustomCrRoomInitData.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCustomCrRoomInitData(handle, mgCustomCrRoomInitData);
|
||||
}
|
||||
break;
|
||||
case SudMGPMGState.MG_CUSTOM_CR_CLICK_SEAT: // 2. 点击主播位或老板位通知
|
||||
SudMGPMGState.MGCustomCrClickSeat mgCustomCrClickSeat = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCustomCrClickSeat.class);
|
||||
if (listener == null) {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
} else {
|
||||
listener.onGameMGCustomCrClickSeat(handle, mgCustomCrClickSeat);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
break;
|
||||
@@ -844,6 +977,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
} else {
|
||||
listener.onPlayerMGCommonPlayerIn(handle, userId, mgCommonPlayerIn);
|
||||
}
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(userId).setSudMGPMGState(SudMGPMGState.MG_COMMON_PLAYER_IN).setPlayerIn(mgCommonPlayerIn));
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_PLAYER_READY: // 2.准备状态(已修改)
|
||||
|
||||
@@ -863,6 +997,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
} else {
|
||||
listener.onPlayerMGCommonPlayerCaptain(handle, userId, mgCommonPlayerCaptain);
|
||||
}
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(userId).setSudMGPMGState(SudMGPMGState.MG_COMMON_PLAYER_CAPTAIN));
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_PLAYER_PLAYING: // 4.游戏状态(已修改)
|
||||
SudMGPMGState.MGCommonPlayerPlaying mgCommonPlayerPlaying = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonPlayerPlaying.class);
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
package com.yunbao.common.sud.state;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@@ -15,7 +17,10 @@ import java.util.List;
|
||||
* 参考文档:https://docs.sud.tech/zh-CN/app/Client/MGFSM/
|
||||
*/
|
||||
public class SudMGPMGState implements Serializable {
|
||||
|
||||
/**
|
||||
* 自定义的,游戏加载完毕的通知
|
||||
*/
|
||||
public static final String MG_GAME_LOAD_OVER="game_load_over";
|
||||
// region MG状态机-通用状态-游戏
|
||||
// 参考文档:https://docs.sud.tech/zh-CN/app/Client/MGFSM/CommonStateGame.html
|
||||
/**
|
||||
@@ -113,6 +118,24 @@ public class SudMGPMGState implements Serializable {
|
||||
|
||||
@SerializedName(value = "tr-TR")
|
||||
public String tr_TR; // 土耳其语
|
||||
|
||||
@SerializedName(value = "pt-PT")
|
||||
public String pt_PT; // 葡萄语
|
||||
|
||||
@SerializedName(value = "hi-IN")
|
||||
public String hi_IN; // 印地语
|
||||
|
||||
@SerializedName(value = "bn-BD")
|
||||
public String bn_BD; // 孟加拉语
|
||||
|
||||
@SerializedName(value = "tl-PH")
|
||||
public String tl_PH; // 塔加路语(菲律宾)
|
||||
|
||||
@SerializedName(value = "fa-IR")
|
||||
public String fa_IR; // 波斯语(伊朗)
|
||||
|
||||
@SerializedName(value = "ru-RU")
|
||||
public String ru_RU; // 俄罗斯语
|
||||
}
|
||||
|
||||
public static class MGCommonPublicMessageMsgUser implements Serializable {
|
||||
@@ -169,7 +192,10 @@ public class SudMGPMGState implements Serializable {
|
||||
|
||||
// 游戏结果玩家列表
|
||||
public List<PlayerResult> results;
|
||||
|
||||
public List<SudActivityGameInfoBean> activityGameInfoBean;
|
||||
public List<SudSettleBean> sudSettleBeans;
|
||||
public String achievement;
|
||||
public int achievementValue;
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MGCommonGameSettle{" +
|
||||
@@ -790,6 +816,178 @@ public class SudMGPMGState implements Serializable {
|
||||
*/
|
||||
public static class MGCommonHideGameScene implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 46. 通知app点击了游戏的金币按钮(赛车)
|
||||
*/
|
||||
public static final String MG_COMMON_SELF_CLICK_GOLD_BTN = "mg_common_self_click_gold_btn";
|
||||
|
||||
/**
|
||||
* 46. 通知app点击了游戏的金币按钮(赛车) 模型
|
||||
*/
|
||||
public static class MGCommonSelfClickGoldBtn implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 47. 通知app棋子到达终点(ludo)
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_PIECE_ARRIVE_END = "mg_common_game_piece_arrive_end";
|
||||
|
||||
/**
|
||||
* 47. 通知app棋子到达终点(ludo) 模型
|
||||
*/
|
||||
public static class MGCommonGamePieceArriveEnd implements Serializable {
|
||||
public String uid; // 玩家id
|
||||
public int pieceIndex; // 棋子编号 0 ~ 3
|
||||
}
|
||||
|
||||
/**
|
||||
* 48. 通知app玩家是否托管
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_PLAYER_MANAGED_STATE = "mg_common_game_player_managed_state";
|
||||
|
||||
/**
|
||||
* 48. 通知app玩家是否托管 模型
|
||||
*/
|
||||
public static class MGCommonGamePlayerManagedState implements Serializable {
|
||||
public String uid; // 玩家id
|
||||
public int managed; // 0: 未托管 1:托管
|
||||
}
|
||||
|
||||
/**
|
||||
* 49. 游戏向app发送爆词
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_SEND_BURST_WORD = "mg_common_game_send_burst_word";
|
||||
|
||||
/**
|
||||
* 49. 游戏向app发送爆词 模型
|
||||
*/
|
||||
public static class MGCommonGameSendBurstWord implements Serializable {
|
||||
public String text; // 爆词
|
||||
}
|
||||
|
||||
/**
|
||||
* 50. 游戏向app发送玩家实时排名(只支持怪物消消乐)
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_PLAYER_RANKS = "mg_common_game_player_ranks";
|
||||
|
||||
/**
|
||||
* 50. 游戏向app发送玩家实时排名(只支持怪物消消乐) 模型
|
||||
*/
|
||||
public static class MGCommonGamePlayerRanks implements Serializable {
|
||||
public List<RanksModel> ranks; // 所有玩家排名变化推送
|
||||
|
||||
public static class RanksModel implements Serializable {
|
||||
public String uid; // 用户id
|
||||
public int rank; // 排名
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 51. 游戏向app发送玩家即时变化的单双牌(只支持okey101)
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_PLAYER_PAIR_SINGULAR = "mg_common_game_player_pair_singular";
|
||||
|
||||
/**
|
||||
* 51. 游戏向app发送玩家即时变化的单双牌(只支持okey101) 模型
|
||||
*/
|
||||
public static class MGCommonGamePlayerPairSingular implements Serializable {
|
||||
public List<SingularModel> pairs; // 玩家单双牌推送
|
||||
|
||||
public static class SingularModel implements Serializable {
|
||||
public String uid; // 用户id
|
||||
public int pair; // pair: 1 双,0 单
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 52. 游戏向app发送获取玩家持有的道具卡(只支持大富翁)
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_PLAYER_MONOPOLY_CARDS = "mg_common_game_player_monopoly_cards";
|
||||
|
||||
/**
|
||||
* 52. 游戏向app发送获取玩家持有的道具卡(只支持大富翁) 模型
|
||||
*/
|
||||
public static class MGCommonGamePlayerMonopolyCards implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 53. 游戏向app发送玩家实时积分(只支持怪物消消乐)
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_PLAYER_SCORES = "mg_common_game_player_scores";
|
||||
|
||||
/**
|
||||
* 53. 游戏向app发送玩家实时积分(只支持怪物消消乐) 模型
|
||||
*/
|
||||
public static class MGCommonGamePlayerScores implements Serializable {
|
||||
public List<ScoresModel> scores; // 所有玩家积分变化推送
|
||||
|
||||
public static class ScoresModel implements Serializable {
|
||||
public String uid; // 用户id
|
||||
public int score; // 积分
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 54. 游戏通知app销毁游戏(只支持部分概率类游戏)
|
||||
*/
|
||||
public static final String MG_COMMON_DESTROY_GAME_SCENE = "mg_common_destroy_game_scene";
|
||||
|
||||
/**
|
||||
* 54. 游戏通知app销毁游戏(只支持部分概率类游戏) 模型
|
||||
*/
|
||||
public static class MGCommonDestroyGameScene implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 55. 游戏通知app击球状态(只支持桌球)
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_BILLIARDS_HIT_STATE = "mg_common_game_billiards_hit_state";
|
||||
|
||||
/**
|
||||
* 55. 游戏通知app击球状态(只支持桌球) 模型
|
||||
*/
|
||||
public static class MGCommonGameBilliardsHitState implements Serializable {
|
||||
public String uid; // 操作玩家的id
|
||||
/**
|
||||
* state状态说明:
|
||||
* 0: 母球击空或者第一击没击中目标球
|
||||
* 2-7: 连杆
|
||||
* 8: 白球进洞
|
||||
* 9: 没有足够的撞库数量
|
||||
* 10: 开球时进了黑八
|
||||
* 11: 提前进了黑八
|
||||
* 12: 没有有效进球
|
||||
* 13: 有有效进球
|
||||
* 14: 超时
|
||||
*/
|
||||
public int state;
|
||||
}
|
||||
|
||||
/**
|
||||
* 56. 游戏向app发送获取玩家持有的指定点数道具卡(只支持飞行棋)
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_PLAYER_PROPS_CARDS = "mg_common_game_player_props_cards";
|
||||
|
||||
/**
|
||||
* 56. 游戏向app发送获取玩家持有的指定点数道具卡(只支持飞行棋) 模型
|
||||
*/
|
||||
public static class MGCommonGamePlayerPropsCards implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 57. 游戏向app发送获游戏通用数据
|
||||
*/
|
||||
public static final String MG_COMMON_GAME_INFO_X = "mg_common_game_info_x";
|
||||
|
||||
/**
|
||||
* 57. 游戏向app发送获游戏通用数据 模型
|
||||
*/
|
||||
public static class MGCommonGameInfoX implements Serializable {
|
||||
public String eventName; // 事件名称 ,(注:具体游戏参考如下)
|
||||
public String data; // 具体的数据,为一个JSON字符串, (注:具体游戏参考如下)
|
||||
}
|
||||
|
||||
// endregion 通用状态-游戏
|
||||
|
||||
// region MG状态机-通用状态-玩家
|
||||
@@ -818,6 +1016,16 @@ public class SudMGPMGState implements Serializable {
|
||||
|
||||
// 当reason==1时有效;kickUID为踢人的用户uid;判断被踢的人是本人条件(onPlayerStateChange(userId==kickedUID == selfUID);(kickUID默认"",无意义便于处理)
|
||||
public String kickUID;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MGCommonPlayerIn{" +
|
||||
"isIn=" + isIn +
|
||||
", teamId=" + teamId +
|
||||
", reason=" + reason +
|
||||
", kickUID='" + kickUID + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1078,6 +1286,7 @@ public class SudMGPMGState implements Serializable {
|
||||
public static final class MGCommonGameDiscoAction implements Serializable {
|
||||
public int actionId; // 指令序号类型
|
||||
public boolean isSuccess; // true 指令成功,false 指令失败
|
||||
public int errCode; // 返回码
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1426,13 +1635,60 @@ public class SudMGPMGState implements Serializable {
|
||||
|
||||
// region 棒球
|
||||
/**
|
||||
* 1. 查询排行榜数据(棒球)
|
||||
* 1. 设置界面默认状态(棒球)
|
||||
*/
|
||||
public static final String MG_BASEBALL_DEFUALT_STATE = "mg_baseball_defualt_state";
|
||||
|
||||
/**
|
||||
* 1. 设置界面默认状态(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballDefaultState implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 2. 前期准备完成(棒球)
|
||||
* 游戏客户端通知APP指令动作前期准备完成
|
||||
*/
|
||||
public static final String MG_BASEBALL_PREPARE_FINISH = "mg_baseball_prepare_finish";
|
||||
|
||||
/**
|
||||
* 2. 前期准备完成(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballPrepareFinish implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 3. 主界面已显示(棒球)
|
||||
* 游戏客户端通知APP指令动作主界面已显示
|
||||
*/
|
||||
public static final String MG_BASEBALL_SHOW_GAME_SCENE = "mg_baseball_show_game_scene";
|
||||
|
||||
/**
|
||||
* 3. 主界面已显示(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballShowGameScene implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 4. 主界面已隐藏(棒球)
|
||||
* 游戏客户端通知APP指令动作主界面已隐藏
|
||||
*/
|
||||
public static final String MG_BASEBALL_HIDE_GAME_SCENE = "mg_baseball_hide_game_scene";
|
||||
|
||||
/**
|
||||
* 4. 主界面已隐藏(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballHideGameScene implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 5. 查询排行榜数据(棒球)
|
||||
* 游戏客户端通知APP查询排行榜数据
|
||||
*/
|
||||
public static final String MG_BASEBALL_RANKING = "mg_baseball_ranking";
|
||||
|
||||
/**
|
||||
* 1. 查询排行榜数据(棒球) 模型
|
||||
* 5. 查询排行榜数据(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballRanking implements Serializable {
|
||||
public int page; // 页数
|
||||
@@ -1440,89 +1696,65 @@ public class SudMGPMGState implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 2. 查询我的排名(棒球)
|
||||
* 6. 查询我的排名(棒球)
|
||||
* 游戏客户端通知APP查询我的排名
|
||||
*/
|
||||
public static final String MG_BASEBALL_MY_RANKING = "mg_baseball_my_ranking";
|
||||
|
||||
/**
|
||||
* 2. 查询我的排名(棒球) 模型
|
||||
* 6. 查询我的排名(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballMyRanking implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 3. 查询当前距离我的前后玩家数据(棒球)
|
||||
* 7. 查询当前距离我的前后玩家数据(棒球)
|
||||
* 游戏客户端通知APP查询当前距离我的前后玩家数据(需要排除自己)
|
||||
*/
|
||||
public static final String MG_BASEBALL_RANGE_INFO = "mg_baseball_range_info";
|
||||
|
||||
/**
|
||||
* 3. 查询当前距离我的前后玩家数据(棒球) 模型
|
||||
* 7. 查询当前距离我的前后玩家数据(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballRangeInfo implements Serializable {
|
||||
public long distance; // 自己当前的距离
|
||||
}
|
||||
|
||||
/**
|
||||
* 4. 设置app提供给游戏可点击区域(棒球)
|
||||
* 8. 设置app提供给游戏可点击区域(棒球)
|
||||
* 游戏客户端通知APP指令动作设置点击区域
|
||||
*/
|
||||
public static final String MG_BASEBALL_SET_CLICK_RECT = "mg_baseball_set_click_rect";
|
||||
|
||||
/**
|
||||
* 4. 设置app提供给游戏可点击区域(棒球) 模型
|
||||
* 8. 设置app提供给游戏可点击区域(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballSetClickRect implements Serializable {
|
||||
public List<InteractionClickRect> list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 5. 前期准备完成(棒球)
|
||||
* 游戏客户端通知APP指令动作前期准备完成
|
||||
*/
|
||||
public static final String MG_BASEBALL_PREPARE_FINISH = "mg_baseball_prepare_finish";
|
||||
|
||||
/**
|
||||
* 5. 前期准备完成(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballPrepareFinish implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 6. 主界面已显示(棒球)
|
||||
* 游戏客户端通知APP指令动作主界面已显示
|
||||
*/
|
||||
public static final String MG_BASEBALL_SHOW_GAME_SCENE = "mg_baseball_show_game_scene";
|
||||
|
||||
/**
|
||||
* 6. 主界面已显示(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballShowGameScene implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 7. 主界面已隐藏(棒球)
|
||||
* 游戏客户端通知APP指令动作主界面已隐藏
|
||||
*/
|
||||
public static final String MG_BASEBALL_HIDE_GAME_SCENE = "mg_baseball_hide_game_scene";
|
||||
|
||||
/**
|
||||
* 7. 主界面已隐藏(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballHideGameScene implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 8. 获取文本配置数据(棒球)
|
||||
* 9. 获取文本配置数据(棒球)
|
||||
*/
|
||||
public static final String MG_BASEBALL_TEXT_CONFIG = "mg_baseball_text_config";
|
||||
|
||||
/**
|
||||
* 8. 获取文本配置数据(棒球) 模型
|
||||
* 9. 获取文本配置数据(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballTextConfig implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 10. 球落地, 通知距离(棒球)
|
||||
*/
|
||||
public static final String MG_BASEBALL_SEND_DISTANCE = "mg_baseball_send_distance";
|
||||
|
||||
/**
|
||||
* 10. 球落地, 通知距离(棒球) 模型
|
||||
*/
|
||||
public static final class MGBaseballSendDistance implements Serializable {
|
||||
public int[] distances;
|
||||
}
|
||||
// endregion 棒球
|
||||
|
||||
/** 点击区域定义 */
|
||||
@@ -1533,4 +1765,29 @@ public class SudMGPMGState implements Serializable {
|
||||
public float height; // 区域的height
|
||||
}
|
||||
|
||||
}
|
||||
// region 3D语聊房
|
||||
/**
|
||||
* 1. 请求房间数据
|
||||
*/
|
||||
public static final String MG_CUSTOM_CR_ROOM_INIT_DATA = "mg_custom_cr_room_init_data";
|
||||
|
||||
/**
|
||||
* 1. 请求房间数据 模型
|
||||
*/
|
||||
public static final class MGCustomCrRoomInitData implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 2. 点击主播位或老板位通知
|
||||
*/
|
||||
public static final String MG_CUSTOM_CR_CLICK_SEAT = "mg_custom_cr_click_seat";
|
||||
|
||||
/**
|
||||
* 2. 点击主播位或老板位通知 模型
|
||||
*/
|
||||
public static final class MGCustomCrClickSeat implements Serializable {
|
||||
public int seatIndex; // 0~4一共5个麦位,0为老板位,1~4为四个面主播位
|
||||
}
|
||||
// endregion 3D语聊房
|
||||
|
||||
}
|
||||
@@ -104,6 +104,7 @@ public class APKDownloadUtil {
|
||||
*/
|
||||
public interface OnUpdateListener {
|
||||
void updateFailure(int code, String error);
|
||||
void onProgress(int progress);
|
||||
}
|
||||
//
|
||||
// /**
|
||||
|
||||
74
common/src/main/java/com/yunbao/common/utils/AesUtils.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
public class AesUtils {
|
||||
/**
|
||||
* 使用AES/ECB/PKCS5Padding模式解密数据
|
||||
*
|
||||
* @param encryptedData 加密后的字节数组(Base64解码后的结果,如果原始数据是Base64编码的话)
|
||||
* @param keyBytes AES密钥(16/24/32字节长,对应AES-128/192/256)
|
||||
* @return 解密后的明文字节数组,如果解密失败则返回null
|
||||
*/
|
||||
public static byte[] decrypt(byte[] encryptedData, byte[] keyBytes) {
|
||||
try {
|
||||
// 创建密钥规格
|
||||
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES-128-ECB");
|
||||
|
||||
// 获取Cipher实例并初始化为解密模式
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||
cipher.init(Cipher.DECRYPT_MODE, keySpec);
|
||||
// 执行解密
|
||||
byte[] decryptedBytes = cipher.doFinal(encryptedData);
|
||||
// 返回解密后的字节数组
|
||||
return decryptedBytes;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null; // 解密失败时返回null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果需要将解密后的字节数组转换为字符串(注意:这可能会导致数据丢失或乱码)
|
||||
*
|
||||
* @param encryptedData 加密后的字节数组(或Base64解码后的结果)
|
||||
* @return 解密后的字符串,如果解密失败则返回null
|
||||
*/
|
||||
public static String decryptToString(byte[] encryptedData) {
|
||||
byte[] decryptedBytes = decrypt(encryptedData,"LhHBfcsN2VmBpHCn".getBytes());
|
||||
if (decryptedBytes != null) {
|
||||
// 尝试将字节数组转换为字符串(使用指定的字符集)
|
||||
try {
|
||||
return decodeUnicode(new String(decryptedBytes, "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String decodeUnicode(String unicode) {
|
||||
/* StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < unicode.length();) {
|
||||
if (unicode.charAt(i) == '\\') {
|
||||
if (i + 5 < unicode.length()) {
|
||||
String codePointStr = unicode.substring(i + 2, i + 6);
|
||||
try {
|
||||
int codePoint = Integer.parseInt(codePointStr, 16);
|
||||
sb.append((char) codePoint);
|
||||
i += 6;
|
||||
continue;
|
||||
} catch (NumberFormatException e) {
|
||||
// Handle format error
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.append(unicode.charAt(i++));
|
||||
}*/
|
||||
return JSON.parseObject(unicode).toString();
|
||||
}
|
||||
}
|
||||