修复:单人PK,PK条主播端和用户端展示问题

This commit is contained in:
18401019693 2022-12-13 16:23:13 +08:00
parent e030db04b9
commit b804c20ba0
10 changed files with 21 additions and 69 deletions

View File

@ -10,9 +10,9 @@ ext {
manifestPlaceholders = [
//
// serverHost : "https://napi.yaoulive.com",
serverHost : "https://napi.yaoulive.com",
//
serverHost : "https://ceshi.yaoulive.com",
// serverHost : "https://ceshi.yaoulive.com",
//
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -242,6 +242,7 @@ public class LiveAudienceEvent extends BaseModel {
LEAVE_PK_SCORE(47, "PK排名"),
PK_TIME_COUNT(48, "多人PK结束"),
DISCONNEXT_PK_TIME(50, "单人Pk结束"),
UP_PK_TWO(51, "PK头像信息"),
CUSTOM_FULL_SERVICE_NOTIFY(51, "全服通知");
private int type;

View File

@ -111,7 +111,6 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
mIsAnchor = isAnchor;
mRoot = root;
mPkContainer = linkMicViewHolder.getPkContainer();
// mPkTimeString1 = WordUtil.getString(R.string.live_pk_time_1);
mPkTimeString2 = WordUtil.getString(R.string.live_pk_time_2);
//从本地取数据

View File

@ -867,6 +867,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE);
SocketRyLinkMicPkUtil.linkMicPkAccept(mSocketRyClient, mApplyUid, mApplyUrl, mApplyNmae);
onLinkMicPkStart(mApplyUid, 2);
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.UP_PK_TWO));
}
});
}
@ -994,6 +995,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onSuccess(io.rong.imlib.model.Message message) {
Log.e("ry", "发送成功");
if (SocketRyClient.mSocketHandler != null) {
SocketRyClient.mSocketHandler.processBroadcast(msg1.mResult.toString() + "");
@ -1860,6 +1862,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
if (mPkPopWindow != null) {
mPkPopWindow.dismiss();
}
}
/**
@ -1957,7 +1960,6 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
}
mLiveLinkMicPkViewHolder.startAnim();
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_START).setObject(pkUid));
mLiveLinkMicPkViewHolder.showTime();
nextPkTimeCountDown();
if (mIsAnchor) {

View File

@ -806,6 +806,7 @@ public class SocketClient {
mListener.onLinkMicPkNotResponse();
break;
case 9://pk结束的回调
mListener.onLinkMicPkEnd(map.getString("win_uid"));
break;
case 10://系统发起PK回调

View File

@ -1056,6 +1056,7 @@ public class SocketRyClient {
break;
case 4://所有人收到PK开始址的回调
// RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_START);
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_START).setObject(map.getString("pkuid")));
mListener.onLinkMicPkStart(map.getString("pkuid"), map.getString("pkhead"), map.getString("pkname"), map.getString("is_ladders"));
break;
case 5://PK时候断开连麦的回调

View File

@ -115,12 +115,6 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
if (mPkProgressBar != null && mPkProgressBar.getVisibility() != View.VISIBLE) {
mPkProgressBar.setVisibility(View.VISIBLE);
}
// if (mLeft != null) {
// mLeft.setBackground(null);
// }
// if (mRight != null) {
// mRight.setBackground(null);
// }
}
});
mAnimator1.setInterpolator(new AccelerateDecelerateInterpolator());
@ -373,34 +367,11 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
img_pk_show_r.setBackgroundResource(R.mipmap.icon_pk_win);
}
LiveRoomViewHolder.pkEndList(result);
// } else {
// //PK结束动画
// mResultImageView.setImageResource(result == 0 ? R.mipmap.icon_live_pk_result_ping : R.mipmap.icon_live_pk_result_win);
// mResultImageView.startAnimation(mEndAnim2);
// }
}
}
});
// mEndAnim2 = new ScaleAnimation(0.2f, 1, 0.2f, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
// mEndAnim2.setDuration(500);
// mEndAnim2.setAnimationListener(new Animation.AnimationListener() {
// @Override
// public void onAnimationStart(Animation animation) {
//
// }
//
// @Override
// public void onAnimationEnd(Animation animation) {
// mEndAnimator3 = getEndValueAnimator(result);
// mEndAnimator3.start();
// }
//
// @Override
// public void onAnimationRepeat(Animation animation) {
//
// }
// });
mEndAnimator1.start();
}
@ -432,7 +403,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
if (mFrameImageView.getVisibility() == View.VISIBLE) {
mFrameImageView.setVisibility(View.INVISIBLE);
}
// if () {
img_pk_show_l.setVisibility(View.VISIBLE);
img_pk_show_r.setVisibility(View.VISIBLE);
if (result == 0) {
@ -446,33 +417,10 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
img_pk_show_r.setBackgroundResource(R.mipmap.icon_pk_win);
}
LiveRoomViewHolder.pkEndList(result);
// } else {
// //PK结束动画
// mResultImageView.setImageResource(result == 0 ? R.mipmap.icon_live_pk_result_ping : R.mipmap.icon_live_pk_result_win);
// mResultImageView.startAnimation(mEndAnim2);
// }
}
}
});
// mEndAnim2 = new ScaleAnimation(0.2f, 1, 0.2f, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
// mEndAnim2.setDuration(500);
// mEndAnim2.setAnimationListener(new Animation.AnimationListener() {
// @Override
// public void onAnimationStart(Animation animation) {
//
// }
//
// @Override
// public void onAnimationEnd(Animation animation) {
// mEndAnimator3 = getEndValueAnimator(result);
// mEndAnimator3.start();
// }
//
// @Override
// public void onAnimationRepeat(Animation animation) {
//
// }
// });
mEndAnimator1.start();
}
@ -486,9 +434,6 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
if (mEndAnimator1 != null) {
mEndAnimator1.cancel();
}
// if (mEndAnim2 != null) {
// mEndAnim2.cancel();
// }
if (mFrameImageView != null) {
mFrameImageView.clearAnimation();
mFrameImageView.release();

View File

@ -1947,12 +1947,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
lt_pk_line.setVisibility(View.VISIBLE);
img_pk_fist_l.setBackgroundResource(R.mipmap.icon_red_no1);
img_pk_fist_r.setBackgroundResource(R.mipmap.icon_blue_no1);
ImgLoader.display2((LiveActivity) Contexts, "", avatar_l1);
ImgLoader.display2((LiveActivity) Contexts, "", avatar_l2);
ImgLoader.display2((LiveActivity) Contexts, "", avatar_l3);
ImgLoader.display2((LiveActivity) Contexts, "", avatar_r1);
ImgLoader.display2((LiveActivity) Contexts, "", avatar_r2);
ImgLoader.display2((LiveActivity) Contexts, "", avatar_r3);
ImgLoader.display2(mContext, R.mipmap.icon_sofa_red, avatar_l1);
ImgLoader.display2(mContext, R.mipmap.icon_sofa_red, avatar_l2);
ImgLoader.display2((LiveActivity) Contexts, R.mipmap.icon_sofa_red, avatar_l3);
ImgLoader.display2((LiveActivity) Contexts, R.mipmap.icon_sofa_blue, avatar_r1);
ImgLoader.display2((LiveActivity) Contexts, R.mipmap.icon_sofa_blue, avatar_r2);
ImgLoader.display2((LiveActivity) Contexts, R.mipmap.icon_sofa_blue, avatar_r3);
uidL1 = "";
uidL2 = "";
@ -3818,6 +3818,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
case PK_TIME_COUNT:
endDRGif();
break;
case UP_PK_TWO:
UpPkTwo();
break;
}
}

View File

@ -414,7 +414,7 @@
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_gravity="center_vertical"
android:layout_marginRight="47dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="40dp"
app:autoPlay="true" />