From 6ee678bd749dbf8043716f2df3aeaf8c729b9a98 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 25 May 2023 13:41:39 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=BC=80=E6=92=AD=E9=A2=91=E9=81=93?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E3=80=90=E7=94=B7=E7=A5=9E=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/dialog/LiveNewRoomClassDialogFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomClassDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomClassDialogFragment.java index f2ba058b5..d248207cc 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomClassDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomClassDialogFragment.java @@ -64,7 +64,13 @@ public class LiveNewRoomClassDialogFragment extends AbsDialogFragment implements if (configBean != null) { List list1 = configBean.getLiveClass(); for (int i = 0; i < list1.size(); i++) { - if (!list1.get(i).getName().equals("New") && !list1.get(i).getName().equals("Hot") && !list1.get(i).getName().equals("熱門") && !list1.get(i).getName().equals("新秀")) { + if (!list1.get(i).getName().equals("New") && + !list1.get(i).getName().equals("新秀") && + !list1.get(i).getName().equals("熱門") && + !list1.get(i).getName().equals("Hot") && + !list1.get(i).getName().equals("男神") && + !list1.get(i).getName().equals("Mr.Right") + ) { list.add(list1.get(i)); } } From 1b637b7a77fb3e2f96a06a3be91412410f71cd49 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 25 May 2023 14:18:00 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E5=BE=A9=E5=BC=80=E5=B1=8F?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=81=9A=E7=84=A6banner=E6=9C=89=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=BA=A2=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/src/main/res/layout/item_main_home_live_head.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/src/main/res/layout/item_main_home_live_head.xml b/main/src/main/res/layout/item_main_home_live_head.xml index 17dd2fa24..36b611239 100644 --- a/main/src/main/res/layout/item_main_home_live_head.xml +++ b/main/src/main/res/layout/item_main_home_live_head.xml @@ -16,6 +16,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="0dp" + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" android:layout_marginBottom="5dp" android:layout_marginTop="5dp" android:scaleType="centerCrop" From 99618a2779f55d3a66bb1ad69bf1013bcd1c45cb Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 25 May 2023 14:25:57 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=A2=9EIM=E6=B6=88=E6=81=AF?= =?UTF-8?q?=EF=BC=9AendPK=EF=BC=8C=E7=94=A8=E4=BA=8E=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9C=80=E7=BB=88=E5=8D=95=E4=BA=BAPK=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/Constants.java | 1 + .../yunbao/live/activity/LiveActivity.java | 14 ++ .../presenter/LiveRyLinkMicPkPresenter.java | 19 +- .../live/socket/SocketMessageListener.java | 10 + .../yunbao/live/socket/SocketRyClient.java | 13 ++ .../live/views/LiveLinkMicPkViewHolder.java | 35 ++- .../live/views/PortraitLiveManager.java | 199 ++++++++++-------- 7 files changed, 191 insertions(+), 100 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/Constants.java b/common/src/main/java/com/yunbao/common/Constants.java index b597b23f7..f1e9e0d49 100644 --- a/common/src/main/java/com/yunbao/common/Constants.java +++ b/common/src/main/java/com/yunbao/common/Constants.java @@ -182,6 +182,7 @@ public class Constants { public static final String LIVE_VOTE_CREATE="createVote"; public static final String LIVE_VOTE_UPDATE="updateVote"; public static final String LIVE_VOTE_END="endVote"; + public static final String LIVE_PK_END="endPK";//结束PK,以这个PK获取到的参数为准 //游戏socket public static final String SOCKET_GAME_ZJH = "startGame";//炸金花 diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index f324bb145..fbc864805 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -1,5 +1,7 @@ package com.yunbao.live.activity; +import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid; + import android.app.Dialog; import android.content.ClipData; import android.content.ClipboardManager; @@ -388,6 +390,17 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL } + @Override + public void onEndPk(long leftUid, long rightUid, long left, long right, LivePKUserListBean bean) { + if (mLiveRyLinkMicPkPresenter != null) { + if (mLiveUid.equals(leftUid + "")) { + mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right, bean); + } else { + mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left, bean); + } + } + } + /** * 收到弹幕消息 */ @@ -1362,6 +1375,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL fragment.setArguments(bundle); fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment"); } + /** * 打开购买守护的弹窗 */ 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 409f79daa..b79c02a83 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -206,13 +206,14 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { Log.d("RYM_DG", "Other onLeaveRoom: room = " + room.getRoomId()); } }; + public LiveRyLinkMicPkPresenter(Context context, ILiveLinkMicViewHolder linkMicViewHolder, boolean isAnchor, View root) { mContext = context; mIsAnchor = isAnchor; mRoot = root; mPkContainer = linkMicViewHolder.getPkContainer(); mPkTimeString1 = ""; - mPkTimeString2 =mContext.getString(R.string.live_pk_time_2); + mPkTimeString2 = mContext.getString(R.string.live_pk_time_2); //从本地取数据 String pkTime = CommonAppConfig.getInstance().getAnchorPkTime(); if (!pkTime.isEmpty()) { @@ -253,7 +254,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { mPkContainer = linkMicViewHolder.getPkContainer(); livePushRyViewHolder = linkMicViewHolder; mPkTimeString1 = ""; - mPkTimeString2 =mContext.getString(R.string.live_pk_time_2); + mPkTimeString2 = mContext.getString(R.string.live_pk_time_2); //从本地取数据 String pkTime = CommonAppConfig.getInstance().getAnchorPkTime(); if (!pkTime.isEmpty()) { @@ -2184,6 +2185,18 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { nextPkTimeCountDown(2); } + /** + * 修改最终PK数据 + * @param leftGift 左边数据 + * @param rightGift 右边数据 + * @param bean 排位数据 + */ + public void onPkProgressEnd(long leftGift, long rightGift,LivePKUserListBean bean) { + if (mLiveLinkMicPkViewHolder != null) { + mLiveLinkMicPkViewHolder.onProgressChanged(leftGift, rightGift, bean, true); + } + } + /** * 进房间的时候懲罰开始 @@ -2312,7 +2325,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { // //恢复播放画面 if (i == 1) { - if(btn_close!=null){ + if (btn_close != null) { btn_close.setVisibility(View.GONE); } if (rtcRoom != null) { diff --git a/live/src/main/java/com/yunbao/live/socket/SocketMessageListener.java b/live/src/main/java/com/yunbao/live/socket/SocketMessageListener.java index 3d5040038..a0d1e6dc5 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketMessageListener.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketMessageListener.java @@ -290,6 +290,16 @@ public interface SocketMessageListener { */ void onPrizePoolUp(String level); + /** + * 最终PK数据 + * @param leftUid 左边uid + * @param rightUid 右边uid + * @param left 左边分数 + * @param right 右边分数 + * @param bean 排位顺序 + */ + void onEndPk(long leftUid,long rightUid,long left,long right,LivePKUserListBean bean); + /***********************以下是游戏*********************************/ /** * 游戏 智勇三张 游戏的回调 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 332c18aa8..827574c36 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -7,8 +7,10 @@ import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom; import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot; import android.app.Activity; +import android.app.Dialog; import android.content.Context; import android.os.Handler; +import android.os.Looper; import android.os.Message; import android.text.TextUtils; import android.util.Log; @@ -38,6 +40,7 @@ import com.yunbao.common.http.HttpClient; import com.yunbao.common.manager.IMRTCManager; import com.yunbao.common.manager.RandomPkManager; import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.R; @@ -64,6 +67,8 @@ import org.greenrobot.eventbus.EventBus; import java.lang.ref.WeakReference; import java.util.List; +import java.util.Timer; +import java.util.TimerTask; import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback; import cn.rongcloud.rtc.base.RTCErrorCode; @@ -650,6 +655,14 @@ public class SocketRyClient { .setObject(map) ); break; + case Constants.LIVE_PK_END: + mListener.onEndPk(map.getLong("uid"), + map.getLong("pkuid"), + map.getLong("uid_score"), + map.getLong("pkuid_score"), + JSONObject.parseObject(map.getJSONObject("ct").getJSONObject("pk_top_users").toJSONString(), LivePKUserListBean.class) + ); + break; } } 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 832a4ec12..94487fe74 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java @@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; +import android.graphics.Color; import android.graphics.Path; import android.graphics.PathMeasure; import android.graphics.RectF; @@ -84,8 +85,8 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder { public void init() { mHalfScreenWidth = ScreenDimenUtil.getInstance().getScreenWdith() / 2; - mLeftString =mContext.getString(R.string.live_link_mic_pk_1); - mRightString =mContext.getString(R.string.live_link_mic_pk_2); + mLeftString = mContext.getString(R.string.live_link_mic_pk_1); + mRightString = mContext.getString(R.string.live_link_mic_pk_2); mFrameImageView = (FrameImageView) findViewById(R.id.frame_img); mFrameImageView.setImageList(LiveIconUtil.getLinkMicPkAnim());//PK开始动画 frame_img_pk = (ImageView) findViewById(R.id.frame_img_pk); @@ -155,7 +156,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { - Log.i("女神说", "倒计时状态:"+s); + Log.i("女神说", "倒计时状态:" + s); if (mTime.getVisibility() == View.VISIBLE) { EventBus.getDefault().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING)); @@ -198,6 +199,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder { animationDrawable = (AnimationDrawable) frame_img_pk.getBackground(); animationDrawable.start(); } + mLeft.setTag(null); } public void showTime() { @@ -233,6 +235,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder { } if (mLeft != null) { mLeft.setTranslationX(0); + mLeft.setTag(null); mLeft2.setTranslationX(0); } if (mRight != null) { @@ -241,7 +244,27 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder { } } + /** + * 修改PK进度条进度 + * @param leftGift 左边进度 + * @param rightGift 右边进度 + * @param bean 排位信息 + */ public void onProgressChanged(long leftGift, long rightGift, LivePKUserListBean bean) { + onProgressChanged(leftGift, rightGift, bean, false); + } + + /** + * 修改PK进度条进度 + * @param leftGift 左边进度 + * @param rightGift 右边进度 + * @param bean 排位信息 + * @param isEnd 是否为最终数据,是的话就不再接收后续修改数据,默认false + */ + public void onProgressChanged(long leftGift, long rightGift, LivePKUserListBean bean, boolean isEnd) { + if (mLeft.getTag() != null && ((boolean) mLeft.getTag())) { + return; + } mLeft.setText(mLeftString + " " + leftGift); mRight.setText(rightGift + " " + mRightString); if (leftGift == rightGift) { @@ -262,8 +285,10 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder { animationDrawable = (AnimationDrawable) frame_img_pk.getBackground(); animationDrawable.start(); } - - EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_UPDATE_HEAD_DATA).setLivePKUserListBean(bean)); + mLeft.setTag(isEnd); + if (bean != null) { + EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_UPDATE_HEAD_DATA).setLivePKUserListBean(bean)); + } } private void changeLine(float nowIndex, long leftGift, long rightGift) { diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 40aff0c3d..3be56a837 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -1,6 +1,7 @@ package com.yunbao.live.views; import static com.yunbao.live.views.LiveRoomViewHolder.isStayRoomfive; +import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid; import android.app.Activity; import android.app.Dialog; @@ -9,6 +10,7 @@ import android.content.res.Configuration; import android.graphics.drawable.AnimationDrawable; import android.os.CountDownTimer; import android.os.Handler; +import android.os.Looper; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; @@ -95,6 +97,8 @@ import org.greenrobot.eventbus.EventBus; import java.util.ArrayList; import java.util.List; +import java.util.Timer; +import java.util.TimerTask; import cn.rongcloud.rtc.api.RCRTCEngine; import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback; @@ -269,105 +273,105 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe @Override public void run() { - try{ + try { - Log.e("ImgLoader1", data.getAvatar()); - if (mLiveRyLinkMicPkPresenter != null) { - mLiveRyLinkMicPkPresenter.clearData(); - mLiveRyLinkMicPkPresenter.release(); - mLiveRyLinkMicPkPresenter = null; - } + Log.e("ImgLoader1", data.getAvatar()); + if (mLiveRyLinkMicPkPresenter != null) { + mLiveRyLinkMicPkPresenter.clearData(); + mLiveRyLinkMicPkPresenter.release(); + mLiveRyLinkMicPkPresenter = null; + } - mLiveBean = data; - mLiveSDK = liveSdk; - mLiveType = liveType; - mLiveTypeVal = liveTypeVal; - liveID = data.getUid(); - Bus.get().post(new LiveAudienceEvent() - .setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS) - .setParametersModel(openParametersModel - .setmLiveType(mLiveType) - .setmLiveTypeVal(mLiveTypeVal))); - loading.setVisibility(View.VISIBLE); - ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), ivBg); - AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground(); - frameAnimation.start(); - liveHandler.removeCallbacks(loadRunnableGone); - if (mLivePlayViewHolder == null) { - mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1); - mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager()); - mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer); - mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, mLiveAudienceViewHolder.getContentView()); - mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null); - mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); - mLivePlayViewHolder.addToParent(); - mLivePlayViewHolder.subscribeActivityLifeCycle(); - mLivePlayViewHolder.setLoadViewListener(new LiveRoomPlayViewHolder.LoadingListener() { + mLiveBean = data; + mLiveSDK = liveSdk; + mLiveType = liveType; + mLiveTypeVal = liveTypeVal; + liveID = data.getUid(); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS) + .setParametersModel(openParametersModel + .setmLiveType(mLiveType) + .setmLiveTypeVal(mLiveTypeVal))); + loading.setVisibility(View.VISIBLE); + ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), ivBg); + AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground(); + frameAnimation.start(); + liveHandler.removeCallbacks(loadRunnableGone); + if (mLivePlayViewHolder == null) { + mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1); + mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager()); + mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer); + mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, mLiveAudienceViewHolder.getContentView()); + mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null); + mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); + mLivePlayViewHolder.addToParent(); + mLivePlayViewHolder.subscribeActivityLifeCycle(); + mLivePlayViewHolder.setLoadViewListener(new LiveRoomPlayViewHolder.LoadingListener() { + @Override + public void onPlayer() { + liveHandler.postDelayed(loadRunnableGone, 350); + } + }); + mLiveRoomViewHolder.subscribeActivityLifeCycle(); + mLiveAudienceViewHolder.addToParent(); + mLiveRoomViewHolder.addToParent(); + mLiveAudienceViewHolder.subscribeActivityLifeCycle(); + } else { + mLivePlayViewHolder.setLiveBeanLandscape(1); + mLiveLinkMicPresenter.setLiveSdk(mLiveSDK); + mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK); + } + + if (mLiveRyLinkMicPkPresenter == null) { + mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); + } + //去除主播离开画面 + if (LivePlayKsyViewHolder.leave != null) { + LivePlayKsyViewHolder.leave.setVisibility(View.GONE); + } + if (LivePlayRyViewHolder.leave != null) { + LivePlayRyViewHolder.leave.setVisibility(View.GONE); + } + //直播间背景 + + ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600); + + mask.setVisibility(View.VISIBLE); + mLivePlayViewHolder.clearFrame(); + mLivePlayViewHolder.setLiveBean(mLiveBean); + mLivePlayViewHolder.removeDetailView(); + mLivePlayViewHolder.setCover(mLiveBean.getAvatar()); + mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape()); + mLiveRoomViewHolder.changeMessageLandscape(mLiveBean.getLandscape()); + //mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF); + mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() { @Override - public void onPlayer() { - liveHandler.postDelayed(loadRunnableGone, 350); + public void onMikUpdate() { + if (mContext instanceof LiveActivity) { + ((LiveActivity) mContext).showMicList(mLiveBean.getUid(), mLiveRoomViewHolder); + } } }); - mLiveRoomViewHolder.subscribeActivityLifeCycle(); - mLiveAudienceViewHolder.addToParent(); - mLiveRoomViewHolder.addToParent(); - mLiveAudienceViewHolder.subscribeActivityLifeCycle(); - } else { - mLivePlayViewHolder.setLiveBeanLandscape(1); - mLiveLinkMicPresenter.setLiveSdk(mLiveSDK); - mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK); - } - - if (mLiveRyLinkMicPkPresenter == null) { - mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); - } - //去除主播离开画面 - if (LivePlayKsyViewHolder.leave != null) { - LivePlayKsyViewHolder.leave.setVisibility(View.GONE); - } - if (LivePlayRyViewHolder.leave != null) { - LivePlayRyViewHolder.leave.setVisibility(View.GONE); - } - //直播间背景 - - ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600); - - mask.setVisibility(View.VISIBLE); - mLivePlayViewHolder.clearFrame(); - mLivePlayViewHolder.setLiveBean(mLiveBean); - mLivePlayViewHolder.removeDetailView(); - mLivePlayViewHolder.setCover(mLiveBean.getAvatar()); - mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape()); - mLiveRoomViewHolder.changeMessageLandscape(mLiveBean.getLandscape()); - //mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF); - mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() { - @Override - public void onMikUpdate() { - if (mContext instanceof LiveActivity) { - ((LiveActivity) mContext).showMicList(mLiveBean.getUid(), mLiveRoomViewHolder); - } + mLiveRoomViewHolder.resetView(); + enterRoomModel.clear(); + enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable); + mLiveRoomViewHolder.setAvatar(data.getAvatar()); + mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor()); + mLiveRoomViewHolder.setName(data.getUserNiceName()); + mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip()); + mLiveRoomViewHolder.setTitle(data.getTitle()); + mLiveRoomViewHolder.setAnchorGoodNumber(data.getGoodNum()); + mLiveRoomViewHolder.clearGuardIcon(); + mLiveRoomViewHolder.clearChat(); + mLiveRoomViewHolder.releaseGift(); + mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), ""); + mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this, mContext); + if (mLiveLinkMicPresenter != null) { + mLiveLinkMicPresenter.setSocketClient(mSocketClient); } - }); - mLiveRoomViewHolder.resetView(); - enterRoomModel.clear(); - enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable); - mLiveRoomViewHolder.setAvatar(data.getAvatar()); - mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor()); - mLiveRoomViewHolder.setName(data.getUserNiceName()); - mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip()); - mLiveRoomViewHolder.setTitle(data.getTitle()); - mLiveRoomViewHolder.setAnchorGoodNumber(data.getGoodNum()); - mLiveRoomViewHolder.clearGuardIcon(); - mLiveRoomViewHolder.clearChat(); - mLiveRoomViewHolder.releaseGift(); - mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), ""); - mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this, mContext); - if (mLiveLinkMicPresenter != null) { - mLiveLinkMicPresenter.setSocketClient(mSocketClient); - } - enterRoomNew(); + enterRoomNew(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } @@ -1173,6 +1177,17 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } } + @Override + public void onEndPk(long leftUid, long rightUid, long left, long right,LivePKUserListBean bean) { + if (mLiveRyLinkMicPkPresenter != null) { + if (mLiveUid.equals(leftUid + "")) { + mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right,bean); + } else { + mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left,bean); + } + } + } + @Override public void onSendDanMu(LiveDanMuBean bean) { if (mLiveRoomViewHolder != null) { From 65bfc77376817df559cda034e857471c6ed269ae Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 25 May 2023 14:34:39 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=95=B0=E6=8D=AE=E7=95=8C=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E6=97=B6=E9=95=BF=E6=9C=AA=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- live/src/main/res/layout/view_live_end.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/live/src/main/res/layout/view_live_end.xml b/live/src/main/res/layout/view_live_end.xml index aaf9be7c0..bf3ac74c6 100644 --- a/live/src/main/res/layout/view_live_end.xml +++ b/live/src/main/res/layout/view_live_end.xml @@ -399,7 +399,6 @@ android:id="@+id/live_duration_anchor" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="12dp" android:text="0" android:textColor="@color/white" android:textSize="16sp" From 27715cda2c871ed9cd3863af58a4315c6d6e94e5 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Fri, 26 May 2023 14:24:29 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8A=95=E7=A5=A8?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=A4=B1=E8=B4=A5=E6=97=B6=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/main/res/values-en-rUS/string.xml | 1 + common/src/main/res/values-zh-rHK/strings.xml | 1 + common/src/main/res/values-zh-rTW/strings.xml | 1 + common/src/main/res/values-zh/strings.xml | 1 + common/src/main/res/values/strings.xml | 1 + .../main/java/com/yunbao/live/utils/LiveAnchorVoteManager.java | 3 +-- 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 11c39afa5..e16582a76 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1177,4 +1177,5 @@ Limited ride And limited avatar frame VOTE %s
box disappears after %s seconds
Please complete the form. + Create Vote Error diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index fb6940897..470a22c53 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1172,4 +1172,5 @@ 愛你,愛你 指導下我好嗎 完整填寫領大禮 + 投票創建失敗 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index e67edd9e0..312518d95 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1171,4 +1171,5 @@ 愛你,愛你 指導下我好嗎 完整填寫領大禮 + 投票創建失敗 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 5152c78d3..fe9bd7a5a 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1172,4 +1172,5 @@ 離開會讓您失去獎勵,您確認離開嗎? 愛你,愛你 指導下我好嗎 + 投票創建失敗 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 765c420e3..f886d0dd7 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1178,4 +1178,5 @@ Limited ride And limited avatar frame Leave without a gift Love you Can you guide me + Create Vote Error diff --git a/live/src/main/java/com/yunbao/live/utils/LiveAnchorVoteManager.java b/live/src/main/java/com/yunbao/live/utils/LiveAnchorVoteManager.java index 1d10fa148..476fb10c6 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveAnchorVoteManager.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveAnchorVoteManager.java @@ -64,9 +64,8 @@ public class LiveAnchorVoteManager { @Override public void onError(String error) { - ToastUtil.show(error); LiveRoomVoteModel voteModel = new LiveRoomVoteModel(); - voteModel.setContent(error); + voteModel.setContent(CommonAppContext.getTopActivity().getString(com.yunbao.common.R.string.live_vote_create_error)); listener.onItemClick(voteModel, -1); } }); From 9526a14ca212c124fd4131253fd0edb8b677439e Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 27 May 2023 11:24:28 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E5=8C=BA=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/live/views/LiveRoomViewHolder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 067ad135d..d3188e201 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -5,6 +5,7 @@ import static com.yunbao.live.bean.LiveChatBean.RECOMMEND_CARD_NOTIFY; import android.app.Activity; import android.app.Dialog; import android.content.Context; +import android.graphics.Color; import android.graphics.Outline; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -1097,7 +1098,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) mChatRecyclerView.getLayoutParams(); - params1.topMargin = 180; + params1.topMargin = DpUtil.dp2px(65); mChatRecyclerView.setLayoutParams(params1); mChatRecyclerView.setHasFixedSize(true);