From 9f90040168263de0952f6f6e6de96a0c401f9b6b Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 30 Jul 2024 16:47:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/Constants.java | 1 + .../yunbao/common/bean/BanDownLiveEvent.java | 47 ++++ .../common/dialog/OrderLevelPopupWindow.java | 12 +- common/src/main/res/values-zh/strings.xml | 2 +- common/src/main/res/values/strings.xml | 2 +- .../live/activity/LiveSwAnchorActivity.java | 128 ++++++---- .../com/yunbao/live/dialog/LiveGiftPopup.java | 3 +- .../live/presenter/LiveGiftAnimPresenter.java | 1 + .../yunbao/live/socket/SocketSwClient.java | 10 + .../yunbao/live/views/LiveEndViewHolder.java | 14 +- .../live/views/LiveNewReadySwViewHolder.java | 2 +- .../yunbao/live/views/LiveParcelFragment.java | 3 + live/src/main/res/layout/view_live_end.xml | 223 +++++++++--------- 13 files changed, 284 insertions(+), 164 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/bean/BanDownLiveEvent.java diff --git a/common/src/main/java/com/yunbao/common/Constants.java b/common/src/main/java/com/yunbao/common/Constants.java index a2bab93b2..ed6747b05 100644 --- a/common/src/main/java/com/yunbao/common/Constants.java +++ b/common/src/main/java/com/yunbao/common/Constants.java @@ -151,6 +151,7 @@ public class Constants { public static final String SOCKET_LIVE_DRPK_RANDOM = "LiveRandomPK";//随机PK public static final String SOCKET_LEAVE_ROOM = "disconnect";//用户离开房间 public static final String SOCKET_LIVE_END = "StartEndLive";//主播关闭直播 + public static final String SOCKET_LIVE_END_CLOSE = "StartEndLiveClose";//主播关闭直播 public static final String SOCKET_SYSTEM = "SystemNot";//系统消息 public static final String UP_USER_LIST = "upuserlist";//更新用戶列表 public static final String LIAN_MAI = "LivePKDRLM";//用户连麦 diff --git a/common/src/main/java/com/yunbao/common/bean/BanDownLiveEvent.java b/common/src/main/java/com/yunbao/common/bean/BanDownLiveEvent.java new file mode 100644 index 000000000..53d9a72db --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/BanDownLiveEvent.java @@ -0,0 +1,47 @@ +package com.yunbao.common.bean; + +public class BanDownLiveEvent extends BaseModel{ + private String reason,reasonContent,content,timer; + + public BanDownLiveEvent() { + } + + public BanDownLiveEvent(String reason, String reasonContent, String content, String timer) { + this.reason = reason; + this.reasonContent = reasonContent; + this.content = content; + this.timer = timer; + } + + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public String getReasonContent() { + return reasonContent; + } + + public void setReasonContent(String reasonContent) { + this.reasonContent = reasonContent; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java index 0328ea94f..67fa91218 100644 --- a/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java @@ -125,11 +125,17 @@ public class OrderLevelPopupWindow extends CenterPopupView { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.buying_experience), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - if(StringUtil.isEmpty(orderLevel.getText().toString())||"0".equals(orderLevel.getText().toString())){ - ToastUtil.show(WordUtil.isNewZh()?"输入数字不可为0":"The input number cannot be 0"); + int input = 0; + try { + input = Integer.parseInt(orderLevel.getText().toString()); + } catch (Exception e) { + input = 0; + } + if (StringUtil.isEmpty(orderLevel.getText().toString()) || input == 0) { + ToastUtil.show(WordUtil.isNewZh() ? "輸入数字不可為0" : "The input number cannot be 0"); return; } - if (Integer.parseInt(orderLevel.getText().toString()+"00") <= maxExp) { + if (Integer.parseInt(orderLevel.getText().toString() + "00") <= maxExp) { LiveNetManager.get(getContext()).buyingExperiencePoint(buyExp + "00", new HttpCallback>() { @Override public void onSuccess(ResponseModel data) { diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 0c2fae81e..b4627cfe7 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1541,7 +1541,7 @@ 助力值 本期展館時間: 上期展館時間: - 您由於【%s】 違規被中斷直播 + 您由於違規被中斷直播 違規原因: 處罰內容: 處罰時間: diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 380bd13bd..979a76d34 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1550,7 +1550,7 @@ *10% of the threshold will be charged as ticket - You were interrupted from the live broadcast due to violation of [%s]. + You were interrupted from the live broadcast due to violation of regulations. Violation reasons: Penalty content: Penalty time: diff --git a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java index d23a91e4d..38c3c3082 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java @@ -20,6 +20,7 @@ import android.util.Log; import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; import android.widget.ImageView; import androidx.annotation.NonNull; @@ -35,12 +36,14 @@ import com.bumptech.glide.request.transition.Transition; import com.lxj.xpopup.XPopup; import com.lxj.xpopup.core.BasePopupView; import com.lxj.xpopup.interfaces.XPopupCallback; +import com.lzf.easyfloat.enums.ShowPattern; import com.opensource.svgaplayer.SVGAImageView; import com.tencent.trtc.TRTCCloudDef; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; import com.yunbao.common.bean.AiAutomaticSpeechModel; +import com.yunbao.common.bean.BanDownLiveEvent; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LinkMicUserBean; import com.yunbao.common.bean.LiveAiRobotBean; @@ -49,6 +52,7 @@ import com.yunbao.common.bean.LiveUserGiftBean; import com.yunbao.common.bean.MicUserBean; import com.yunbao.common.bean.SendMoneyLongModel; import com.yunbao.common.bean.UserBean; +import com.yunbao.common.dialog.DebugDialog; import com.yunbao.common.dialog.NotCancelableDialog; import com.yunbao.common.event.AllServerNotifyFFGGGDJANEvent; import com.yunbao.common.event.GiftWallIlluminateEvent; @@ -219,7 +223,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl initFaceManager(); leave_img = findViewById(R.id.leave_img); mLiveSDK = intent.getIntExtra(Constants.LIVE_SDK, Constants.LIVE_SDK_KSY); - if(mLiveSDK ==Constants.LIVE_SDK_SW){ + if (mLiveSDK == Constants.LIVE_SDK_SW) { isSw = true; } mLiveKsyConfigBean = intent.getParcelableExtra(Constants.LIVE_KSY_CONFIG); @@ -285,7 +289,23 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl } }); - + /*DebugDialog.getInstance(new DebugDialog.DebugDialogRunnable() { + @Override + public void run(DebugDialog dialog) { + dialog.setShowPattern(ShowPattern.ALL_TIME); + dialog.show(); + dialog.setView("测试", new Button(mContext), new View.OnClickListener() { + @Override + public void onClick(View v) { + android.os.Message msg = android.os.Message.obtain(); + msg.what = Constants.SOCKET_WHAT_BROADCAST; + String json = "{\"msg\":[{\"_method_\":\"StartEndLive\",\"action\":\"18\",\"ct\":\"直播关闭\",\"touid\":\"\",\"equipment\":\"app\",\"msgtype\":\"1\",\"uname\":\"1\",\"timestamp\":\"\",\"touname\":\"\",\"uid\":\"98274\",\"tougood\":\"\",\"ugood\":\"\",\"roomnum\":\"98274\",\"riskDescription\":\"色情:性行为:中度色情\",\"enRiskDescription\":\"Pornography: Sexual behavior: Moderate pornography\",\"riskhType\":\"封禁1分钟\",\"enRiskhType\":\"Banned for 1 minute\",\"date\":\"2024-07-30 15:03:11\"}],\"retcode\":\"000000\",\"retmsg\":\"OK\"}"; + msg.obj = json; + SocketSwClient.mSocketHandler.sendMessage(msg); + } + }); + } + });*/ } private void initFaceManager() { @@ -368,7 +388,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl fragment.setOnPrankResultListener(new LivePrankDialogFragment.onPrankResultListener() { @Override public void OpenAndCloseListener() { - if(mLiveRoomViewHolder!=null){ + if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.initPrankProgress(1); } } @@ -700,7 +720,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl bundle.putBoolean("isPk", isDRPK == 1 || PKing || mLivePushViewHolder.isPking()); bundle.putLong("liveTime", mLiveAnchorViewHolder.getmAnchorLiveTime()); bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen()); - bundle.putBoolean("isShowZgRed",mLiveAnchorViewHolder.isShowMenuRed()); + bundle.putBoolean("isShowZgRed", mLiveAnchorViewHolder.isShowMenuRed()); fragment.setArguments(bundle); fragment.setFunctionClickListener(this); fragment.show(getSupportFragmentManager(), "LiveFunctionDialogFragment"); @@ -738,7 +758,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl public void openRandomPkWindow() { RandomPkDialogFragment fragment = new RandomPkDialogFragment(); Bundle bundle = new Bundle(); - bundle.putBoolean("isSw",true); + bundle.putBoolean("isSw", true); fragment.setArguments(bundle); fragment.show(getSupportFragmentManager(), "RandomPkDialogFragment"); } @@ -787,7 +807,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl } mLiveReadyViewHolder = null; if (mLiveRoomViewHolder == null) { - mLiveRoomViewHolder = new LiveRoomViewHolder(true, 2, mContext, mContainer, (GifImageView) findViewById(R.id.gift_gif), (SVGAImageView) findViewById(R.id.gift_svga), mContainerWrap, getWindowManager(),isSw); + mLiveRoomViewHolder = new LiveRoomViewHolder(true, 2, mContext, mContainer, (GifImageView) findViewById(R.id.gift_gif), (SVGAImageView) findViewById(R.id.gift_svga), mContainerWrap, getWindowManager(), isSw); mLiveRoomViewHolder.setManager(manager); mLiveRoomViewHolder.addToParent(); mLiveRoomViewHolder.subscribeActivityLifeCycle(); @@ -875,13 +895,13 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl MicedUserManager.get().removeAllMicUserList(); MicUserManager.get().removeAllMicUserList(); - if(mLiveRoomViewHolder!=null){ + if (mLiveRoomViewHolder != null) { //加载整蛊 mLiveRoomViewHolder.initPrankProgress(2); mLiveRoomViewHolder.sendMsgPrank(); //初始化天梯数据 - mLiveRoomViewHolder.initRankPKInfo(mLiveUid,""); + mLiveRoomViewHolder.initRankPKInfo(mLiveUid, ""); } mLiveSwLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder); } @@ -975,6 +995,10 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl mLiveEndViewHolder.addToParent(); mLiveEndViewHolder.showData(mLiveBean, mStream); mLiveEndViewHolder.upData(datas.getString("votes"), datas.getString("length"), Long.parseLong(datas.getString("nums"))); + if (banEvent != null) { + mLiveEndViewHolder.showBanDownLive(banEvent); + banEvent = null; + } } if (mLiveAnchorViewHolder != null) { mLiveAnchorViewHolder.release(); @@ -1230,46 +1254,46 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl JSONObject obj = JSON.parseObject(info[0]); if (obj != null) { if (obj.getString("ispk").equals("0")) { - final SocketSendBean msg1 = new SocketSendBean() - .param("_method_", SOCKET_LINK_MIC_PK) - .param("action", 1) - .param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()) - .param("pkuid", pkUid) - .param("uid", CommonAppConfig.getInstance().getUid()) - .param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar()) - .param("uhead", CommonAppConfig.getInstance().getUserBean().getAvatar()) - .param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()); - //判断是否是随机PK - if(extra){ - msg1.param("random_pk", "1"); - msg1.param("msgtype","11"); - if (RandomPkManager.getInstance().isRankModel()) { - msg1.param("is_ladders", "https://downs.yaoulive.com/rank_top_box.png"); - } + final SocketSendBean msg1 = new SocketSendBean() + .param("_method_", SOCKET_LINK_MIC_PK) + .param("action", 1) + .param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()) + .param("pkuid", pkUid) + .param("uid", CommonAppConfig.getInstance().getUid()) + .param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar()) + .param("uhead", CommonAppConfig.getInstance().getUserBean().getAvatar()) + .param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()); + //判断是否是随机PK + if (extra) { + msg1.param("random_pk", "1"); + msg1.param("msgtype", "11"); + if (RandomPkManager.getInstance().isRankModel()) { + msg1.param("is_ladders", "https://downs.yaoulive.com/rank_top_box.png"); } - msg1.create(); + } + msg1.create(); - Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM; - TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); - io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain("g" + pkUid, conversationType, messageContent); + Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM; + TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); + io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain("g" + pkUid, conversationType, messageContent); - RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { - @Override - public void onAttached(io.rong.imlib.model.Message message) { + RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { + @Override + public void onAttached(io.rong.imlib.model.Message message) { - } + } - @Override - public void onSuccess(io.rong.imlib.model.Message message) { - Log.e("tx", "发送成功"); - } + @Override + public void onSuccess(io.rong.imlib.model.Message message) { + Log.e("tx", "发送成功"); + } - @Override - public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) { - Log.e("tx", "发送失败" + errorCode.getMessage()); + @Override + public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) { + Log.e("tx", "发送失败" + errorCode.getMessage()); - } - }); + } + }); } else { ToastUtil.show(mContext.getString(R.string.pking_over)); if (RandomPkManager.getInstance().isRandomModel()) { @@ -1297,7 +1321,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl } } - public void linkDrMicRemoveListUid(String uid){ + public void linkDrMicRemoveListUid(String uid) { if (mLiveAnchorViewHolder != null) { mLiveAnchorViewHolder.removeYaoqing(uid); } @@ -1328,8 +1352,8 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl .param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()) .param("pkuid", pkUid) .param("uid", CommonAppConfig.getInstance().getUid()) - .param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar()) - .param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()); + .param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar()) + .param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()); msg1.create(); String targetId = "g" + pkUid; @@ -1474,7 +1498,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl @Override public void onUpdatePrankProgress(String prankString) { - if (mLiveRoomViewHolder != null){ + if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.refreshPrank(prankString); } } @@ -1665,7 +1689,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl case LEAVE_DR_ROOM: if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.seisShowGif(true); - if(DRPKing==1){ + if (DRPKing == 1) { mLiveRoomViewHolder.endDRGif(); } } @@ -1680,7 +1704,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl case LEAVE_PK_SCORE: if (mLiveSwLinkMicPkPresenter != null) { mLiveSwLinkMicPkPresenter.closeButtonGone(); - mLiveSwLinkMicPkPresenter.upDataPkScore(event.getPkScores(), event.getUid(), event.getTime(),true); + mLiveSwLinkMicPkPresenter.upDataPkScore(event.getPkScores(), event.getUid(), event.getTime(), true); } if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.seisShowGif(true); @@ -1957,10 +1981,11 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl } + @Subscribe(threadMode = ThreadMode.MAIN) public void onAllServerNotifyFFGGGDJANEvent(AllServerNotifyFFGGGDJANEvent event) { if (mLiveRoomViewHolder != null) { - mLiveRoomViewHolder.showAllServerNotifyFFGGGD(event,false); + mLiveRoomViewHolder.showAllServerNotifyFFGGGD(event, false); } } @@ -1971,4 +1996,11 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl } } + private BanDownLiveEvent banEvent = null; + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onBanDownLiveEvent(BanDownLiveEvent event) { + banEvent = event; + } + } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 2e82c7209..12733abfb 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -830,8 +830,9 @@ public class LiveGiftPopup extends AbsDialogFragment { mBtnSendGroup.removeCallbacks(newLianSongRunnable); getCoin(); if (liveGiftModel!=null){ + int giftId=liveGiftModel.isPageGift()?liveGiftModel.getGift_id():liveGiftModel.getId(); LiveNetManager.get(mContext) - .getGiftNamingInfo(liveGiftModel.getId() + "", new com.yunbao.common.http.base.HttpCallback() { + .getGiftNamingInfo(giftId + "", new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(GiftNamingInfoModel data) { if (TextUtils.equals(data.getNamingStatus(), "1")) { diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index 6ebfb5e08..c0a3eecf8 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -1255,6 +1255,7 @@ public class LiveGiftAnimPresenter { stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(dto.getColour())), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } } catch (Exception e) { + e.printStackTrace(); iv_look_full_service_notice_new.setText(buttonString); } iv_look_full_service_notice_new.setText(stringBuilder); diff --git a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java index 30964957e..d7917ade1 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java @@ -29,6 +29,7 @@ import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; import com.yunbao.common.bean.AiAutomaticSpeechModel; +import com.yunbao.common.bean.BanDownLiveEvent; import com.yunbao.common.bean.FansModel; import com.yunbao.common.bean.GuardMaturityDateRemindModel; import com.yunbao.common.bean.LinkMicUserBean; @@ -500,6 +501,15 @@ public class SocketSwClient { if (action == 18) { mListener.onLiveEnd(); LiveEndViewHolder.upData(map.getString("votes"), map.getString("length"), map.getIntValue("nums"), map.getString("uname")); + if(map.containsKey("riskhType")){ + Bus.get().post(new BanDownLiveEvent( + WordUtil.isNewZh()?map.getString("riskDescription"):map.getString("enRiskDescription"), + WordUtil.isNewZh()?map.getString("riskDescription"):map.getString("enRiskDescription"), + WordUtil.isNewZh()?map.getString("riskhType"):map.getString("enRiskhType"), + map.getString("date") + + )); + } } else if (action == 19) { mListener.onAnchorInvalid(); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java index f7d8744b0..6b926c278 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java @@ -16,6 +16,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.alibaba.fastjson.JSON; import com.yunbao.common.bean.AnchorRecommendModel; +import com.yunbao.common.bean.BanDownLiveEvent; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.SetAttentsModel; @@ -77,7 +78,7 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList private IMLoginModel model = null; private String live_id; private String leaveStream, leaveGroupId; - private TextView banContent, banReason, banTimer; + private TextView banTitle, banContent, banReason, banTimer; private View banLayout; public LiveEndViewHolder(Context context, ViewGroup parentView, String uid) { @@ -263,7 +264,8 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList banContent = (TextView) findViewById(R.id.ban_content); banReason = (TextView) findViewById(R.id.ban_reason); banTimer = (TextView) findViewById(R.id.ban_timer); - banLayout=findViewById(R.id.banLayout); + banTitle = (TextView) findViewById(R.id.ban_title); + banLayout = findViewById(R.id.banLayout); findViewById(R.id.go_home_anchor) .setOnClickListener(new View.OnClickListener() { @@ -385,6 +387,14 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList Bus.getOff(this); } + public void showBanDownLive(BanDownLiveEvent event) { + banTitle.setText(String.format(WordUtil.getNewString(R.string.live_end_view_ban_title), event.getReason())); + banReason.setText(String.format("%s", event.getReason())); + banContent.setText(event.getContent()); + banTimer.setText(event.getTimer()); + banLayout.setVisibility(View.VISIBLE); + } + /** * 结束的类型 */ diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java index 44a9a4d5d..4883a5b0d 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java @@ -944,7 +944,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl } }); } else { - ToastUtil.show("請求中,請勿重複點擊"); + ToastUtil.show(WordUtil.isNewZh()?"請求中,請勿重複點擊":"During request, please do not click repeatedly"); } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveParcelFragment.java b/live/src/main/java/com/yunbao/live/views/LiveParcelFragment.java index b3776a559..04422693c 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveParcelFragment.java +++ b/live/src/main/java/com/yunbao/live/views/LiveParcelFragment.java @@ -26,6 +26,9 @@ import com.yunbao.common.http.LiveHttpUtil; import java.util.ArrayList; import java.util.List; +/** + * 直播间礼物栏包裹 fragment + */ public class LiveParcelFragment extends BaseFragment { private ViewPager fragmentViewpager; private int pageCount; diff --git a/live/src/main/res/layout/view_live_end.xml b/live/src/main/res/layout/view_live_end.xml index 0c6491963..75f13aa1c 100644 --- a/live/src/main/res/layout/view_live_end.xml +++ b/live/src/main/res/layout/view_live_end.xml @@ -17,7 +17,7 @@ android:layout_height="match_parent" android:background="#b3000000" android:visibility="gone" - tools:visibility="visible"> + tools:visibility="gone"> - - - - - - - - - - - - - - - - - - - - - - - - + android:visibility="gone" + tools:visibility="visible"> + + + + + + + + + + + + + + + + + + + + + + + + + + +