Compare commits
11 Commits
v681小游戏
...
local_mast
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e79741b297 | ||
| 238dfcc2d3 | |||
| 61b1101c3f | |||
| daf881f6a7 | |||
| 38f3b721e0 | |||
| 04ae7eeacc | |||
|
|
3440b71229 | ||
|
|
214e6f5d89 | ||
| 2d9e1cd685 | |||
| 7196ebd16e | |||
| e0405e9c13 |
@@ -48,8 +48,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_18
|
||||
targetCompatibility JavaVersion.VERSION_18
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
|
||||
32
PD项目说明文档.txt
Normal file
32
PD项目说明文档.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
切换正式服/测试服 在AndroidStudio的Build Variant中切换
|
||||
link_test 链接包-测试服
|
||||
link_online 链接包-正式服
|
||||
其余以此类推
|
||||
|
||||
注册账号可以在测试服用手机号注册,手机号可以随便填,验证码是123
|
||||
|
||||
网络请求尽量统一用com.yunbao.common.http.live.LiveNetManager
|
||||
Bean类尽量放common模块里
|
||||
Activity启动用com.yunbao.common.utils.RouteUtil来统一管理
|
||||
要用对话框可以用AbsDialogPopupWindow系列
|
||||
|
||||
英文字符串放 values/strings.xml
|
||||
中文字符串放 values-zh/strings.xml
|
||||
|
||||
英文图片放 默认mipmap
|
||||
中文图片放 mipmap-zh
|
||||
|
||||
模块相关
|
||||
app 主程序
|
||||
common 公共模块
|
||||
FaceUnity 美颜模块
|
||||
IAP6Helper 三星模块
|
||||
lib_faceunity 声网美颜模块
|
||||
lib_google 谷歌模块
|
||||
lib_huawei 华为模块
|
||||
live 直播间模块
|
||||
main 主页及其他模块
|
||||
pluginsForAnchor 插件模块,暂时不用管
|
||||
Share 分享模块
|
||||
TabLayout 第三方模块
|
||||
video 社区视频模块
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -24,8 +24,8 @@ android {
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_18
|
||||
targetCompatibility JavaVersion.VERSION_18
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -77,8 +77,8 @@ android {
|
||||
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_18
|
||||
targetCompatibility JavaVersion.VERSION_18
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
@@ -98,11 +98,12 @@ android {
|
||||
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
||||
processManifestTask.doLast { pm ->
|
||||
// String manifestPath = "build/intermediates/bundle_manifest/google_onlineRelease/bundle-manifest/AndroidManifest.xml"
|
||||
String manifestPath = "build/intermediates/merged_manifests/google_onlineRelease/processGoogle_onlineReleaseManifest/AndroidManifest.xml"
|
||||
def isGooglePlay = variant.name.contains("google")
|
||||
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 == 1)
|
||||
println "" + (isGooglePlay)
|
||||
println "" + (file(manifestPath).exists() && isGooglePlay)
|
||||
if (file(manifestPath).exists() && isGooglePlay) {
|
||||
def manifestContent = file(manifestPath).getText()
|
||||
|
||||
71
app/src/google_online/google-services.json
Normal file
71
app/src/google_online/google-services.json
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "822566078854",
|
||||
"project_id": "pdlvenew",
|
||||
"storage_bucket": "pdlvenew.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:822566078854:android:9cafc8bca8f63076bf8407",
|
||||
"android_client_info": {
|
||||
"package_name": "com.newpdlive.sy"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "822566078854-8c7698l64j66ijng9bq799o5qvbguhdo.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpdlive.sy",
|
||||
"certificate_hash": "e059b937bfa49d58f40fddee4c7463e03e2aae47"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "822566078854-9cej31ie42tgjeimdk691gmvkavrooa7.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpdlive.sy",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "822566078854-c63gcmvkn2ctfct9eebuo0r4tiolloel.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpdlive.sy",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "822566078854-jfpovcealtjkv6sf0338to2grv4e5i6k.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpdlive.sy",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "822566078854-lt8fjmii2f35anh46dquk0mk5qa0hi5f.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBVlPTRCNLnBNJNei5rHjEqok8CfbJLraI"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "822566078854-lt8fjmii2f35anh46dquk0mk5qa0hi5f.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
71
app/src/google_test/google-services.json
Normal file
71
app/src/google_test/google-services.json
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "822566078854",
|
||||
"project_id": "pdlvenew",
|
||||
"storage_bucket": "pdlvenew.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:822566078854:android:9cafc8bca8f63076bf8407",
|
||||
"android_client_info": {
|
||||
"package_name": "com.newpdlive.sy"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "822566078854-8c7698l64j66ijng9bq799o5qvbguhdo.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpdlive.sy",
|
||||
"certificate_hash": "e059b937bfa49d58f40fddee4c7463e03e2aae47"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "822566078854-9cej31ie42tgjeimdk691gmvkavrooa7.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpdlive.sy",
|
||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "822566078854-c63gcmvkn2ctfct9eebuo0r4tiolloel.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpdlive.sy",
|
||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "822566078854-jfpovcealtjkv6sf0338to2grv4e5i6k.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.newpdlive.sy",
|
||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "822566078854-lt8fjmii2f35anh46dquk0mk5qa0hi5f.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBVlPTRCNLnBNJNei5rHjEqok8CfbJLraI"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "822566078854-lt8fjmii2f35anh46dquk0mk5qa0hi5f.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -13,6 +13,14 @@
|
||||
}
|
||||
},
|
||||
"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,
|
||||
@@ -13,6 +13,14 @@
|
||||
}
|
||||
},
|
||||
"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,
|
||||
70
app/src/link_test/google-services.json
Normal file
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"
|
||||
}
|
||||
@@ -54,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" />
|
||||
@@ -171,6 +172,9 @@
|
||||
<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" />
|
||||
@@ -178,10 +182,10 @@
|
||||
|
||||
<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" />
|
||||
@@ -192,6 +196,7 @@
|
||||
android:name="firebase_analytics_collection_enabled"
|
||||
android:value="false" />
|
||||
|
||||
|
||||
<receiver
|
||||
android:name="com.shayu.phonelive.utils.CustomMessageReceiver"
|
||||
android:exported="true">
|
||||
|
||||
@@ -372,7 +372,7 @@ public class AppContext extends CommonAppContext {
|
||||
});
|
||||
|
||||
}).setUncaughtCrashHandler((t, e) -> {
|
||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||
Log.e("ApplicationError", "子线程异常");
|
||||
e.printStackTrace();
|
||||
}).register(this);
|
||||
}
|
||||
|
||||
70
app/src/samsung_online/google-services.json
Normal file
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
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"
|
||||
}
|
||||
@@ -66,8 +66,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_18
|
||||
targetCompatibility JavaVersion.VERSION_18
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -39,7 +39,7 @@ 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");
|
||||
//外部sd卡
|
||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||
//内部存储 /data/data/<application package>/files目录
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,7 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
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); // 第一名
|
||||
@@ -118,8 +119,8 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
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);
|
||||
@@ -137,15 +138,14 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
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")));
|
||||
//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;
|
||||
}
|
||||
}
|
||||
ToastUtil.show("结算:" + isDraw + " | " + isFirstMe + "|");
|
||||
} 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()));
|
||||
@@ -157,6 +157,7 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
sub_loss_name.setText(lossBean.getNick_name());
|
||||
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 {
|
||||
@@ -182,7 +183,7 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
if (isActivityGame) {
|
||||
Map<String, Integer> map = showActivityGameScore();
|
||||
if (!map.isEmpty()) {
|
||||
isDraw = map.get("win").intValue() == map.get("loss").intValue();
|
||||
// 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()));
|
||||
@@ -190,6 +191,7 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
}
|
||||
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 {
|
||||
@@ -207,14 +209,40 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
}
|
||||
System.out.println("是否为活动游戏" + isActivityGame + " 成就内容:" + gameSettle.achievement);
|
||||
if (isActivityGame) {
|
||||
//TODO 败者没显示成就
|
||||
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);
|
||||
@@ -294,14 +322,17 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
}
|
||||
}
|
||||
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() {
|
||||
dismiss();
|
||||
countDownTimer.cancel();
|
||||
if(countDownTimer!=null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
countDownTimer = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
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;
|
||||
|
||||
@@ -59,6 +61,10 @@ public class CheckRemainingBalanceEvent extends BaseModel {
|
||||
}
|
||||
|
||||
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle(List<SudActivityGameInfoBean> data) {
|
||||
if(data==null) {
|
||||
LogUtils.e("数据为空");
|
||||
DebugUtils.showStackTrace();
|
||||
}
|
||||
mgCommonGameSettle.activityGameInfoBean = data;
|
||||
return mgCommonGameSettle;
|
||||
}
|
||||
|
||||
@@ -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,5 +1,6 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
|
||||
@@ -31,6 +32,8 @@ public class LiveSudGamePopupShowOrHideEvent {
|
||||
}
|
||||
|
||||
public LiveSudGamePopupShowOrHideEvent setType(int type) {
|
||||
LogUtils.e("调用游戏显示",isActivityGame);
|
||||
DebugUtils.showStackTrace();
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -397,15 +397,15 @@ public class CommonHttpUtil {
|
||||
* 谷歌支付成功后,通知自己服务器
|
||||
*/
|
||||
public static void notifyMeGoogle(String purchaseToken, String productId, String orderno, HttpCallback callback) {
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE).params("purchaseToken", purchaseToken).params("productId", productId).params("orderno", orderno).params("package_name", "com.pdlive.shayu").execute(callback);
|
||||
HttpClient.getInstance().get(CommonHttpConsts.NOTIFY_GOOGLE, CommonHttpConsts.NOTIFY_GOOGLE).params("purchaseToken", purchaseToken).params("productId", productId).params("orderno", orderno).params("package_name", 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("Charge.Google_sec_pay", "Charge.Google_sec_pay").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) {
|
||||
|
||||
@@ -76,6 +76,7 @@ import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.SlideInBannerModel;
|
||||
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;
|
||||
@@ -1373,4 +1374,8 @@ public interface PDLiveApi {
|
||||
@GET("/api/public/?service=Sudgameserver.ballClearanceTableJoinRoom")
|
||||
Observable<ResponseModel<BallClearanceTableJoinRoomBean>> ballClearanceTableJoinRoom (
|
||||
);
|
||||
@GET("/api/public/?service=Sudgameserver.getRoomInfo")
|
||||
Observable<ResponseModel<SudGameActivityInfoRoomBean>> checkGameForActivity(
|
||||
@Query("room_id")String roomId
|
||||
);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ 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;
|
||||
@@ -3713,6 +3714,25 @@ public class LiveNetManager {
|
||||
}
|
||||
}).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);
|
||||
|
||||
@@ -2,9 +2,6 @@ package com.yunbao.common.manager;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
@@ -16,7 +13,6 @@ 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.bean.SudGameRoomInfoBean;
|
||||
import com.yunbao.common.event.CheckCurrencyModel;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@@ -28,7 +24,6 @@ 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.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -39,7 +34,6 @@ public class RandomSudGameManager {
|
||||
private static RandomSudGameManager manager;
|
||||
private AbsRandomGameManager gameManager;
|
||||
private CreateSudRoomModel sudRoomModel;
|
||||
private QuickStartGameViewModel gameViewModel;
|
||||
private boolean isRandom = false;
|
||||
|
||||
public static RandomSudGameManager getManager() {
|
||||
@@ -81,14 +75,16 @@ public class RandomSudGameManager {
|
||||
}
|
||||
|
||||
private void createRoom(Context mContext) {
|
||||
if(gameManager!=null){
|
||||
gameManager.randomCreateRoom(mContext, new OnItemClickListener<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onItemClick(CreateSudRoomModel bean, int position) {
|
||||
start(bean, true, true);
|
||||
}
|
||||
});
|
||||
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() {
|
||||
@@ -247,7 +243,6 @@ public class RandomSudGameManager {
|
||||
}
|
||||
|
||||
public void setGameViewModel(QuickStartGameViewModel gameViewModel) {
|
||||
this.gameManager = gameManager;
|
||||
if (gameManager != null) {
|
||||
gameManager.setGameViewModel(gameViewModel);
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -144,6 +145,9 @@ public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||
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) {
|
||||
@@ -184,6 +188,7 @@ public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||
|
||||
@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;
|
||||
@@ -219,6 +224,7 @@ public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||
@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) {
|
||||
@@ -279,16 +285,15 @@ public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||
}
|
||||
|
||||
private void onSendNotOneOver() {
|
||||
ToastUtil.showDebug("标记丢失一杆清台");
|
||||
LiveNetManager.get(AppManager.getInstance().getMainActivity())
|
||||
.ballClearanceTableStatus(data.getSudGameRoomId(), new HttpCallback<BaseModel>() {
|
||||
@Override
|
||||
public void onSuccess(BaseModel data) {
|
||||
ToastUtil.show("标记一杆清台失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show("标记一杆清台失败 错误:" + error);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -195,6 +195,7 @@ public class SudMGPMGState implements Serializable {
|
||||
public List<SudActivityGameInfoBean> activityGameInfoBean;
|
||||
public List<SudSettleBean> sudSettleBeans;
|
||||
public String achievement;
|
||||
public int achievementValue;
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MGCommonGameSettle{" +
|
||||
|
||||
@@ -3,13 +3,20 @@ package com.yunbao.common.utils;
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.ImageDecoder;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.PickVisualMediaRequest;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yalantis.ucrop.UCrop;
|
||||
import com.yalantis.ucrop.util.FileUtils;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
@@ -39,6 +46,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
private ImageResultCallback mResultCallback;
|
||||
private boolean mNeedCrop;//是否需要裁剪
|
||||
private boolean mNeedGif;//允许gif图
|
||||
ActivityResultLauncher<PickVisualMediaRequest> launcher;
|
||||
|
||||
public void setNeedGif(boolean mNeedGif) {
|
||||
this.mNeedGif = mNeedGif;
|
||||
@@ -83,7 +91,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
if (mNeedCrop) {
|
||||
Uri uri = null;
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
uri = FileProvider.getUriForFile(mContext, "com.pdlive.shayu.fileprovider", mCameraResult);
|
||||
uri = FileProvider.getUriForFile(mContext, mContext.getPackageName() + ".fileprovider", mCameraResult);
|
||||
} else {
|
||||
uri = Uri.fromFile(mCameraResult);
|
||||
}
|
||||
@@ -117,6 +125,19 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
return;
|
||||
}
|
||||
String path = FileUtils.getPath(mContext, intent.getData());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
ImageDecoder.Source source = ImageDecoder.createSource(mContext.getContentResolver(), intent.getData());
|
||||
try {
|
||||
Bitmap bitmap = ImageDecoder.decodeBitmap(source);
|
||||
path=BitmapUtil.getInstance().saveBitmap(bitmap);
|
||||
bitmap.recycle();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
mResultCallback.onFailure();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
File file = new File(path);
|
||||
if (file.exists()) {
|
||||
mResultCallback.onSuccess(file);
|
||||
@@ -153,6 +174,19 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
}
|
||||
}
|
||||
};
|
||||
launcher = ((AppCompatActivity) mContext).registerForActivityResult(new ActivityResultContracts.PickVisualMedia(), new androidx.activity.result.ActivityResultCallback<Uri>() {
|
||||
@Override
|
||||
public void onActivityResult(Uri result) {
|
||||
LogUtils.e("result:" + result);
|
||||
if (result == null) {
|
||||
mAlumbResultCallback.onFailure();
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.setData(result);
|
||||
mAlumbResultCallback.onSuccess(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,15 +207,28 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
/**
|
||||
* 相册获取图片
|
||||
*/
|
||||
public void getImageByAlumb() {
|
||||
public void getImageByAlbum() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
showSystemPick();
|
||||
return;
|
||||
}
|
||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||
}
|
||||
|
||||
public void getImageByAlumb(boolean needCrop) {
|
||||
public void getImageByAlbum(boolean needCrop) {
|
||||
this.mNeedCrop = needCrop;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
showSystemPick();
|
||||
return;
|
||||
}
|
||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||
}
|
||||
|
||||
private void showSystemPick() {
|
||||
PickVisualMediaRequest.Builder builder = new PickVisualMediaRequest.Builder()
|
||||
.setMediaType(ActivityResultContracts.PickVisualMedia.ImageOnly.INSTANCE);
|
||||
launcher.launch(builder.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启摄像头,执行照相
|
||||
@@ -195,7 +242,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
mCameraResult = getNewFile();
|
||||
Uri uri = null;
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
uri = FileProvider.getUriForFile(mContext, "com.pdlive.shayu.fileprovider", mCameraResult);
|
||||
uri = FileProvider.getUriForFile(mContext, mContext.getPackageName() + ".fileprovider", mCameraResult);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||
} else {
|
||||
uri = Uri.fromFile(mCameraResult);
|
||||
@@ -255,7 +302,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
startActivityForResult(intent, mCropResultCallback);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
Uri resultUri = FileProvider.getUriForFile(mContext, "com.pdlive.shayu.fileprovider", mCorpResult);
|
||||
Uri resultUri = FileProvider.getUriForFile(mContext, mContext.getPackageName() + ".fileprovider", mCorpResult);
|
||||
if (resultUri == null || mFragment == null || mContext == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class VersionUtil {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+context.getPackageName()));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class VersionUtil {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+context.getPackageName()));
|
||||
context.startActivity(i);
|
||||
context.finish();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,9 @@ public class WordUtil {
|
||||
|
||||
public static boolean isNewZh() {
|
||||
return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE ;
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.CHINESE
|
||||
|| IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.CHINA;
|
||||
}
|
||||
|
||||
public static String getNewString(int res) {
|
||||
|
||||
@@ -125,15 +125,15 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
public void onViewClicks() {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
||||
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.pdlive.shayu"));
|
||||
i.setData(Uri.parse("https://play.google.com/store/apps/details?id="+mContext.getPackageName()));
|
||||
mContext.startActivity(i);
|
||||
mContext.finish();
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
//华为
|
||||
launchHwAppDetail(mContext, "com.pdlive.shayu", "com.huawei.appmarket");
|
||||
launchHwAppDetail(mContext, mContext.getPackageName(), "com.huawei.appmarket");
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 3) {
|
||||
//三星
|
||||
launchSmAppDetail(mContext, "com.pdlive.shayu", "com.sec.android.app.samsungapps");
|
||||
launchSmAppDetail(mContext, mContext.getPackageName(), "com.sec.android.app.samsungapps");
|
||||
} else {
|
||||
versionImmediateUse.setVisibility(GONE);
|
||||
updateLine.setVisibility(VISIBLE);
|
||||
|
||||
@@ -19,11 +19,13 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameActivityInfoRoomBean;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
import com.yunbao.common.dialog.SudGameDoubleDialog;
|
||||
@@ -89,7 +91,7 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
||||
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
||||
//第二次进入时,viewmodel数据丢失,所以初始化时直接获取
|
||||
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),getActivity());
|
||||
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(), getActivity());
|
||||
IMLoginManager.get(context).setSudGame("");
|
||||
if (isActivityGame) {
|
||||
RandomSudGameManager.getManager().setGameViewModel(gameViewModel);
|
||||
@@ -120,8 +122,21 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initDate();
|
||||
LiveNetManager.get(getContext())
|
||||
.checkGameForActivity(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(SudGameActivityInfoRoomBean data) {
|
||||
isActivityGame = data.getIsActivity() == 1;
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -221,7 +236,8 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
gameConfigModel.ui.start_btn.custom = true;
|
||||
// SudMGP平台64bit游戏ID
|
||||
gameViewModel.switchGame((Activity) getContext(), mLiveUid, mInteractionID);
|
||||
if(isActivityGame){
|
||||
LogUtils.e("半窗游戏活动设置:" + isActivityGame);
|
||||
if (isActivityGame) {
|
||||
sudGameDoubleDialog.setActivityGame();
|
||||
sudLoadDialog.setActivityGame();
|
||||
}
|
||||
@@ -243,7 +259,7 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
|
||||
//加载弹窗监听
|
||||
sudLoadDialog.setOnDismissListener(() -> {
|
||||
if (sudLoadDialog.getClickStatus() == 2){
|
||||
if (sudLoadDialog.getClickStatus() == 2) {
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
}
|
||||
});
|
||||
@@ -273,6 +289,8 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void BusGetOff() {
|
||||
@@ -281,7 +299,9 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
|
||||
if(isActivityGame){
|
||||
RandomSudGameManager.getManager().destroy();
|
||||
}
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
@@ -344,29 +364,60 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
LiveNetManager.get(getContext()).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudGameInfoBean> infoBean) {
|
||||
if (!infoBean.isEmpty()) {
|
||||
System.out.println("结算,是否为游戏活动:" + isActivityGame);
|
||||
if (isActivityGame) {
|
||||
loadScore(infoBean, 3);
|
||||
} else {
|
||||
gameViewModel.setSudGameInfoBeanList(infoBean);
|
||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
|
||||
LiveNetManager.get(getContext()).checkGameForActivity(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<SudGameActivityInfoRoomBean>() {
|
||||
@Override
|
||||
public void onSuccess(SudGameActivityInfoRoomBean data) {
|
||||
isActivityGame=data.getIsActivity()==1;
|
||||
if(isActivityGame) {
|
||||
sudLoadDialog.setActivityGame();
|
||||
sudGameDoubleDialog.setActivityGame();
|
||||
}
|
||||
if (!infoBean.isEmpty()) {
|
||||
System.out.println("结算,是否为游戏活动:" + isActivityGame);
|
||||
if (isActivityGame) {
|
||||
loadScore(infoBean, 3);
|
||||
} else {
|
||||
gameViewModel.setSudGameInfoBeanList(infoBean);
|
||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
|
||||
}
|
||||
} else {
|
||||
if (isActivityGame) {
|
||||
showDialog();
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isActivityGame) {
|
||||
showDialog();
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.net_error));
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (!infoBean.isEmpty()) {
|
||||
System.out.println("结算,是否为游戏活动:" + isActivityGame);
|
||||
if (isActivityGame) {
|
||||
loadScore(infoBean, 3);
|
||||
} else {
|
||||
gameViewModel.setSudGameInfoBeanList(infoBean);
|
||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
|
||||
}
|
||||
} else {
|
||||
if (isActivityGame) {
|
||||
showDialog();
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void showDialog() {
|
||||
DialogUitl.showSimpleDialog(getContext(), WordUtil.isNewZh() ? "結算超時\n請前往活動頁面查看本局結果" :
|
||||
"Settlement timed out\nPlease check the result on the event page Confirm.", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
dialog.dismiss();
|
||||
if(sudLoadDialog.isShow()){
|
||||
if (sudLoadDialog.isShow()) {
|
||||
sudLoadDialog.dismiss();
|
||||
}
|
||||
}
|
||||
@@ -374,7 +425,8 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
}
|
||||
|
||||
private void loadScore(List<SudGameInfoBean> infoBean, int index) {
|
||||
if (index == 0) {
|
||||
LogUtils.e("活动判断", isActivityGame);
|
||||
if (index == 0 && isActivityGame) {
|
||||
showDialog();
|
||||
return;
|
||||
}
|
||||
@@ -382,7 +434,7 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
.ballClearanceTableGetResultScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudActivityGameInfoBean> data) {
|
||||
if (data.isEmpty()) {
|
||||
if (data.isEmpty() && isActivityGame) {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
loadScore(infoBean, index - 1);
|
||||
}, 500);
|
||||
@@ -398,6 +450,7 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
|
||||
@@ -212,10 +212,36 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk, boolean isSw) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal), isSw);
|
||||
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bus.get().post(new LiveOpenSudRoomEvent().setCreateSudRoomModel(createSudRoomModel));
|
||||
LiveNetManager.get(mAvatar.getContext())
|
||||
.getScore(model.getSudGameRoomId(), new com.yunbao.common.http.base.HttpCallback<SudGameScoreBean>() {
|
||||
@Override
|
||||
public void onSuccess(SudGameScoreBean data) {
|
||||
if(data.getGolden_bean_remaining_balance()!=1){
|
||||
RandomSudGameManager.getManager().showNotActivityTicketDialog(itemView.getContext(), true, new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Bus.get().post(new LiveOpenSudRoomEvent().setActivity(isActivity).setCreateSudRoomModel(createSudRoomModel));
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
Bus.get().post(new LiveOpenSudRoomEvent().setActivity(isActivity).setCreateSudRoomModel(createSudRoomModel));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
@@ -7,37 +7,40 @@
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="15dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<!--這個不是系統消息-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="通知標題標題通知標題標題"
|
||||
android:textColor="#ff161616"
|
||||
android:textSize="17sp" />
|
||||
android:textSize="17sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/time_text"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="19dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="2-24 17:00"
|
||||
android:text="2024-08-22 17:00"
|
||||
android:textColor="#ff8c8c8c"
|
||||
android:textSize="13sp" />
|
||||
</FrameLayout>
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/banner_card"
|
||||
|
||||
@@ -648,7 +648,7 @@
|
||||
<string name="welcome_pdlive">歡迎來到PDLIVE</string>
|
||||
<string name="newcomer">恭喜你獲得了新人獎勵</string>
|
||||
|
||||
<string name="FILE_PROVIDER">com.pdlive.shayu.fileprovider</string>
|
||||
<string name="FILE_PROVIDER">com.newpdlive.sy.fileprovider</string>
|
||||
<string name="ren">人</string>
|
||||
<string name="ge">個</string>
|
||||
<string name="count">數量</string>
|
||||
|
||||
@@ -4,7 +4,7 @@ ext {
|
||||
buildToolsVersion: "29.0.2",
|
||||
minSdkVersion : 23,
|
||||
targetSdkVersion : 34,
|
||||
versionCode : 693,
|
||||
versionCode : 697,
|
||||
versionName : "6.8.1"
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
@@ -30,5 +30,8 @@ ext {
|
||||
isUploadLog : true,
|
||||
//是否打包成插件包模式
|
||||
isPluginModel : false,
|
||||
facebook_app_id : "2011402032399020",
|
||||
facebook_client_token : "959584e054a33614996361f0044e5253",
|
||||
lineChannelId : "1656399535"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ ext {
|
||||
// "tencent-bugly" : 'com.tencent.bugly:crashreport:2.6.6',//腾讯bugly
|
||||
// "umeng-common" : 'com.umeng.sdk:common:1.5.3',//友盟统计
|
||||
// "umeng-analytics" : 'com.umeng.sdk:analytics:7.5.3',//友盟统计
|
||||
"ucrop" : 'com.github.yalantis:ucrop:2.2.3',//图片裁剪
|
||||
"ucrop" : 'com.github.yalantis:ucrop:2.2.9',//图片裁剪
|
||||
"smartRefreshLayout" : 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-20',//下拉刷新上拉加载
|
||||
"magicIndicator" : 'com.github.hackware1993:MagicIndicator:1.6.0',//ViewPager指示器
|
||||
"banner" : 'com.ms:banner:1.0.0',//轮播图
|
||||
|
||||
@@ -19,6 +19,7 @@ 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.base.BaseCacheManager;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
@@ -21,8 +21,8 @@ android {
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_18
|
||||
targetCompatibility JavaVersion.VERSION_18
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ public class GoogleManage {
|
||||
object.put("openId", account.getId());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.i("Log", "ApiException = " + e);
|
||||
}
|
||||
return object;
|
||||
|
||||
@@ -1 +1 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.android.library'
|
||||
@@ -36,6 +36,7 @@ import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameActivityInfoRoomBean;
|
||||
import com.yunbao.common.bean.SudGameChatImModel;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
@@ -241,7 +242,9 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
|
||||
if(isActivityGame){
|
||||
RandomSudGameManager.getManager().destroy();
|
||||
}
|
||||
LiveNetManager.get(mContext).leaveMic(mLiveUid, new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
@@ -278,9 +281,6 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
||||
//第二次进入时,viewmodel数据丢失,所以初始化时直接获取
|
||||
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(), mContext);
|
||||
if (isActivityGame) {
|
||||
RandomSudGameManager.getManager().setGameViewModel(gameViewModel);
|
||||
}
|
||||
gameContainer = findViewById(R.id.game_container);
|
||||
roomName = findViewById(R.id.room_name);
|
||||
roomNumber = findViewById(R.id.room_number);
|
||||
@@ -529,10 +529,7 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
sudGameDoubleDialog = new SudGameDoubleDialog(this);//双人游戏
|
||||
sudGameMultipleDialog = new SudGameMultipleDialog(this);//多人游戏
|
||||
sudLoadDialog = new SudLoadDialog(this);//加载弹窗
|
||||
if (isActivityGame) {
|
||||
sudGameDoubleDialog.setActivityGame();
|
||||
sudLoadDialog.setActivityGame();
|
||||
}
|
||||
|
||||
//游戏结算结束
|
||||
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
|
||||
//观察结算排名数据,点击跳过和再来一局不需要显示结算界面
|
||||
@@ -556,10 +553,30 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
}
|
||||
});
|
||||
//通知活动游戏
|
||||
if (isActivityGame) {
|
||||
RandomSudGameManager.getManager().onInitGame(mCreateSudRoomModel);
|
||||
}
|
||||
LiveNetManager.get(mContext)
|
||||
.checkGameForActivity(gameViewModel.getGameRoomId(), new HttpCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(SudGameActivityInfoRoomBean data) {
|
||||
isActivityGame = data.getIsActivity() == 1;
|
||||
if (isActivityGame) {
|
||||
sudGameDoubleDialog.setActivityGame();
|
||||
sudLoadDialog.setActivityGame();
|
||||
}
|
||||
if (isActivityGame) {
|
||||
RandomSudGameManager.getManager().setGameViewModel(gameViewModel);
|
||||
}
|
||||
//通知活动游戏
|
||||
if (isActivityGame) {
|
||||
RandomSudGameManager.getManager().onInitGame(mCreateSudRoomModel);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -612,21 +629,51 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
LiveNetManager.get(mContext).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudGameInfoBean> infoBean) {
|
||||
if (!infoBean.isEmpty()) {
|
||||
System.out.println("结算,是否为游戏活动:" + isActivityGame);
|
||||
if (isActivityGame) {
|
||||
loadScore(infoBean, 3);
|
||||
} else {
|
||||
gameViewModel.setSudGameInfoBeanList(infoBean);
|
||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
|
||||
LiveNetManager.get(mContext).checkGameForActivity(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<SudGameActivityInfoRoomBean>() {
|
||||
@Override
|
||||
public void onSuccess(SudGameActivityInfoRoomBean data) {
|
||||
isActivityGame=data.getIsActivity()==1;
|
||||
if(isActivityGame) {
|
||||
sudLoadDialog.setActivityGame();
|
||||
sudGameDoubleDialog.setActivityGame();
|
||||
}
|
||||
if (!infoBean.isEmpty()) {
|
||||
System.out.println("结算,是否为游戏活动:" + isActivityGame);
|
||||
if (isActivityGame) {
|
||||
loadScore(infoBean, 3);
|
||||
} else {
|
||||
gameViewModel.setSudGameInfoBeanList(infoBean);
|
||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
|
||||
}
|
||||
} else {
|
||||
if (isActivityGame) {
|
||||
showDialog();
|
||||
} else {
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isActivityGame) {
|
||||
showDialog();
|
||||
} else {
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (!infoBean.isEmpty()) {
|
||||
System.out.println("结算,是否为游戏活动:" + isActivityGame);
|
||||
if (isActivityGame) {
|
||||
loadScore(infoBean, 3);
|
||||
} else {
|
||||
gameViewModel.setSudGameInfoBeanList(infoBean);
|
||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
|
||||
}
|
||||
} else {
|
||||
if (isActivityGame) {
|
||||
showDialog();
|
||||
} else {
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void showDialog() {
|
||||
@@ -643,7 +690,8 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
}
|
||||
|
||||
private void loadScore(List<SudGameInfoBean> infoBean, int index) {
|
||||
if (index == 0) {
|
||||
LogUtils.e("活动判断", isActivityGame);
|
||||
if (index == 0 && isActivityGame) {
|
||||
showDialog();
|
||||
return;
|
||||
}
|
||||
@@ -651,7 +699,7 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
.ballClearanceTableGetResultScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudActivityGameInfoBean> data) {
|
||||
if (data.isEmpty()) {
|
||||
if (data.isEmpty() && isActivityGame) {
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
loadScore(infoBean, index - 1);
|
||||
}, 500);
|
||||
|
||||
@@ -237,7 +237,7 @@ public class LiveReportAdapter extends RecyclerView.Adapter {
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -691,7 +691,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
||||
*/
|
||||
private void setAvatar() {
|
||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
} else {
|
||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||
@@ -700,7 +700,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -673,7 +673,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
|
||||
*/
|
||||
private void setAvatar() {
|
||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum(true);
|
||||
} else {
|
||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||
@@ -682,7 +682,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -35,7 +35,6 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveChooseClassActivity;
|
||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.live.adapter.LiveReadyShareAdapter;
|
||||
import com.yunbao.common.bean.LiveRoomTypeBean;
|
||||
import com.yunbao.live.dialog.LiveRoomTypeDialogFragment;
|
||||
@@ -262,7 +261,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick
|
||||
*/
|
||||
private void setAvatar() {
|
||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
} else {
|
||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||
@@ -271,7 +270,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -285,7 +285,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi
|
||||
*/
|
||||
private void setAvatar() {
|
||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
} else {
|
||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||
@@ -294,7 +294,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1373,7 +1373,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}
|
||||
if (createSudRoomModel != null) {
|
||||
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel));
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel).setActivityGame(createSudRoomModel.isActivity()));
|
||||
createSudRoomModel = null;
|
||||
}
|
||||
// String jsonCreateSudRoom = IMLoginManager.get(mContext).getSudGame();
|
||||
|
||||
@@ -5,34 +5,46 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--这个系统消息-->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/background_fff">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/titleLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="65dp"
|
||||
android:text="通知標題標題通知標題標題"
|
||||
android:textColor="#ff161616"
|
||||
android:textSize="16sp" />
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="通知標題標題通知標題標題"
|
||||
android:textColor="#ff161616"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/time"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2-24 17:00"
|
||||
android:textColor="#ff8c8c8c"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:text="2-24 17:00"
|
||||
android:textColor="#ff8c8c8c"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_img_content"
|
||||
@@ -40,7 +52,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_below="@id/text"
|
||||
android:layout_below="@id/titleLayout"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
|
||||
@@ -2208,11 +2208,6 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/enter_room_svg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/inner_container"
|
||||
@@ -2832,4 +2827,9 @@
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/enter_room_svg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitCenter" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -59,8 +59,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_18
|
||||
targetCompatibility JavaVersion.VERSION_18
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
|
||||
@@ -439,7 +439,7 @@ public class EditProfileActivity extends AbsActivity {
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else if (tag == R.string.alumb) {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum(true);
|
||||
} else {
|
||||
RouteUtil.forwardUserAvatarSelect();
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.DeviceUtils;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.facebook.AccessToken;
|
||||
import com.facebook.CallbackManager;
|
||||
import com.facebook.FacebookCallback;
|
||||
@@ -441,7 +442,8 @@ public class EntryActivity extends AppCompatActivity {
|
||||
} else if (loginType == 4) {
|
||||
try {
|
||||
// App-to-app login
|
||||
Intent loginIntent = LineLoginApi.getLoginIntent(findViewById(R.id.btn_line).getContext(), "1656399535", new LineAuthenticationParams.Builder().scopes(Arrays.asList(Scope.PROFILE))
|
||||
LogUtils.e(CommonAppConfig.LINE_CHANNEL_ID,CommonAppConfig.BUILD_TIME);
|
||||
Intent loginIntent = LineLoginApi.getLoginIntent(findViewById(R.id.btn_line).getContext(), String.valueOf(CommonAppConfig.LINE_CHANNEL_ID), new LineAuthenticationParams.Builder().scopes(Arrays.asList(Scope.PROFILE))
|
||||
// .nonce("<a randomly-generated string>") // nonce can be used to improve security
|
||||
.build());
|
||||
startActivityForResult(loginIntent, 1001);
|
||||
|
||||
@@ -33,8 +33,6 @@ import com.yunbao.main.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Route(path = RouteUtil.PATH_FEEDBACK_EDIT_ACTIVITY)
|
||||
public class FeedbackEditActivity extends AbsActivity {
|
||||
@@ -299,7 +297,7 @@ public class FeedbackEditActivity extends AbsActivity {
|
||||
loadingDialog = DialogUitl.loadingDialog(mContext);
|
||||
loadingDialog.show();
|
||||
if (tag == 1) {
|
||||
imageUtil.getImageByAlumb(false);
|
||||
imageUtil.getImageByAlbum(false);
|
||||
} else {
|
||||
imageUtil.getImageByCamera(false);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import androidx.viewpager.widget.ViewPager;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.jakewharton.rxbinding3.view.RxView;
|
||||
@@ -55,6 +56,7 @@ import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMSDKConfig;
|
||||
import com.tencent.imsdk.v2.V2TIMSDKListener;
|
||||
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.QiniuLog;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.server.DownloadService;
|
||||
@@ -232,6 +234,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
LogUtils.e("MainActivity",
|
||||
"语言:"+IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage(),
|
||||
"测试文本:"+getString(R.string.hot)
|
||||
);
|
||||
ToastUtil.showDebug("打包时间:"+CommonAppConfig.BUILD_TIME+"\n系统语言:"+IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage());
|
||||
//初始化声网
|
||||
SWAuManager.get().initRtcEngine(this);
|
||||
ActivityCompat.postponeEnterTransition(this);
|
||||
|
||||
@@ -585,7 +585,7 @@ public class MyWebViewActivity extends AbsActivity {
|
||||
if (tag == com.yunbao.main.R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ public class OneLoginActivity extends AbsActivity {
|
||||
if (tag == R.string.camera) {
|
||||
mImageUtil.getImageByCamera();
|
||||
} else {
|
||||
mImageUtil.getImageByAlumb();
|
||||
mImageUtil.getImageByAlbum();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -169,7 +169,12 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||
if (isAnchor) {
|
||||
String[] permissions;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.READ_MEDIA_IMAGES,
|
||||
Manifest.permission.CAMERA,
|
||||
@@ -195,7 +200,12 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||
if (isAnchor) {
|
||||
String[] permissions;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
};
|
||||
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
|
||||
permissions = new String[]{
|
||||
Manifest.permission.READ_MEDIA_IMAGES,
|
||||
Manifest.permission.CAMERA,
|
||||
@@ -234,9 +244,9 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
JSONObject obj1 = JSON.parseObject(info1[0]);
|
||||
try {
|
||||
if(code==201){ //声网
|
||||
if (code == 201) { //声网
|
||||
LiveSwAnchorActivity.forward(mContext, Constants.LIVE_SDK_SW, JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
|
||||
}else if(code==200){//融云
|
||||
} else if (code == 200) {//融云
|
||||
LiveRyAnchorActivity.forward(mContext, obj.getIntValue("live_sdk"), JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -309,7 +319,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
if (i == R.id.btn_close) {
|
||||
} else if (i == R.id.btn_live) {
|
||||
if (isWifiProxy(mContext) || checkVPN((ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE))) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。":
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。" :
|
||||
"It is detected that VPN or proxy is turned on. Please turn off VPN or proxy before starting the broadcast.");
|
||||
} else {
|
||||
if (mCallback != null) {
|
||||
@@ -324,6 +334,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isWifiProxy(Context context) {
|
||||
final boolean IS_ICS_OR_LATER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
|
||||
String proxyAddress;
|
||||
@@ -345,6 +356,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
||||
boolean isVpnConn = networkInfo == null ? false : networkInfo.isConnected();
|
||||
return isVpnConn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
android{
|
||||
android {
|
||||
dexOptions {
|
||||
jumboMode = true
|
||||
javaMaxHeapSize "8g"
|
||||
@@ -46,20 +46,32 @@ android{
|
||||
}
|
||||
google_test {
|
||||
dimension 'packageApk'
|
||||
if (project.getPluginManager().hasPlugin("com.android.application")) {
|
||||
applicationId "com.newpdlive.sy"
|
||||
}
|
||||
manifestPlaceholders = [
|
||||
serverHost : rootProject.ext.manifestPlaceholders.testServerHost,
|
||||
isGooglePlay : 1,
|
||||
isUploadLog : true,
|
||||
isPluginModel: rootProject.ext.manifestPlaceholders.isPluginModel
|
||||
isPluginModel: rootProject.ext.manifestPlaceholders.isPluginModel,
|
||||
facebook_app_id : "938330614686044",
|
||||
facebook_client_token : "b1b574a2cdf0ced1ae5df7274636f65d",
|
||||
lineChannelId : "2006123567"
|
||||
]
|
||||
}
|
||||
google_online {
|
||||
dimension 'packageApk'
|
||||
if (project.getPluginManager().hasPlugin("com.android.application")) {
|
||||
applicationId "com.newpdlive.sy"
|
||||
}
|
||||
manifestPlaceholders = [
|
||||
serverHost : rootProject.ext.manifestPlaceholders.serverHost,
|
||||
isGooglePlay : 1,
|
||||
isUploadLog : true,
|
||||
isPluginModel: rootProject.ext.manifestPlaceholders.isPluginModel
|
||||
isPluginModel: rootProject.ext.manifestPlaceholders.isPluginModel,
|
||||
facebook_app_id : "938330614686044",
|
||||
facebook_client_token : "b1b574a2cdf0ced1ae5df7274636f65d",
|
||||
lineChannelId : "2006123567"
|
||||
]
|
||||
}
|
||||
huawei_test {
|
||||
|
||||
@@ -10,11 +10,19 @@ import android.view.ViewGroup;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.tencent.rtmp.ITXVodPlayListener;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.DefaultLoadControl;
|
||||
import com.google.android.exoplayer2.ExoPlayer;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.android.exoplayer2.PlaybackException;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
|
||||
import com.google.android.exoplayer2.ui.StyledPlayerView;
|
||||
import com.google.android.exoplayer2.video.VideoSize;
|
||||
import com.tencent.rtmp.TXLiveConstants;
|
||||
import com.tencent.rtmp.TXVodPlayConfig;
|
||||
import com.tencent.rtmp.TXVodPlayer;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.video.R;
|
||||
@@ -27,11 +35,11 @@ import com.yunbao.video.http.VideoHttpUtil;
|
||||
* 视频播放器
|
||||
*/
|
||||
|
||||
public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayListener, View.OnClickListener {
|
||||
public class VideoPlayViewHolder extends AbsViewHolder implements View.OnClickListener {
|
||||
|
||||
private TXCloudVideoView mTXCloudVideoView;
|
||||
private StyledPlayerView mTXCloudVideoView;
|
||||
private View mVideoCover;
|
||||
private TXVodPlayer mPlayer;
|
||||
private ExoPlayer mPlayer;
|
||||
private boolean mPaused;//生命周期暂停
|
||||
private boolean mClickPaused;//点击暂停
|
||||
private ActionListener mActionListener;
|
||||
@@ -41,7 +49,6 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
private boolean mEndPlay;
|
||||
private VideoBean mVideoBean;
|
||||
private String mCachePath;
|
||||
private TXVodPlayConfig mTXVodPlayConfig;
|
||||
|
||||
public VideoPlayViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
@@ -55,17 +62,21 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
DefaultLoadControl control = new DefaultLoadControl.Builder()
|
||||
.setPrioritizeTimeOverSizeThresholds(false)
|
||||
.setBackBuffer(10_000, true)
|
||||
.setBufferDurationsMs(500,
|
||||
5_000,
|
||||
150,
|
||||
200)
|
||||
.build();
|
||||
|
||||
mCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
mTXCloudVideoView = (TXCloudVideoView) findViewById(R.id.video_view);
|
||||
mTXCloudVideoView.setRenderMode(TXLiveConstants.RENDER_MODE_FULL_FILL_SCREEN);
|
||||
mPlayer = new TXVodPlayer(mContext);
|
||||
mTXVodPlayConfig = new TXVodPlayConfig();
|
||||
mTXVodPlayConfig.setMaxCacheItems(15);
|
||||
mTXVodPlayConfig.setProgressInterval(200);
|
||||
mPlayer.setConfig(mTXVodPlayConfig);
|
||||
mPlayer.setAutoPlay(true);
|
||||
mPlayer.setVodListener(this);
|
||||
mPlayer.setPlayerView(mTXCloudVideoView);
|
||||
mTXCloudVideoView = (StyledPlayerView) findViewById(R.id.placeholderView);
|
||||
mTXCloudVideoView.setKeepContentOnPlayerReset(true);
|
||||
mTXCloudVideoView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIXED_WIDTH);
|
||||
mPlayer = new ExoPlayer.Builder(mContext).setLoadControl(control).build();
|
||||
mPlayer.setVideoScalingMode(C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING);
|
||||
findViewById(R.id.root).setOnClickListener(this);
|
||||
mVideoCover = findViewById(R.id.video_cover);
|
||||
mPlayBtn = findViewById(R.id.btn_play);
|
||||
@@ -76,13 +87,59 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
PropertyValuesHolder.ofFloat("alpha", 0f, 1f));
|
||||
mPlayBtnAnimator.setDuration(150);
|
||||
mPlayBtnAnimator.setInterpolator(new AccelerateInterpolator());
|
||||
mPlayer.addListener(new Player.Listener() {
|
||||
@Override
|
||||
public void onIsPlayingChanged(boolean isPlaying) {
|
||||
Player.Listener.super.onIsPlayingChanged(isPlaying);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlaybackStateChanged(int playbackState) {
|
||||
Player.Listener.super.onPlaybackStateChanged(playbackState);
|
||||
if (playbackState == Player.STATE_READY) {
|
||||
mPlayer.play();
|
||||
onPlayEvent(TXLiveConstants.PLAY_EVT_PLAY_BEGIN, null);
|
||||
} else if (playbackState == Player.STATE_BUFFERING) {
|
||||
onPlayEvent(TXLiveConstants.PLAY_EVT_PLAY_LOADING, null);
|
||||
} else if (playbackState == Player.STATE_ENDED) {
|
||||
onPlayEvent(TXLiveConstants.PLAY_EVT_PLAY_END, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoSizeChanged(VideoSize videoSize) {
|
||||
Player.Listener.super.onVideoSizeChanged(videoSize);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt("EVT_PARAM1", videoSize.width);
|
||||
bundle.putInt("EVT_PARAM2", videoSize.height);
|
||||
onPlayEvent(TXLiveConstants.PLAY_EVT_CHANGE_RESOLUTION, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderedFirstFrame() {
|
||||
Player.Listener.super.onRenderedFirstFrame();
|
||||
onPlayEvent(TXLiveConstants.PLAY_EVT_RCV_FIRST_I_FRAME, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(PlaybackException error) {
|
||||
Player.Listener.super.onPlayerError(error);
|
||||
LogUtils.e(error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerErrorChanged(@Nullable PlaybackException error) {
|
||||
Player.Listener.super.onPlayerErrorChanged(error);
|
||||
LogUtils.e(error);
|
||||
}
|
||||
});
|
||||
mTXCloudVideoView.setPlayer(mPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放器事件回调
|
||||
*/
|
||||
@Override
|
||||
public void onPlayEvent(TXVodPlayer txVodPlayer, int e, Bundle bundle) {
|
||||
public void onPlayEvent(int e, Bundle bundle) {
|
||||
switch (e) {
|
||||
case TXLiveConstants.PLAY_EVT_PLAY_BEGIN://加载完成,开始播放的回调
|
||||
mStartPlay = true;
|
||||
@@ -119,11 +176,6 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetStatus(TXVodPlayer txVodPlayer, Bundle bundle) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到视频宽高回调
|
||||
*/
|
||||
@@ -166,20 +218,8 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
return;
|
||||
}
|
||||
if (mTXVodPlayConfig == null) {
|
||||
mTXVodPlayConfig = new TXVodPlayConfig();
|
||||
mTXVodPlayConfig.setMaxCacheItems(15);
|
||||
mTXVodPlayConfig.setProgressInterval(200);
|
||||
}
|
||||
if (url.endsWith(".m3u8")) {
|
||||
mTXVodPlayConfig.setCacheFolderPath(null);
|
||||
} else {
|
||||
mTXVodPlayConfig.setCacheFolderPath(mCachePath);
|
||||
}
|
||||
mPlayer.setConfig(mTXVodPlayConfig);
|
||||
if (mPlayer != null) {
|
||||
mPlayer.startPlay(url);
|
||||
}
|
||||
mPlayer.setMediaItem(MediaItem.fromUri(url));
|
||||
mPlayer.prepare();
|
||||
VideoHttpUtil.videoWatchStart(videoBean.getUid(), videoBean.getId());
|
||||
}
|
||||
|
||||
@@ -188,7 +228,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
*/
|
||||
public void stopPlay() {
|
||||
if (mPlayer != null) {
|
||||
mPlayer.stopPlay(false);
|
||||
mPlayer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,8 +237,8 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
*/
|
||||
private void replay() {
|
||||
if (mPlayer != null) {
|
||||
mPlayer.seek(0);
|
||||
mPlayer.resume();
|
||||
mPlayer.seekTo(0);
|
||||
mPlayer.play();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,8 +246,8 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
VideoHttpUtil.cancel(VideoHttpConsts.VIDEO_WATCH_START);
|
||||
VideoHttpUtil.cancel(VideoHttpConsts.VIDEO_WATCH_END);
|
||||
if (mPlayer != null) {
|
||||
mPlayer.stopPlay(false);
|
||||
mPlayer.setPlayListener(null);
|
||||
mPlayer.stop();
|
||||
mPlayer.release();
|
||||
}
|
||||
mPlayer = null;
|
||||
mActionListener = null;
|
||||
@@ -229,7 +269,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
public void resumePlay() {
|
||||
if (mPaused) {
|
||||
if (!mClickPaused && mPlayer != null) {
|
||||
mPlayer.resume();
|
||||
mPlayer.play();
|
||||
}
|
||||
}
|
||||
mPaused = false;
|
||||
@@ -263,7 +303,7 @@ public class VideoPlayViewHolder extends AbsViewHolder implements ITXVodPlayList
|
||||
}
|
||||
if (mPlayer != null) {
|
||||
if (mClickPaused) {
|
||||
mPlayer.resume();
|
||||
mPlayer.play();
|
||||
} else {
|
||||
mPlayer.pause();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.tencent.rtmp.ui.TXCloudVideoView
|
||||
android:id="@+id/video_view"
|
||||
<com.google.android.exoplayer2.ui.StyledPlayerView
|
||||
android:id="@+id/placeholderView"
|
||||
app:surface_type="texture_view"
|
||||
app:use_controller="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true" />
|
||||
@@ -14,7 +18,7 @@
|
||||
android:id="@+id/video_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#000" />
|
||||
android:background="@color/transparent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_play"
|
||||
|
||||
Reference in New Issue
Block a user