diff --git a/config.gradle b/config.gradle index 37ecbef9b..f139351ac 100644 --- a/config.gradle +++ b/config.gradle @@ -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", diff --git a/live/src/main/assets/free_gift_tip.svga b/live/src/main/assets/free_gift_tip.svga index 7c5513011..aa1b18515 100644 Binary files a/live/src/main/assets/free_gift_tip.svga and b/live/src/main/assets/free_gift_tip.svga differ diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index 9053bc708..af4ba5b01 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -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; diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java index 440fcdce3..9bd798386 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java @@ -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); //从本地取数据 diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java index 17a430889..ae81dcdd1 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -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) { diff --git a/live/src/main/java/com/yunbao/live/socket/SocketClient.java b/live/src/main/java/com/yunbao/live/socket/SocketClient.java index 1e313692c..f7933e897 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketClient.java @@ -806,6 +806,7 @@ public class SocketClient { mListener.onLinkMicPkNotResponse(); break; case 9://pk结束的回调 + mListener.onLinkMicPkEnd(map.getString("win_uid")); break; case 10://系统发起PK回调 diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 29bdaf0ad..6ed52072a 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -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时候断开连麦的回调 diff --git a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java index c1b6fd9c6..74f922ae3 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java @@ -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(); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 3fef94002..9695bbaa2 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -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 = ""; @@ -3807,7 +3807,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis case PK_TWO_START: pkUid = event.getObject().toString(); UpPkTwo(); - new Handler(Looper.getMainLooper()).postDelayed(this::initPkRank,300); + new Handler(Looper.getMainLooper()).postDelayed(this::initPkRank, 300); break; case PK_TWO_END: closePkTwo(); @@ -3818,6 +3818,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis case PK_TIME_COUNT: endDRGif(); break; + case UP_PK_TWO: + UpPkTwo(); + break; } } diff --git a/live/src/main/res/layout/view_live_audience.xml b/live/src/main/res/layout/view_live_audience.xml index 75a10c0b5..f8ca03e26 100644 --- a/live/src/main/res/layout/view_live_audience.xml +++ b/live/src/main/res/layout/view_live_audience.xml @@ -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" />