Merge branch 'refs/heads/v681小游戏'

This commit is contained in:
zlzw 2024-08-21 10:43:27 +08:00
commit 04ae7eeacc
69 changed files with 3906 additions and 771 deletions

View File

@ -28,6 +28,7 @@ import com.facebook.appevents.AppEventsLogger;
import com.fm.openinstall.OpenInstall;
import com.google.gson.Gson;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DebugUtils;
import com.yunbao.common.utils.LogUtils;
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
import com.tencent.imsdk.v2.V2TIMManager;
@ -355,7 +356,7 @@ public class AppContext extends CommonAppContext {
NeverCrashUtils.getInstance().setDebugMode(BuildConfig.DEBUG).setMainCrashHandler((t, e) -> {
Log.e("ApplicationError", "主线程异常");//此处log只是展示当debug为true时主类内部log会打印异常信息
e.printStackTrace();
AppManager.runDebugCode(() -> {
DebugUtils.runDebugCode(() -> {
//闪退后finish所有Activity并且杀死进程
for (WeakReference<Activity> activity : activities) {
if (activity != null && activity.get() != null) {

View File

@ -10,6 +10,7 @@ import android.widget.Toast;
import com.yunbao.common.bean.CrashSaveBean;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.DebugUtils;
import com.yunbao.common.utils.FileUtil;
import com.yunbao.common.utils.SpUtil;
@ -105,10 +106,10 @@ public class NeverCrashUtils {
}
e.printStackTrace();
AppContext.setFirebaseCrashData();
AppManager.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
DebugUtils.runDebugCode(() -> Toast.makeText(application, "发生闪退:" + e.getMessage(), Toast.LENGTH_SHORT).show());
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
AppManager.runDebugCode(() -> errorWhile = false);
DebugUtils.runDebugCode(() -> errorWhile = false);
// return;
}
}

View File

@ -669,5 +669,7 @@ public class CommonAppConfig {
public String getAnchorPkTime() {
return SpUtil.getInstance().getStringValue(SpUtil.ANCHOR_PK_TIME);
}
public static boolean isTestEnv() {
return CommonAppConfig.HOST.contains("ceshi");
}
}

View File

@ -1,6 +1,9 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -9,12 +12,17 @@ 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.interfaces.OnItemClickListener;
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,8 +35,23 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
private boolean isLiveRoom;
private boolean isStar;
int giftStatus;
int giftId;
private String anchorName;
private String anchorAvatar;
private Context mContext;
private OnItemClickListener<GiftWallTab2Bean.Gift> onItemClickListener;
public GiftWallGiftInfoListItemAdapter(Context mContext) {
this.mContext = mContext;
}
public void setOnItemClickListener(OnItemClickListener<GiftWallTab2Bean.Gift> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
public void setGiftId(int giftId) {
this.giftId = giftId;
}
public void setAnchorName(String anchorName) {
this.anchorName = anchorName;
@ -71,9 +94,20 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
notifyDataSetChanged();
}
@Override
public int getItemViewType(int position) {
if (isStar && (getItemCount() > 0) && data.get(0).getId() != -1 && list_type == 2) {
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 +190,41 @@ 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;
}
if(onItemClickListener!=null){
onItemClickListener.onItemClick(giftData,position);
}
}
});
}
}
}

View File

@ -0,0 +1,39 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class BallClearanceTableJoinRoomBean extends BaseModel{
@SerializedName("room_id")
private String room_id;
@SerializedName("room_name")
private String roomName;
@SerializedName("sud_game_id")
private String gameId;
public BallClearanceTableJoinRoomBean() {
}
public String getRoom_id() {
return room_id;
}
public void setRoom_id(String room_id) {
this.room_id = room_id;
}
public String getRoomName() {
return roomName;
}
public void setRoomName(String roomName) {
this.roomName = roomName;
}
public String getGameId() {
return gameId;
}
public void setGameId(String gameId) {
this.gameId = gameId;
}
}

View File

@ -89,6 +89,36 @@ public class GiftWallInfoBean extends BaseModel {
private int gift_status;
@SerializedName("sendtype")
private int sendtype;//0默认钻石购买1金币购买
@SerializedName("live_nicename")
private String live_nicename;
@SerializedName("live_avatar")
private String live_avatar;
@SerializedName("live_sort")
private int live_sort;
public int getLive_sort() {
return live_sort;
}
public void setLive_sort(int live_sort) {
this.live_sort = live_sort;
}
public String getLive_nicename() {
return live_nicename;
}
public void setLive_nicename(String live_nicename) {
this.live_nicename = live_nicename;
}
public String getLive_avatar() {
return live_avatar;
}
public void setLive_avatar(String live_avatar) {
this.live_avatar = live_avatar;
}
public int getSendtype() {
return sendtype;
@ -327,5 +357,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 + '\'' +
'}';
}
}
}

View File

@ -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(info.getLive_avatar());
giftInfo.setNamingLiveId(gift.getNamingLiveId());
giftInfo.setNamingLiveNicename(info.getLive_nicename());
giftInfo.setGiftHallSendNum(Integer.parseInt(info.getGift_hall_send_num()));
}
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 {

View File

@ -493,6 +493,9 @@ public class IMLoginModel extends BaseModel {
public long getId() {
return id;
}
public String getUid(){
return id+"";
}
public IMLoginModel setId(long id) {
this.id = id;

View File

@ -0,0 +1,58 @@
package com.yunbao.common.bean;
public class SudActivityGameInfoBean extends BaseModel {
private int id;
private int uid;//用户id
private int userType;//用户类型 1.主播 2.用户
private int score;//对局获得的积分
private int hot_num;//对局获得的热度
private int is_win;//对局结果 0.无结果 1. 2. 3.平局
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public int getUserType() {
return userType;
}
public void setUserType(int userType) {
this.userType = userType;
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public int getHot_num() {
return hot_num;
}
public void setHot_num(int hot_num) {
this.hot_num = hot_num;
}
public int getIs_win() {
return is_win;
}
public void setIs_win(int is_win) {
this.is_win = is_win;
}
}

View File

@ -0,0 +1,24 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.List;
public class SudGameAiInfo extends BaseModel{
@SerializedName("uids")
private List<String> uids;
public SudGameAiInfo() {
}
public List<String> getUids() {
if(uids==null)
uids=new ArrayList<>();
return uids;
}
public void setUids(List<String> uids) {
this.uids = uids;
}
}

View File

@ -0,0 +1,117 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class SudGameRoomInfoBean extends BaseModel{
public static final String STATUS_WAITING = "WATING";
public static final String STATUS_PLAYING = "PLAYING";
@SerializedName("status")
private String status="";
@SerializedName("captain_uid")
private String captainUid;
@SerializedName("player")
private List<Player> players;
// 注意这里没有getter和setter方法
// 可以添加一个构造方法或其他方法来初始化对象如果需要
public SudGameRoomInfoBean() {
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getCaptainUid() {
return captainUid;
}
public void setCaptainUid(String captainUid) {
this.captainUid = captainUid;
}
public List<Player> getPlayers() {
return players;
}
public void setPlayers(List<Player> players) {
this.players = players;
}
// 嵌套类来表示游戏位玩家
public static class Player {
public static final String PLAYER_STATUS_READY = "READY";
public static final String PLAYER_STATUS_IDLE = "IDLE";
@SerializedName("uid")
private String uid;
@SerializedName("seat_index")
private int seatIndex;
@SerializedName("status")
private String status="";
@SerializedName("is_ai")
private int isAi;
@SerializedName("ai_level")
private int aiLevel;
// 同样这里没有getter和setter方法
// 可以根据需要添加构造方法或其他方法
public Player() {
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public int getSeatIndex() {
return seatIndex;
}
public void setSeatIndex(int seatIndex) {
this.seatIndex = seatIndex;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public int getIsAi() {
return isAi;
}
public void setIsAi(int isAi) {
this.isAi = isAi;
}
public int getAiLevel() {
return aiLevel;
}
public void setAiLevel(int aiLevel) {
this.aiLevel = aiLevel;
}
}
// 如果需要可以添加其他方法来操作这些数据
}

View File

@ -44,6 +44,16 @@ public class SudRoomListModel extends BaseModel {
private String sudgameicon;
@SerializedName("currency_type")
private String currencyType;
@SerializedName("is_activity")
private String isActivity;
public String getIsActivity() {
return isActivity;
}
public void setIsActivity(String isActivity) {
this.isActivity = isActivity;
}
public String getCurrencyType() {
return currencyType;

View File

@ -3,11 +3,16 @@ package com.yunbao.common.dialog;
import static androidx.core.content.ContextCompat.getSystemService;
import android.animation.ObjectAnimator;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Handler;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ImageSpan;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
@ -16,6 +21,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import com.blankj.utilcode.util.LogUtils;
import com.google.gson.Gson;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BottomPopupView;
@ -32,7 +38,9 @@ import com.yunbao.common.event.SudGameListDissMissEvent;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.RandomSudGameManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
@ -95,6 +103,7 @@ public class CreateSudGamePopup extends BottomPopupView {
private String userName;
private boolean isYuanbao;
private CheckCurrencyModel currencyModel;
private void initDate() {
currencyTypeName = getContext().getString(R.string.golden_bean);
@ -108,6 +117,7 @@ public class CreateSudGamePopup extends BottomPopupView {
@Override
public void onSuccess(CheckCurrencyModel data) {
isYuanbao = TextUtils.equals(data.getIsYuanbao(), "1") || TextUtils.equals(data.getIsYuanbao(), "true");
currencyModel = data;
}
@Override
@ -213,7 +223,8 @@ public class CreateSudGamePopup extends BottomPopupView {
ToastUtil.show("貨幣數量区间为[10 - 1000]");
} else {
ToastUtil.show("Currency quantity range [10-1000]");
} }
}
}
return;
}
@ -245,7 +256,7 @@ public class CreateSudGamePopup extends BottomPopupView {
return;
}
}
} else {
} else if (!TextUtils.equals(currencyType, "4")) {
if (sill.length() > 4) {
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("貨幣數量区间为[10 - 1000]");
@ -274,17 +285,28 @@ public class CreateSudGamePopup extends BottomPopupView {
}
}
if (TextUtils.equals(currencyType, "4") && currencyModel.getZqTicketNumberInt() < 1) {
RandomSudGameManager.getManager().showNotActivityTicketDialog(getContext());
return;
}
LiveNetManager.get(getContext())
.createSudRoom(name, sill, currencyType, id, new HttpCallback<CreateSudRoomModel>() {
.createSudRoom(name, sill, currencyType, id, TextUtils.equals(currencyType, "4"), new HttpCallback<CreateSudRoomModel>() {
@Override
public void onSuccess(CreateSudRoomModel data) {
if (TextUtils.equals(currencyType, "4")) {
RandomSudGameManager.getManager().start(data, isHome, false);
dialog.dismiss();
if (!isHome) {
Bus.get().post(new SudGameListDissMissEvent());
}
return;
}
if (isHome) {
dialog.dismiss();
if(CommonAppConfig.getInstance().getConfig().isSw()){
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data),true,isHome);
}else{
RouteUtil.forwardRySudGameActivity(new Gson().toJson(data),true,isHome);
if (CommonAppConfig.getInstance().getConfig().isSw()) {
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data), false, false, isHome);
} else {
RouteUtil.forwardRySudGameActivity(new Gson().toJson(data), true, isHome);
}
} else {
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
@ -299,6 +321,15 @@ public class CreateSudGamePopup extends BottomPopupView {
public void onError(String error) {
ToastUtil.show(error);
}
@Override
public void onError(String error, int code) {
if (code != 501) {
super.onError(error, code);
} else {
RandomSudGameManager.getManager().showNotActivityTicketDialog(getContext());
}
}
});
}
});
@ -332,7 +363,7 @@ public class CreateSudGamePopup extends BottomPopupView {
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Bottom)
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName, isYuanbao, id, currencyModel)
.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
@ -343,13 +374,13 @@ public class CreateSudGamePopup extends BottomPopupView {
.show();
}
}, 500);
}else {
} else {
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
builder.hasShadowBg(false)
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Bottom)
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName, isYuanbao, id, currencyModel)
.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
@ -361,11 +392,11 @@ public class CreateSudGamePopup extends BottomPopupView {
}
}
});
}
private void closeAnimSudGameListEvent() {
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 90f, 0f);
animator.setDuration(animDuration);
@ -384,7 +415,14 @@ public class CreateSudGamePopup extends BottomPopupView {
interactionID = event.getInteractionID();
createGameType.setText(event.getTitle());
id = event.getId();
gameSill.setEnabled(true);
gameSill.setText("");
LogUtils.e(id,currencyType);
if (!currencyModel.getActivityList().contains(id) && "4".equals(currencyType)) {
currencyType = "3";
currencyTypeName = WordUtil.getNewString(R.string.golden_bean);
selectCurrencyType.setText(currencyTypeName);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
@ -397,5 +435,12 @@ public class CreateSudGamePopup extends BottomPopupView {
} else {
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
}
if (TextUtils.equals(currencyType, "4")) {
gameSill.setText("1");
gameSill.setEnabled(false);
} else {
gameSill.setEnabled(true);
gameSill.setText("");
}
}
}

View File

@ -26,6 +26,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.R;
import com.yunbao.common.adapter.GiftWallGiftInfoListItemAdapter;
import com.yunbao.common.bean.GiftWallInfoBean;
import com.yunbao.common.bean.GiftWallTab2Bean;
import com.yunbao.common.bean.JsWishBean;
import com.yunbao.common.custom.ItemDecoration;
import com.yunbao.common.event.ClosePopupDialogEvent;
@ -37,6 +38,7 @@ import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ScreenDimenUtil;
import com.yunbao.common.utils.ViewUtils;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -67,6 +69,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
View bottom_layout;
View gift_schedule;
ImageView diamond_icon;
View titleLayout, titleLayout2;
GiftWallGiftInfoListItemAdapter adapter;
RecyclerView recyclerView;
@ -167,10 +170,28 @@ 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);
adapter = new GiftWallGiftInfoListItemAdapter();
titleLayout = findViewById(R.id.list_title);
titleLayout2 = findViewById(R.id.list_title2);
adapter = new GiftWallGiftInfoListItemAdapter(mContext);
adapter.setAnchor(isAnchor);
adapter.setLiveRoom(isLiveRoom);
adapter.setStar(isStar);
adapter.setOnItemClickListener(new OnItemClickListener<GiftWallTab2Bean.Gift>() {
@Override
public void onItemClick(GiftWallTab2Bean.Gift bean, int position) {
new GiftWallMainTab2ClassicInfoDialog(mContext, bean, isAnchor)
.setFullWindows(!isLiveRoom)
.setRank(position+1)
.setGiftWallGiftInfoDialog(new GiftWallGiftInfoDialog(mContext, giftId, toUserId, isAnchor)
.setFullWindows(isFullWindows)
.setAnchorId(anchorId)
.setTab2Enter(isTab2Enter)
.setLiveRoom(isLiveRoom)
.setStar(isStar))
.showDialog();
dismiss();
}
});
recyclerView.setAdapter(adapter);
recyclerView.addItemDecoration(new ItemDecoration(mContext, 0x00000000, 0, 10));
@ -191,11 +212,13 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
adapter.setList_type(list_type);
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_assistance_user));
((TextView) findViewById(R.id.tv_rename)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_assistance_star));
titleLayout2.setVisibility(View.GONE);
titleLayout.setVisibility(View.VISIBLE);
user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename());
initData();
});
ViewClicksAntiShake.clicksAntiShake(tab2, () -> {
btn_one.setVisibility(View.VISIBLE);
btn_one_tips.setVisibility(View.VISIBLE);
tab2.setBackgroundResource(R.drawable.gift_wall_gift_info_list_btn_up);
tab2.setTextColor(Color.parseColor("#31326D"));
@ -204,7 +227,19 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
tab1.setTextColor(Color.parseColor("#FFFFFF"));
list_type = 2;
adapter.setList_type(list_type);
if (isStar && list_type == 2) {
btn_one.setVisibility(View.GONE);
btn_one_tips.setVisibility(View.GONE);
titleLayout.setVisibility(View.GONE);
titleLayout2.setVisibility(View.VISIBLE);
} else {
btn_one.setVisibility(View.VISIBLE);
btn_one_tips.setVisibility(View.VISIBLE);
titleLayout.setVisibility(View.VISIBLE);
}
initTabText();
initData();
});
XPopup.Builder builder = new XPopup.Builder(getContext())
@ -251,6 +286,9 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
mIvBack.setLayoutParams(params);
ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss);
resetWindows();
if (isStar && list_type == 2) {
findViewById(R.id.anchorTips).setVisibility(View.VISIBLE);
}
}
private void initTabText() {
@ -259,7 +297,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 +378,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());
/**
* 如果对方是主播要有点亮标记
* 如果对方是用户不要有点亮标记
@ -371,12 +414,34 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
}
adapter.setData(giftBean.getData());
time = (WordUtil.isNewZh() ? "榜單結算時間:" : "Settlement time:") + giftBean.getGift_info().getGift_hall_start() + " - " + giftBean.getGift_info().getGift_hall_end();
ImgLoader.display(mContext, IMLoginManager.get(mContext).getUserInfo().getAvatar(), avatar);
user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename());
send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getUser_gift_hall_send_num()));
if (isStar && list_type == 2) {
user_name.setText(giftBean.getGift_info().getLive_nicename());
send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getGift_hall_send_num()));
ImgLoader.display(mContext, giftBean.getGift_info().getLive_avatar(), avatar);
findViewById(R.id.anchorTips).setVisibility(View.VISIBLE);
ViewUtils.findViewById(this, R.id.textView7, TextView.class).setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_tips3));
if (giftBean.getGift_info().getLive_sort() == 0) {
ViewUtils.findViewById(this, R.id.bottom_rank_value, TextView.class).setText(WordUtil.isNewZh() ? "未上榜" : "Not listed");
} else {
ViewUtils.findViewById(this, R.id.bottom_rank_value, TextView.class).setText(String.valueOf(giftBean.getGift_info().getLive_sort()));
}
findViewById(R.id.bottom_rank_layout).setVisibility(View.VISIBLE);
} else {
ImgLoader.display(mContext, IMLoginManager.get(mContext).getUserInfo().getAvatar(), avatar);
user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename());
send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getUser_gift_hall_send_num()));
findViewById(R.id.anchorTips).setVisibility(View.GONE);
ViewUtils.findViewById(this, R.id.textView7, TextView.class).setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_send));
findViewById(R.id.bottom_rank_layout).setVisibility(View.GONE);
}
String tmp = "";
if (giftBean.getGift_info().getIlluminate_status() != 1) {//未點亮
if(list_type==2) {
btn_one.setVisibility(View.VISIBLE);
}
btn_one.setText(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_light);
tmp = String.format(Locale.getDefault(), "%s", (giftBean.getGift_info().getIlluminate_num() - Integer.parseInt(giftBean.getGift_info().getGift_hall_send_num())));
setTips(tmp);
@ -392,7 +457,14 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
}
private void setTips(String tmp) {
btn_one_tips.setVisibility(View.VISIBLE);
if (isStar && list_type == 2) {
btn_one.setVisibility(View.GONE);
btn_one_tips.setVisibility(View.GONE);
return;
}
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,
@ -410,6 +482,9 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get));
btn_one_tips.setVisibility(View.GONE);
} else {
if(list_type==2) {
btn_one.setVisibility(View.VISIBLE);
}
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion));
setTips(String.valueOf(tmp));
}

View File

@ -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;
@ -35,6 +36,7 @@ import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ScreenDimenUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.ViewUtils;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.CustomEllipsizeTextView;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -67,6 +69,8 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
GiftWallTab2Bean.Gift gift;
String userName;
boolean isAnchor;
GiftWallGiftInfoDialog giftWallGiftInfoDialog;
int rank;
public GiftWallMainTab2ClassicInfoDialog(@NonNull Context context, GiftWallTab2Bean.Gift gift, boolean isAnchor) {
super(context);
@ -80,6 +84,24 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
return this;
}
public GiftWallMainTab2ClassicInfoDialog setRank(int rank) {
this.rank = rank;
return this;
}
public GiftWallMainTab2ClassicInfoDialog setGiftWallGiftInfoDialog(GiftWallGiftInfoDialog giftWallGiftInfoDialog) {
this.giftWallGiftInfoDialog = giftWallGiftInfoDialog;
return this;
}
@Override
protected void onDismiss() {
super.onDismiss();
if (giftWallGiftInfoDialog != null) {
giftWallGiftInfoDialog.showDialog();
}
}
@Override
public void buildDialog(XPopup.Builder builder) {
@ -100,17 +122,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) {
@ -149,6 +191,12 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
}
}
});
if (giftWallGiftInfoDialog == null) {
ViewUtils.findViewById(this, R.id.tv_rank, TextView.class).setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_tips4));
ViewUtils.findViewById(this, R.id.rank_value, TextView.class).setText("1");
} else {
ViewUtils.findViewById(this, R.id.rank_value, TextView.class).setText(String.valueOf(rank));
}
}
void setTopData(GiftWallMainTab2ClassicInfoBean.GiftData data, ImageView avatar, TextView name, TextView value) {

View File

@ -2,8 +2,14 @@ package com.yunbao.common.dialog;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.os.CountDownTimer;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatImageView;
@ -14,36 +20,46 @@ import com.lxj.xpopup.XPopup;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.bean.SudActivityGameInfoBean;
import com.yunbao.common.bean.SudSettleBean;
import com.yunbao.common.event.CheckRemainingBalanceEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.sud.state.SudMGPMGState;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 双人小游戏结算弹窗
*/
public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
public SudGameDoubleDialog(@NonNull Context context) {
super(context);
}
@Override
public int bindLayoutId() {
return R.layout.dialog_sub_double;
}
private AppCompatImageView sub_win_hat,sub_leave,sub_again,sub_title;
private RoundedImageView sub_win_head,sub_loss_head;
private AppCompatTextView sub_win_name,sub_win_score,sub_loss_name,sub_loss_score,sub_time;
private AppCompatImageView sub_win_hat, sub_leave, sub_again, sub_title;
private RoundedImageView sub_win_head, sub_loss_head;
private AppCompatTextView sub_win_name, sub_win_score, sub_loss_name, sub_loss_score, sub_time;
private CountDownTimer countDownTimer;
private TextView activityGameAchievement;
private ImageView lossActivityIcon, winActivityIcon;
private List<SudSettleBean> settleBeans = new ArrayList<>();
private boolean containMe;
private boolean isActivityGame;
@Override
public void buildDialog(XPopup.Builder builder) {
@ -64,21 +80,23 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
sub_loss_name = findViewById(R.id.sub_loss_name);//失败方昵称
sub_loss_score = findViewById(R.id.sub_loss_score);//失败方分数
sub_time = findViewById(R.id.sub_time);//关闭倒计时
lossActivityIcon = findViewById(R.id.lossActivityIcon);
winActivityIcon = findViewById(R.id.winActivityIcon);
activityGameAchievement = findViewById(R.id.activityGameAchievement);
initData();
if (WordUtil.isNewZh()){
if (WordUtil.isNewZh()) {
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
sub_again.setImageResource(R.mipmap.sub_again_zh);
}else {
} else {
sub_leave.setImageResource(R.mipmap.sub_leave_en);
sub_again.setImageResource(R.mipmap.sub_again_en);
}
sub_leave.setOnClickListener(v-> destroyDialog());
sub_again.setOnClickListener(v-> {
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
sub_leave.setOnClickListener(v -> destroyDialog());
sub_again.setOnClickListener(v -> {
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
destroyDialog();
});
@ -86,30 +104,57 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
@SuppressLint("SetTextI18n")
private void initData() {
if (settleBeans.size() == 2){
sub_win_score.setVisibility(View.VISIBLE);
sub_win_name.setVisibility(View.VISIBLE);
sub_loss_score.setVisibility(View.VISIBLE);
sub_loss_name.setVisibility(View.VISIBLE);
winActivityIcon.setVisibility(View.VISIBLE);
lossActivityIcon.setVisibility(View.VISIBLE);
if (settleBeans.size() == 2) {
sortByWinNum(settleBeans);
SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名
SudSettleBean sudSettleBean2 = settleBeans.get(1); // 第二名
checkMe(sudSettleBean1.getUid(),sudSettleBean2.getUid());//判断这场对局是不是包含自己
checkMe(sudSettleBean1.getUid(), sudSettleBean2.getUid());//判断这场对局是不是包含自己
LogUtils.e("第一名:" + sudSettleBean1.getNick_name());
LogUtils.e("第二名:" + sudSettleBean2.getNick_name());
// 检查是否是当前用户
boolean isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid());
boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num();
boolean isZh = WordUtil.isNewZh();
String myUid = CommonAppConfig.getInstance().getUid();
LogUtils.e("isFirstMe:" + isFirstMe);
if (isActivityGame) {
findViewById(R.id.tips).setVisibility(View.INVISIBLE);
}
if (containMe) {
// 当前用户在游戏中
SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2;
SudSettleBean lossBean = isFirstMe ? sudSettleBean2 : sudSettleBean1;
// SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2;
// SudSettleBean lossBean = isFirstMe ? sudSettleBean2 : sudSettleBean1;
SudSettleBean winBean = sudSettleBean1;
SudSettleBean lossBean = sudSettleBean2;
if (isActivityGame) {
Map<String, Integer> map = showActivityGameScore();
if (!map.isEmpty()) {
isDraw = map.get("win").intValue() == map.get("loss").intValue();
isFirstMe = IMLoginManager.get(mContext).getUserInfo().getUid().equals(String.valueOf(map.get("win_uid")));
if (lossBean.getUid().equals(map.get("win_uid").toString())) {
SudSettleBean tmp = lossBean;
lossBean = winBean;
winBean = tmp;
}
}
ToastUtil.show("结算:" + isDraw + " | " + isFirstMe + "|");
} else {
sub_win_score.setText(winBean.getWin_num() > 0 ? "+" + winBean.getWin_num() : String.valueOf(winBean.getWin_num()));
sub_loss_score.setText(String.valueOf(lossBean.getWin_num()));
System.out.println("胜者名字:" + winBean.getNick_name() + "|败者名字:" + lossBean.getNick_name());
}
ImgLoader.display(mContext, winBean.getAvatar_url(), sub_win_head);
ImgLoader.display(mContext, lossBean.getAvatar_url(), sub_loss_head);
sub_win_name.setText(winBean.getNick_name());
sub_loss_name.setText(lossBean.getNick_name());
sub_win_score.setText(winBean.getWin_num() > 0 ? "+" + winBean.getWin_num() : String.valueOf(winBean.getWin_num()));
sub_loss_score.setText(String.valueOf(lossBean.getWin_num()));
if (isDraw) {
// 平局
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
@ -119,16 +164,30 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
sub_title.setImageResource(isZh ? (isFirstMe ? R.mipmap.sub_win_zh : R.mipmap.sub_loss_zh) : (isFirstMe ? R.mipmap.sub_win_en : R.mipmap.sub_loss_en));
sub_win_hat.setVisibility(View.VISIBLE);
}
if (isActivityGame) {
if (sudSettleBean1.getUid().equals(myUid)) {
sub_loss_score.setVisibility(View.INVISIBLE);
lossActivityIcon.setVisibility(View.INVISIBLE);
} else {
sub_win_score.setVisibility(View.INVISIBLE);
winActivityIcon.setVisibility(View.INVISIBLE);
}
}
} else {
// 当前用户不在游戏中
ImgLoader.display(mContext, sudSettleBean1.getAvatar_url(), sub_win_head);
ImgLoader.display(mContext, sudSettleBean2.getAvatar_url(), sub_loss_head);
sub_win_name.setText(sudSettleBean1.getNick_name());
sub_loss_name.setText(sudSettleBean2.getNick_name());
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()));
if (isActivityGame) {
Map<String, Integer> map = showActivityGameScore();
if (!map.isEmpty()) {
isDraw = map.get("win").intValue() == map.get("loss").intValue();
}
} 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()));
}
if (isDraw) {
// 平局
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
@ -138,11 +197,59 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
sub_title.setImageResource(isZh ? R.mipmap.sub_win_zh : R.mipmap.sub_win_en);
sub_win_hat.setVisibility(View.VISIBLE);
}
if (isActivityGame) {
sub_win_score.setVisibility(View.INVISIBLE);
winActivityIcon.setVisibility(View.INVISIBLE);
sub_loss_score.setVisibility(View.INVISIBLE);
lossActivityIcon.setVisibility(View.INVISIBLE);
}
}
}
System.out.println("是否为活动游戏" + isActivityGame + " 成就内容:" + gameSettle.achievement);
if (isActivityGame) {
//TODO 败者没显示成就
if (!StringUtil.isEmpty(gameSettle.achievement)) {
String activityGameAchievementText = WordUtil.getNewString(R.string.game_dialog_activity_achievements_title);
String activityGameAchievementContent = gameSettle.achievement;
activityGameAchievement.setVisibility(View.VISIBLE);
SpannableString ss = new SpannableString(activityGameAchievementText + activityGameAchievementContent);
ss.setSpan(new ForegroundColorSpan(Color.parseColor("#FFBA6A")), activityGameAchievementText.length(), ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
activityGameAchievement.setText(ss);
}
if (sub_loss_score.getVisibility() == View.VISIBLE) {
lossActivityIcon.setVisibility(View.VISIBLE);
}
if (sub_win_score.getVisibility() == View.VISIBLE) {
winActivityIcon.setVisibility(View.VISIBLE);
}
if(!containMe){
sub_win_score.setVisibility(View.INVISIBLE);
winActivityIcon.setVisibility(View.INVISIBLE);
sub_loss_score.setVisibility(View.INVISIBLE);
lossActivityIcon.setVisibility(View.INVISIBLE);
}
}
}
private void checkMe(String id1,String id2){
@SuppressLint("SetTextI18n")
private Map<String, Integer> showActivityGameScore() {
Map<String, Integer> map = new HashMap<>();
if (gameSettle.activityGameInfoBean == null) return map;
for (SudActivityGameInfoBean infoBean : gameSettle.activityGameInfoBean) {
if (infoBean.getIs_win() == 1) {
sub_loss_score.setText("+" + infoBean.getScore());
map.put("loss", infoBean.getScore());
} else if (infoBean.getIs_win() == 2) {
sub_win_score.setText("+" + infoBean.getScore());
map.put("win", infoBean.getScore());
map.put("win_uid", infoBean.getUid());
}
}
return map;
}
private void checkMe(String id1, String id2) {
containMe = CommonAppConfig.getInstance().getUid().equals(id1) || CommonAppConfig.getInstance().getUid().equals(id2);
}
@ -150,11 +257,11 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
protected void onShow() {
super.onShow();
//关闭倒计时
countDownTimer = new CountDownTimer(10000, 1000){
countDownTimer = new CountDownTimer(10000, 1000) {
@Override
public void onTick(long l) {
sub_time.setText(String.valueOf((l+500)/1000));
sub_time.setText(String.valueOf((l + 500) / 1000));
}
@Override
@ -165,23 +272,40 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
initData();
}
public void setSudSettleList(List<SudSettleBean> data){
SudMGPMGState.MGCommonGameSettle gameSettle;
public void setSudSettleList(SudMGPMGState.MGCommonGameSettle data) {
gameSettle = data;
settleBeans.clear();
settleBeans.addAll(data);
LogUtils.e("yqw=====>"+settleBeans);
settleBeans.addAll(data.sudSettleBeans);
LogUtils.e("yqw=====>" + settleBeans);
}
private void sortByWinNum(List<SudSettleBean> list){
private void sortByWinNum(List<SudSettleBean> list) {
// 按照胜利数排序 settleBeans 列表
if (isActivityGame) {
for (SudActivityGameInfoBean infoBean : gameSettle.activityGameInfoBean) {
for (SudSettleBean bean : list) {
if (bean.getUid().equals(infoBean.getUid() + "")) {
bean.setWin_num(infoBean.getScore());
break;
}
}
}
}
Collections.sort(list, (bean1, bean2) -> {
return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序
});
LogUtils.e("排序后=====>" + settleBeans);
}
private void destroyDialog(){
private void destroyDialog() {
dismiss();
countDownTimer.cancel();
countDownTimer = null;
}
public void setActivityGame() {
isActivityGame = true;
}
}

View File

@ -13,6 +13,7 @@ import com.lxj.xpopup.core.AttachPopupView;
import com.yunbao.common.R;
import com.yunbao.common.adapter.SudTitleSelectAdapter;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.CheckCurrencyModel;
import com.yunbao.common.event.CreateSudGameEvent;
import com.yunbao.common.event.CurrencyTypeEvent;
import com.yunbao.common.event.LiveSudGameHistoryEvent;
@ -21,6 +22,7 @@ import com.yunbao.common.event.SudGameListEvent;
import com.yunbao.common.event.SudGameListSillEvent;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import java.util.ArrayList;
@ -42,6 +44,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
private DialogInterface.OnDismissListener onDismissListener;
private String mSill;
private boolean isYuanbao;
private String gameId = null;
private CheckCurrencyModel currencyModel = null;
public SudGameListSelectPopup(@NonNull Context context, int type, List<CustomSidebarChildModel> child, long interactionID) {
super(context);
@ -68,6 +72,15 @@ public class SudGameListSelectPopup extends AttachPopupView {
this.isYuanbao = isYuanbao;
}
public SudGameListSelectPopup(@NonNull Context context, int mType, String sill, boolean isYuanbao, String gameId, CheckCurrencyModel data) {
super(context);
this.mType = mType;
mSill = sill;
this.isYuanbao = isYuanbao;
this.gameId = gameId;
this.currencyModel = data;
}
public SudGameListSelectPopup(@NonNull Context context, String sill, List<CustomSidebarChildModel> child) {
super(context);
this.mType = 8;
@ -160,7 +173,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
dialog.dismiss();
}
});
} else if (mType == 2) {
}
else if (mType == 2) {
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
selectString.add(getContext().getString(R.string.live_anchor));
selectString.add(getContext().getString(R.string.interactive_game_player));
@ -195,6 +209,10 @@ public class SudGameListSelectPopup extends AttachPopupView {
if (isYuanbao) {
selectSill.put(getContext().getString(R.string.coins), "2");
}
if (currencyModel != null && currencyModel.isActivityGame(gameId)) {
selectString.add(WordUtil.getNewString(R.string.game_create_coid_ticket));
selectSill.put(WordUtil.getNewString(R.string.game_create_coid_ticket), "4");
}
index = 0;
for (int i = 0; i < selectString.size(); i++) {
@ -247,7 +265,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
}
}
});
} else if (mType == 7) {
}
else if (mType == 7) {
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today));
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today_7));
@ -278,7 +297,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
}
}
});
} else if (mType == 8) {
}
else if (mType == 8) {
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
for (int i = 0; i < customSidebarChildModels.size(); i++) {

View File

@ -65,7 +65,7 @@ public class SudGameMultipleDialog extends AbsDialogCenterPopupWindow{
sub_leave.setOnClickListener(v-> destroyDialog());
sub_again.setOnClickListener(v-> {
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
destroyDialog();
});
@ -97,9 +97,9 @@ public class SudGameMultipleDialog extends AbsDialogCenterPopupWindow{
// limitItem();
}
public void setSudSettleList(List<SudSettleBean> data){
public void setSudSettleList(SudMGPMGState.MGCommonGameSettle data){
settleBeans.clear();
settleBeans.addAll(data);
settleBeans.addAll(data.sudSettleBeans);
}
//设置最多显示的高度

View File

@ -56,7 +56,6 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
@Override
public void dismiss() {
Bus.getOff(this);
super.dismiss();
}
@ -78,7 +77,6 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
@Override
protected void onCreate() {
super.onCreate();
Bus.getOn(this);
editSearch = findViewById(R.id.edit_search);
// listHistory = findViewById(R.id.list_history);
listRoom = findViewById(R.id.list_room);

View File

@ -1,24 +1,28 @@
package com.yunbao.common.dialog;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.LinearLayoutCompat;
import androidx.core.content.ContextCompat;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.R;
import com.yunbao.common.utils.WordUtil;
public class SudLoadDialog extends AbsDialogCenterPopupWindow{
public class SudLoadDialog extends AbsDialogCenterPopupWindow {
public SudLoadDialog(@NonNull Context context) {
super(context);
}
private LinearLayoutCompat sud_load_bg;
private AppCompatImageView sud_load,sud_load_skip,sud_load_again;
private ProgressBar sud_load_bar_double,sud_load_bar_multiple;
private AppCompatImageView sud_load, sud_load_skip, sud_load_again;
private ProgressBar sud_load_bar_double, sud_load_bar_multiple;
private int isDouble = 0;//游戏模式 1:双人对战 2:多人游戏
private int clickStatus = 0;//0:什么都不点击 1:点击跳过 2:点击再来一局
@ -50,36 +54,39 @@ public class SudLoadDialog extends AbsDialogCenterPopupWindow{
sud_load_bar_double = findViewById(R.id.sud_load_bar_double);
sud_load_bar_multiple = findViewById(R.id.sud_load_bar_multiple);
if (WordUtil.isNewZh()){
if (WordUtil.isNewZh()) {
sud_load.setImageResource(R.mipmap.sud_load_zh);
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_zh);
sud_load_again.setImageResource(R.mipmap.sub_again_zh);
}else {
} else {
sud_load.setImageResource(R.mipmap.sud_load_en);
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_en);
sud_load_again.setImageResource(R.mipmap.sub_again_en);
}
sud_load_skip.setOnClickListener(v->{
sud_load_skip.setOnClickListener(v -> {
clickStatus = 1;
dismiss();
});
sud_load_again.setOnClickListener(v->{
sud_load_again.setOnClickListener(v -> {
clickStatus = 2;
dismiss();
});
}
Handler activityGameTipsHandler = null;
Runnable activityGameTipsRunnable = () -> {
findViewById(R.id.sud_activity_tips_text).setVisibility(View.VISIBLE);
};
@Override
protected void onShow() {
super.onShow();
if (isDouble == 1){
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_double));
if (isDouble == 1) {
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext, R.mipmap.sud_load_bg_double));
sud_load_bar_double.setVisibility(View.VISIBLE);
sud_load_bar_multiple.setVisibility(View.GONE);
}else {
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_multiple));
} else {
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext, R.mipmap.sud_load_bg_multiple));
sud_load_bar_double.setVisibility(View.GONE);
sud_load_bar_multiple.setVisibility(View.VISIBLE);
}
@ -88,9 +95,25 @@ public class SudLoadDialog extends AbsDialogCenterPopupWindow{
// dismiss();
// }
// },10000);
activityGameTipsHandler=new Handler(Looper.getMainLooper());
activityGameTipsHandler.postDelayed(activityGameTipsRunnable,5000);
}
public void setDouble(int isDouble){
public void setDouble(int isDouble) {
this.isDouble = isDouble;
}
private boolean isActivityGame = false;
public void setActivityGame() {
isActivityGame = true;
}
@Override
protected void onDismiss() {
super.onDismiss();
if(activityGameTipsHandler!=null){
activityGameTipsHandler.removeCallbacks(activityGameTipsRunnable);
}
}
}

View File

@ -1,12 +1,47 @@
package com.yunbao.common.event;
import android.text.TextUtils;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import java.util.ArrayList;
import java.util.List;
public class CheckCurrencyModel extends BaseModel {
@SerializedName("is_yuanbao")
private String isYuanbao;
private String isYuanbao;//是否开启星币 0. 1.
@SerializedName("zq_game_status")
private String zqGameStatus="1";//一杆清台活动开启状态 0.未开启 1.开启
@SerializedName("zq_ticket_number")
private String zqTicketNumber;//一杆清台活动门票余额
private List<String> activityList;//活动列表 **本地注册接口本身没这个字段
public CheckCurrencyModel() {
activityList = new ArrayList<>();
if(CommonAppConfig.isTestEnv()) {
activityList.add("24");//测试服-台球
}else {
activityList.add("38");//正式服-台球
}
}
public List<String> getActivityList() {
return activityList;
}
public boolean isActivityGame(String gameId){
if(StringUtil.isEmpty(gameId))return false;
if(TextUtils.equals(zqGameStatus,"0")) return false;
return activityList.contains(gameId);
}
public String getIsYuanbao() {
return isYuanbao;
@ -16,4 +51,27 @@ public class CheckCurrencyModel extends BaseModel {
this.isYuanbao = isYuanbao;
return this;
}
public String getZqGameStatus() {
return zqGameStatus;
}
public void setZqGameStatus(String zqGameStatus) {
this.zqGameStatus = zqGameStatus;
}
public String getZqTicketNumber() {
return zqTicketNumber;
}
public int getZqTicketNumberInt() {
try {
return Integer.parseInt(zqTicketNumber);
}catch (Exception e){
return 0;
}
}
public void setZqTicketNumber(String zqTicketNumber) {
this.zqTicketNumber = zqTicketNumber;
}
}

View File

@ -1,18 +1,68 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.SudActivityGameInfoBean;
import com.yunbao.common.sud.state.SudMGPMGState;
import java.util.List;
public class CheckRemainingBalanceEvent extends BaseModel {
public int seatIndex=0;
public int seatIndex = 0;
private String SudMGPMGState;
private boolean subReady = false;//是否直接自动准备
private SudMGPMGState.MGCommonGameSettle mgCommonGameSettle;//结算数据
private boolean isActivityGame;
private SudMGPMGState.MGCommonPlayerIn playerIn;
private String uid;
private Object object;
public boolean isSubReady() {
return subReady;
}
public boolean isActivityGame() {
return isActivityGame;
}
public Object getObject() {
return object;
}
public String getUid() {
return uid;
}
public CheckRemainingBalanceEvent(String uid) {
this.uid = uid;
}
public void setObject(Object object) {
this.object = object;
}
public com.yunbao.common.sud.state.SudMGPMGState.MGCommonPlayerIn getPlayerIn() {
return playerIn;
}
public CheckRemainingBalanceEvent setPlayerIn(com.yunbao.common.sud.state.SudMGPMGState.MGCommonPlayerIn playerIn) {
this.playerIn = playerIn;
return this;
}
public CheckRemainingBalanceEvent setActivityGame(boolean activityGame) {
isActivityGame = activityGame;
return this;
}
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle() {
return mgCommonGameSettle;
}
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle(List<SudActivityGameInfoBean> data) {
mgCommonGameSettle.activityGameInfoBean = data;
return mgCommonGameSettle;
}
public CheckRemainingBalanceEvent setMgCommonGameSettle(SudMGPMGState.MGCommonGameSettle mgCommonGameSettle) {
this.mgCommonGameSettle = mgCommonGameSettle;
return this;
@ -36,12 +86,23 @@ public class CheckRemainingBalanceEvent extends BaseModel {
return this;
}
public CheckRemainingBalanceEvent setSubReady(boolean subReady){
public CheckRemainingBalanceEvent setSubReady(boolean subReady) {
this.subReady = subReady;
return this;
}
public boolean getSubReady(){
public boolean getSubReady() {
return subReady;
}
@Override
public String toString() {
return "CheckRemainingBalanceEvent{" +
"seatIndex=" + seatIndex +
", SudMGPMGState='" + SudMGPMGState + '\'' +
", subReady=" + subReady +
", mgCommonGameSettle=" + mgCommonGameSettle +
", isActivityGame=" + isActivityGame +
'}';
}
}

View File

@ -1,10 +1,21 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.utils.DebugUtils;
public class LiveSudGamePopupShowOrHideEvent {
private int type = 0;//0展示1hide隱藏2dismiss關閉
private CreateSudRoomModel createSudRoomModel;
private boolean isActivityGame;
public boolean isActivityGame() {
return isActivityGame;
}
public LiveSudGamePopupShowOrHideEvent setActivityGame(boolean activityGame) {
isActivityGame = activityGame;
return this;
}
public CreateSudRoomModel getCreateSudRoomModel() {
return createSudRoomModel;

View File

@ -5,6 +5,7 @@ import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.AvatarBean;
import com.yunbao.common.bean.BallClearanceTableJoinRoomBean;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.BattlePassPoints;
import com.yunbao.common.bean.BattlePassTask;
@ -74,7 +75,10 @@ import com.yunbao.common.bean.SendMoneyLongModel;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.bean.SlideInBannerModel;
import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.SudActivityGameInfoBean;
import com.yunbao.common.bean.SudGameAiInfo;
import com.yunbao.common.bean.SudGameInfoBean;
import com.yunbao.common.bean.SudGameRoomInfoBean;
import com.yunbao.common.bean.SudGameScoreBean;
import com.yunbao.common.bean.SudGameUserModel;
import com.yunbao.common.bean.SudRoomListModel;
@ -1054,6 +1058,7 @@ public interface PDLiveApi {
@Query("room_name") String roomName,
@Query("golden_bean_number") String goldenBeanNumber,
@Query("currency_type") String currencyType,
@Query("activity_game") String isActivity,
@Query("game_id") String gameId);
/**
@ -1349,4 +1354,23 @@ public interface PDLiveApi {
@GET("/api/public/?service=Message.penalizeStatus")
Observable<ResponseModel> getPenalizeStatus();
@GET("/api/public/?service=Sudgameserver.ballClearanceTableStatus")
Observable<ResponseModel<BaseModel>> ballClearanceTableStatus(
@Query("room_id")String roomId
);
@GET("/api/public/?service=Sudgameserver.ballClearanceTableGetResultScore")
Observable<ResponseModel<List<SudActivityGameInfoBean>>> ballClearanceTableGetResultScore(
@Query("room_id")String roomId
);
@GET("/api/public/?service=Sudgameserver.ballClearanceTableAiAdd")
Observable<ResponseModel<SudGameAiInfo>> ballClearanceTableAiAdd(
@Query("room_id")String roomId
);
@GET("/api/public/?service=Sudgameserver.ballClearanceTableGetRoomInfo")
Observable<ResponseModel<SudGameRoomInfoBean>> ballClearanceTableGetRoomInfo(
@Query("room_id")String roomId
);
@GET("/api/public/?service=Sudgameserver.ballClearanceTableJoinRoom")
Observable<ResponseModel<BallClearanceTableJoinRoomBean>> ballClearanceTableJoinRoom (
);
}

View File

@ -3,18 +3,21 @@ package com.yunbao.common.http.base;
/**
* maim的请求回调接口
*/
public interface HttpCallback<T> {
public abstract class HttpCallback<T> {
/**
* 请求成功
*
* @param data
*/
void onSuccess(T data);
public abstract void onSuccess(T data);
/**
* 请求失败
*
* @param error
*/
void onError(String error);
public abstract void onError(String error);
public void onError(String error,int code){
onError(error);
}
}

View File

@ -10,6 +10,7 @@ import com.yunbao.common.Constants;
import com.yunbao.common.R;
import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.AvatarBean;
import com.yunbao.common.bean.BallClearanceTableJoinRoomBean;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.BattlePassPoints;
import com.yunbao.common.bean.BattlePassTask;
@ -72,7 +73,10 @@ import com.yunbao.common.bean.RoomMicStatusModel;
import com.yunbao.common.bean.SendMoneyLongModel;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.SudActivityGameInfoBean;
import com.yunbao.common.bean.SudGameAiInfo;
import com.yunbao.common.bean.SudGameInfoBean;
import com.yunbao.common.bean.SudGameRoomInfoBean;
import com.yunbao.common.bean.SudGameScoreBean;
import com.yunbao.common.bean.SudGameUserModel;
import com.yunbao.common.bean.SudRoomListModel;
@ -2346,8 +2350,22 @@ public class LiveNetManager {
}
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
createSudRoom(roomName, goldenBeanNumber, currencyType, gameId, false, callback);
}
/**
* 创建游戏房
*
* @param roomName 房间名称
* @param goldenBeanNumber 游戏豆数量
* @param currencyType 货币类型
* @param gameId 游戏ID
* @param isActivityGame 是否是活动游戏
* @param callback 回调
*/
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, boolean isActivityGame, HttpCallback<CreateSudRoomModel> callback) {
API.get().pdLiveApi(mContext)
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
.createSudRoom(roomName, goldenBeanNumber, currencyType, isActivityGame ? "1" : "0", gameId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {
@ -2357,7 +2375,7 @@ public class LiveNetManager {
if (createSudRoomModelResponseModel.getData().getCode() == 0) {
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
} else {
callback.onError(createSudRoomModelResponseModel.getData().getMsg());
callback.onError(createSudRoomModelResponseModel.getData().getMsg(), createSudRoomModelResponseModel.getData().getCode());
}
}
@ -3600,7 +3618,101 @@ public class LiveNetManager {
}
}).isDisposed();
}
public void ballClearanceTableStatus( String roomId, HttpCallback<BaseModel> callback) {
API.get().pdLiveApi(mContext)
.ballClearanceTableStatus(roomId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void ballClearanceTableGetResultScore( String roomId, HttpCallback<List<SudActivityGameInfoBean>> callback) {
API.get().pdLiveApi(mContext)
.ballClearanceTableGetResultScore(roomId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void ballClearanceTableAiAdd( String roomId, HttpCallback<SudGameAiInfo> callback) {
API.get().pdLiveApi(mContext)
.ballClearanceTableAiAdd(roomId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void ballClearanceTableGetRoomInfo( String roomId, HttpCallback<SudGameRoomInfoBean> callback) {
API.get().pdLiveApi(mContext)
.ballClearanceTableGetRoomInfo(roomId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void ballClearanceTableJoinRoom( HttpCallback<BallClearanceTableJoinRoomBean> callback) {
API.get().pdLiveApi(mContext)
.ballClearanceTableJoinRoom()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
private MultipartBody.Part createUploadFile(File file) {
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);

View File

@ -0,0 +1,265 @@
package com.yunbao.common.manager;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Looper;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ImageSpan;
import android.view.View;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.BallClearanceTableJoinRoomBean;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.SudGameRoomInfoBean;
import com.yunbao.common.event.CheckCurrencyModel;
import com.yunbao.common.event.CheckRemainingBalanceEvent;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.game.AbsRandomGameManager;
import com.yunbao.common.manager.game.BilliardsRandomManager;
import com.yunbao.common.sud.QuickStartGameViewModel;
import com.yunbao.common.sud.state.SudMGPMGState;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import java.util.Locale;
public class RandomSudGameManager {
private static RandomSudGameManager manager;
private AbsRandomGameManager gameManager;
private CreateSudRoomModel sudRoomModel;
private QuickStartGameViewModel gameViewModel;
private boolean isRandom = false;
public static RandomSudGameManager getManager() {
if (manager == null) {
manager = new RandomSudGameManager();
}
return manager;
}
private RandomSudGameManager() {
}
public void start(CreateSudRoomModel data, boolean isHome, boolean isRandom) {
//TODO 等待五秒调用接口获取可以匹配的玩家
//TODO 五秒内没有玩家就自己创建
sudRoomModel = data;
this.isRandom = isRandom;
createRoom(data, isHome, isRandom);
}
private void createRoom(CreateSudRoomModel data, boolean isHome, boolean isRandom) {
//TODO 创建房间五秒内没有其他玩家就上AI
LiveNetManager.get(AppManager.getInstance().getMainActivity())
.checkCurrency(new HttpCallback<CheckCurrencyModel>() {
@Override
public void onSuccess(CheckCurrencyModel currencyModel) {
gameManager = new BilliardsRandomManager();
gameManager.setRandom(isRandom);
gameManager.onStart(currencyModel, data, isHome, isRandom);
}
@Override
public void onError(String error) {
}
});
}
private void createRoom(Context mContext) {
if(gameManager!=null){
gameManager.randomCreateRoom(mContext, new OnItemClickListener<CreateSudRoomModel>() {
@Override
public void onItemClick(CreateSudRoomModel bean, int position) {
start(bean, true, true);
}
});
}
}
public void reset() {
if (gameManager != null) {
gameManager.reset();
}
}
public void destroy() {
if (gameManager != null) {
gameManager.destroy();
gameManager = null;
}
sudRoomModel = null;
}
/**
* 游戏结算
*
* @return 返回true则用默认的结算弹框
*/
public boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model) {
if (gameManager == null) return true;
return gameManager.onGameMGCommonGameSettle(model);
}
/**
* 台球状态
*/
public void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model) {
if (gameManager != null) {
gameManager.onGameMGCommonGameBilliardsHitState(model);
}
}
public void showNotActivityTicketDialog(Context mContext) {
showNotActivityTicketDialog(mContext, false, null);
}
public void showNotActivityTicketDialog(Context mContext, boolean isAudience, DialogUitl.SimpleCallback2 simpleCallback) {
String text = WordUtil.isNewZh() ? "您還未用有門票$立即前往獲取吧~" : "You don thave a ticket yet$Go get it now~";
SpannableString ss = new SpannableString(text);
ImageSpan image = new ImageSpan(mContext, R.mipmap.ic_game_ticket);
ss.setSpan(image, text.indexOf("$"), text.indexOf("$") + 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
DialogUitl.Builder builder = new DialogUitl.Builder(mContext)
.setTitle(WordUtil.isNewZh() ? "提示" : "Hint")
.setHtmlCode(ss)
.setCancelable(true)
.setShowConfirmButton(true)
.setShowCancelButton(true);
if (isAudience) {
builder.setConfirmString(WordUtil.isNewZh() ? "僅觀戰" : "Watch the game");
builder.setCancelString(WordUtil.isNewZh() ? "獲取" : "Obtain");
text = WordUtil.isNewZh() ? "您還未擁有門票$是否前往獲取?" : "You don t have the tickets yet $ Do you want to get them?";
ss = new SpannableString(text);
ss.setSpan(image, text.indexOf("$"), text.indexOf("$") + 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
builder.setHtmlCode(ss);
}else {
builder.setConfirmString(WordUtil.isNewZh() ? "獲取" : "Obtain");
}
builder.setSimpleCallbackView(new DialogUitl.SimpleCallbackView() {
@Override
public void onShow(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
}
@Override
public void onConfirmClick(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
dialog.dismiss();
if(!isAudience){
openTicketWeb(mContext);
}
if (simpleCallback != null) {
simpleCallback.onConfirmClick(dialog, "");
}
}
@Override
public void onCancel(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
dialog.dismiss();
if(isAudience){
openTicketWeb(mContext);
}
if (simpleCallback != null) {
simpleCallback.onCancelClick();
}
}
})
.build()
.show();
}
public void onInitGame(CreateSudRoomModel mCreateSudRoomModel) {
if (gameManager == null) {
gameManager = new BilliardsRandomManager();
gameManager.setRandom(isRandom);
gameManager.onStart(null, mCreateSudRoomModel, false, false);
}
}
public void onGameState(CheckRemainingBalanceEvent event) {
if (gameManager != null) {
gameManager.onGameState(event);
}
}
public void random(Context mContext) {
LiveNetManager.get(mContext)
.ballClearanceTableJoinRoom(new HttpCallback<>() {
@Override
public void onSuccess(BallClearanceTableJoinRoomBean data) {
if (data != null) {
if ("0".equals(data.getRoom_id()) || StringUtil.isEmpty(data.getRoom_id())) {
createRoom(mContext);
return;
}
check(data);
}
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
private void check(BallClearanceTableJoinRoomBean data) {
LiveNetManager.get(mContext).checkRoomStatus(data.getRoom_id(), new HttpCallback<>() {
@Override
public void onSuccess(CreateSudRoomModel model) {
if (TextUtils.equals(model.getRoomStatus(), "0")) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("房间不存在");
} else {
ToastUtil.show("The room does not exist");
}
} else {
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
createSudRoomModel.setSudGameId(data.getGameId());
createSudRoomModel.setSudGameRoomId(data.getRoom_id());
createSudRoomModel.setRoomName(data.getRoomName());
start(createSudRoomModel, true, true);
}
}
@Override
public void onError(String error) {
}
});
}
});
}
public void setGameViewModel(QuickStartGameViewModel gameViewModel) {
this.gameManager = gameManager;
if (gameManager != null) {
gameManager.setGameViewModel(gameViewModel);
}
}
public void openTicketWeb(Context mContext) {
String url = String.format(Locale.getDefault(), "%s/h5/monthlyActivities/20240822/index.html?type=1&uid=%s&token=%s&isZh=%s",
CommonAppConfig.HOST,
IMLoginManager.get(mContext).getUserInfo().getId(),
IMLoginManager.get(mContext).getUserInfo().getToken(),
WordUtil.isNewZh() ? "1" : "0"
);
WebViewActivity.forward(mContext, url, true, false);
}
}

View File

@ -0,0 +1,50 @@
package com.yunbao.common.manager.game;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.SudGameRoomInfoBean;
import com.yunbao.common.event.CheckCurrencyModel;
import com.yunbao.common.event.CheckRemainingBalanceEvent;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.sud.QuickStartGameViewModel;
import com.yunbao.common.sud.state.SudMGPMGState;
public abstract class AbsRandomGameManager {
protected CreateSudRoomModel data;
protected QuickStartGameViewModel gameViewModel;
protected boolean isRandom;
protected boolean isCaptain = false;
public void setRandom(boolean random) {
isRandom = random;
}
public void setGameViewModel(QuickStartGameViewModel gameViewModel) {
this.gameViewModel = gameViewModel;
}
public abstract void onStart(CheckCurrencyModel currencyModel, CreateSudRoomModel data, boolean isHome, boolean isRandom);
public abstract void reset();
public abstract void randomCreateRoom(Context mContext, OnItemClickListener<CreateSudRoomModel> onClickListener);
public abstract void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model);
public abstract boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model);
public void onGameState(CheckRemainingBalanceEvent event) {
if (event.getSudMGPMGState().equals(SudMGPMGState.MG_COMMON_PLAYER_CAPTAIN)) {
isCaptain = true;
}
}
protected int getPlayerSize() {
if (gameViewModel == null) return 0;
return gameViewModel.getSudFSMMGCache().getPlayerInSet().size();
}
public abstract void destroy();
}

View File

@ -0,0 +1,296 @@
package com.yunbao.common.manager.game;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.widget.Button;
import com.blankj.utilcode.util.LogUtils;
import com.google.gson.Gson;
import com.lzf.easyfloat.enums.ShowPattern;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.SudGameAiInfo;
import com.yunbao.common.bean.SudGameRoomInfoBean;
import com.yunbao.common.dialog.DebugDialog;
import com.yunbao.common.event.CheckCurrencyModel;
import com.yunbao.common.event.CheckRemainingBalanceEvent;
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.RandomSudGameManager;
import com.yunbao.common.sud.QuickStartGameViewModel;
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.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
public class BilliardsRandomManager extends AbsRandomGameManager {
int isOneOverForMy = -1;//自己是否一杆清台
int isOneOverForOther = -1;//对方是否一杆清台
int comboNumberForMy = 0;//自己连杆数
int comboNumberForOther = 0;//对方连杆数
private SudGameAiInfo aiInfo;
private boolean isAddRobot = true;
private OnItemClickListener<String> onItemClickListener;
Handler autoJoinRobotHandler = null;
Runnable autoJoinRobotRunnable = () -> {
if (gameViewModel != null && gameViewModel.getSudFSMMGCache().getPlayerInSet().size() <= 2) {
if (isCaptain) {
onAddAiPlayer();
}
}
};
private boolean isInitDebug = false;
@Override
public void onStart(CheckCurrencyModel currencyModel, CreateSudRoomModel data, boolean isHome, boolean isRandom) {
this.data = data;
if (isInitDebug) {
isInitDebug = false;
new Handler(Looper.getMainLooper())
.postDelayed(() -> {
DebugDialog.getInstance(new DebugDialog.DebugDialogRunnable() {
@Override
public void run(DebugDialog dialog) {
dialog.setShowPattern(ShowPattern.ALL_TIME);
onItemClickListener = (bean, position) -> {
dialog.setParams("AI状态", isAddRobot + "");
dialog.setParams("清杆状态", isOneOverForMy + "");
dialog.setParams("连击", comboNumberForMy + "");
if (position == -1) {
dialog.setParams("参数", bean);
}
dialog.setView("关闭", new Button(AppManager.getInstance().getMainActivity()), new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.close();
}
});
};
dialog.show();
}
});
}, 300);
}
if (currencyModel == null) return;
if (isHome) {
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data), true, isRandom, true);
} else {
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data).setActivityGame(true));
}
}
@Override
public void reset() {
isOneOverForMy = -1;
isOneOverForOther = -1;
comboNumberForMy = 0;
comboNumberForOther = 0;
if (autoJoinRobotHandler != null) {
LogUtils.e("终止机器人");
DebugUtils.showStackTrace();
autoJoinRobotHandler.removeCallbacks(autoJoinRobotRunnable);
autoJoinRobotHandler = null;
}
aiInfo = null;
if (onItemClickListener != null)
onItemClickListener.onItemClick("", 0);
}
@Override
public void randomCreateRoom(Context mContext, OnItemClickListener<CreateSudRoomModel> onClickListener) {
//name = 三大风扇史蒂夫史蒂夫的房间 sill = 1 currencyType = 4 id = 24 isTicket = true
String userName = IMLoginManager.get(mContext).getUserInfo().getUserNicename();
String name = WordUtil.isNewZh() ? userName + "的房间 " : userName + "s room";
String sill = "1";
String currencyType = "4";
String id;
if (CommonAppConfig.isTestEnv()) {
id = "24";
} else {
id = "38";
}
LiveNetManager.get(mContext).createSudRoom(name, sill, currencyType, id, true, new HttpCallback<CreateSudRoomModel>() {
@Override
public void onSuccess(CreateSudRoomModel data) {
onClickListener.onItemClick(data, 0);
}
@Override
public void onError(String error) {
}
});
}
@Override
public void onGameState(CheckRemainingBalanceEvent event) {
super.onGameState(event);
if (event.getSudMGPMGState().equals(SudMGPMGState.MG_GAME_LOAD_OVER)) {
joinAiRobot();
}
if (event.getSudMGPMGState().equals(SudMGPMGState.MG_COMMON_PLAYER_IN)) {
LogUtils.e("收到的回调: AI uid = " + getAiUid() + "| kickUid = " + event.getPlayerIn().kickUID + "|" + getPlayerSize());
if (event.getPlayerIn().reason == 1 && aiInfo != null) {
reset();
isAddRobot = false;
} else if (event.getPlayerIn().isIn && getPlayerSize() < 2) {
reset();
joinAiRobot();
}
}
}
private String getAiUid() {
if (aiInfo == null) {
return "";
}
if (aiInfo.getUids().isEmpty()) {
return "";
}
try {
return aiInfo.getUids().get(0);
} catch (Exception e) {
e.printStackTrace();
}
return "";
}
private void joinAiRobot() {
if (!isAddRobot) return;
if (!isRandom) return;
if (getPlayerSize() == 2) return;
if (autoJoinRobotHandler != null) {
autoJoinRobotHandler.removeCallbacks(autoJoinRobotRunnable);
}
autoJoinRobotHandler = new Handler(Looper.getMainLooper());
autoJoinRobotHandler.postDelayed(autoJoinRobotRunnable, 5000);
}
@Override
public void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model) {
if (Integer.parseInt(model.uid) == IMLoginManager.get(AppManager.getInstance().getMainActivity()).getUserInfo().getId()) {
if (isOneOverForMy == -1) {
isOneOverForMy = 1;
}
if (model.state == 13 && comboNumberForMy == 0) {
comboNumberForMy = 1;
} else if (model.state >= 2 && model.state <= 7) {
if (model.state > comboNumberForMy) {
comboNumberForMy = model.state;
}
}
if (onItemClickListener != null) {
onItemClickListener.onItemClick(model.state + "", -1);
}
} else {
if (isOneOverForMy == 1) {
isOneOverForMy = 0;
onSendNotOneOver();
}
if (isOneOverForOther == -1) {
isOneOverForOther = 1;
}
if (model.state == 13 && comboNumberForOther == 0) {
comboNumberForOther = 1;
} else if (model.state >= 2 && model.state <= 7) {
if (model.state > comboNumberForOther) {
comboNumberForOther = model.state;
}
}
}
}
@Override
public boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model) {
System.out.println("游戏结束 :" + isOneOverForMy + "|" + comboNumberForMy);
if (isOneOverForMy == 1 && comboNumberForMy > 1) {
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_0);
} else if (comboNumberForMy > 0) {
switch (comboNumberForMy) {
case 1:
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_1);
break;
case 2:
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_2);
break;
case 3:
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_3);
break;
case 4:
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_4);
break;
case 5:
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_5);
break;
case 6:
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_6);
break;
case 7:
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_7);
break;
}
}
Bus.get().post(new CheckRemainingBalanceEvent(null)
.setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE)
.setActivityGame(true)
.setMgCommonGameSettle(model));
return false;
}
@Override
public void destroy() {
isAddRobot = true;
reset();
}
public void onAddAiPlayer() {
if (isAddRobot && getPlayerSize() == 1) {
LiveNetManager.get(AppManager.getInstance().getMainActivity())
.ballClearanceTableAiAdd(data.getSudGameRoomId(), new HttpCallback<>() {
@Override
public void onSuccess(SudGameAiInfo data) {
if (data != null) {
aiInfo = data;
}
}
@Override
public void onError(String error) {
}
});
}
}
private void onSendNotOneOver() {
LiveNetManager.get(AppManager.getInstance().getMainActivity())
.ballClearanceTableStatus(data.getSudGameRoomId(), new HttpCallback<BaseModel>() {
@Override
public void onSuccess(BaseModel data) {
ToastUtil.show("标记一杆清台失败");
}
@Override
public void onError(String error) {
ToastUtil.show("标记一杆清台失败 错误:" + error);
}
});
}
}

View File

@ -11,6 +11,8 @@ import android.widget.Toast;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.BuildConfig;
import com.yunbao.common.event.CheckRemainingBalanceEvent;
import com.yunbao.common.manager.RandomSudGameManager;
import com.yunbao.common.sud.decorator.SudFSMMGCache;
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
import com.yunbao.common.sud.decorator.SudFSMMGListener;
@ -19,6 +21,7 @@ import com.yunbao.common.sud.model.GameConfigModel;
import com.yunbao.common.sud.model.GameViewInfoModel;
import com.yunbao.common.sud.state.MGStateResponse;
import com.yunbao.common.sud.state.SudMGPMGState;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.SudJsonUtils;
import com.yunbao.common.utils.ToastUtil;
@ -127,7 +130,8 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
public void onFailure(int errCode, String errMsg) {
// TODO: 2022/6/13 下面toast可以根据业务需要决定是否保留
if (isTestEnv()) {
Toast.makeText(activity, "initSDK onFailure:" + errMsg + "(" + errCode + ")", Toast.LENGTH_LONG).show();
//Toast.makeText(activity, "initSDK onFailure:" + errMsg + "(" + errCode + ")", Toast.LENGTH_LONG).show();
ToastUtil.show("initSDK onFailure:" + errMsg + "(" + errCode + ")");
}
delayLoadGame(activity, gameId);
@ -491,7 +495,17 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
@Override
public void onGameMGCommonGameSettle(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameSettle model) {
LogUtils.e("yqw=====>"+model);
if(RandomSudGameManager.getManager().onGameMGCommonGameSettle(model)){
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE).setMgCommonGameSettle(model));
}
}
/**
* 台球回调
*/
@Override
public void onGameMGCommonGameBilliardsHitState(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameBilliardsHitState model) {
SudFSMMGListener.super.onGameMGCommonGameBilliardsHitState(handle, model);
RandomSudGameManager.getManager().onGameMGCommonGameBilliardsHitState(model);
}
}

View File

@ -21,6 +21,7 @@ import com.yunbao.common.sud.model.GameConfigModel;
import com.yunbao.common.sud.model.GameViewInfoModel;
import com.yunbao.common.sud.state.SudMGPMGState;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import java.util.ArrayList;
import java.util.Collections;
@ -74,7 +75,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
private SudGameScoreBean sudGameScoreBean;//房间金豆的门槛和赢家奖励
private List<SudGameInfoBean> sudGameInfoBeanList = new ArrayList<>();//玩家信息
public final MutableLiveData<List<SudSettleBean>> listMutableLiveData = new MutableLiveData<>();//玩家排名信息
public final MutableLiveData<SudMGPMGState.MGCommonGameSettle> listMutableLiveData = new MutableLiveData<>();//玩家排名信息
public void setSudGameInfoBeanList(List<SudGameInfoBean> sudGameInfoBeanList) {
this.sudGameInfoBeanList = sudGameInfoBeanList;
@ -94,7 +95,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
*/
@Override
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
if (WordUtil.isNewZh()) {
languageCode = "zh-TW";
} else {
languageCode = "en-US";
@ -203,27 +204,29 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
String uid = playerResult.uid;
int rank = playerResult.rank;
SudGameInfoBean sudGameInfoBean = findGameInfoBean(uid);
System.out.println("查找游戏信息" + sudGameInfoBean);
if (sudGameInfoBean == null) return;
if (sudGameScoreBean.getGame_mode() == 1) {
//双人游戏
if (winnerNUm == 1){
if (winnerNUm == 1) {
winNum = (rank == 1) ? (int) (sudGameScoreBean.getRoom_sill() * 0.8) : -sudGameScoreBean.getRoom_sill();
}else {
} else {
winNum = -sudGameScoreBean.getRoom_ticket();
}
} else {
//多人游戏
if (rank == 1){
winNum = (playerNum*sudGameScoreBean.getRoom_win_num()-winnerNUm*sudGameScoreBean.getRoom_sill())/winnerNUm;
}else {
if (rank == 1) {
winNum = (playerNum * sudGameScoreBean.getRoom_win_num() - winnerNUm * sudGameScoreBean.getRoom_sill()) / winnerNUm;
} else {
winNum = -sudGameScoreBean.getRoom_sill();
}
}
settleBeans.add(new SudSettleBean(uid,sudGameInfoBean.getNick_name(),sudGameInfoBean.getAvatar_url(),rank,winNum));
settleBeans.add(new SudSettleBean(uid, sudGameInfoBean.getNick_name(), sudGameInfoBean.getAvatar_url(), rank, winNum));
}
mgCommonGameSettle.sudSettleBeans = settleBeans;
// 更新LiveData
listMutableLiveData.setValue(settleBeans);
listMutableLiveData.setValue(mgCommonGameSettle);
}
// 统计第一名的玩家数量

View File

@ -10,8 +10,11 @@ import android.util.Log;
import com.blankj.utilcode.util.LogUtils;
import com.yunbao.common.event.CheckRemainingBalanceEvent;
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;
@ -80,6 +83,9 @@ public class SudFSMMGDecorator implements ISudFSMMG {
if (listener != null) {
listener.onGameStarted();
}
Bus.get().post(new CheckRemainingBalanceEvent(null)
.setSudMGPMGState(SudMGPMGState.MG_GAME_LOAD_OVER)
);
}
/**
@ -178,11 +184,10 @@ public class SudFSMMGDecorator implements ISudFSMMG {
} else {
listener.onGameMGCommonGameSettle(handle, mgCommonGameSettle);
}
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE).setMgCommonGameSettle(mgCommonGameSettle));
break;
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: // 4. 加入游戏按钮点击状态
SudMGPMGState.MGCommonSelfClickJoinBtn mgCommonSelfClickJoinBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickJoinBtn.class);
Bus.get().post(new CheckRemainingBalanceEvent().setSeatIndex(mgCommonSelfClickJoinBtn.seatIndex).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN).setSubReady(false));
Bus.get().post(new CheckRemainingBalanceEvent(null).setSeatIndex(mgCommonSelfClickJoinBtn.seatIndex).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN).setSubReady(false));
// if (listener == null) {
// ISudFSMStateHandleUtils.handleSuccess(handle);
// } else {
@ -216,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);
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN));
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN));
// if (listener == null) {
// ISudFSMStateHandleUtils.handleSuccess(handle);
// } else {
@ -236,7 +241,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
SudMGPMGState.MGCommonGameState mgCommonGameState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameState.class);
sudFSMMGCache.onGameMGCommonGameState(mgCommonGameState);
if (mgCommonGameState.gameState == 2) {
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
}
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
@ -259,7 +264,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
// } else {
// listener.onGameMGCommonSelfClickGameSettleAgainBtn(handle, mgCommonSelfClickGameSettleAgainBtn);
// }
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
break;
case SudMGPMGState.MG_COMMON_GAME_SOUND_LIST: // 13. 游戏上报游戏中的声音列表2021-12-30新增现在只支持碰碰我最强
SudMGPMGState.MGCommonGameSoundList mgCommonGameSoundList = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSoundList.class);
@ -533,6 +538,102 @@ public class SudFSMMGDecorator implements ISudFSMMG {
listener.onGameMGCommonHideGameScene(handle, mgCommonHideGameScene);
}
break;
case SudMGPMGState.MG_COMMON_SELF_CLICK_GOLD_BTN: // 46. 通知app点击了游戏的金币按钮(赛车)
SudMGPMGState.MGCommonSelfClickGoldBtn mgCommonSelfClickGoldBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickGoldBtn.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonSelfClickGoldBtn(handle, mgCommonSelfClickGoldBtn);
}
break;
case SudMGPMGState.MG_COMMON_GAME_PIECE_ARRIVE_END: // 47. 通知app棋子到达终点(ludo)
SudMGPMGState.MGCommonGamePieceArriveEnd mgCommonGamePieceArriveEnd = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePieceArriveEnd.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGamePieceArriveEnd(handle, mgCommonGamePieceArriveEnd);
}
break;
case SudMGPMGState.MG_COMMON_GAME_PLAYER_MANAGED_STATE: // 48. 通知app玩家是否托管
SudMGPMGState.MGCommonGamePlayerManagedState mgCommonGamePlayerManagedState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerManagedState.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGamePlayerManagedState(handle, mgCommonGamePlayerManagedState);
}
break;
case SudMGPMGState.MG_COMMON_GAME_SEND_BURST_WORD: // 49. 游戏向app发送爆词
SudMGPMGState.MGCommonGameSendBurstWord mgCommonGameSendBurstWord = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSendBurstWord.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGameSendBurstWord(handle, mgCommonGameSendBurstWord);
}
break;
case SudMGPMGState.MG_COMMON_GAME_PLAYER_RANKS: // 50. 游戏向app发送玩家实时排名只支持怪物消消乐
SudMGPMGState.MGCommonGamePlayerRanks mgCommonGamePlayerRanks = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerRanks.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGamePlayerRanks(handle, mgCommonGamePlayerRanks);
}
break;
case SudMGPMGState.MG_COMMON_GAME_PLAYER_PAIR_SINGULAR: // 51. 游戏向app发送玩家即时变化的单双牌只支持okey101
SudMGPMGState.MGCommonGamePlayerPairSingular mgCommonGamePlayerPairSingular = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerPairSingular.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGamePlayerPairSingular(handle, mgCommonGamePlayerPairSingular);
}
break;
case SudMGPMGState.MG_COMMON_GAME_PLAYER_MONOPOLY_CARDS: // 52. 游戏向app发送获取玩家持有的道具卡只支持大富翁
SudMGPMGState.MGCommonGamePlayerMonopolyCards mgCommonGamePlayerMonopolyCards = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerMonopolyCards.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGamePlayerMonopolyCards(handle, mgCommonGamePlayerMonopolyCards);
}
break;
case SudMGPMGState.MG_COMMON_GAME_PLAYER_SCORES: // 53. 游戏向app发送玩家实时积分只支持怪物消消乐
SudMGPMGState.MGCommonGamePlayerScores mgCommonGamePlayerScores = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerScores.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGamePlayerScores(handle, mgCommonGamePlayerScores);
}
break;
case SudMGPMGState.MG_COMMON_DESTROY_GAME_SCENE: // 54. 游戏通知app销毁游戏只支持部分概率类游戏
SudMGPMGState.MGCommonDestroyGameScene mgCommonDestroyGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonDestroyGameScene.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonDestroyGameScene(handle, mgCommonDestroyGameScene);
}
break;
case SudMGPMGState.MG_COMMON_GAME_BILLIARDS_HIT_STATE: // 55. 游戏通知app击球状态只支持桌球
SudMGPMGState.MGCommonGameBilliardsHitState mgCommonGameBilliardsHitState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameBilliardsHitState.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGameBilliardsHitState(handle, mgCommonGameBilliardsHitState);
}
break;
case SudMGPMGState.MG_COMMON_GAME_PLAYER_PROPS_CARDS: // 56. 游戏向app发送获取玩家持有的指定点数道具卡只支持飞行棋
SudMGPMGState.MGCommonGamePlayerPropsCards mgCommonGamePlayerPropsCards = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerPropsCards.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGamePlayerPropsCards(handle, mgCommonGamePlayerPropsCards);
}
break;
case SudMGPMGState.MG_COMMON_GAME_INFO_X: // 57. 游戏向app发送获游戏通用数据
SudMGPMGState.MGCommonGameInfoX mgCommonGameInfoX = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameInfoX.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCommonGameInfoX(handle, mgCommonGameInfoX);
}
break;
case SudMGPMGState.MG_COMMON_GAME_DISCO_ACTION: // 1. 元宇宙砂砂舞指令回调
SudMGPMGState.MGCommonGameDiscoAction mgCommonGameDiscoAction = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameDiscoAction.class);
if (listener == null) {
@ -749,39 +850,15 @@ public class SudFSMMGDecorator implements ISudFSMMG {
listener.onGameMGCustomRocketSaveSignColor(handle, mgCustomRocketSaveSignColor);
}
break;
case SudMGPMGState.MG_BASEBALL_RANKING: // 1. 查询排行榜数据(棒球)
SudMGPMGState.MGBaseballRanking mgBaseballRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRanking.class);
case SudMGPMGState.MG_BASEBALL_DEFUALT_STATE: // 1. 设置界面默认状态(棒球)
SudMGPMGState.MGBaseballDefaultState mgBaseballDefaultState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballDefaultState.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGBaseballRanking(handle, mgBaseballRanking);
listener.onGameMGBaseballDefaultState(handle, mgBaseballDefaultState);
}
break;
case SudMGPMGState.MG_BASEBALL_MY_RANKING: // 2. 查询我的排名(棒球)
SudMGPMGState.MGBaseballMyRanking mgBaseballMyRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballMyRanking.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGBaseballMyRanking(handle, mgBaseballMyRanking);
}
break;
case SudMGPMGState.MG_BASEBALL_RANGE_INFO: // 3. 查询当前距离我的前后玩家数据(棒球)
SudMGPMGState.MGBaseballRangeInfo mgBaseballRangeInfo = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRangeInfo.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGBaseballRangeInfo(handle, mgBaseballRangeInfo);
}
break;
case SudMGPMGState.MG_BASEBALL_SET_CLICK_RECT: // 4. 设置app提供给游戏可点击区域(棒球)
SudMGPMGState.MGBaseballSetClickRect mgBaseballSetClickRect = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballSetClickRect.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGBaseballSetClickRect(handle, mgBaseballSetClickRect);
}
break;
case SudMGPMGState.MG_BASEBALL_PREPARE_FINISH: // 5. 前期准备完成(棒球)
case SudMGPMGState.MG_BASEBALL_PREPARE_FINISH: // 2. 前期准备完成(棒球)
SudMGPMGState.MGBaseballPrepareFinish mgBaseballPrepareFinish = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballPrepareFinish.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
@ -789,7 +866,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
listener.onGameMGBaseballPrepareFinish(handle, mgBaseballPrepareFinish);
}
break;
case SudMGPMGState.MG_BASEBALL_SHOW_GAME_SCENE: // 6. 主界面已显示(棒球)
case SudMGPMGState.MG_BASEBALL_SHOW_GAME_SCENE: // 3. 主界面已显示(棒球)
SudMGPMGState.MGBaseballShowGameScene mgBaseballShowGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballShowGameScene.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
@ -797,7 +874,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
listener.onGameMGBaseballShowGameScene(handle, mgBaseballShowGameScene);
}
break;
case SudMGPMGState.MG_BASEBALL_HIDE_GAME_SCENE: // 7. 主界面已隐藏(棒球)
case SudMGPMGState.MG_BASEBALL_HIDE_GAME_SCENE: // 4. 主界面已隐藏(棒球)
SudMGPMGState.MGBaseballHideGameScene mgBaseballHideGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballHideGameScene.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
@ -805,7 +882,39 @@ public class SudFSMMGDecorator implements ISudFSMMG {
listener.onGameMGBaseballHideGameScene(handle, mgBaseballHideGameScene);
}
break;
case SudMGPMGState.MG_BASEBALL_TEXT_CONFIG: // 8. 获取文本配置数据(棒球)
case SudMGPMGState.MG_BASEBALL_RANKING: // 5. 查询排行榜数据(棒球)
SudMGPMGState.MGBaseballRanking mgBaseballRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRanking.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGBaseballRanking(handle, mgBaseballRanking);
}
break;
case SudMGPMGState.MG_BASEBALL_MY_RANKING: // 6. 查询我的排名(棒球)
SudMGPMGState.MGBaseballMyRanking mgBaseballMyRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballMyRanking.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGBaseballMyRanking(handle, mgBaseballMyRanking);
}
break;
case SudMGPMGState.MG_BASEBALL_RANGE_INFO: // 7. 查询当前距离我的前后玩家数据(棒球)
SudMGPMGState.MGBaseballRangeInfo mgBaseballRangeInfo = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRangeInfo.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGBaseballRangeInfo(handle, mgBaseballRangeInfo);
}
break;
case SudMGPMGState.MG_BASEBALL_SET_CLICK_RECT: // 8. 设置app提供给游戏可点击区域(棒球)
SudMGPMGState.MGBaseballSetClickRect mgBaseballSetClickRect = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballSetClickRect.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGBaseballSetClickRect(handle, mgBaseballSetClickRect);
}
break;
case SudMGPMGState.MG_BASEBALL_TEXT_CONFIG: // 9. 获取文本配置数据(棒球)
SudMGPMGState.MGBaseballTextConfig mgBaseballTextConfig = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballTextConfig.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
@ -813,6 +922,30 @@ public class SudFSMMGDecorator implements ISudFSMMG {
listener.onGameMGBaseballTextConfig(handle, mgBaseballTextConfig);
}
break;
case SudMGPMGState.MG_BASEBALL_SEND_DISTANCE: // 10. 球落地, 通知距离(棒球)
SudMGPMGState.MGBaseballSendDistance mgBaseballSendDistance = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballSendDistance.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGBaseballSendDistance(handle, mgBaseballSendDistance);
}
break;
case SudMGPMGState.MG_CUSTOM_CR_ROOM_INIT_DATA: // 1. 请求房间数据
SudMGPMGState.MGCustomCrRoomInitData mgCustomCrRoomInitData = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCustomCrRoomInitData.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCustomCrRoomInitData(handle, mgCustomCrRoomInitData);
}
break;
case SudMGPMGState.MG_CUSTOM_CR_CLICK_SEAT: // 2. 点击主播位或老板位通知
SudMGPMGState.MGCustomCrClickSeat mgCustomCrClickSeat = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCustomCrClickSeat.class);
if (listener == null) {
ISudFSMStateHandleUtils.handleSuccess(handle);
} else {
listener.onGameMGCustomCrClickSeat(handle, mgCustomCrClickSeat);
}
break;
default:
ISudFSMStateHandleUtils.handleSuccess(handle);
break;
@ -844,6 +977,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
} else {
listener.onPlayerMGCommonPlayerIn(handle, userId, mgCommonPlayerIn);
}
Bus.get().post(new CheckRemainingBalanceEvent(userId).setSudMGPMGState(SudMGPMGState.MG_COMMON_PLAYER_IN).setPlayerIn(mgCommonPlayerIn));
break;
case SudMGPMGState.MG_COMMON_PLAYER_READY: // 2.准备状态已修改
@ -863,6 +997,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
} else {
listener.onPlayerMGCommonPlayerCaptain(handle, userId, mgCommonPlayerCaptain);
}
Bus.get().post(new CheckRemainingBalanceEvent(userId).setSudMGPMGState(SudMGPMGState.MG_COMMON_PLAYER_CAPTAIN));
break;
case SudMGPMGState.MG_COMMON_PLAYER_PLAYING: // 4.游戏状态已修改
SudMGPMGState.MGCommonPlayerPlaying mgCommonPlayerPlaying = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonPlayerPlaying.class);

View File

@ -6,6 +6,8 @@
package com.yunbao.common.sud.state;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.bean.SudActivityGameInfoBean;
import com.yunbao.common.bean.SudSettleBean;
import java.io.Serializable;
import java.util.List;
@ -15,7 +17,10 @@ import java.util.List;
* 参考文档https://docs.sud.tech/zh-CN/app/Client/MGFSM/
*/
public class SudMGPMGState implements Serializable {
/**
* 自定义的游戏加载完毕的通知
*/
public static final String MG_GAME_LOAD_OVER="game_load_over";
// region MG状态机-通用状态-游戏
// 参考文档https://docs.sud.tech/zh-CN/app/Client/MGFSM/CommonStateGame.html
/**
@ -113,6 +118,24 @@ public class SudMGPMGState implements Serializable {
@SerializedName(value = "tr-TR")
public String tr_TR; // 土耳其语
@SerializedName(value = "pt-PT")
public String pt_PT; // 葡萄语
@SerializedName(value = "hi-IN")
public String hi_IN; // 印地语
@SerializedName(value = "bn-BD")
public String bn_BD; // 孟加拉语
@SerializedName(value = "tl-PH")
public String tl_PH; // 塔加路语(菲律宾)
@SerializedName(value = "fa-IR")
public String fa_IR; // 波斯语(伊朗)
@SerializedName(value = "ru-RU")
public String ru_RU; // 俄罗斯语
}
public static class MGCommonPublicMessageMsgUser implements Serializable {
@ -169,7 +192,9 @@ public class SudMGPMGState implements Serializable {
// 游戏结果玩家列表
public List<PlayerResult> results;
public List<SudActivityGameInfoBean> activityGameInfoBean;
public List<SudSettleBean> sudSettleBeans;
public String achievement;
@Override
public String toString() {
return "MGCommonGameSettle{" +
@ -790,6 +815,178 @@ public class SudMGPMGState implements Serializable {
*/
public static class MGCommonHideGameScene implements Serializable {
}
/**
* 46. 通知app点击了游戏的金币按钮(赛车)
*/
public static final String MG_COMMON_SELF_CLICK_GOLD_BTN = "mg_common_self_click_gold_btn";
/**
* 46. 通知app点击了游戏的金币按钮(赛车) 模型
*/
public static class MGCommonSelfClickGoldBtn implements Serializable {
}
/**
* 47. 通知app棋子到达终点(ludo)
*/
public static final String MG_COMMON_GAME_PIECE_ARRIVE_END = "mg_common_game_piece_arrive_end";
/**
* 47. 通知app棋子到达终点(ludo) 模型
*/
public static class MGCommonGamePieceArriveEnd implements Serializable {
public String uid; // 玩家id
public int pieceIndex; // 棋子编号 0 ~ 3
}
/**
* 48. 通知app玩家是否托管
*/
public static final String MG_COMMON_GAME_PLAYER_MANAGED_STATE = "mg_common_game_player_managed_state";
/**
* 48. 通知app玩家是否托管 模型
*/
public static class MGCommonGamePlayerManagedState implements Serializable {
public String uid; // 玩家id
public int managed; // 0: 未托管 1托管
}
/**
* 49. 游戏向app发送爆词
*/
public static final String MG_COMMON_GAME_SEND_BURST_WORD = "mg_common_game_send_burst_word";
/**
* 49. 游戏向app发送爆词 模型
*/
public static class MGCommonGameSendBurstWord implements Serializable {
public String text; // 爆词
}
/**
* 50. 游戏向app发送玩家实时排名只支持怪物消消乐
*/
public static final String MG_COMMON_GAME_PLAYER_RANKS = "mg_common_game_player_ranks";
/**
* 50. 游戏向app发送玩家实时排名只支持怪物消消乐 模型
*/
public static class MGCommonGamePlayerRanks implements Serializable {
public List<RanksModel> ranks; // 所有玩家排名变化推送
public static class RanksModel implements Serializable {
public String uid; // 用户id
public int rank; // 排名
}
}
/**
* 51. 游戏向app发送玩家即时变化的单双牌只支持okey101
*/
public static final String MG_COMMON_GAME_PLAYER_PAIR_SINGULAR = "mg_common_game_player_pair_singular";
/**
* 51. 游戏向app发送玩家即时变化的单双牌只支持okey101 模型
*/
public static class MGCommonGamePlayerPairSingular implements Serializable {
public List<SingularModel> pairs; // 玩家单双牌推送
public static class SingularModel implements Serializable {
public String uid; // 用户id
public int pair; // pair: 1 0
}
}
/**
* 52. 游戏向app发送获取玩家持有的道具卡只支持大富翁
*/
public static final String MG_COMMON_GAME_PLAYER_MONOPOLY_CARDS = "mg_common_game_player_monopoly_cards";
/**
* 52. 游戏向app发送获取玩家持有的道具卡只支持大富翁 模型
*/
public static class MGCommonGamePlayerMonopolyCards implements Serializable {
}
/**
* 53. 游戏向app发送玩家实时积分只支持怪物消消乐
*/
public static final String MG_COMMON_GAME_PLAYER_SCORES = "mg_common_game_player_scores";
/**
* 53. 游戏向app发送玩家实时积分只支持怪物消消乐 模型
*/
public static class MGCommonGamePlayerScores implements Serializable {
public List<ScoresModel> scores; // 所有玩家积分变化推送
public static class ScoresModel implements Serializable {
public String uid; // 用户id
public int score; // 积分
}
}
/**
* 54. 游戏通知app销毁游戏只支持部分概率类游戏
*/
public static final String MG_COMMON_DESTROY_GAME_SCENE = "mg_common_destroy_game_scene";
/**
* 54. 游戏通知app销毁游戏只支持部分概率类游戏 模型
*/
public static class MGCommonDestroyGameScene implements Serializable {
}
/**
* 55. 游戏通知app击球状态只支持桌球
*/
public static final String MG_COMMON_GAME_BILLIARDS_HIT_STATE = "mg_common_game_billiards_hit_state";
/**
* 55. 游戏通知app击球状态只支持桌球 模型
*/
public static class MGCommonGameBilliardsHitState implements Serializable {
public String uid; // 操作玩家的id
/**
* state状态说明:
* 0: 母球击空或者第一击没击中目标球
* 2-7: 连杆
* 8: 白球进洞
* 9: 没有足够的撞库数量
* 10: 开球时进了黑八
* 11: 提前进了黑八
* 12: 没有有效进球
* 13: 有有效进球
* 14: 超时
*/
public int state;
}
/**
* 56. 游戏向app发送获取玩家持有的指定点数道具卡只支持飞行棋
*/
public static final String MG_COMMON_GAME_PLAYER_PROPS_CARDS = "mg_common_game_player_props_cards";
/**
* 56. 游戏向app发送获取玩家持有的指定点数道具卡只支持飞行棋 模型
*/
public static class MGCommonGamePlayerPropsCards implements Serializable {
}
/**
* 57. 游戏向app发送获游戏通用数据
*/
public static final String MG_COMMON_GAME_INFO_X = "mg_common_game_info_x";
/**
* 57. 游戏向app发送获游戏通用数据 模型
*/
public static class MGCommonGameInfoX implements Serializable {
public String eventName; // 事件名称 具体游戏参考如下
public String data; // 具体的数据为一个JSON字符串 具体游戏参考如下
}
// endregion 通用状态-游戏
// region MG状态机-通用状态-玩家
@ -818,6 +1015,16 @@ public class SudMGPMGState implements Serializable {
// 当reason==1时有效kickUID为踢人的用户uid判断被踢的人是本人条件(onPlayerStateChange(userId==kickedUID == selfUID)kickUID默认""无意义便于处理
public String kickUID;
@Override
public String toString() {
return "MGCommonPlayerIn{" +
"isIn=" + isIn +
", teamId=" + teamId +
", reason=" + reason +
", kickUID='" + kickUID + '\'' +
'}';
}
}
/**
@ -1078,6 +1285,7 @@ public class SudMGPMGState implements Serializable {
public static final class MGCommonGameDiscoAction implements Serializable {
public int actionId; // 指令序号类型
public boolean isSuccess; // true 指令成功false 指令失败
public int errCode; // 返回码
}
/**
@ -1426,13 +1634,60 @@ public class SudMGPMGState implements Serializable {
// region 棒球
/**
* 1. 查询排行榜数据(棒球)
* 1. 设置界面默认状态(棒球)
*/
public static final String MG_BASEBALL_DEFUALT_STATE = "mg_baseball_defualt_state";
/**
* 1. 设置界面默认状态(棒球) 模型
*/
public static final class MGBaseballDefaultState implements Serializable {
}
/**
* 2. 前期准备完成(棒球)
* 游戏客户端通知APP指令动作前期准备完成
*/
public static final String MG_BASEBALL_PREPARE_FINISH = "mg_baseball_prepare_finish";
/**
* 2. 前期准备完成(棒球) 模型
*/
public static final class MGBaseballPrepareFinish implements Serializable {
}
/**
* 3. 主界面已显示(棒球)
* 游戏客户端通知APP指令动作主界面已显示
*/
public static final String MG_BASEBALL_SHOW_GAME_SCENE = "mg_baseball_show_game_scene";
/**
* 3. 主界面已显示(棒球) 模型
*/
public static final class MGBaseballShowGameScene implements Serializable {
}
/**
* 4. 主界面已隐藏(棒球)
* 游戏客户端通知APP指令动作主界面已隐藏
*/
public static final String MG_BASEBALL_HIDE_GAME_SCENE = "mg_baseball_hide_game_scene";
/**
* 4. 主界面已隐藏(棒球) 模型
*/
public static final class MGBaseballHideGameScene implements Serializable {
}
/**
* 5. 查询排行榜数据(棒球)
* 游戏客户端通知APP查询排行榜数据
*/
public static final String MG_BASEBALL_RANKING = "mg_baseball_ranking";
/**
* 1. 查询排行榜数据(棒球) 模型
* 5. 查询排行榜数据(棒球) 模型
*/
public static final class MGBaseballRanking implements Serializable {
public int page; // 页数
@ -1440,89 +1695,65 @@ public class SudMGPMGState implements Serializable {
}
/**
* 2. 查询我的排名(棒球)
* 6. 查询我的排名(棒球)
* 游戏客户端通知APP查询我的排名
*/
public static final String MG_BASEBALL_MY_RANKING = "mg_baseball_my_ranking";
/**
* 2. 查询我的排名(棒球) 模型
* 6. 查询我的排名(棒球) 模型
*/
public static final class MGBaseballMyRanking implements Serializable {
}
/**
* 3. 查询当前距离我的前后玩家数据(棒球)
* 7. 查询当前距离我的前后玩家数据(棒球)
* 游戏客户端通知APP查询当前距离我的前后玩家数据需要排除自己
*/
public static final String MG_BASEBALL_RANGE_INFO = "mg_baseball_range_info";
/**
* 3. 查询当前距离我的前后玩家数据(棒球) 模型
* 7. 查询当前距离我的前后玩家数据(棒球) 模型
*/
public static final class MGBaseballRangeInfo implements Serializable {
public long distance; // 自己当前的距离
}
/**
* 4. 设置app提供给游戏可点击区域(棒球)
* 8. 设置app提供给游戏可点击区域(棒球)
* 游戏客户端通知APP指令动作设置点击区域
*/
public static final String MG_BASEBALL_SET_CLICK_RECT = "mg_baseball_set_click_rect";
/**
* 4. 设置app提供给游戏可点击区域(棒球) 模型
* 8. 设置app提供给游戏可点击区域(棒球) 模型
*/
public static final class MGBaseballSetClickRect implements Serializable {
public List<InteractionClickRect> list;
}
/**
* 5. 前期准备完成(棒球)
* 游戏客户端通知APP指令动作前期准备完成
*/
public static final String MG_BASEBALL_PREPARE_FINISH = "mg_baseball_prepare_finish";
/**
* 5. 前期准备完成(棒球) 模型
*/
public static final class MGBaseballPrepareFinish implements Serializable {
}
/**
* 6. 主界面已显示(棒球)
* 游戏客户端通知APP指令动作主界面已显示
*/
public static final String MG_BASEBALL_SHOW_GAME_SCENE = "mg_baseball_show_game_scene";
/**
* 6. 主界面已显示(棒球) 模型
*/
public static final class MGBaseballShowGameScene implements Serializable {
}
/**
* 7. 主界面已隐藏(棒球)
* 游戏客户端通知APP指令动作主界面已隐藏
*/
public static final String MG_BASEBALL_HIDE_GAME_SCENE = "mg_baseball_hide_game_scene";
/**
* 7. 主界面已隐藏(棒球) 模型
*/
public static final class MGBaseballHideGameScene implements Serializable {
}
/**
* 8. 获取文本配置数据(棒球)
* 9. 获取文本配置数据(棒球)
*/
public static final String MG_BASEBALL_TEXT_CONFIG = "mg_baseball_text_config";
/**
* 8. 获取文本配置数据(棒球) 模型
* 9. 获取文本配置数据(棒球) 模型
*/
public static final class MGBaseballTextConfig implements Serializable {
}
/**
* 10. 球落地, 通知距离(棒球)
*/
public static final String MG_BASEBALL_SEND_DISTANCE = "mg_baseball_send_distance";
/**
* 10. 球落地, 通知距离(棒球) 模型
*/
public static final class MGBaseballSendDistance implements Serializable {
public int[] distances;
}
// endregion 棒球
/** 点击区域定义 */
@ -1533,4 +1764,29 @@ public class SudMGPMGState implements Serializable {
public float height; // 区域的height
}
// region 3D语聊房
/**
* 1. 请求房间数据
*/
public static final String MG_CUSTOM_CR_ROOM_INIT_DATA = "mg_custom_cr_room_init_data";
/**
* 1. 请求房间数据 模型
*/
public static final class MGCustomCrRoomInitData implements Serializable {
}
/**
* 2. 点击主播位或老板位通知
*/
public static final String MG_CUSTOM_CR_CLICK_SEAT = "mg_custom_cr_click_seat";
/**
* 2. 点击主播位或老板位通知 模型
*/
public static final class MGCustomCrClickSeat implements Serializable {
public int seatIndex; // 0~4一共5个麦位0为老板位1~4为四个面主播位
}
// endregion 3D语聊房
}

View File

@ -179,15 +179,6 @@ public class AppManager {
activityStack.clear();
}
/**
* 仅在debug下运行的代码
*/
public static void runDebugCode(Runnable runnable) {
if (BuildConfig.DEBUG) {
runnable.run();
}
}
/**
* 退出应用程序

View 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();
}
}
}

View File

@ -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);
}
}

View File

@ -9,6 +9,7 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants;
import com.yunbao.common.HtmlConfig;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.RedPacketListBean;
import com.yunbao.common.manager.IMLoginManager;
@ -69,10 +70,11 @@ public class RouteUtil {
.navigation();
}
public static void forwardSwSudGameActivity(String CreateSudRoom, boolean isAn, boolean isHome) {
public static void forwardSwSudGameActivity(String CreateSudRoom, boolean isActivityGame,boolean isRandomRankUser, boolean isHome) {
ARouter.getInstance().build(PATH_SudSwGameActivity)
.withString("CreateSudRoom", CreateSudRoom)
.withBoolean("CreateIsAn", isAn)
.withBoolean("isActivity", isActivityGame)
.withBoolean("isRandomRankUser", isRandomRankUser)
.withBoolean("CreateIsHome", isHome)
.navigation();
}

View File

@ -1,6 +1,7 @@
package com.yunbao.common.views;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
@ -22,6 +23,7 @@ import com.yunbao.common.bean.CheckRemainingBalance;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.SudActivityGameInfoBean;
import com.yunbao.common.bean.SudGameInfoBean;
import com.yunbao.common.bean.SudGameScoreBean;
import com.yunbao.common.dialog.SudGameDoubleDialog;
@ -36,14 +38,17 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.RandomSudGameManager;
import com.yunbao.common.sud.QuickStartGameViewModel;
import com.yunbao.common.sud.model.GameConfigModel;
import com.yunbao.common.sud.model.GameViewInfoModel;
import com.yunbao.common.sud.state.SudMGPAPPState;
import com.yunbao.common.sud.state.SudMGPMGState;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import org.greenrobot.eventbus.Subscribe;
@ -69,6 +74,8 @@ public class LiveSudGamePopup extends BottomPopupView {
private SudGameDoubleDialog sudGameDoubleDialog;//双人游戏弹窗
private SudGameMultipleDialog sudGameMultipleDialog;//多人游戏弹窗
private SudLoadDialog sudLoadDialog;//加载弹窗
private boolean isActivityGame;
private boolean isRandomRankUser;
public LiveSudGamePopup(@NonNull Context context, long interactionID, String liveUid) {
super(context);
@ -84,7 +91,9 @@ public class LiveSudGamePopup extends BottomPopupView {
//第二次进入时viewmodel数据丢失所以初始化时直接获取
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),getActivity());
IMLoginManager.get(context).setSudGame("");
if (isActivityGame) {
RandomSudGameManager.getManager().setGameViewModel(gameViewModel);
}
// 设置游戏安全操作区域
GameViewInfoModel.GameViewRectModel gameViewRectModel = new GameViewInfoModel.GameViewRectModel();
gameViewRectModel.left = 0;
@ -97,6 +106,7 @@ public class LiveSudGamePopup extends BottomPopupView {
sudGameDoubleDialog = new SudGameDoubleDialog(context);//双人游戏
sudGameMultipleDialog = new SudGameMultipleDialog(context);//多人游戏
sudLoadDialog = new SudLoadDialog(context);//加载弹窗
}
// 返回自定义弹窗的布局
@ -115,6 +125,16 @@ public class LiveSudGamePopup extends BottomPopupView {
}
public LiveSudGamePopup setActivityGame(boolean activityGame) {
isActivityGame = activityGame;
return this;
}
public LiveSudGamePopup setRandomRankUser(boolean randomRankUser) {
isRandomRankUser = randomRankUser;
return this;
}
private void initView() {
gameContainer = findViewById(R.id.game_container);
gameTitle = findViewById(R.id.game_title);
@ -201,7 +221,10 @@ public class LiveSudGamePopup extends BottomPopupView {
gameConfigModel.ui.start_btn.custom = true;
// SudMGP平台64bit游戏ID
gameViewModel.switchGame((Activity) getContext(), mLiveUid, mInteractionID);
if(isActivityGame){
sudGameDoubleDialog.setActivityGame();
sudLoadDialog.setActivityGame();
}
//游戏结算结束
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
if (sudLoadDialog.getClickStatus() == 0) {
@ -221,9 +244,13 @@ public class LiveSudGamePopup extends BottomPopupView {
//加载弹窗监听
sudLoadDialog.setOnDismissListener(() -> {
if (sudLoadDialog.getClickStatus() == 2){
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
}
});
//通知活动游戏
if (isActivityGame) {
RandomSudGameManager.getManager().onInitGame(mCreateSudRoomModel);
}
}
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
@ -273,6 +300,9 @@ public class LiveSudGamePopup extends BottomPopupView {
@Subscribe(threadMode = ThreadMode.MAIN)
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
if (isActivityGame) {
RandomSudGameManager.getManager().onGameState(event);
}
switch (event.getSudMGPMGState()) {
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
@ -313,15 +343,61 @@ public class LiveSudGamePopup extends BottomPopupView {
//获取用户信息
LiveNetManager.get(getContext()).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
@Override
public void onSuccess(List<SudGameInfoBean> data) {
if (!data.isEmpty()){
gameViewModel.setSudGameInfoBeanList(data);
gameViewModel.sudGameRank(event.getMgCommonGameSettle());
}else {
ToastUtil.show(getContext().getString(R.string.net_error));
public void onSuccess(List<SudGameInfoBean> infoBean) {
if (!infoBean.isEmpty()) {
System.out.println("结算,是否为游戏活动:" + isActivityGame);
if (isActivityGame) {
loadScore(infoBean, 3);
} else {
gameViewModel.setSudGameInfoBeanList(infoBean);
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
}
} else {
if (isActivityGame) {
showDialog();
} else {
ToastUtil.show(WordUtil.getNewString(R.string.net_error));
}
}
}
private void showDialog() {
DialogUitl.showSimpleDialog(getContext(), WordUtil.isNewZh() ? "結算超時\n請前往活動頁面查看本局結果" :
"Settlement timed out\nPlease check the result on the event page Confirm.", new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
if(sudLoadDialog.isShow()){
sudLoadDialog.dismiss();
}
}
});
}
private void loadScore(List<SudGameInfoBean> infoBean, int index) {
if (index == 0) {
showDialog();
return;
}
LiveNetManager.get(getContext())
.ballClearanceTableGetResultScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<>() {
@Override
public void onSuccess(List<SudActivityGameInfoBean> data) {
if (data.isEmpty()) {
new Handler(Looper.getMainLooper()).postDelayed(() -> {
loadScore(infoBean, index - 1);
}, 500);
return;
}
gameViewModel.setSudGameInfoBeanList(infoBean);
gameViewModel.sudGameRank(event.getMgCommonGameSettle(data));//结算游戏
}
@Override
public void onError(String error) {
}
});
}
@Override
public void onError(String error) {
ToastUtil.show(error);

View File

@ -1,5 +1,6 @@
package com.yunbao.common.views;
import android.app.Dialog;
import android.content.Intent;
import android.os.Handler;
import android.text.TextUtils;
@ -18,7 +19,9 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.SudGameScoreBean;
import com.yunbao.common.bean.SudRoomListModel;
import com.yunbao.common.event.CheckCurrencyModel;
import com.yunbao.common.event.LiveOpenSudRoomEvent;
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
import com.yunbao.common.event.SudGameListDissMissEvent;
@ -28,10 +31,13 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.RandomSudGameManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import java.util.Locale;
@ -42,7 +48,8 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
private RoundedImageView avatarList1, avatarList2, avatarList3, avatarList4, avatarList5;
private ImageView gifImageView;
private ImageView sex, game_icon, gold_coin;
private TextView activityTitle;
private View topLayout;
public SudGameListViewHolder(@NonNull View itemView) {
super(itemView);
@ -60,6 +67,8 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
avatarList5 = itemView.findViewById(R.id.avatar_list5);
gold_coin = itemView.findViewById(R.id.gold_coin);
sex = itemView.findViewById(R.id.sex);
activityTitle = itemView.findViewById(R.id.activityTitle);
topLayout = itemView.findViewById(R.id.topLayout);
avatarList1.setVisibility(View.GONE);
avatarList2.setVisibility(View.GONE);
avatarList3.setVisibility(View.GONE);
@ -84,6 +93,25 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
} else {
ImgLoader.display(itemView.getContext(), R.mipmap.gold_coin, gold_coin);
}
if (TextUtils.equals(model.getIsActivity(), "1")) {
gold_coin.setVisibility(View.GONE);
goldenBeanNumber.setText("");
activityTitle.setVisibility(View.VISIBLE);
topLayout.setBackgroundResource(R.mipmap.bg_game_list_activity_top);
if(WordUtil.isNewZh()){
activityTitle.setTextSize(14);
}else{
activityTitle.setTextSize(10);
}
} else {
gold_coin.setVisibility(View.VISIBLE);
activityTitle.setVisibility(View.GONE);
if(isHome){
topLayout.setBackgroundResource(R.drawable.bg_home_sud_list_sill);
}else{
topLayout.setBackgroundResource(R.drawable.bg_live_sud_list_sill);
}
}
ImgLoader.display(itemView.getContext(), model.getSudgameicon(), game_icon);
ViewClicksAntiShake.clicksAntiShake(itemView.findViewById(R.id.layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
@ -99,80 +127,35 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
}
Bus.get().post(new SudGameListRefreshEvent());
} else {
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
createSudRoomModel.setSudGameId(model.getSudGameId());
createSudRoomModel.setSudGameRoomId(model.getSudGameRoomId());
createSudRoomModel.setAvatar(model.getAvatar());
createSudRoomModel.setRoomName(model.getRoomName());
createSudRoomModel.setSudGameName(model.getSudGameName());
if (isHome) {
if (TextUtils.equals(model.getLiveUid(), "0")) {
if(CommonAppConfig.getInstance().getConfig().isSw()){
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
}else{
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
}
} else {
String yes = "";
if (IMLoginManager.get(itemView.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
yes = "";
} else {
yes = "Yes";
}
new XPopup.Builder(itemView.getContext())
.asCustom(new HintCustomPopup(itemView.getContext(),
itemView.getContext().getString(R.string.interactive_game_search_room_currently_live),
itemView.getContext().getString(R.string.interactive_game_search_room_broadcast_room))
.setLiveOpenOk(yes)
.setLiveOpenCancel(itemView.getContext().getString(R.string.interactive_game_search_room_bhe_game))
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
@Override
public void onSure() {
LiveHttpUtil.getLiveInfo(model.getLiveUid() + "", new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
new LiveRoomCheckLivePresenter(itemView.getContext(), liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal),isSw);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Bus.get().post(new LiveOpenSudRoomEvent().setCreateSudRoomModel(createSudRoomModel));
}
}, 1500);
}
if (TextUtils.equals(model.getIsActivity(), "1")) {
LiveNetManager.get(mAvatar.getContext())
.getScore(model.getSudGameRoomId(), new com.yunbao.common.http.base.HttpCallback<SudGameScoreBean>() {
@Override
public void onSuccess(SudGameScoreBean data) {
if(data.getGolden_bean_remaining_balance()!=1){
RandomSudGameManager.getManager().showNotActivityTicketDialog(itemView.getContext(), true, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
@Override
public void onCheckError(String contextError) {
}
}
});
} else {
RouteUtil.forwardUserHome(itemView.getContext(), model.getLiveUid(), 0);
}
}
});
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
toGame(model, isHome, true);
}
});
return;
}
toGame(model, isHome, true);
}
@Override
public void onCancel() {
if(CommonAppConfig.getInstance().getConfig().isSw()){
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
}else{
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
}
}
})).show();
}
@Override
public void onError(String error) {
}
});
} else {
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel));
Bus.get().post(new SudGameListDissMissEvent());
toGame(model, isHome, false);
}
}
}
@ -187,4 +170,83 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
}
});
}
private void toGame(SudRoomListModel model, boolean isHome,boolean isActivity) {
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
createSudRoomModel.setSudGameId(model.getSudGameId());
createSudRoomModel.setSudGameRoomId(model.getSudGameRoomId());
createSudRoomModel.setAvatar(model.getAvatar());
createSudRoomModel.setRoomName(model.getRoomName());
createSudRoomModel.setSudGameName(model.getSudGameName());
if (isHome) {
if (TextUtils.equals(model.getLiveUid(), "0")) {
if (CommonAppConfig.getInstance().getConfig().isSw()) {
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel), isActivity,false, isHome);
} else {
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel), true, isHome);
}
} else {
String yes = "";
if (IMLoginManager.get(itemView.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
yes = "";
} else {
yes = "Yes";
}
new XPopup.Builder(itemView.getContext())
.asCustom(new HintCustomPopup(itemView.getContext(),
itemView.getContext().getString(R.string.interactive_game_search_room_currently_live),
itemView.getContext().getString(R.string.interactive_game_search_room_broadcast_room))
.setLiveOpenOk(yes)
.setLiveOpenCancel(itemView.getContext().getString(R.string.interactive_game_search_room_bhe_game))
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
@Override
public void onSure() {
LiveHttpUtil.getLiveInfo(model.getLiveUid() + "", new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
new LiveRoomCheckLivePresenter(itemView.getContext(), liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk, boolean isSw) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal), isSw);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Bus.get().post(new LiveOpenSudRoomEvent().setCreateSudRoomModel(createSudRoomModel));
}
}, 1500);
}
@Override
public void onCheckError(String contextError) {
}
});
} else {
RouteUtil.forwardUserHome(itemView.getContext(), model.getLiveUid(), 0);
}
}
});
}
@Override
public void onCancel() {
if (CommonAppConfig.getInstance().getConfig().isSw()) {
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel), isActivity,false, isHome);
} else {
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel), true, isHome);
}
}
})).show();
}
} else {
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setActivityGame(isActivity).setCreateSudRoomModel(createSudRoomModel));
Bus.get().post(new SudGameListDissMissEvent());
}
}
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="39dp" android:height="14dp">
<shape android:shape="rectangle">
<solid android:color="#ffcad8ff" />
<corners android:topLeftRadius="9dp" android:topRightRadius="9dp" android:bottomLeftRadius="9dp" android:bottomRightRadius="9dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="22dp" android:height="22dp">
<shape android:shape="rectangle">
<solid android:color="#ffffffff" />
<corners android:radius="10dp" />
</shape>
</item>
</selector>

View File

@ -186,7 +186,9 @@
android:textAllCaps="false"
android:textColor="#02215D"
android:textSize="16sp"
tools:text="繼續點亮" />
android:visibility="gone"
tools:text="繼續點亮"
tools:visibility="visible" />
</LinearLayout>
@ -199,8 +201,8 @@
android:layout_marginTop="10dp"
android:layout_marginEnd="17dp"
android:layout_marginBottom="58dp"
android:paddingBottom="32dp"
android:background="@mipmap/gift_wall_gift_info_list"
android:paddingBottom="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
@ -263,29 +265,41 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<include
android:id="@+id/list_title"
layout="@layout/item_dialog_gift_wall_gift_info"
<LinearLayout
android:id="@+id/titleLayout"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="20dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tips_timer" />
app:layout_constraintTop_toBottomOf="@+id/tips_timer">
<include
android:id="@+id/list_title"
layout="@layout/item_dialog_gift_wall_gift_info" />
<include
android:id="@+id/list_title2"
layout="@layout/item_dialog_gift_wall_gift_info2t"
android:visibility="gone" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="20dp"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/list_title"
app:layout_constraintTop_toBottomOf="@+id/titleLayout"
tools:itemCount="1"
tools:listitem="@layout/item_dialog_gift_wall_gift_info" />
</androidx.constraintlayout.widget.ConstraintLayout>
@ -297,54 +311,81 @@
android:layout_width="0dp"
android:layout_height="64dp"
android:background="@mipmap/gift_wall_gift_info_botton"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
app:layout_constraintStart_toStartOf="parent"
tools:visibility="visible">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/bottom_avatar"
android:layout_width="37dp"
android:layout_height="37dp"
android:layout_alignParentBottom="true"
android:layout_marginStart="17dp"
android:scaleType="centerCrop"
android:src="@mipmap/icon_avatar_placeholder"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:riv_oval="true" />
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/bottom_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="TextView"
android:textColor="#FFFFFF"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="@+id/bottom_avatar"
app:layout_constraintTop_toTopOf="@+id/bottom_avatar" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/bottom_avatar"
android:layout_width="37dp"
android:layout_height="37dp"
android:layout_alignParentBottom="true"
android:layout_marginStart="17dp"
android:scaleType="centerCrop"
android:src="@mipmap/icon_avatar_placeholder"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/anchorTips"
android:layout_marginTop="6dp"
app:riv_oval="true" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/dialog_gift_wall_gfit_info_list_bottom_send"
android:textColor="#BDBDBD"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/bottom_avatar"
app:layout_constraintStart_toEndOf="@+id/bottom_avatar" />
<TextView
android:id="@+id/bottom_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="TextView"
android:textColor="#FFFFFF"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="@+id/bottom_avatar"
app:layout_constraintTop_toTopOf="@+id/bottom_avatar" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/dialog_gift_wall_gfit_info_list_bottom_send"
android:textColor="#BDBDBD"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/bottom_avatar"
app:layout_constraintStart_toEndOf="@+id/bottom_avatar" />
<TextView
android:id="@+id/send_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/textView7"
app:layout_constraintStart_toEndOf="@+id/textView7"
tools:text="00" />
<Button
android:id="@+id/anchorTips"
android:layout_width="39dp"
android:layout_height="14dp"
android:background="@drawable/bg_gift_wall_star_t1"
android:text="@string/dialog_gift_wall_gfit_info_list_bottom_tips"
android:textAllCaps="false"
android:textSize="8sp"
android:visibility="gone"
tools:visibility="visible"
app:layout_constraintEnd_toEndOf="@+id/bottom_avatar"
app:layout_constraintStart_toStartOf="@+id/bottom_avatar"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/send_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/textView7"
app:layout_constraintStart_toEndOf="@+id/textView7"
tools:text="00" />
<TextView
android:id="@+id/btn_one"
@ -353,32 +394,61 @@
android:layout_marginEnd="17dp"
android:background="@drawable/gift_wall_gift_info_btn"
android:gravity="center"
android:textAllCaps="false"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:textAllCaps="false"
android:textColor="#02215D"
android:textSize="11.5sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/dialog_gift_wall_gfit_info_list_bottom_btn_one_champion" />
tools:text="@string/dialog_gift_wall_gfit_info_list_bottom_btn_one_champion"
tools:visibility="gone" />
<Button
android:id="@+id/btn_one_tips"
android:layout_width="wrap_content"
android:layout_height="11dp"
android:layout_marginBottom="-5dp"
android:textAllCaps="false"
android:background="@drawable/gift_wall_gift_info_bottom_btn_tips"
android:elevation="10dp"
android:minWidth="32dp"
android:text="需10个"
android:textAllCaps="false"
android:textSize="8dp"
android:visibility="gone"
tools:visibility="visible"
android:translationZ="2dp"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/btn_one"
app:layout_constraintEnd_toEndOf="@+id/btn_one" />
app:layout_constraintEnd_toEndOf="@+id/btn_one"
tools:visibility="visible" />
<LinearLayout
android:id="@+id/bottom_rank_layout"
android:layout_marginEnd="17dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:orientation="vertical"
android:layout_width="wrap_content"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:textColor="#FFFFFF"
android:textSize="12sp"
android:text="@string/dialog_gift_wall_gfit_info_list_bottom_tips2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/bottom_rank_value"
android:textColor="#AAEAF3"
android:textSize="14sp"
android:text="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -123,14 +123,14 @@
android:id="@+id/tv_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="55dp"
android:layout_marginTop="5dp"
android:text="@string/dialog_gift_wall_list_info_list_header_rename_value1"
android:textColor="#EEFFF8"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="@+id/imageView6"
app:layout_constraintStart_toStartOf="@+id/imageView6"
app:layout_constraintTop_toBottomOf="@+id/imageView6" />
app:layout_constraintEnd_toEndOf="@+id/gift_name"
app:layout_constraintStart_toStartOf="@+id/gift_name"
app:layout_constraintTop_toBottomOf="@+id/gift_name" />
<TextView
android:id="@+id/star_value"
@ -143,12 +143,36 @@
app:layout_constraintStart_toStartOf="@+id/tv_star"
app:layout_constraintTop_toBottomOf="@+id/tv_star" />
<TextView
android:id="@+id/tv_rank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/dialog_gift_wall_gfit_info_list_bottom_tips2"
android:textColor="#EEFFF8"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="@+id/anchor_name"
app:layout_constraintStart_toStartOf="@+id/anchor_name"
app:layout_constraintTop_toBottomOf="@+id/anchor_name" />
<TextView
android:id="@+id/rank_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textColor="#EEFFF8"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="@+id/tv_rank"
app:layout_constraintStart_toStartOf="@+id/tv_rank"
app:layout_constraintTop_toBottomOf="@+id/tv_rank" />
<ImageView
android:id="@+id/imageView7"
android:layout_width="214dp"
android:layout_height="25dp"
android:layout_marginTop="10dp"
app:layout_constraintEnd_toEndOf="@+id/star_value"
app:layout_constraintEnd_toEndOf="@+id/rank_value"
app:layout_constraintStart_toStartOf="@+id/star_value"
app:layout_constraintTop_toBottomOf="@+id/star_value"
app:srcCompat="@mipmap/gift_wall_tab2_classic_info_tips" />

View File

@ -2,19 +2,30 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="45dp"
android:background="@mipmap/sub_bg"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="68dp"
android:paddingBottom="16dp"
android:gravity="center_horizontal"
android:layout_marginTop="45dp">
android:paddingBottom="16dp">
<TextView
android:id="@+id/activityGameAchievement"
android:textSize="14sp"
android:visibility="gone"
android:textColor="#FFFFFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/layoutUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
@ -33,9 +44,9 @@
android:id="@+id/sub_win_hat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="@mipmap/sub_win_hat"
android:visibility="gone"
android:layout_centerHorizontal="true"/>
android:visibility="gone" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/sub_win_head"
@ -43,9 +54,9 @@
android:layout_height="70dp"
android:layout_marginTop="25dp"
android:scaleType="centerCrop"
app:riv_corner_radius="360dp"
app:riv_border_color="#FFFFDCB3"
app:riv_border_width="1dp"/>
app:riv_border_width="1dp"
app:riv_corner_radius="360dp" />
</RelativeLayout>
@ -54,23 +65,40 @@
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:fontFamily="sans-serif-medium"
android:textColor="@color/white"
android:textSize="13sp"
android:ellipsize="end"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:singleLine="true"
android:text="用户昵称哈哈哈"/>
android:text="用户昵称哈哈哈"
android:textColor="@color/white"
android:textSize="13sp" />
<LinearLayout
android:layout_width="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/sub_win_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/white_60"
android:textSize="11sp"
android:layout_gravity="center"
android:singleLine="true"
android:text="+10000"/>
android:text="+10000"
android:textColor="@color/white_60"
android:textSize="11sp" />
<ImageView
android:id="@+id/winActivityIcon"
android:layout_gravity="center"
android:visibility="gone"
tools:visibility="visible"
android:src="@mipmap/ic_game_activity_rank_coin"
android:layout_width="12dp"
android:layout_height="12dp"/>
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
@ -80,7 +108,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:src="@mipmap/sub_vs"/>
android:src="@mipmap/sub_vs" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
@ -92,12 +120,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!-- <androidx.appcompat.widget.AppCompatImageView-->
<!-- android:id="@+id/sub_loss_hat"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:src="@mipmap/sub_win_hat"-->
<!-- android:layout_centerHorizontal="true"/>-->
<!-- <androidx.appcompat.widget.AppCompatImageView-->
<!-- android:id="@+id/sub_loss_hat"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:src="@mipmap/sub_win_hat"-->
<!-- android:layout_centerHorizontal="true"/>-->
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/sub_loss_head"
@ -105,9 +133,9 @@
android:layout_height="70dp"
android:layout_marginTop="25dp"
android:scaleType="centerCrop"
app:riv_corner_radius="360dp"
app:riv_border_color="#FFFFDCB3"
app:riv_border_width="1dp"/>
app:riv_border_width="1dp"
app:riv_corner_radius="360dp" />
</RelativeLayout>
@ -116,23 +144,36 @@
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:fontFamily="sans-serif-medium"
android:textColor="@color/white"
android:ellipsize="end"
android:textSize="13sp"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:singleLine="true"
android:text="用户昵称"/>
android:text="用户昵称"
android:textColor="@color/white"
android:textSize="13sp" />
<LinearLayout
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/sub_loss_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/white_60"
android:textSize="11sp"
android:singleLine="true"
android:text="+10000"/>
android:text="+10000"
android:textColor="@color/white_60"
android:textSize="11sp" />
<ImageView
android:id="@+id/lossActivityIcon"
android:layout_gravity="center"
android:visibility="gone"
tools:visibility="visible"
android:src="@mipmap/ic_game_activity_rank_coin"
android:layout_width="12dp"
android:layout_height="12dp"/>
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
@ -142,32 +183,32 @@
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:gravity="center_vertical">
android:gravity="center_vertical"
android:orientation="horizontal">
<RelativeLayout
android:layout_marginEnd="15dp"
android:layout_width="100dp"
android:layout_height="40dp">
android:layout_height="40dp"
android:layout_marginEnd="15dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/sub_leave"
android:layout_width="100dp"
android:layout_height="40dp"
android:src="@mipmap/sub_leave_zh"/>
android:src="@mipmap/sub_leave_zh" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/sub_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:fontFamily="sans-serif-medium"
android:textColor="#FF5B5B5B"
android:textSize="13sp"
android:text="10"
android:layout_marginTop="10dp"
android:layout_marginEnd="30dp"
android:layout_marginTop="10dp"/>
android:fontFamily="sans-serif-medium"
android:text="10"
android:textColor="#FF5B5B5B"
android:textSize="13sp" />
</RelativeLayout>
@ -176,18 +217,19 @@
android:id="@+id/sub_again"
android:layout_width="100dp"
android:layout_height="40dp"
android:src="@mipmap/sub_again_zh"/>
android:src="@mipmap/sub_again_zh" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:textSize="11sp"
android:textColor="@color/white_60"
android:singleLine="true"
android:text="@string/sub_admission_fee"
android:singleLine="true"/>
android:textColor="@color/white_60"
android:textSize="11sp" />
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@ -1,31 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/sud_load_bg"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/sud_load"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/sud_load_zh"
android:layout_marginTop="16dp"/>
android:layout_marginTop="16dp"
android:src="@mipmap/sud_load_zh" />
<RelativeLayout
android:layout_marginTop="19dp"
android:layout_width="100dp"
android:layout_height="100dp">
android:layout_height="100dp"
android:layout_marginTop="19dp">
<ProgressBar
android:id="@+id/sud_load_bar_double"
android:layout_width="100dp"
android:layout_height="100dp"
android:visibility="gone"
android:indeterminateBehavior="repeat"
android:indeterminateDrawable="@drawable/anim_loading_double"
android:indeterminateDuration="500"/>
android:indeterminateDuration="500"
android:visibility="gone" />
<ProgressBar
android:id="@+id/sud_load_bar_multiple"
@ -33,32 +34,44 @@
android:layout_height="100dp"
android:indeterminateBehavior="repeat"
android:indeterminateDrawable="@drawable/anim_loading_multiple"
android:indeterminateDuration="500"/>
android:indeterminateDuration="500" />
</RelativeLayout>
<TextView
android:id="@+id/sud_activity_tips_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:visibility="gone"
tools:visibility="visible"
android:textColor="#333333"
android:textSize="14sp"
android:gravity="center"
android:text="@string/game_dialog_loading_tips_text" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:gravity="center_vertical">
android:gravity="center_vertical"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/sud_load_skip"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_marginEnd="20dp"
android:src="@mipmap/sud_load_skip_zh"/>
android:src="@mipmap/sud_load_skip_zh" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/sud_load_again"
android:layout_width="100dp"
android:layout_height="40dp"
android:src="@mipmap/sub_again_zh"/>
android:src="@mipmap/sub_again_zh" />
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_rank"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.4"
android:gravity="start|center"
android:text="@string/dialog_gift_wall_list_info_list_header_rank"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="10" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_gravity="bottom"
android:gravity="center|bottom"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@+id/tv_rank"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_rank">
<LinearLayout
android:orientation="vertical"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_alignParentBottom="true"
android:scaleType="centerCrop"
android:src="@mipmap/icon_avatar_placeholder"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/tv_rank"
app:layout_constraintEnd_toEndOf="@+id/avatar2"
app:layout_constraintTop_toTopOf="@+id/tv_rank"
app:riv_oval="true"
tools:visibility="visible" />
<TextView
android:id="@+id/item_anchor_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_gift_wall_list_info_list_header_rename"
android:textColor="#FFFFFF"
android:textSize="12sp"
android:visibility="gone"
tools:visibility="visible" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tv_rename"
app:layout_constraintStart_toEndOf="@+id/avatar2"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
<LinearLayout
android:orientation="vertical"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/avatar2_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar2"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_alignParentBottom="true"
android:layout_marginTop="8dp"
android:src="@mipmap/icon_avatar_placeholder"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:riv_oval="true"
tools:visibility="visible" />
<Button
android:id="@+id/tips1"
android:layout_width="39dp"
android:layout_height="14dp"
android:background="@drawable/bg_gift_wall_star_t1"
android:text="@string/dialog_gift_wall_list_info_list_header_rename_tip1"
android:textAllCaps="false"
android:textSize="8sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/tips2"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_marginStart="40dp"
android:background="@drawable/bg_gift_wall_star_t2"
android:text="@string/dialog_gift_wall_list_info_list_header_rename_tip2"
android:textAllCaps="false"
android:textSize="6sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/user_name"
android:layout_width="58dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_gift_wall_list_info_list_header_rename_tip3"
android:textColor="#FFFFFF"
android:textSize="12sp"
tools:text="啊啊啊啊" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/tv_rename"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.4"
android:gravity="end|center"
android:text="@string/dialog_gift_wall_list_info_list_header_rename_value"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>

View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_rank"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.4"
android:gravity="start|center"
android:text="@string/dialog_gift_wall_list_info_list_header_rank"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="10" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_gravity="bottom"
android:gravity="center|bottom"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@+id/tv_rank"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_rank">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_alignParentBottom="true"
android:scaleType="centerCrop"
android:src="@mipmap/icon_avatar_placeholder"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/tv_rank"
app:layout_constraintEnd_toEndOf="@+id/avatar2"
app:layout_constraintTop_toTopOf="@+id/tv_rank"
app:riv_oval="true"
/>
<TextView
android:id="@+id/item_anchor_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_gift_wall_list_info_list_header_rename"
android:textColor="#FFFFFF"
android:textSize="12sp"
android:visibility="visible"
/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tv_rename"
app:layout_constraintStart_toEndOf="@+id/avatar2"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/avatar2_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar2"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_alignParentBottom="true"
android:layout_marginTop="8dp"
android:src="@mipmap/icon_avatar_placeholder"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:riv_oval="true"
tools:visibility="visible" />
<Button
android:id="@+id/tips1"
android:layout_width="39dp"
android:layout_height="14dp"
android:background="@drawable/bg_gift_wall_star_t1"
android:text="@string/dialog_gift_wall_list_info_list_header_rename_tip1"
android:textAllCaps="false"
android:textSize="8sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/tips2"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_marginStart="40dp"
android:background="@drawable/bg_gift_wall_star_t2"
android:text="@string/dialog_gift_wall_list_info_list_header_rename_tip2"
android:textAllCaps="false"
android:textSize="6sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:singleLine="true"
android:text="@string/dialog_gift_wall_list_info_list_header_rename_tip3"
android:textColor="#FFFFFF"
android:textSize="12sp"
tools:text="@string/dialog_gift_wall_list_info_list_header_rename_tip3" />
</LinearLayout>
<TextView
android:id="@+id/tv_rename"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.4"
android:gravity="end|center"
android:text="@string/dialog_gift_wall_list_info_list_header_rename_value"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>

View File

@ -56,12 +56,12 @@
<TextView
android:id="@+id/user_name"
android:layout_width="wrap_content"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#FFD3A4"
android:textSize="13sp"
android:maxLength="5"
android:gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/dialog_gift_wall_list_info_list_header_rename"

View File

@ -1,178 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="88dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="15dp"
android:background="@mipmap/background_home_sud_game_list"
android:orientation="horizontal">
<FrameLayout
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="10dp"
android:layout_marginTop="17dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<ImageView
android:id="@+id/btn_live"
android:layout_width="36dp"
android:layout_height="14dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginEnd="3dp"
android:adjustViewBounds="true"
android:src="@mipmap/icon_user_game_living"
android:visibility="visible" />
<ImageView
android:id="@+id/sex"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="bottom|end" />
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:orientation="vertical">
android:id="@+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
<TextView
android:id="@+id/room_name"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ellipsize="end"
android:singleLine="true"
android:textStyle="bold"
android:text="@string/interactive_game_create_room_name"
android:textColor="#000"
android:textSize="14sp" />
android:layout_marginTop="8dp"
android:background="@mipmap/background_home_sud_game_list"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<View
android:layout_width="1dp"
android:layout_height="0dp"
android:layout_weight="1" />
<FrameLayout
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="10dp"
android:layout_marginTop="17dp">
<TextView
android:id="@+id/player_we_are"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="5dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_player_we_are"
android:textColor="#B3000000"
android:textSize="12sp" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<TextView
android:id="@+id/player_we_are_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="3dp"
android:layout_marginBottom="3dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_player_we_are_2"
android:textColor="#B3000000"
android:textSize="12sp" />
<ImageView
android:id="@+id/btn_live"
android:layout_width="36dp"
android:layout_height="14dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginEnd="3dp"
android:adjustViewBounds="true"
android:src="@mipmap/icon_user_game_living"
android:visibility="visible" />
<ImageView
android:id="@+id/sex"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="bottom|end" />
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical">
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:orientation="vertical">
<TextView
android:id="@+id/room_name"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_create_room_name"
android:textColor="#000"
android:textSize="14sp"
android:textStyle="bold" />
<View
android:layout_width="1dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/player_we_are"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="5dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_player_we_are"
android:textColor="#B3000000"
android:textSize="12sp" />
<TextView
android:id="@+id/player_we_are_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="3dp"
android:layout_marginBottom="3dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_player_we_are_2"
android:textColor="#B3000000"
android:textSize="12sp" />
<LinearLayout
android:layout_width="79dp"
android:layout_height="20dp"
android:visibility="gone">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list1"
android:layout_width="20dp"
<LinearLayout
android:layout_width="79dp"
android:layout_height="20dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
android:visibility="gone">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list2"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list1"
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list3"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list2"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list4"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list3"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list5"
android:layout_width="20dp"
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list4"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list5"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/avatar_list"
android:layout_width="76dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
android:visibility="gone" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/avatar_list"
android:layout_width="76dp"
android:layout_height="20dp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="3dp"
android:orientation="vertical">
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/topLayout"
android:layout_width="68dp"
android:layout_height="26dp"
android:layout_gravity="end"
android:layout_marginTop="2dp"
android:background="@drawable/bg_home_sud_list_sill"
android:gravity="center_vertical">
android:gravity="center">
<TextView
android:id="@+id/golden_bean_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="1000"
android:text="1"
android:textColor="#FF8000"
android:textSize="12sp" />
@ -200,4 +214,21 @@
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/activityTitle"
android:layout_width="0dp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:layout_marginTop="-6dp"
android:ellipsize="end"
android:gravity="end"
android:maxLines="1"
android:text="@string/game_list_activity_title"
android:textColor="#FDE888"
android:textSize="14sp"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@+id/linearLayout3"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/linearLayout4"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,164 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="88dp"
android:layout_marginStart="15dp"
android:layout_marginTop="14dp"
android:layout_marginEnd="15dp"
android:background="@mipmap/background_sud_game_list"
android:orientation="horizontal">
<FrameLayout
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="10dp"
android:layout_marginTop="17dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<ImageView
android:id="@+id/btn_live"
android:layout_width="36dp"
android:layout_height="14dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginEnd="3dp"
android:adjustViewBounds="true"
android:src="@mipmap/icon_user_game_living"
android:visibility="visible" />
<ImageView
android:id="@+id/sex"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="bottom|end" />
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:orientation="vertical">
android:id="@+id/linearLayout5"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="15dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="15dp"
android:background="@mipmap/background_sud_game_list"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/room_name"
android:ellipsize="end"
android:layout_width="150dp"
android:singleLine="true"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/interactive_game_create_room_name"
android:textColor="@color/white"
android:textSize="14sp" />
<FrameLayout
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="10dp"
android:layout_marginTop="17dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<View
android:layout_width="1dp"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/btn_live"
android:layout_width="36dp"
android:layout_height="14dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginEnd="3dp"
android:adjustViewBounds="true"
android:src="@mipmap/icon_user_game_living"
android:visibility="visible" />
<TextView
android:id="@+id/player_we_are"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="5dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_player_we_are"
android:textColor="#80ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/player_we_are_2"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginEnd="3dp"
android:layout_marginBottom="3dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_player_we_are_2"
android:textColor="@color/white"
android:textSize="12sp" />
<ImageView
android:id="@+id/sex"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="bottom|end" />
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:visibility="gone">
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:orientation="vertical">
<TextView
android:id="@+id/room_name"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_create_room_name"
android:textColor="@color/white"
android:textSize="14sp" />
<View
android:layout_width="1dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/player_we_are"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="5dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_player_we_are"
android:textColor="#80ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/player_we_are_2"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginEnd="3dp"
android:layout_marginBottom="3dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_player_we_are_2"
android:textColor="@color/white"
android:textSize="12sp" />
<LinearLayout
android:layout_width="79dp"
android:layout_height="20dp">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:visibility="gone">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list1"
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<LinearLayout
android:layout_width="79dp"
android:layout_height="20dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list2"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list1"
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list3"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list2"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list4"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list3"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list5"
android:layout_width="20dp"
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list4"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_list5"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/avatar_list"
android:layout_width="76dp"
android:layout_height="20dp"
android:layout_marginStart="-6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
android:visibility="gone" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/avatar_list"
android:layout_width="76dp"
android:layout_height="20dp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_marginTop="8dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="@+id/linearLayout5"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/topLayout"
android:layout_width="68dp"
android:layout_height="26dp"
android:layout_gravity="end"
@ -197,4 +209,21 @@
android:layout_marginEnd="5dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/activityTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="-10dp"
android:ellipsize="end"
android:gravity="end"
android:maxLines="1"
android:text="@string/game_list_activity_title"
android:textColor="#FDE888"
android:textSize="14sp"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@+id/linearLayout3"
app:layout_constraintStart_toStartOf="@+id/linearLayout5"
app:layout_constraintTop_toTopOf="@+id/linearLayout5"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -1524,11 +1524,18 @@
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_star_get">已摘星</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get">已冠名</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get_un">未冠名</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips">當前主播</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips2">當前排名</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips3">已收到:</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips4">曆史排名</string>
<string name="dialog_gift_wall_list_info_list_header_rank">排名</string>
<string name="dialog_gift_wall_list_info_list_header_rename">冠名歸屬</string>
<string name="dialog_gift_wall_list_info_list_header_rename1">周星歸屬</string>
<string name="dialog_gift_wall_list_info_list_header_rename_value">冠名值</string>
<string name="dialog_gift_wall_list_info_list_header_rename_value1">星光值</string>
<string name="dialog_gift_wall_list_info_list_header_rename_tip1">最佳助力</string>
<string name="dialog_gift_wall_list_info_list_header_rename_tip2">更多\n助力</string>
<string name="dialog_gift_wall_list_info_list_header_rename_tip3">助力團</string>
<string name="dialog_gift_wall_list1_title">周星禮物</string>
<string name="dialog_gift_wall_list2_title">經典禮物</string>
<string name="dialog_gift_wall_tab2_list_wait">等待點亮</string>
@ -1547,4 +1554,16 @@
<string name="live_end_view_ban_timer">處罰時間:</string>
<string name="live_end_view_ban_punish_title">處罰通知</string>
<string name="game_create_coid_ticket">門票</string>
<string name="game_list_activity_title">挑戰一桿清台,瓜分高額獎金</string>
<string name="game_dialog_loading_tips_text">結算超時,請前往活動頁面查看本局結果</string>
<string name="game_dialog_activity_achievements_title">恭喜您本局完成</string>
<string name="game_dialog_activity_achievements_0">一桿清台</string>
<string name="game_dialog_activity_achievements_1">1連桿</string>
<string name="game_dialog_activity_achievements_2">2連桿</string>
<string name="game_dialog_activity_achievements_3">3連桿</string>
<string name="game_dialog_activity_achievements_4">4連桿</string>
<string name="game_dialog_activity_achievements_5">5連桿</string>
<string name="game_dialog_activity_achievements_6">6連桿</string>
<string name="game_dialog_activity_achievements_7">7連桿</string>
</resources>

View File

@ -1528,11 +1528,18 @@
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_star_get">Picked</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get">Titled</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get_un">Untitled</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips">Anchor</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips2">Current ranking</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips3">Received:</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips4">Historical ranking</string>
<string name="dialog_gift_wall_list_info_list_header_rank">Rank</string>
<string name="dialog_gift_wall_list_info_list_header_rename">Title attribution</string>
<string name="dialog_gift_wall_list_info_list_header_rename1">Weekly star attribution</string>
<string name="dialog_gift_wall_list_info_list_header_rename_value">Title value</string>
<string name="dialog_gift_wall_list_info_list_header_rename_value1">Star value</string>
<string name="dialog_gift_wall_list_info_list_header_rename_tip1">Best</string>
<string name="dialog_gift_wall_list_info_list_header_rename_tip2">More</string>
<string name="dialog_gift_wall_list_info_list_header_rename_tip3">Assistance Team</string>
<string name="dialog_gift_wall_list1_title">Star Gifts</string>
<string name="dialog_gift_wall_list2_title">Classic Gifts</string>
<string name="dialog_gift_wall_tab2_list_wait">Waiting for lighting</string>
@ -1554,5 +1561,17 @@
<string name="live_end_view_ban_reason">Violation reasons:</string>
<string name="live_end_view_ban_content">Penalty content:</string>
<string name="live_end_view_ban_timer">Penalty time:</string>
<string name="live_end_view_ban_punish_title">Punishment Notice</string>
<string name="live_end_view_ban_punish_title">Penalty Notice</string>
<string name="game_create_coid_ticket">Ticket</string>
<string name="game_list_activity_title">Challenge One-shot clearance Share high bonuses</string>
<string name="game_dialog_loading_tips_text"> Settlement timed out. Please check the result on the event page</string>
<string name="game_dialog_activity_achievements_title">Your office has completed </string>
<string name="game_dialog_activity_achievements_0">One-shotclearance</string>
<string name="game_dialog_activity_achievements_1">1 Combo</string>
<string name="game_dialog_activity_achievements_2">2 Combo</string>
<string name="game_dialog_activity_achievements_3">3 Combo</string>
<string name="game_dialog_activity_achievements_4">4 Combo</string>
<string name="game_dialog_activity_achievements_5">5 Combo</string>
<string name="game_dialog_activity_achievements_6">6 Combo</string>
<string name="game_dialog_activity_achievements_7">7 Combo</string>
</resources>

View File

@ -4,8 +4,8 @@ ext {
buildToolsVersion: "29.0.2",
minSdkVersion : 23,
targetSdkVersion : 34,
versionCode : 692,
versionName : "6.8.0"
versionCode : 693,
versionName : "6.8.1"
]
manifestPlaceholders = [
//

View File

@ -1724,6 +1724,7 @@ public class LiveAudienceActivity extends LiveActivity {
case 0:
if (liveSudGamePopupXPopup == null) {
liveSudGamePopupXPopup = new LiveSudGamePopup(mContext, event.getCreateSudRoomModel());
liveSudGamePopupXPopup.setActivityGame(event.isActivityGame());
new XPopup.Builder(mContext).enableDrag(false).dismissOnTouchOutside(false).dismissOnBackPressed(false).asCustom(liveSudGamePopupXPopup).show();
} else {
if (liveSudGamePopupXPopup != null) {

View File

@ -1950,6 +1950,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
case 0:
if (liveSudGamePopupXPopup == null) {
liveSudGamePopupXPopup = new LiveSudGamePopup(mContext, event.getCreateSudRoomModel());
liveSudGamePopupXPopup.setActivityGame(event.isActivityGame());
new XPopup.Builder(mContext)
.enableDrag(false)
.dismissOnTouchOutside(false)

View File

@ -487,7 +487,7 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M
//加载弹窗监听
sudLoadDialog.setOnDismissListener(() -> {
if (sudLoadDialog.getClickStatus() == 2){
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
}
});
}

View File

@ -2,6 +2,7 @@ package com.yunbao.live.activity;
import android.Manifest;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@ -27,12 +28,14 @@ import com.yunbao.common.R;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.adapter.SudGameChatAdapter;
import com.yunbao.common.adapter.SudGameUserListAdapter;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.CheckRemainingBalance;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.bean.RoomMicStatusModel;
import com.yunbao.common.bean.SudActivityGameInfoBean;
import com.yunbao.common.bean.SudGameChatImModel;
import com.yunbao.common.bean.SudGameInfoBean;
import com.yunbao.common.bean.SudGameScoreBean;
@ -49,12 +52,14 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.RandomSudGameManager;
import com.yunbao.common.manager.imrongcloud.GameSwMicManager;
import com.yunbao.common.sud.QuickStartGameViewModel;
import com.yunbao.common.sud.model.GameConfigModel;
import com.yunbao.common.sud.model.GameViewInfoModel;
import com.yunbao.common.sud.state.SudMGPMGState;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ProcessResultUtil;
import com.yunbao.common.utils.RouteUtil;
@ -248,7 +253,7 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
}
});
if(isSw){
if (isSw) {
SWAuManager.get().exitChannelAll();
}
if (gameMicManager != null) {
@ -261,15 +266,21 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
super.onDestroy();
}
private void initView() {
private boolean isActivityGame;
private boolean isRandomRankUser;
private void initView() {
isActivityGame = getIntent().getBooleanExtra("isActivity", false);
isRandomRankUser = getIntent().getBooleanExtra("isRandomRankUser", false);
String createSudRoomJson = getIntent().getStringExtra("CreateSudRoom");
mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class);
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
//第二次进入时viewmodel数据丢失所以初始化时直接获取
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),mContext);
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(), mContext);
if (isActivityGame) {
RandomSudGameManager.getManager().setGameViewModel(gameViewModel);
}
gameContainer = findViewById(R.id.game_container);
roomName = findViewById(R.id.room_name);
roomNumber = findViewById(R.id.room_number);
@ -432,9 +443,9 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
} else {
disable = true;
// 设置禁用麦克风采集
if(isSw){
if (isSw) {
SWAuManager.get().setMicAn(false);
}else{
} else {
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);
}
ImgLoader.display(mContext, R.mipmap.icon_game_close_wheat, gameCloseWheat);
@ -518,7 +529,10 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
sudGameDoubleDialog = new SudGameDoubleDialog(this);//双人游戏
sudGameMultipleDialog = new SudGameMultipleDialog(this);//多人游戏
sudLoadDialog = new SudLoadDialog(this);//加载弹窗
if (isActivityGame) {
sudGameDoubleDialog.setActivityGame();
sudLoadDialog.setActivityGame();
}
//游戏结算结束
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
//观察结算排名数据点击跳过和再来一局不需要显示结算界面
@ -538,14 +552,22 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
//加载弹窗消失监听自动消失和点击跳过在这个监听中都不做处理
sudLoadDialog.setOnDismissListener(() -> {
if (sudLoadDialog.getClickStatus() == 2){
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
if (sudLoadDialog.getClickStatus() == 2) {
Bus.get().post(new CheckRemainingBalanceEvent(null).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
}
});
//通知活动游戏
if (isActivityGame) {
RandomSudGameManager.getManager().onInitGame(mCreateSudRoomModel);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
LogUtils.e("收到的回调:" + event.getSudMGPMGState() + "|" + event.getPlayerIn());
if (isActivityGame) {
RandomSudGameManager.getManager().onGameState(event);
}
switch (event.getSudMGPMGState()) {
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
@ -589,15 +611,63 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
//先获取用户信息再进行结算处理
LiveNetManager.get(mContext).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
@Override
public void onSuccess(List<SudGameInfoBean> data) {
if (!data.isEmpty()){
gameViewModel.setSudGameInfoBeanList(data);
gameViewModel.sudGameRank(event.getMgCommonGameSettle());//结算游戏
}else {
ToastUtil.show(getString(R.string.net_error));
public void onSuccess(List<SudGameInfoBean> infoBean) {
if (!infoBean.isEmpty()) {
System.out.println("结算,是否为游戏活动:" + isActivityGame);
if (isActivityGame) {
loadScore(infoBean, 3);
} else {
gameViewModel.setSudGameInfoBeanList(infoBean);
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
}
} else {
if (isActivityGame) {
showDialog();
} else {
ToastUtil.show(getString(R.string.net_error));
}
}
}
private void showDialog() {
DialogUitl.showSimpleDialog(mContext, WordUtil.isNewZh() ? "結算超時\n請前往活動頁面查看本局結果" :
"Settlement timed out\nPlease check the result on the event page Confirm.", new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
if(sudLoadDialog.isShow()){
sudLoadDialog.dismiss();
}
}
});
}
private void loadScore(List<SudGameInfoBean> infoBean, int index) {
if (index == 0) {
showDialog();
return;
}
LiveNetManager.get(mContext)
.ballClearanceTableGetResultScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<>() {
@Override
public void onSuccess(List<SudActivityGameInfoBean> data) {
if (data.isEmpty()) {
new Handler(Looper.getMainLooper()).postDelayed(() -> {
loadScore(infoBean, index - 1);
}, 500);
return;
}
gameViewModel.setSudGameInfoBeanList(infoBean);
gameViewModel.sudGameRank(event.getMgCommonGameSettle(data));//结算游戏
}
@Override
public void onError(String error) {
}
});
}
@Override
public void onError(String error) {
ToastUtil.show(error);
@ -626,9 +696,16 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
case SudMGPMGState.MG_COMMON_GAME_STATE:
LiveNetManager.get(mContext).deductMoney(mCreateSudRoomModel.getSudGameRoomId());
break;
case SudMGPMGState.MG_GAME_LOAD_OVER:
if (isActivityGame && isRandomRankUser) {
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, -1, true, 1);
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfReady(true);
}
break;
}
}
@Override
public void onJoinRoomSuccess(RCRTCRoom rcrtcRoom) {
LiveNetManager.get(mContext).getRoomMicData(mLiveUid, new HttpCallback<List<SudGameUserModel>>() {

View File

@ -7,6 +7,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.blankj.utilcode.util.LogUtils;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.activity.SelectImageActivity;
@ -72,30 +73,37 @@ public class SystemMessageActivity extends AbsActivity {
// }
init();
punish = findViewById(R.id.tv_sys_msg_punish);
punish.setVisibility(View.GONE);
punish.setVisibility(View.VISIBLE);
punishNotice = findViewById(R.id.tv_sys_msg_punish_notice);
punish.setOnClickListener(v -> {
RouteUtil.forwardPunishActivity();
punishNotice.setVisibility(View.GONE);
});
if (!"4".equals(type)) {
punish.setVisibility(View.GONE);
punishNotice.setVisibility(View.GONE);
} else {
punish.setVisibility(View.VISIBLE);
}
mSystemMessageViewHolder.btn_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
/*LiveNetManager.get(mContext).getPenalizeStatus(new com.yunbao.common.http.base.HttpCallback<ResponseModel>() {
LiveNetManager.get(mContext).getPenalizeStatus(new com.yunbao.common.http.base.HttpCallback<ResponseModel>() {
@Override
public void onSuccess(ResponseModel responseModel) {
punishNotice.setVisibility(View.VISIBLE);
if (punish.getVisibility() == View.VISIBLE) {
punishNotice.setVisibility(View.VISIBLE);
}
}
@Override
public void onError(String error) {
punishNotice.setVisibility(View.GONE);
}
});*/
});
}
//更新新消息

View File

@ -62,6 +62,7 @@ import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DebugUtils;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.GiftCacheUtil;
@ -1092,7 +1093,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
Bus.get().post(event);
}).build().show();
AppManager.runDebugCode(() -> {
DebugUtils.runDebugCode(() -> {
Log.i("gifBean", mLiveGiftBean.toString());
});
} else if (code == 1001) {

View File

@ -44,6 +44,7 @@ import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.utils.DebugUtils;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
@ -1432,7 +1433,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
Bus.get().post(event);
}).build().show();
AppManager.runDebugCode(() -> {
DebugUtils.runDebugCode(() -> {
Log.i("gifBean", mGiftBean.toString());
});
} else if (code == 1001) {

View File

@ -70,6 +70,7 @@ import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.bean.PrankProgressBean;
import com.yunbao.common.fragment.GiftWallMainTab1Fragment;
import com.yunbao.common.utils.DebugUtils;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
@ -2354,7 +2355,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (!IMLoginManager.get(mContext).hintChat()) {
msgLayout.setVisibility(View.VISIBLE);
}
AppManager.runDebugCode(() -> msgLayout.setVisibility(View.GONE));
DebugUtils.runDebugCode(() -> msgLayout.setVisibility(View.GONE));
if (d_pk_view != null) {
d_pk_view.setVisibility(View.GONE);
}

View File

@ -33,6 +33,7 @@ import com.lzf.easyfloat.permission.PermissionUtils;
import com.lzf.easyfloat.utils.LifecycleUtils;
import com.yunbao.common.dialog.DebugDialog;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DebugUtils;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
@ -287,7 +288,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
liveImDeletUtil = new LiveImDeletUtil();
portraitLiveManager = this;
ininView();
AppManager.runDebugCode(() -> waitShowTopBannerTime = 1000);
DebugUtils.runDebugCode(() -> waitShowTopBannerTime = 1000);
}
/**
@ -873,7 +874,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
}
//liveHandler.postDelayed(loadTimeoutRunnableGone, 15_000);
AppManager.runDebugCode(() -> {
DebugUtils.runDebugCode(() -> {
liveHandler.postDelayed(loadTimeoutRunnableGone, 1_000);
});
if (TextUtils.equals(data.getEnterRoomInfo().getIsconnection(), "1")) {

View File

@ -46,9 +46,11 @@
<TextView
android:id="@+id/tv_sys_msg_punish"
android:layout_width="60dp"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:layout_centerVertical="true"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_ffae04_6dp"

View File

@ -263,7 +263,7 @@ public class BattlePassActivity extends AbsActivity {
if (data.isBattlePassStatus()) {
SpUtil.getInstance().removeValue("is_battle_pass_status");
}
fragments.get(viewPager.getCurrentItem()).updateData();
// fragments.get(viewPager.getCurrentItem()).updateData();
}

View File

@ -1,6 +1,8 @@
package com.yunbao.main.views;
import android.app.Activity;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
@ -10,17 +12,22 @@ import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompat;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BottomPopupView;
import com.yunbao.common.dialog.GiftWallDialog;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.RandomSudGameManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.DebugUtils;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.event.FloatWarOrderEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.dialog.LivePrankDialogFragment;
import com.yunbao.main.R;
@ -65,12 +72,14 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
img_trophy.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
AppManager.runDebugCode(new Runnable() {
DebugUtils.runDebugCode(new Runnable() {
@Override
public void run() {
new GiftWallDialog(mContext, IMLoginManager.get(mContext).getUserInfo().getId() + "",
/* new GiftWallDialog(mContext, IMLoginManager.get(mContext).getUserInfo().getId() + "",
IMLoginManager.get(mContext).getUserInfo().getUserNicename(), null
, false).setFullWindows(true).setTab2(true).showDialog();
, false).setFullWindows(true).setTab2(true).showDialog();*/
// RouteUtil.forwardBattlePass();
RandomSudGameManager.getManager().random(mContext);
}
});
return true;