From 2093306d3676ca4af1256a7f3cd85de202fc4e73 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sun, 5 May 2024 16:13:28 +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=E9=97=AE=E9=A2=98=20=E8=B0=83=E6=95=B4=E5=B0=8F?= =?UTF-8?q?=E5=8A=A9=E6=89=8B=E3=80=81=E6=9C=BA=E5=99=A8=E4=BA=BA=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=20=E8=B0=83=E6=95=B4PD=E4=B8=80=E5=8F=B7=E7=9A=84IM?= =?UTF-8?q?=E6=B6=88=E6=81=AF=20=E8=B0=83=E6=95=B4PD=E4=B8=80=E5=8F=B7?= =?UTF-8?q?=E7=9A=84=E7=BA=A2=E5=8C=85UI=20=E8=B0=83=E6=95=B4=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/InteractionGamesAdapter.java | 8 ++++- .../common/bean/AiAutomaticSpeechModel.java | 3 +- .../common/bean/RedPacketInfoModel.java | 10 ++++++ .../java/com/yunbao/common/bean/UserBean.java | 9 +++++ .../common/dialog/CreateSudGamePopup.java | 3 ++ .../common/event/SendBlindGiftEvent.java | 30 ++++++++++++++++ .../yunbao/common/sud/BaseGameViewModel.java | 27 +++++++++----- .../com/yunbao/common/utils/DialogUitl.java | 20 ++++++++++- ...LiveNewRoleInteractionGamesViewHolder.java | 1 - .../yunbao/common/views/LiveSudGamePopup.java | 4 +-- .../res/layout/view_fun_games_child_view.xml | 2 +- ...ew_live_new_role_fun_games_child_view3.xml | 11 +++++- common/src/main/res/values-en-rUS/string.xml | 6 ++-- common/src/main/res/values/strings.xml | 6 ++-- .../live/activity/LiveRyAnchorActivity.java | 10 ++++++ .../yunbao/live/activity/SudGameActivity.java | 4 +-- .../com/yunbao/live/bean/LiveChatBean.java | 13 +++++-- .../live/dialog/ReceiveRendPacketPopup.java | 7 ++++ .../yunbao/live/event/LiveAudienceEvent.java | 3 +- .../yunbao/live/socket/SocketRyChatUtil.java | 6 ++++ .../yunbao/live/socket/SocketRyClient.java | 36 ++++++++++++------- .../yunbao/live/views/LiveRoomViewHolder.java | 2 ++ .../main/res/layout/activity_compensate.xml | 2 +- .../src/main/res/layout/item_msg_sys_gift.xml | 3 +- live/src/main/res/layout/view_live_room.xml | 6 ++-- .../res/layout/view_receive_red_packet.xml | 2 ++ main/src/main/res/values/strings.xml | 2 +- 27 files changed, 190 insertions(+), 46 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/adapter/InteractionGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/InteractionGamesAdapter.java index 9bd25c0d3..bbbc9e328 100644 --- a/common/src/main/java/com/yunbao/common/adapter/InteractionGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/InteractionGamesAdapter.java @@ -18,10 +18,14 @@ import com.yunbao.common.views.InteractionGamesChildViewHolder; import java.util.ArrayList; import java.util.List; +/** + * 侧边栏游戏列表适配器,改游戏列表数量在这里改 + */ public class InteractionGamesAdapter extends RecyclerView.Adapter { private Context mContext; private boolean rigts; private List child = new ArrayList<>(); + private List srcChild = new ArrayList<>(); public InteractionGamesAdapter(Context mContext, boolean rigts) { this.mContext = mContext; @@ -46,7 +50,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter { long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc()); if (activityID != 0) { Bus.get().post(new CustomDrawerPopupEvent() - .setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(child)); + .setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild)); } @@ -61,6 +65,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter { public void updateData(List mChild) { child.clear(); + srcChild.clear(); if (mChild.size() > 8) { for (int i = 0; i < 8; i++) { child.add(mChild.get(i)); @@ -68,6 +73,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter { } else { child.addAll(mChild); } + srcChild.addAll(mChild); notifyDataSetChanged(); } diff --git a/common/src/main/java/com/yunbao/common/bean/AiAutomaticSpeechModel.java b/common/src/main/java/com/yunbao/common/bean/AiAutomaticSpeechModel.java index 428a79c84..72bec43e9 100644 --- a/common/src/main/java/com/yunbao/common/bean/AiAutomaticSpeechModel.java +++ b/common/src/main/java/com/yunbao/common/bean/AiAutomaticSpeechModel.java @@ -53,8 +53,9 @@ public class AiAutomaticSpeechModel extends BaseModel { return iconEn; } - public void setIconEn(String iconEn) { + public AiAutomaticSpeechModel setIconEn(String iconEn) { this.iconEn = iconEn; + return this; } public String getContent() { diff --git a/common/src/main/java/com/yunbao/common/bean/RedPacketInfoModel.java b/common/src/main/java/com/yunbao/common/bean/RedPacketInfoModel.java index a28783b02..7bb3f8e60 100644 --- a/common/src/main/java/com/yunbao/common/bean/RedPacketInfoModel.java +++ b/common/src/main/java/com/yunbao/common/bean/RedPacketInfoModel.java @@ -49,6 +49,16 @@ public class RedPacketInfoModel extends BaseModel { //超级红包ID @SerializedName("super_jackpot_id") private String superJackpotId; + @SerializedName("red_packet_type") + private int redPacketType;// 1.普通红包 2.特殊红包 + + public int getRedPacketType() { + return redPacketType; + } + + public void setRedPacketType(int redPacketType) { + this.redPacketType = redPacketType; + } public String getSuperJackpotId() { return superJackpotId; diff --git a/common/src/main/java/com/yunbao/common/bean/UserBean.java b/common/src/main/java/com/yunbao/common/bean/UserBean.java index aa44fc257..987f7408a 100644 --- a/common/src/main/java/com/yunbao/common/bean/UserBean.java +++ b/common/src/main/java/com/yunbao/common/bean/UserBean.java @@ -865,11 +865,20 @@ public class UserBean implements Parcelable { private String medal; private String bubble; private String medal_new; + private String medal_new_en; public String getMedal_new() { return medal_new; } + public String getMedal_new_en() { + return medal_new_en; + } + + public void setMedal_new_en(String medal_new_en) { + this.medal_new_en = medal_new_en; + } + public void setMedal_new(String medal_new) { this.medal_new = medal_new; } diff --git a/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java b/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java index 82f607bfa..d8759af91 100644 --- a/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java @@ -45,6 +45,9 @@ import java.util.List; import java.util.Locale; import java.util.Random; +/** + * 半屏创建游戏房间 + */ public class CreateSudGamePopup extends BottomPopupView { private List customSidebarChildModels = new ArrayList<>(); private TextView createGameType, selectCurrencyType; diff --git a/common/src/main/java/com/yunbao/common/event/SendBlindGiftEvent.java b/common/src/main/java/com/yunbao/common/event/SendBlindGiftEvent.java index 9c99fab9b..e9efbc93a 100644 --- a/common/src/main/java/com/yunbao/common/event/SendBlindGiftEvent.java +++ b/common/src/main/java/com/yunbao/common/event/SendBlindGiftEvent.java @@ -115,6 +115,36 @@ public class SendBlindGiftEvent extends BaseModel { private String liveGiftNotify; @SerializedName("userNiceName") private String userNiceName; + @SerializedName("special_gift") + private int specialGift; + @SerializedName("special_gift_name") + private String specialGiftName; + @SerializedName("special_gift_name_en") + private String specialGiftNameEn; + + public int getSpecialGift() { + return specialGift; + } + + public void setSpecialGift(int specialGift) { + this.specialGift = specialGift; + } + + public String getSpecialGiftName() { + return specialGiftName; + } + + public void setSpecialGiftName(String specialGiftName) { + this.specialGiftName = specialGiftName; + } + + public String getSpecialGiftNameEn() { + return specialGiftNameEn; + } + + public void setSpecialGiftNameEn(String specialGiftNameEn) { + this.specialGiftNameEn = specialGiftNameEn; + } public String getUserNiceName() { return userNiceName; diff --git a/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java b/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java index 803d333f7..780775644 100644 --- a/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java +++ b/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java @@ -20,6 +20,7 @@ import com.yunbao.common.sud.state.MGStateResponse; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.SudJsonUtils; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import tech.sud.mgp.core.ISudFSMStateHandle; import tech.sud.mgp.core.ISudFSTAPP; @@ -148,7 +149,7 @@ public abstract class BaseGameViewModel implements SudFSMMGListener { sudFSMMGDecorator.setGameId(gameId); sudFSMMGDecorator.setRoomId(gameRoomId); sudFSMMGDecorator.setUserId(getUserId()); - Log.i("游戏回调",code+" "+gameId+" "+gameRoomId+" "); + Log.i("游戏回调", code + " " + gameId + " " + gameRoomId + " "); // 调用游戏sdk加载游戏 ISudFSTAPP iSudFSTAPP = SudMGP.loadMG(activity, getUserId(), gameRoomId, code, gameId, getLanguageCode(), sudFSMMGDecorator); @@ -288,17 +289,25 @@ public abstract class BaseGameViewModel implements SudFSMMGListener { public void onGameLog(String str) { SudFSMMGListener.super.onGameLog(str); Log.e("onGameStarted", "游戏日志:" + str); - if(!StringUtil.isEmpty()){ - try{ - JSONObject json=JSONObject.parseObject(str); - if("error".equals(json.getString("level"))){ + if (!StringUtil.isEmpty()) { + try { + JSONObject json = JSONObject.parseObject(str); + if ("error".equals(json.getString("level"))) { String msg = json.getString("msg"); - JSONObject error=JSONObject.parseObject(msg); - if(error.containsKey("msg")) { - ToastUtil.show(error.getString("msg") + ":" + error.getInteger("resultCode")); + JSONObject error = JSONObject.parseObject(msg); + if (error.containsKey("msg")) { + int resultCode = error.getInteger("resultCode"); + switch (resultCode) { + case 100503: + ToastUtil.show(WordUtil.isNewZh()?"有玩家未点击准备":":There are players who haven't clicked \"Ready\" yet."); + break; + case 100504: + ToastUtil.show(WordUtil.isNewZh()?"小于游戏最小开始人数":"The number of players is less than the minimum required to start the game."); + break; + } } } - }catch (Exception ignore){ + } catch (Exception ignore) { } } diff --git a/common/src/main/java/com/yunbao/common/utils/DialogUitl.java b/common/src/main/java/com/yunbao/common/utils/DialogUitl.java index d431d1b0e..72a88646a 100644 --- a/common/src/main/java/com/yunbao/common/utils/DialogUitl.java +++ b/common/src/main/java/com/yunbao/common/utils/DialogUitl.java @@ -358,6 +358,8 @@ public class DialogUitl { private boolean mCancelable; private boolean mBackgroundDimEnabled;//显示区域以外是否使用黑色半透明背景 private boolean mInput;//是否是输入框的 + private boolean isShowCancelButton=true; + private boolean isSHowConfirmButton=true; private String mHint; private int mInputType; private int mLength; @@ -454,6 +456,16 @@ public class DialogUitl { return this; } + public Builder setShowCancelButton(boolean showCancelButton) { + isShowCancelButton = showCancelButton; + return this; + } + + public Builder setShowConfirmButton(boolean showConfirmButton) { + isSHowConfirmButton = showConfirmButton; + return this; + } + public Dialog build() { final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2); if (mView != 0) { @@ -495,13 +507,19 @@ public class DialogUitl { btnConfirm.setText(mConfirmString); btnConfirm.setVisibility(View.VISIBLE); }else if(mConfirmString==null){ - btnConfirm.setVisibility(View.GONE); + // btnConfirm.setVisibility(View.GONE); } TextView btnCancel = (TextView) dialog.findViewById(R.id.btn_cancel); if (!TextUtils.isEmpty(mCancelString)) { btnCancel.setText(mCancelString); btnCancel.setVisibility(View.VISIBLE); }else if(mCancelString==null){ + //btnCancel.setVisibility(View.GONE); + } + if(!isSHowConfirmButton){ + btnConfirm.setVisibility(View.GONE); + } + if(!isShowCancelButton){ btnCancel.setVisibility(View.GONE); } View.OnClickListener listener = new View.OnClickListener() { diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java b/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java index 98380e2f6..4a30f3397 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java @@ -9,7 +9,6 @@ import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.yunbao.common.R; -import com.yunbao.common.adapter.InteractionGamesAdapter; import com.yunbao.common.adapter.LiveNewRoleInteractionGamesAdapter; import com.yunbao.common.bean.CustomSidebarChildModel; import com.yunbao.common.bean.CustomSidebarInfoModel; diff --git a/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java b/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java index d1b90ec09..9bb18cb88 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java @@ -234,7 +234,7 @@ public class LiveSudGamePopup extends BottomPopupView { if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); } else { - ToastUtil.show("Shortage of money"); + ToastUtil.show("Insufficient number of currency"); } } @@ -245,7 +245,7 @@ public class LiveSudGamePopup extends BottomPopupView { if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); } else { - ToastUtil.show("Shortage of money"); + ToastUtil.show("Insufficient number of currency"); } } }); diff --git a/common/src/main/res/layout/view_fun_games_child_view.xml b/common/src/main/res/layout/view_fun_games_child_view.xml index 4ac669274..cf798f976 100644 --- a/common/src/main/res/layout/view_fun_games_child_view.xml +++ b/common/src/main/res/layout/view_fun_games_child_view.xml @@ -6,7 +6,7 @@ android:layout_marginTop="12dp" android:gravity="center" android:orientation="vertical"> - + \ No newline at end of file diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 9198719be..cf8ac1696 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1373,11 +1373,11 @@ Limited ride And limited avatar frame "Paired Users " " Currently No Records~" "Today " - 1. Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; - Currently, [Backgammon], [Flying Chess], [Bumper I’m the Strongest], [Monster Match], [Jump], [Friendly Challenge], [Magic Battle], [American 8 Ball] More game types will be provided in the future, so stay tuned; + 1.Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; + 2.Currently, [Backgammon], [Flying Chess], [Bumper I’m the Strongest], [Monster Match], [Jump], [Friendly Challenge], [Magic Battle], [American 8 Ball] More game types will be provided in the future, so stay tuned; 3.Users can customize the game threshold, which must be between 100 to 50000 gold beans , and the amount must be a multiple of 10; 4.At the beginning of the game, chips from participating users will be collected. After the game ends, 10% of the chips will be collected as tickets, and all remaining chips will be given to the winning users.In a draw, the corresponding chips will be deducted from the tickets and returned to the users; - 5. The final interpretation right of the event belongs to PDLIVE. + 5.The final interpretation right of the event belongs to PDLIVE. Currency Currency: Time: diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 0d8d52e82..c937e7e14 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1381,9 +1381,9 @@ Limited ride And limited avatar frame "Today " "≤7 days " ≤ 30 days - 1. Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; - 2.Currently, we have launched \'GoBang\',\' Bumper car \',\' Flying Chess\', \'Minesweeping\', \'Dart Master\', and \'Monster Eliminating\'. We will provide more game types in the future. Stay tuned; - 3.. Users can customize the game threshold, which must be between 100 to 50000 gold beans , and the amount must be a multiple of 10; + 1.Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; + 2.Currently, [Backgammon], [Flying Chess], [Bumper I’m the Strongest], [Monster Match], [Jump], [Friendly Challenge], [Magic Battle], [American 8 Ball] More game types will be provided in the future, so stay tuned; + 3. Users can customize the game threshold, which must be between 100 to 50000 gold beans , and the amount must be a multiple of 10; 4.At the beginning of the game, chips from participating users will be collected. After the game ends, 10% of the chips will be collected as tickets, and all remaining chips will be given to the winning users.In a draw, the corresponding chips will be deducted from the tickets and returned to the users; 5. The final interpretation right of the event belongs to PDLIVE. 0-100 coins diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index d1ed67746..87d8cbe19 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -1712,6 +1712,15 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl liveInputDialogFragment.setArguments(liveInputBundle); liveInputDialogFragment.show(getSupportFragmentManager(), "LiveInputDialogFragment"); break; + case LIVE_DIALOG_ANCHOR_TIPS: + new DialogUitl.Builder(mContext) + .setContent(event.getObject().toString()) + .setConfirmString(WordUtil.isNewZh() ? "確定" : "confirm") + .setCancelable(true) + .setShowCancelButton(false) + .build() + .show(); + break; } } @@ -1850,6 +1859,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl .setIcon("https://downs.yaoulive.com/xzs_tab.png") .setNameColor("#f19ec2") .setSystemBubble("https://downs.yaoulive.com/xzs_qipao.9.png") + .setIconEn("https://downs.yaoulive.com/Robot_en.png") .setUserName("") .setContent(content); SocketSendBean msg = diff --git a/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java index 00abb5228..5385e5801 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java @@ -465,7 +465,7 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); } else { - ToastUtil.show("Shortage of money"); + ToastUtil.show("Insufficient number of currency"); } } @@ -478,7 +478,7 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); } else { - ToastUtil.show("Shortage of money"); + ToastUtil.show("Insufficient number of currency"); } } diff --git a/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java b/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java index d33e53a4a..90cd294c8 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java +++ b/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.annotation.JSONField; import com.google.gson.annotations.SerializedName; import com.yunbao.common.bean.AiAutomaticSpeechModel; import com.yunbao.common.bean.MsgModel; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.WordUtil; /** @@ -28,7 +29,7 @@ public class LiveChatBean { public static final int XYD_COMPLETE = 207;//心愿单完成通知 public static final int WISH_LIST_PROGRESS = 307;//心愿单进度通知 public static final int BLIND_BOX = 409;//盲盒礼物消息 - public static final int TYPE_TO_USER_MSG=500;//指定信息 + public static final int TYPE_TO_USER_MSG = 500;//指定信息 private String id; @@ -47,6 +48,7 @@ public class LiveChatBean { private String bubble;//气泡 private String medal;//勋章 private String medal_new; + private String medal_new_en; private String medal_honor;//荣誉勋章 private String hot_num; private String good_nub; @@ -63,7 +65,7 @@ public class LiveChatBean { } public String getGiftName() { - return WordUtil.isNewZh()?giftName:giftname_en; + return WordUtil.isNewZh() ? giftName : giftname_en; } public LiveChatBean setGiftName(String giftName) { @@ -215,6 +217,9 @@ public class LiveChatBean { } public String getMedal_new() { + if (!WordUtil.isNewZh() && !StringUtil.isEmpty(medal_new_en)) { + return medal_new_en; + } return medal_new; } @@ -222,6 +227,10 @@ public class LiveChatBean { this.medal_new = medal_new; } + public void setMedal_new_en(String medal_new_en) { + this.medal_new_en = medal_new_en; + } + public String getPrankIcon() { return prankIcon; } diff --git a/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java b/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java index c08778b6b..b871f19cf 100644 --- a/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java @@ -4,6 +4,7 @@ import android.content.Context; import android.os.Handler; import android.text.TextUtils; import android.util.TypedValue; +import android.view.View; import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; @@ -97,6 +98,12 @@ public class ReceiveRendPacketPopup extends CenterPopupView { .getString(R.string.together_to_achieve_goal), redPacketInfoModel.getUserNicename())); } + if(redPacketInfoModel.getRedPacketType()==2){ + ((ImageView)findViewById(R.id.value_icon)).setImageResource(R.mipmap.gold_coin); + redPacketValue.setText(redPacketInfoModel.getRedPacketMoney()); + findViewById(R.id.red_packet_list).setVisibility(View.INVISIBLE); + findViewById(R.id.tips).setVisibility(View.INVISIBLE); + } userID = redPacketInfoModel.getUserId(); 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 54afe4314..4a8c493d2 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -489,7 +489,8 @@ public class LiveAudienceEvent extends BaseModel { UPDATE_FANS_TASK_STATUS(74, "更新粉丝任务状态"), SUD_GAME_CREATE_ROOM(75, "主播创建sud游戏"), PK_RANK_START(76, "PK排位赛开始"), - GuardSpecialEffect(77, "PK排位赛开始"); + GuardSpecialEffect(77, "PK排位赛开始"), + LIVE_DIALOG_ANCHOR_TIPS(78, "主播公会赛tips"); private int type; private String name; diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java index 6192c56cc..be8a115f3 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java @@ -99,6 +99,7 @@ public class SocketRyChatUtil { .param("medal_honor", u.getMedal_no_display_src()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("uid", u.getId()) .param("liangname", u.getGoodName()) .param("vip_type", u.getVip().getType()) @@ -180,6 +181,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("guard_type", IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getGuardType()) .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) @@ -308,6 +310,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) .param("guard_type", guard_type + "") @@ -347,6 +350,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("ct", giftToken) .param("ancherName", ancherName) .param("medal_name", u.getMedalName()) @@ -712,6 +716,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("uname", u.getUserNiceName()) .param("uhead", u.getAvatar()) .param("votestotal", votes) @@ -742,6 +747,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("guard_type", IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getGuardType()); msg.create(); 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 b65c211a8..6237cff21 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -390,7 +390,7 @@ public class SocketRyClient { receiveGiftBean.setSendtype(map.getIntValue("action")); receiveGiftBean.setAllServerNotify(true); mListener.onSys(receiveGiftBean); - } else if (action2 == 61) {//赠送礼物 + } else if (action2 == 61) {//赠送礼物 超级头条 sendGiftByNotify(map); } else if (action2 == 62) {//购买守护 // buyGuardByNotify(map); @@ -403,7 +403,7 @@ public class SocketRyClient { buyZuoJiByNotify(map); } else if (action2 == 66) {//购买贵族 buyVipByNotify(map); - } else if (action2 == 88) { + } else if (action2 == 88) {//盲盒 JSONObject mCt = map.getJSONObject("ct"); String boxType = map.getString("box_type"); String boxTypeName = ""; @@ -446,7 +446,7 @@ public class SocketRyClient { NewAllServerNotifyGuardEvent notifyGuardEvent = GsonUtils.fromJson(map.toString(), NewAllServerNotifyGuardEvent.class); Bus.get().post(notifyGuardEvent); buyGuardInSameRoom(map); - } else if (action2 == 91) { + } else if (action2 == 91) {//通用模板 AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent = GsonUtils.fromJson(map.toString(), AllServerNotifyFFGGGDJANEvent.class); Bus.get().post(notifyFFGGGDJANEvent); } @@ -824,12 +824,9 @@ public class SocketRyClient { case Constants.SOCKET_LIVE_ANCHOR_PK_DIALOG: item = map.getJSONObject("ct"); //DialogUitl.showSimpleDialog(mContext,WordUtil.isNewZh()?item.getString("text"):item.getString("text_en"),null); - new DialogUitl.Builder(mContext) - .setContent(WordUtil.isNewZh() ? item.getString("text") : item.getString("text_en")) - .setConfirmString(WordUtil.isNewZh() ? "確定" : "confirm") - .setCancelString(null) - .build() - .show(); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_DIALOG_ANCHOR_TIPS) + .setObject(WordUtil.isNewZh() ? item.getString("text") : item.getString("text_en"))); break; } @@ -993,6 +990,7 @@ public class SocketRyClient { chatBean.setBubble(map.getString("bubble")); chatBean.setMedal(map.getString("medal")); chatBean.setMedal_new(map.getString("medal_new")); + chatBean.setMedal_new_en(map.getString("medal_new_en")); chatBean.setVipType(map.getIntValue("vip_type")); chatBean.setVipType(map.getIntValue("vip_type")); chatBean.setMedal_honor(map.getString("medal_honor")); @@ -1050,6 +1048,7 @@ public class SocketRyClient { chatBean.setBubble(obj.getString("bubble")); chatBean.setMedal(obj.getString("medal")); chatBean.setMedal_new(obj.getString("medal_new")); + chatBean.setMedal_new_en(map.getString("medal_new_en")); chatBean.setHot_num(obj.getString("hot_num")); UserBean.DressBean dressBean = new UserBean.DressBean(); dressBean.setAvatar_frame(obj.getString("avatar_frame")); @@ -1165,6 +1164,7 @@ public class SocketRyClient { chatBean.setBubble(map.getString("bubble")); chatBean.setMedal(map.getString("medal")); chatBean.setMedal_new(map.getString("medal_new")); + chatBean.setMedal_new_en(map.getString("medal_new_en")); chatBean.setGood_nub(map.getString("good_num")); chatBean.setType(LiveChatBean.GIFT); if (map.get("guard_type") != null && !"".equals(map.get("guard_type")) && !"null".equals(map.get("guard_type"))) { @@ -1212,16 +1212,26 @@ public class SocketRyClient { chatBean.setBubble(map.getString("bubble")); chatBean.setMedal(map.getString("medal")); chatBean.setMedal_new(map.getString("medal_new")); + chatBean.setMedal_new_en(map.getString("medal_new_en")); chatBean.setGood_nub(map.getString("good_num")); chatBean.setType(LiveChatBean.GIFT); if (map.get("guard_type") != null && !"".equals(map.get("guard_type")) && !"null".equals(map.get("guard_type"))) { chatBean.setGuardType(map.getInteger("guard_type")); } - - if (WordUtil.isNewZh()) { - chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); + String special = ""; + if (sendBlindGiftEvent.getSpecialGift() == 1) { + if (WordUtil.isNewZh()) { + special = "送出" + receiveGiftBean.getGiftName() + sendBlindGiftEvent.getSpecialGiftName(); + } else { + special = "Send " + receiveGiftBean.getGiftName() + sendBlindGiftEvent.getSpecialGiftNameEn(); + } + chatBean.setContent(special); } else { - chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); + if (WordUtil.isNewZh()) { + chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName() + special); + } else { + chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen() + special); + } } //增加粉丝徽章信息 chatBean.setMedalNmae(map.getString("medal_name")); 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 66bc715c2..bf096330d 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1637,6 +1637,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private Runnable timeRunnable = new Runnable() { @Override public void run() { + Log.i("红包", "run: 红包倒计时 "+redTimeCountdown); if (redTimeCountdown > 1) { timeHandler.postDelayed(timeRunnable, 1000); redPacketCountdown.setText(String.format(mContext.getString(R.string.red_packet_countdown), TimeUtils.getTime(redTimeCountdown))); @@ -1662,6 +1663,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private Runnable anchorTimeRunnable = new Runnable() { @Override public void run() { + Log.i("红包", "anchorTimeRunnable run: "+mCountdown); if (mCountdown > 0) { mCountdown = mCountdown - 1; anchorTimeHandler.postDelayed(anchorTimeRunnable, 1000); diff --git a/live/src/main/res/layout/activity_compensate.xml b/live/src/main/res/layout/activity_compensate.xml index 3eec71ab9..f6a09f57a 100644 --- a/live/src/main/res/layout/activity_compensate.xml +++ b/live/src/main/res/layout/activity_compensate.xml @@ -99,7 +99,7 @@ diff --git a/live/src/main/res/layout/item_msg_sys_gift.xml b/live/src/main/res/layout/item_msg_sys_gift.xml index 3b3a8730c..fb67f8078 100644 --- a/live/src/main/res/layout/item_msg_sys_gift.xml +++ b/live/src/main/res/layout/item_msg_sys_gift.xml @@ -2,7 +2,8 @@ - + + android:visibility="invisible"> Confirm Feedback Problem Description - Please Describe The Problem You Need To See + Please describe the problem you need to solve Problem Pictures Contact Information Leave Your Phone Or Email For Us To Contact You