update 版本
This commit is contained in:
@@ -9,12 +9,16 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.dialog.GiftWallMainTab2ClassicInfoDialog;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -27,9 +31,14 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
private boolean isLiveRoom;
|
||||
private boolean isStar;
|
||||
int giftStatus;
|
||||
int giftId;
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
|
||||
public void setGiftId(int giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
public void setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
}
|
||||
@@ -71,9 +80,20 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (isStar && (getItemCount() > 0) && data.get(0).getId() != -1) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (viewType == 1) {
|
||||
return new VH2(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_dialog_gift_wall_gift_info2, parent, false));
|
||||
}
|
||||
return new VH(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_dialog_gift_wall_gift_info, parent, false));
|
||||
}
|
||||
|
||||
@@ -156,4 +176,39 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class VH2 extends VH {
|
||||
View avatar2_layout;
|
||||
View tips2;
|
||||
|
||||
public VH2(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
avatar2_layout = itemView.findViewById(R.id.avatar2_layout);
|
||||
tips2 = itemView.findViewById(R.id.tips2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(GiftWallInfoBean.Data data, int position) {
|
||||
super.setData(data, position);
|
||||
ViewClicksAntiShake.clicksAntiShake(tips2, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
GiftWallTab2Bean.Gift giftData = new GiftWallTab2Bean.Gift();
|
||||
giftData.setGiftId(giftId);
|
||||
giftData.setSendType(-1);
|
||||
giftData.setNamingLiveId(Integer.parseInt(data.getLive_id()));
|
||||
giftData.setNamingLiveAvatar(data.getLive_avatar());
|
||||
giftData.setNamingLiveNicename(data.getLive_user_name());
|
||||
giftData.setGiftHallSendNum(data.getGift_hall_send_num());
|
||||
try {
|
||||
giftData.setNamingLiveId(Integer.parseInt(data.getLive_id()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
new GiftWallMainTab2ClassicInfoDialog(itemView.getContext(), giftData, isAnchor).setFullWindows(!isLiveRoom).showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,5 +327,21 @@ public class GiftWallInfoBean extends BaseModel {
|
||||
public void setCreate_time(String create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Data{" +
|
||||
"gift_hall_send_num=" + gift_hall_send_num +
|
||||
", user_name='" + user_name + '\'' +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", user_id='" + user_id + '\'' +
|
||||
", id=" + id +
|
||||
", gift_hall_rank_hide=" + gift_hall_rank_hide +
|
||||
", create_time='" + create_time + '\'' +
|
||||
", live_id='" + live_id + '\'' +
|
||||
", live_user_name='" + live_user_name + '\'' +
|
||||
", live_avatar='" + live_avatar + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yunbao.common.bean;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWallMainTab2ClassicInfoBean extends BaseModel{
|
||||
@@ -41,6 +42,36 @@ public class GiftWallMainTab2ClassicInfoBean extends BaseModel{
|
||||
this.isMe = isMe;
|
||||
}
|
||||
|
||||
public void setWallInfoGiftInfo(GiftWallInfoBean.GiftInfo info,GiftWallTab2Bean.Gift gift) {
|
||||
giftInfo=new GiftInfo();
|
||||
giftInfo.setGiftId(info.getGift_id());
|
||||
giftInfo.setSendType(info.getSendtype());
|
||||
giftInfo.setGiftName(info.getGiftname());
|
||||
giftInfo.setGiftIcon(info.getGifticon());
|
||||
giftInfo.setIlluminateNum(info.getIlluminate_num());
|
||||
giftInfo.setNamingLiveAvatar(gift.getNamingLiveAvatar());
|
||||
giftInfo.setNamingLiveId(gift.getNamingLiveId());
|
||||
giftInfo.setNamingLiveNicename(gift.getNamingLiveNicename());
|
||||
giftInfo.setGiftHallSendNum(gift.getGiftHallSendNum());
|
||||
}
|
||||
|
||||
public void setWallInfoData(List<GiftWallInfoBean.Data> list) {
|
||||
data=new ArrayList<>();
|
||||
for (GiftWallInfoBean.Data item : list) {
|
||||
GiftData gift=new GiftData();
|
||||
gift.setUserId(item.user_id);
|
||||
gift.setAvatar(item.getAvatar());
|
||||
gift.setCreateTime(item.getCreate_time());
|
||||
gift.setLiveAvatar(item.getLive_avatar());
|
||||
gift.setActiveRankHide(item.getGift_hall_rank_hide());
|
||||
gift.setLiveUserName(item.getLive_user_name());
|
||||
gift.setGiftHallSendNum(item.getGift_hall_send_num());
|
||||
gift.setNaming_user_gift_hall_rank_hide(item.getGift_hall_rank_hide());
|
||||
gift.setUserName(item.getUser_name());
|
||||
data.add(gift);
|
||||
}
|
||||
}
|
||||
|
||||
// 内部类:GiftInfo
|
||||
public static class GiftInfo {
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
View bottom_layout;
|
||||
View gift_schedule;
|
||||
ImageView diamond_icon;
|
||||
View titleLayout, titleLayout2;
|
||||
|
||||
GiftWallGiftInfoListItemAdapter adapter;
|
||||
RecyclerView recyclerView;
|
||||
@@ -167,6 +168,8 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
tab_layout = findViewById(R.id.tab_layout);
|
||||
bottom_layout = findViewById(R.id.bottom_layout);
|
||||
gift_schedule = findViewById(R.id.gift_schedule);
|
||||
titleLayout = findViewById(R.id.list_title);
|
||||
titleLayout2 = findViewById(R.id.list_title2);
|
||||
adapter = new GiftWallGiftInfoListItemAdapter();
|
||||
adapter.setAnchor(isAnchor);
|
||||
adapter.setLiveRoom(isLiveRoom);
|
||||
@@ -251,6 +254,9 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
mIvBack.setLayoutParams(params);
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss);
|
||||
resetWindows();
|
||||
if(isStar){
|
||||
findViewById(R.id.anchorTips).setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void initTabText() {
|
||||
@@ -259,7 +265,11 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename1));
|
||||
((TextView) findViewById(R.id.tv_rename)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename_value1));
|
||||
tv_list_title.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_star));
|
||||
titleLayout.setVisibility(View.GONE);
|
||||
titleLayout2.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
titleLayout.setVisibility(VISIBLE);
|
||||
titleLayout2.setVisibility(View.GONE);
|
||||
tab2.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_champion));
|
||||
tv_list_title.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_champion));
|
||||
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename));
|
||||
@@ -336,6 +346,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
btn_lighten.setBackgroundResource(R.drawable.gift_wall_gift_info_un_lighten);
|
||||
}
|
||||
adapter.setGiftStatus(giftBean.getGift_info().getIlluminate_status());
|
||||
adapter.setGiftId(giftBean.getGift_info().getGift_id());
|
||||
/**
|
||||
* 如果对方是主播,要有点亮标记。
|
||||
* 如果对方是用户,不要有点亮标记
|
||||
@@ -392,7 +403,9 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
private void setTips(String tmp) {
|
||||
if(btn_one.getVisibility()==VISIBLE){
|
||||
btn_one_tips.setVisibility(View.VISIBLE);
|
||||
}
|
||||
btn_one_tips.setText(String.format(Locale.getDefault(), "%s%s%s"
|
||||
, WordUtil.isNewZh() ? "需 " : "Need ",
|
||||
tmp,
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftWallTab2GiftInfoListItemAdapter;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallMainTab2ClassicInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
@@ -100,17 +101,37 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
void initData() {
|
||||
LiveNetManager.get(mContext).lastAllGiftHallWeekStarDetail(gift.getGiftId() + "", gift.getNamingLiveId() + "", new HttpCallback<GiftWallMainTab2ClassicInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallMainTab2ClassicInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
if (gift.getSendType() == -1) {
|
||||
LiveNetManager.get(mContext)
|
||||
.liveGiftHallDetail(gift.getNamingLiveId() + "", gift.getGiftId() + "", 2, 1, new HttpCallback<GiftWallInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallInfoBean data) {
|
||||
GiftWallMainTab2ClassicInfoBean infoBean = new GiftWallMainTab2ClassicInfoBean();
|
||||
infoBean.setIsMe(data.getIs_me());
|
||||
infoBean.setWallInfoGiftInfo(data.getGift_info(),gift);
|
||||
infoBean.setWallInfoData(data.getData());
|
||||
initData(infoBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
LiveNetManager.get(mContext).lastAllGiftHallWeekStarDetail(gift.getGiftId() + "",
|
||||
gift.getNamingLiveId() + "", new HttpCallback<GiftWallMainTab2ClassicInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallMainTab2ClassicInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void initData(GiftWallMainTab2ClassicInfoBean data) {
|
||||
|
||||
@@ -116,6 +116,9 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num();
|
||||
boolean isZh = WordUtil.isNewZh();
|
||||
LogUtils.e("isFirstMe:" + isFirstMe);
|
||||
if(isActivityGame){
|
||||
findViewById(R.id.tips).setVisibility(View.INVISIBLE);
|
||||
}
|
||||
if (containMe) {
|
||||
// 当前用户在游戏中
|
||||
// SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2;
|
||||
@@ -165,7 +168,6 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||
if (!map.isEmpty()) {
|
||||
isDraw = map.get("win").intValue() == map.get("loss").intValue();
|
||||
}
|
||||
findViewById(R.id.tips).setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
sub_win_score.setText(sudSettleBean1.getWin_num() > 0 ? "+" + sudSettleBean1.getWin_num() : String.valueOf(sudSettleBean1.getWin_num()));
|
||||
sub_loss_score.setText(String.valueOf(sudSettleBean2.getWin_num()));
|
||||
|
||||
@@ -48,7 +48,7 @@ public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||
}
|
||||
}
|
||||
};
|
||||
private boolean isInitDebug = true;
|
||||
private boolean isInitDebug = false;
|
||||
|
||||
@Override
|
||||
public void onStart(CheckCurrencyModel currencyModel, CreateSudRoomModel data, boolean isHome, boolean isRandom) {
|
||||
@@ -111,7 +111,7 @@ public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||
joinAiRobot();
|
||||
}
|
||||
if (event.getSudMGPMGState().equals(SudMGPMGState.MG_COMMON_PLAYER_IN)) {
|
||||
LogUtils.e("收到的回调: AI uid = " + getAiUid() + "| kickUid = " + event.getPlayerIn().kickUID);
|
||||
LogUtils.e("收到的回调: AI uid = " + getAiUid() + "| kickUid = " + event.getPlayerIn().kickUID + "|" + getPlayerSize());
|
||||
if (event.getPlayerIn().reason == 1 && aiInfo != null) {
|
||||
ToastUtil.show("踢掉了AI");
|
||||
reset();
|
||||
@@ -141,7 +141,6 @@ public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||
private void joinAiRobot() {
|
||||
if (!isAddRobot) return;
|
||||
if (!isRandom) return;
|
||||
if(!isCaptain)return;
|
||||
if (getPlayerSize() == 2) return;
|
||||
if (autoJoinRobotHandler != null) {
|
||||
autoJoinRobotHandler.removeCallbacks(autoJoinRobotRunnable);
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.yunbao.common.manager.RandomSudGameManager;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
||||
import com.yunbao.common.utils.SudJsonUtils;
|
||||
|
||||
@@ -220,7 +221,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN: // 8. 开始游戏按钮点击状态
|
||||
SudMGPMGState.MGCommonSelfClickStartBtn mgCommonSelfClickStartBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickStartBtn.class);
|
||||
AppManager.runDebugCode(new Runnable() {
|
||||
DebugUtils.runDebugCode(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
RandomSudGameManager.getManager().reset();
|
||||
|
||||
@@ -179,15 +179,6 @@ public class AppManager {
|
||||
activityStack.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅在debug下运行的代码
|
||||
*/
|
||||
public static void runDebugCode(Runnable runnable) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退出应用程序
|
||||
|
||||
29
common/src/main/java/com/yunbao/common/utils/DebugUtils.java
Normal file
29
common/src/main/java/com/yunbao/common/utils/DebugUtils.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.yunbao.common.BuildConfig;
|
||||
|
||||
public class DebugUtils {
|
||||
/**
|
||||
* 打印堆栈信息
|
||||
*/
|
||||
public static void showStackTrace(){
|
||||
StackTraceElement[] stackTrace = new Throwable().getStackTrace();
|
||||
StringBuilder sb=new StringBuilder();
|
||||
for (StackTraceElement element : stackTrace) {
|
||||
if(element!=null){
|
||||
sb.append(element).append("\n");
|
||||
}
|
||||
}
|
||||
Log.e("DebugUtils",sb.toString());
|
||||
}
|
||||
/**
|
||||
* 仅在debug下运行的代码
|
||||
*/
|
||||
public static void runDebugCode(Runnable runnable) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.CheckUpgradesModel;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.ReportCommunityBean;
|
||||
@@ -38,6 +39,7 @@ import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.RandomSudGameManager;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -717,4 +719,16 @@ public class JavascriptInterfaceUtils {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void androidRandomSudGame(){
|
||||
RandomSudGameManager.getManager().random(mContext);
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void androidStartSudGame(String roomName,String roomId,String gameId){
|
||||
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
|
||||
createSudRoomModel.setSudGameId(gameId);
|
||||
createSudRoomModel.setSudGameRoomId(roomId);
|
||||
createSudRoomModel.setRoomName(roomName);
|
||||
RandomSudGameManager.getManager().start(createSudRoomModel,true,true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user