修复:人Pk状态展示不正常

This commit is contained in:
18401019693 2022-12-12 17:00:51 +08:00
parent 49167f332d
commit f024283e80
2 changed files with 91 additions and 92 deletions

View File

@ -1,7 +1,5 @@
package com.yunbao.live.presenter;
import android.app.Dialog;
import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK;
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
@ -13,6 +11,7 @@ import static com.yunbao.live.views.LivePushRyViewHolder.rcrtcLiveInfo;
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
import static cn.rongcloud.rtc.core.RendererCommon.ScalingType.SCALE_ASPECT_FILL;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@ -30,26 +29,20 @@ import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.tencent.trtc.TRTCCloud;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.bean.LiveInfoModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMRTCManager;
import com.yunbao.common.manager.RandomPkManager;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
@ -69,8 +62,6 @@ import com.yunbao.live.socket.SocketRyLinkMicPkUtil;
import com.yunbao.live.socket.SocketSendBean;
import com.yunbao.live.views.LiveLinkMicPkViewHolder;
import com.yunbao.live.views.LivePushRyViewHolder;
import com.yunbao.live.views.LiveRoomPlayViewHolder;
import com.yunbao.live.views.PortraitLiveManager;
import org.greenrobot.eventbus.EventBus;
@ -1313,6 +1304,8 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onSuccess(int code, String msg, String[] info) {
Log.i(TAG, "code = " + code + ", msg = " + msg + ", info = " + Arrays.deepToString(info));
if (info.length > 0) {
JSONObject datas = JSONObject.parseObject(info[0]);
boolean agree = true;
if (datas.getIntValue("pk_num_day") <= 0) {
@ -1413,7 +1406,11 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
ToastUtil.show("接受失败");
}
});
}else {
ToastUtil.show(msg);
}
}
});

View File

@ -644,6 +644,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
img.setImageResource(R.mipmap.icon_no4);
} else if (j == 5) {
img.setImageResource(R.mipmap.icon_no5);
}else {
img.setImageResource(R.mipmap.icon_no1);
}