Compare commits
8 Commits
dev_poyo_6
...
新改版_poyo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b85806f81 | ||
|
|
bae13be70e | ||
|
|
cfb9cca71a | ||
|
|
50fa5831c0 | ||
|
|
33b889cb79 | ||
|
|
336b433513 | ||
| addaf00adb | |||
|
|
c9a72dfa14 |
@@ -4,10 +4,12 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'com.alibaba.arouter'
|
apply plugin: 'com.alibaba.arouter'
|
||||||
apply from: "../package_config.gradle"
|
apply from: "../package_config.gradle"
|
||||||
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "myname.pdlive.shayu"
|
namespace "myname.pdlive.shayu"
|
||||||
compileSdk rootProject.ext.android.compileSdkVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -68,7 +70,7 @@ android {
|
|||||||
exclude 'lib/armeabi-v7a/libMNN_CL.so'
|
exclude 'lib/armeabi-v7a/libMNN_CL.so'
|
||||||
exclude 'lib/armeabi-v7a/libMNN_Express.so'
|
exclude 'lib/armeabi-v7a/libMNN_Express.so'
|
||||||
|
|
||||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 0) {
|
/*if (rootProject.ext.manifestPlaceholders.isGooglePlay == 0) {
|
||||||
// 链接包剔除相心美颜SO
|
// 链接包剔除相心美颜SO
|
||||||
exclude 'lib/armeabi-v7a/libCNamaSDK.so'
|
exclude 'lib/armeabi-v7a/libCNamaSDK.so'
|
||||||
exclude 'lib/armeabi-v7a/libfuai.so'
|
exclude 'lib/armeabi-v7a/libfuai.so'
|
||||||
@@ -76,7 +78,7 @@ android {
|
|||||||
exclude 'lib/arm64-v8a/libCNamaSDK.so'
|
exclude 'lib/arm64-v8a/libCNamaSDK.so'
|
||||||
exclude 'lib/arm64-v8a/libfuai.so'
|
exclude 'lib/arm64-v8a/libfuai.so'
|
||||||
|
|
||||||
/* // 剔除声网X86架构的so
|
// 剔除声网X86架构的so
|
||||||
exclude 'lib/x86/libagora-core.so'
|
exclude 'lib/x86/libagora-core.so'
|
||||||
exclude 'lib/x86/libagora-ffmpeg.so'
|
exclude 'lib/x86/libagora-ffmpeg.so'
|
||||||
exclude 'lib/x86/libagora-fdkaac.so'
|
exclude 'lib/x86/libagora-fdkaac.so'
|
||||||
@@ -99,7 +101,7 @@ android {
|
|||||||
exclude 'lib/x86/libagora_video_encoder_extension.so'
|
exclude 'lib/x86/libagora_video_encoder_extension.so'
|
||||||
exclude 'lib/x86/libagora_video_quality_analyzer_extension.so'
|
exclude 'lib/x86/libagora_video_quality_analyzer_extension.so'
|
||||||
exclude 'lib/x86/libagora_video_dec.so'
|
exclude 'lib/x86/libagora_video_dec.so'
|
||||||
exclude 'lib/x86/libagora_video_enc.so'*//*
|
exclude 'lib/x86/libagora_video_enc.so'/*
|
||||||
|
|
||||||
exclude 'lib/x86_64/libagora-core.so'
|
exclude 'lib/x86_64/libagora-core.so'
|
||||||
exclude 'lib/x86_64/libagora-ffmpeg.so'
|
exclude 'lib/x86_64/libagora-ffmpeg.so'
|
||||||
@@ -107,7 +109,7 @@ android {
|
|||||||
exclude 'lib/x86_64/libagora-soundtouch.so'
|
exclude 'lib/x86_64/libagora-soundtouch.so'
|
||||||
exclude 'lib/x86_64/libagora-rtc-sdk.so'
|
exclude 'lib/x86_64/libagora-rtc-sdk.so'
|
||||||
|
|
||||||
*//* exclude 'lib/x86_64/libagora_clear_vision_extension.so'
|
/* exclude 'lib/x86_64/libagora_clear_vision_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_segmentation_extension.so'
|
exclude 'lib/x86_64/libagora_segmentation_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_screen_capture_extension.so'
|
exclude 'lib/x86_64/libagora_screen_capture_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_audio_beauty_extension.so'
|
exclude 'lib/x86_64/libagora_audio_beauty_extension.so'
|
||||||
@@ -123,10 +125,13 @@ android {
|
|||||||
exclude 'lib/x86_64/libagora_ai_echo_cancellation_extension.so'
|
exclude 'lib/x86_64/libagora_ai_echo_cancellation_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_lip_sync_extension.so'
|
exclude 'lib/x86_64/libagora_lip_sync_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_video_dec.so'
|
exclude 'lib/x86_64/libagora_video_dec.so'
|
||||||
exclude 'lib/x86_64/libagora_video_enc.so'*/
|
exclude 'lib/x86_64/libagora_video_enc.so'
|
||||||
|
|
||||||
|
*//*
|
||||||
|
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@@ -138,6 +143,34 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
|
// 根据渠道配置删除美颜so文件
|
||||||
|
if (variant.flavorName == "link_test" || variant.flavorName == "link_online") {
|
||||||
|
println "variant.flavorName:${variant.flavorName}"
|
||||||
|
println "variant.name:${variant.name}"
|
||||||
|
|
||||||
|
// 这里使用 mergeNativeLibs 任务,它会在文件合并后执行
|
||||||
|
def taskName = "merge${variant.name.capitalize()}NativeLibs"
|
||||||
|
tasks.matching { it.name == taskName }.configureEach { task ->
|
||||||
|
task.doLast {
|
||||||
|
def soFiles = [
|
||||||
|
file("${buildDir}/intermediates/merged_native_libs/${variant.name}/merge${variant.name.capitalize()}NativeLibs/out/lib/armeabi-v7a/libCNamaSDK.so"),
|
||||||
|
file("${buildDir}/intermediates/merged_native_libs/${variant.name}/merge${variant.name.capitalize()}NativeLibs/out/lib/armeabi-v7a/libfuai.so"),
|
||||||
|
file("${buildDir}/intermediates/merged_native_libs/${variant.name}/merge${variant.name.capitalize()}NativeLibs/out/lib/arm64-v8a/libCNamaSDK.so"),
|
||||||
|
file("${buildDir}/intermediates/merged_native_libs/${variant.name}/merge${variant.name.capitalize()}NativeLibs/out/lib/arm64-v8a/libfuai.so")
|
||||||
|
]
|
||||||
|
|
||||||
|
soFiles.each { soFile ->
|
||||||
|
if (soFile.exists()) {
|
||||||
|
soFile.delete()
|
||||||
|
println "Deleted ${soFile.name} for ${variant.flavorName}"
|
||||||
|
} else {
|
||||||
|
println "File not found: ${soFile.path}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
println "清空build文件夹";
|
println "清空build文件夹";
|
||||||
for (final def project in rootProject.getAllprojects()) {
|
for (final def project in rootProject.getAllprojects()) {
|
||||||
def name = variant.name.replace('Debug', '').replace('Release', '').toLowerCase()
|
def name = variant.name.replace('Debug', '').replace('Release', '').toLowerCase()
|
||||||
@@ -286,10 +319,6 @@ android {
|
|||||||
useNewCruncher = false
|
useNewCruncher = false
|
||||||
}
|
}
|
||||||
|
|
||||||
packagingOptions {//加上这写代码 为了mob兼容性androidx
|
|
||||||
// pickFirst 'META-INF/*'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// applicationId "myname.pdlive.shayu"
|
// applicationId "myname.pdlive.shayu"
|
||||||
@@ -329,6 +358,9 @@ android {
|
|||||||
zipAlignEnabled true
|
zipAlignEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
firebaseCrashlytics{
|
||||||
|
mappingFileUploadEnabled = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
@@ -336,6 +368,10 @@ android {
|
|||||||
zipAlignEnabled false
|
zipAlignEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
|
||||||
|
firebaseCrashlytics{
|
||||||
|
mappingFileUploadEnabled = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lintOptions {
|
lintOptions {
|
||||||
@@ -344,7 +380,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
flatDir {
|
flatDir {
|
||||||
dirs 'libs', '../libs'
|
dirs 'libs', '../libs'
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ ext {
|
|||||||
|
|
||||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||||
|
|
||||||
// true表示谷歌支付 false 0 链接包(isPluginModel-> true) 1 谷歌包 2华为包 3 samsung包
|
// 0 链接包 1 谷歌包 2华为包 3 samsung包
|
||||||
isGooglePlay : 0,
|
isGooglePlay : 0,
|
||||||
//是否上报异常日志
|
//是否上报异常日志
|
||||||
isUploadLog : true,
|
isUploadLog : true,
|
||||||
@@ -32,7 +32,7 @@ ext {
|
|||||||
isPluginModel : false,
|
isPluginModel : false,
|
||||||
facebook_app_id : "2011402032399020",
|
facebook_app_id : "2011402032399020",
|
||||||
facebook_client_token : "959584e054a33614996361f0044e5253",
|
facebook_client_token : "959584e054a33614996361f0044e5253",
|
||||||
lineChannelId : "1656399535",
|
lineChannelId : "1657514693",
|
||||||
isHideGoogleLogin : false, //是否隐藏谷歌登陆
|
isHideGoogleLogin : false, //是否隐藏谷歌登陆
|
||||||
isHideFacebookLogin : false,//是否隐藏facebook登陆
|
isHideFacebookLogin : false,//是否隐藏facebook登陆
|
||||||
isHideLineLogin : false, //是否隐藏line登陆
|
isHideLineLogin : false, //是否隐藏line登陆
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class SWManager extends BaseCacheManager {
|
|||||||
private FrameLayout pkContainer; //pk主播视图1
|
private FrameLayout pkContainer; //pk主播视图1
|
||||||
private FrameLayout linkUserContainer;//连麦用户视图
|
private FrameLayout linkUserContainer;//连麦用户视图
|
||||||
private onRtcEngineListener onRtcEngineListener;
|
private onRtcEngineListener onRtcEngineListener;
|
||||||
|
private onNetWorkListener onNetWorkListener;
|
||||||
private List<String> drPkUserInfo = new ArrayList<>();
|
private List<String> drPkUserInfo = new ArrayList<>();
|
||||||
private ImageTrackOptions imageTrackOptions = null;
|
private ImageTrackOptions imageTrackOptions = null;
|
||||||
|
|
||||||
@@ -81,6 +82,9 @@ public class SWManager extends BaseCacheManager {
|
|||||||
public void setOnRtcEngineListener(SWManager.onRtcEngineListener onRtcEngineListener) {
|
public void setOnRtcEngineListener(SWManager.onRtcEngineListener onRtcEngineListener) {
|
||||||
this.onRtcEngineListener = onRtcEngineListener;
|
this.onRtcEngineListener = onRtcEngineListener;
|
||||||
}
|
}
|
||||||
|
public void setOnNetWorkListener(SWManager.onNetWorkListener onNetWorkListener) {
|
||||||
|
this.onNetWorkListener = onNetWorkListener;
|
||||||
|
}
|
||||||
|
|
||||||
public SWManager(Context context) {
|
public SWManager(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -530,6 +534,26 @@ public class SWManager extends BaseCacheManager {
|
|||||||
super.onLocalVideoStateChanged(source, state, error);
|
super.onLocalVideoStateChanged(source, state, error);
|
||||||
L.eSw("onLocalVideoStateChanged_source" + source + " state_" + state + " error_" + error);
|
L.eSw("onLocalVideoStateChanged_source" + source + " state_" + state + " error_" + error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConnectionStateChanged(int state, int reason) {
|
||||||
|
super.onConnectionStateChanged(state, reason);
|
||||||
|
L.eSw("onConnectionStateChanged: state = " + state + " reason = " + reason );
|
||||||
|
|
||||||
|
// 使用wifi和数据切换的时候,也会引起这个回调
|
||||||
|
if (state == 4 && reason == 2){
|
||||||
|
// 断网了
|
||||||
|
if (onNetWorkListener != null){
|
||||||
|
onNetWorkListener.onConnectionFail();
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if (state == 3 && reason == 15){
|
||||||
|
// 断网后又恢复了
|
||||||
|
if (onNetWorkListener != null){
|
||||||
|
onNetWorkListener.onConnectionSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private void refreshToken() {
|
private void refreshToken() {
|
||||||
@@ -552,6 +576,11 @@ public class SWManager extends BaseCacheManager {
|
|||||||
public void release() {
|
public void release() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface onNetWorkListener {
|
||||||
|
void onConnectionSuccess();
|
||||||
|
|
||||||
|
void onConnectionFail();
|
||||||
|
}
|
||||||
public interface onRtcEngineListener {
|
public interface onRtcEngineListener {
|
||||||
void onOpenSuccess(String channel, int uid);
|
void onOpenSuccess(String channel, int uid);
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,8 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
private LiveBean mLiveBean;
|
private LiveBean mLiveBean;
|
||||||
//当前直播间下标
|
//当前直播间下标
|
||||||
private int mCurrentItem, mCurrentPage;
|
private int mCurrentItem, mCurrentPage;
|
||||||
|
|
||||||
|
// 这里集成直播间UI
|
||||||
private static PortraitLiveManager manager;
|
private static PortraitLiveManager manager;
|
||||||
private int mLastPosition = -1;
|
private int mLastPosition = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,27 @@ public class LivePkBean {
|
|||||||
private int levelAnchor;
|
private int levelAnchor;
|
||||||
private int sex;
|
private int sex;
|
||||||
private String attention;
|
private String attention;
|
||||||
|
private String pk_avatar_thumb;
|
||||||
|
private String is_shengwang;
|
||||||
|
|
||||||
|
public String getPk_avatar_thumb() {
|
||||||
|
if (pk_avatar_thumb == null) {
|
||||||
|
pk_avatar_thumb = "0";
|
||||||
|
}
|
||||||
|
return pk_avatar_thumb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIs_shengwang() {
|
||||||
|
return is_shengwang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_shengwang(String is_shengwang) {
|
||||||
|
this.is_shengwang = is_shengwang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPk_avatar_thumb(String pk_avatar_thumb) {
|
||||||
|
this.pk_avatar_thumb = pk_avatar_thumb;
|
||||||
|
}
|
||||||
@JSONField(name = "isattention")
|
@JSONField(name = "isattention")
|
||||||
public String getAttention() {
|
public String getAttention() {
|
||||||
if(StringUtil.isEmpty(attention)){
|
if(StringUtil.isEmpty(attention)){
|
||||||
|
|||||||
@@ -343,13 +343,15 @@ public class FreePkDialogFragment extends AbsDialogFragment implements View.OnCl
|
|||||||
userBean.setId(bean.getUid());
|
userBean.setId(bean.getUid());
|
||||||
userBean.setUserNiceName(bean.getUserNiceName());
|
userBean.setUserNiceName(bean.getUserNiceName());
|
||||||
userBean.setAvatar(bean.getAvatar());
|
userBean.setAvatar(bean.getAvatar());
|
||||||
if(bean.getPkUid().equals("0")||bean.getDrpkStatus().equals("0")){
|
if(bean.getPk_avatar_thumb().equals("0")&&bean.getDrpkStatus().equals("0")){
|
||||||
userBean.setPk(0);
|
userBean.setPk(0);
|
||||||
}else{
|
}else{
|
||||||
userBean.setPk(1);
|
userBean.setPk(1);
|
||||||
}
|
}
|
||||||
userBean.setAttention("1");
|
userBean.setAttention("1");
|
||||||
list.add(userBean);
|
if("1".equals(bean.getIs_shengwang())){
|
||||||
|
list.add(userBean);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.yunbao.live.dialog;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
|
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.yunbao.common.dialog.AbsDialogCenterPopupWindow;
|
||||||
|
import com.yunbao.live.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author: plx
|
||||||
|
* Date: 2024/11/11
|
||||||
|
* Description:
|
||||||
|
*/
|
||||||
|
@SuppressLint("ViewConstructor")
|
||||||
|
public class NetWorkTipDialog extends AbsDialogCenterPopupWindow {
|
||||||
|
// 1 断网 2 恢复
|
||||||
|
private int type;
|
||||||
|
private TextView text_tip;
|
||||||
|
private CardView close_btn;
|
||||||
|
|
||||||
|
public NetWorkTipDialog(@NonNull Context context,int type) {
|
||||||
|
super(context);
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void buildDialog(XPopup.Builder builder) {
|
||||||
|
builder.dismissOnTouchOutside(false).dismissOnBackPressed(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int bindLayoutId() {
|
||||||
|
return R.layout.dialog_network_tip;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
text_tip = (TextView)findViewById(R.id.text_tip);
|
||||||
|
close_btn = (CardView)findViewById(R.id.close_btn);
|
||||||
|
|
||||||
|
if (type == 1){
|
||||||
|
text_tip.setText(R.string.connection_fail);
|
||||||
|
}else {
|
||||||
|
text_tip.setText(R.string.connection_success);
|
||||||
|
}
|
||||||
|
|
||||||
|
close_btn.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,6 +45,7 @@ import com.yunbao.live.R;
|
|||||||
import com.yunbao.live.activity.LiveActivity;
|
import com.yunbao.live.activity.LiveActivity;
|
||||||
import com.yunbao.live.activity.LiveSwAnchorActivity;
|
import com.yunbao.live.activity.LiveSwAnchorActivity;
|
||||||
import com.yunbao.live.bean.DrPkbean;
|
import com.yunbao.live.bean.DrPkbean;
|
||||||
|
import com.yunbao.live.dialog.NetWorkTipDialog;
|
||||||
import com.yunbao.live.event.LiveAudienceEvent;
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
import com.yunbao.common.http.LiveHttpConsts;
|
import com.yunbao.common.http.LiveHttpConsts;
|
||||||
import com.yunbao.common.http.LiveHttpUtil;
|
import com.yunbao.common.http.LiveHttpUtil;
|
||||||
@@ -230,6 +231,9 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder {
|
|||||||
initRtcEngine();
|
initRtcEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private NetWorkTipDialog netWorkTipOkDialog;
|
||||||
|
private NetWorkTipDialog netWorkTipFailDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化声网SDK
|
* 初始化声网SDK
|
||||||
*/
|
*/
|
||||||
@@ -247,6 +251,46 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder {
|
|||||||
@Override
|
@Override
|
||||||
public void onUserOffline(int uid) {
|
public void onUserOffline(int uid) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
swManager.setOnNetWorkListener(new SWManager.onNetWorkListener() {
|
||||||
|
@Override
|
||||||
|
public void onConnectionSuccess() {
|
||||||
|
// 显示成功连接网络通知
|
||||||
|
if (mContext != null){
|
||||||
|
((Activity) mContext).runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (netWorkTipFailDialog != null && netWorkTipFailDialog.isShow()){
|
||||||
|
netWorkTipFailDialog.dismiss();
|
||||||
|
}
|
||||||
|
if (netWorkTipOkDialog == null){
|
||||||
|
netWorkTipOkDialog = new NetWorkTipDialog(mContext, 2);
|
||||||
|
}
|
||||||
|
netWorkTipOkDialog.showDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConnectionFail() {
|
||||||
|
if (mContext != null){
|
||||||
|
((Activity) mContext).runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// 显示断网通知
|
||||||
|
if (netWorkTipOkDialog != null && netWorkTipOkDialog.isShow()){
|
||||||
|
netWorkTipOkDialog.dismiss();
|
||||||
|
}
|
||||||
|
if (netWorkTipFailDialog == null){
|
||||||
|
netWorkTipFailDialog = new NetWorkTipDialog(mContext, 1);
|
||||||
|
}
|
||||||
|
netWorkTipFailDialog.showDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6111,35 +6111,40 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
public void upDataPkScore(JSONArray pkScores, int time) {
|
public void upDataPkScore(JSONArray pkScores, int time) {
|
||||||
L.eSw("upDataPkScore(JSONArray pkScores, int time) {" + new Gson().toJson(pkScores));
|
L.eSw("upDataPkScore(JSONArray pkScores, int time) {" + new Gson().toJson(pkScores));
|
||||||
isShowGif = true;
|
isShowGif = true;
|
||||||
if (detailsView != null) {
|
|
||||||
mRoot.removeView(detailsView);
|
if (detailsView == null){
|
||||||
|
L.eSw("upDataPkScore(JSONArray pkScores, int time) {detailsView=null");
|
||||||
|
detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
timeTitle = detailsView.findViewById(R.id.time_title);
|
||||||
|
textTime = detailsView.findViewById(R.id.text_time);
|
||||||
|
linearGrade1 = detailsView.findViewById(R.id.lin_pk1);
|
||||||
|
linearGrade2 = detailsView.findViewById(R.id.lin_pk2);
|
||||||
|
linearGrade3 = detailsView.findViewById(R.id.lin_pk3);
|
||||||
|
linearGrade4 = detailsView.findViewById(R.id.lin_pk4);
|
||||||
|
textPkName1 = detailsView.findViewById(R.id.text_pk_name1);
|
||||||
|
textPkName2 = detailsView.findViewById(R.id.text_pk_name2);
|
||||||
|
textPkName3 = detailsView.findViewById(R.id.text_pk_name3);
|
||||||
|
textPkName4 = detailsView.findViewById(R.id.text_pk_name4);
|
||||||
|
textGrade1 = detailsView.findViewById(R.id.text_grade1);
|
||||||
|
textGrade2 = detailsView.findViewById(R.id.text_grade2);
|
||||||
|
textGrade3 = detailsView.findViewById(R.id.text_grade3);
|
||||||
|
textGrade4 = detailsView.findViewById(R.id.text_grade4);
|
||||||
|
imageGrade1 = detailsView.findViewById(R.id.image_grade1);
|
||||||
|
imageGrade2 = detailsView.findViewById(R.id.image_grade2);
|
||||||
|
imageGrade3 = detailsView.findViewById(R.id.image_grade3);
|
||||||
|
imageGrade4 = detailsView.findViewById(R.id.image_grade4);
|
||||||
}
|
}
|
||||||
L.eSw("upDataPkScore(JSONArray pkScores, int time) {detailsView=null");
|
|
||||||
detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
if (detailsView.getParent() == null){
|
||||||
timeTitle = detailsView.findViewById(R.id.time_title);
|
L.eSw("detailsView 添加到了 mRoot");
|
||||||
textTime = detailsView.findViewById(R.id.text_time);
|
mRoot.addView(detailsView);
|
||||||
linearGrade1 = detailsView.findViewById(R.id.lin_pk1);
|
}
|
||||||
linearGrade2 = detailsView.findViewById(R.id.lin_pk2);
|
|
||||||
linearGrade3 = detailsView.findViewById(R.id.lin_pk3);
|
|
||||||
linearGrade4 = detailsView.findViewById(R.id.lin_pk4);
|
|
||||||
textPkName1 = detailsView.findViewById(R.id.text_pk_name1);
|
|
||||||
textPkName2 = detailsView.findViewById(R.id.text_pk_name2);
|
|
||||||
textPkName3 = detailsView.findViewById(R.id.text_pk_name3);
|
|
||||||
textPkName4 = detailsView.findViewById(R.id.text_pk_name4);
|
|
||||||
textGrade1 = detailsView.findViewById(R.id.text_grade1);
|
|
||||||
textGrade2 = detailsView.findViewById(R.id.text_grade2);
|
|
||||||
textGrade3 = detailsView.findViewById(R.id.text_grade3);
|
|
||||||
textGrade4 = detailsView.findViewById(R.id.text_grade4);
|
|
||||||
imageGrade1 = detailsView.findViewById(R.id.image_grade1);
|
|
||||||
imageGrade2 = detailsView.findViewById(R.id.image_grade2);
|
|
||||||
imageGrade3 = detailsView.findViewById(R.id.image_grade3);
|
|
||||||
imageGrade4 = detailsView.findViewById(R.id.image_grade4);
|
|
||||||
//暂时关闭
|
|
||||||
linearGrade1.setVisibility(View.GONE);
|
linearGrade1.setVisibility(View.GONE);
|
||||||
linearGrade2.setVisibility(View.GONE);
|
linearGrade2.setVisibility(View.GONE);
|
||||||
linearGrade3.setVisibility(View.GONE);
|
linearGrade3.setVisibility(View.GONE);
|
||||||
linearGrade4.setVisibility(View.GONE);
|
linearGrade4.setVisibility(View.GONE);
|
||||||
mRoot.addView(detailsView);
|
|
||||||
|
|
||||||
mRoot.post(new Runnable() {
|
mRoot.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -6161,6 +6166,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
timeTitle.post(countdownRunnable);
|
timeTitle.post(countdownRunnable);
|
||||||
}
|
}
|
||||||
Log.e("多人Pk", "upDataPkScore mPkTimeCount:" + mPkTimeCount);
|
Log.e("多人Pk", "upDataPkScore mPkTimeCount:" + mPkTimeCount);
|
||||||
|
|
||||||
|
|
||||||
|
Log.e("TestPK", "pkScores.size(): " + pkScores.size());
|
||||||
for (int i = 0; i < pkScores.size(); i++) {
|
for (int i = 0; i < pkScores.size(); i++) {
|
||||||
JSONObject score = pkScores.getJSONObject(i);
|
JSONObject score = pkScores.getJSONObject(i);
|
||||||
String userNiceName = score.getString("user_nicename");
|
String userNiceName = score.getString("user_nicename");
|
||||||
@@ -6201,6 +6209,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
textGrade2.setText(String.valueOf(userScore));
|
textGrade2.setText(String.valueOf(userScore));
|
||||||
userId2 = userId;
|
userId2 = userId;
|
||||||
} else if (i == 2) {
|
} else if (i == 2) {
|
||||||
|
// 如果只有三个人
|
||||||
if (pkScores.size() == 3) {
|
if (pkScores.size() == 3) {
|
||||||
linearGrade4.setVisibility(View.VISIBLE);
|
linearGrade4.setVisibility(View.VISIBLE);
|
||||||
textPkName4.setText(userNiceName);
|
textPkName4.setText(userNiceName);
|
||||||
@@ -6208,6 +6217,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
textGrade4.setText(String.valueOf(userScore));
|
textGrade4.setText(String.valueOf(userScore));
|
||||||
userId4 = userId;
|
userId4 = userId;
|
||||||
} else {
|
} else {
|
||||||
|
Log.e("TestPK 23332222", "pkScores.size(): " + pkScores.size());
|
||||||
linearGrade3.setVisibility(View.VISIBLE);
|
linearGrade3.setVisibility(View.VISIBLE);
|
||||||
textPkName3.setText(userNiceName);
|
textPkName3.setText(userNiceName);
|
||||||
ImgLoader.displayNew(mContext, resScore, imageGrade3);
|
ImgLoader.displayNew(mContext, resScore, imageGrade3);
|
||||||
@@ -6269,11 +6279,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
imageGrade2 = detailsView.findViewById(R.id.image_grade2);
|
imageGrade2 = detailsView.findViewById(R.id.image_grade2);
|
||||||
imageGrade3 = detailsView.findViewById(R.id.image_grade3);
|
imageGrade3 = detailsView.findViewById(R.id.image_grade3);
|
||||||
imageGrade4 = detailsView.findViewById(R.id.image_grade4);
|
imageGrade4 = detailsView.findViewById(R.id.image_grade4);
|
||||||
//暂时关闭
|
|
||||||
linearGrade1.setVisibility(View.GONE);
|
|
||||||
linearGrade2.setVisibility(View.GONE);
|
|
||||||
linearGrade3.setVisibility(View.GONE);
|
|
||||||
linearGrade4.setVisibility(View.GONE);
|
|
||||||
mRoot.removeView(detailsView);
|
mRoot.removeView(detailsView);
|
||||||
mRoot.addView(detailsView);
|
mRoot.addView(detailsView);
|
||||||
mRoot.post(new Runnable() {
|
mRoot.post(new Runnable() {
|
||||||
@@ -6291,12 +6297,20 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
Log.e("多人Pk", "upDataPkScore mPkTimeCount:" + mPkTimeCount);
|
Log.e("多人Pk", "upDataPkScore mPkTimeCount:" + mPkTimeCount);
|
||||||
if (pkScores.size() == 2) {
|
/* if (pkScores.size() == 2) {
|
||||||
linearGrade3.setVisibility(View.GONE);
|
linearGrade3.setVisibility(View.GONE);
|
||||||
linearGrade4.setVisibility(View.GONE);
|
linearGrade4.setVisibility(View.GONE);
|
||||||
} else if (pkScores.size() == 3) {
|
} else if (pkScores.size() == 3) {
|
||||||
linearGrade4.setVisibility(View.GONE);
|
linearGrade3.setVisibility(View.GONE);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
//暂时关闭
|
||||||
|
linearGrade1.setVisibility(View.GONE);
|
||||||
|
linearGrade2.setVisibility(View.GONE);
|
||||||
|
linearGrade3.setVisibility(View.GONE);
|
||||||
|
linearGrade4.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < pkScores.size(); i++) {
|
for (int i = 0; i < pkScores.size(); i++) {
|
||||||
JSONObject score = pkScores.getJSONObject(i);
|
JSONObject score = pkScores.getJSONObject(i);
|
||||||
String userNiceName = score.getString("user_nicename");
|
String userNiceName = score.getString("user_nicename");
|
||||||
|
|||||||
53
live/src/main/res/layout/dialog_network_tip.xml
Normal file
53
live/src/main/res/layout/dialog_network_tip.xml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
app:cardCornerRadius="10dp"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:paddingBottom="15dp"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_tip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginStart="30dp"
|
||||||
|
android:layout_marginEnd="30dp"
|
||||||
|
android:textSize="15sp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
app:cardBackgroundColor="#FF3482"
|
||||||
|
app:cardCornerRadius="15dp"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/text_tip"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:id="@+id/close_btn"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:gravity="center"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
@@ -162,5 +162,6 @@
|
|||||||
<string name="live_room_push_details">詳情</string>
|
<string name="live_room_push_details">詳情</string>
|
||||||
<string name="live_room_push_like_an">喜歡主播就關注ta吧~</string>
|
<string name="live_room_push_like_an">喜歡主播就關注ta吧~</string>
|
||||||
<string name="message_1">點擊查看</string>
|
<string name="message_1">點擊查看</string>
|
||||||
|
<string name="connection_fail">网络连接中断,请检查您的网络</string>
|
||||||
|
<string name="connection_success">已连接网络</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -165,4 +165,6 @@
|
|||||||
<string name="live_room_push_details">Details</string>
|
<string name="live_room_push_details">Details</string>
|
||||||
<string name="live_room_push_like_an">If you like this anchor, please subscribe to him.</string>
|
<string name="live_room_push_like_an">If you like this anchor, please subscribe to him.</string>
|
||||||
<string name="message_1">Click to view</string>
|
<string name="message_1">Click to view</string>
|
||||||
|
<string name="connection_fail">The network connection is interrupted. Please check your network.</string>
|
||||||
|
<string name="connection_success">The network has been restored.</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user