创建游戏房

This commit is contained in:
18401019693 2023-09-23 17:44:16 +08:00
parent 0756dd9560
commit eedbbb5304
42 changed files with 1424 additions and 32 deletions

View File

@ -1,6 +1,7 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -10,7 +11,8 @@ import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.views.FunGamesChildViewHolder;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.InteractionGamesChildViewHolder;
import java.util.ArrayList;
@ -37,6 +39,19 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
childViewHolder.setData(child.get(position), rigts);
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
@Override
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
if (activityID != 0) {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setInteractionID(activityID).setInteraction(true));
}
}
});
}
@Override

View File

@ -1,6 +1,7 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -10,6 +11,10 @@ import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.event.LiveNewRoleEvent;
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.InteractionGamesChildViewHolder;
import java.util.ArrayList;
@ -36,6 +41,23 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
childViewHolder.setData(child.get(position), rigts);
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
@Override
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
if (activityID != 0) {
Bus.get().post(new NewRoleCustomDrawerPopupEvent()
.setDisMiss(true)
.setInteractionID(activityID)
.setChild(child)
.setInteraction(true));
}
Bus.get().post(new LiveNewRoleEvent());
}
});
}
@Override

View File

@ -0,0 +1,62 @@
package com.yunbao.common.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.views.SudTitleSelectViewHolder;
import java.util.ArrayList;
import java.util.List;
public class SudTitleSelectAdapter extends RecyclerView.Adapter {
private List<String> selectString = new ArrayList<>();
private int mIndex;
public SudTitleSelectAdapter(List<String> selectString, int index) {
this.selectString = selectString;
mIndex = index;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_sud_title_select_view, parent, false);
return new SudTitleSelectViewHolder(runGamesView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
SudTitleSelectViewHolder childViewHolder = (SudTitleSelectViewHolder) holder;
childViewHolder.setData(selectString.get(position), mIndex == position, position, new SudTitleSelectViewHolder.SudTitleSelectListener() {
@Override
public void onSudTitleSelectCallBack(int index) {
if (sudTitleSelectCallBack != null) {
sudTitleSelectCallBack.onSudTitleSelectCallBack(index);
}
}
});
}
@Override
public int getItemCount() {
return selectString.size();
}
private SudTitleSelectCallBack sudTitleSelectCallBack;
public void setSudTitleSelectCallBack(SudTitleSelectCallBack sudTitleSelectCallBack) {
this.sudTitleSelectCallBack = sudTitleSelectCallBack;
}
public interface SudTitleSelectCallBack {
void onSudTitleSelectCallBack(int index);
}
}

View File

@ -0,0 +1,160 @@
package com.yunbao.common.bean;
import android.text.TextUtils;
import com.google.gson.annotations.SerializedName;
public class CreateSudRoomModel extends BaseModel {
@SerializedName("sud_game_room_id")
private String sudGameRoomId;
@SerializedName("sud_game_id")
private String sudGameId;
@SerializedName("room_holder_id")
private int roomHolderId;
@SerializedName("room_holder_name")
private String roomHolderName;
@SerializedName("avatar")
private String avatar;
@SerializedName("room_holder_type")
private int roomHolderType;
@SerializedName("sud_game_name")
private String sudGameName;
@SerializedName("room_name")
private String roomName;
@SerializedName("room_status")
private String roomStatus;
@SerializedName("player_total")
private String playerTotal;
@SerializedName("ob_total")
private String obTotal;
@SerializedName("mg_id")
private String mgId;
@SerializedName("sud_game_icon")
private String sudGameIcon;
public String getSudGameRoomId() {
return sudGameRoomId;
}
public CreateSudRoomModel setSudGameRoomId(String sudGameRoomId) {
this.sudGameRoomId = sudGameRoomId;
return this;
}
public String getSudGameId() {
return sudGameId;
}
public long getLongSudGameId() {
if (TextUtils.isEmpty(sudGameId)) {
return 0;
} else {
return Long.parseLong(sudGameId);
}
}
public CreateSudRoomModel setSudGameId(String sudGameId) {
this.sudGameId = sudGameId;
return this;
}
public int getRoomHolderId() {
return roomHolderId;
}
public CreateSudRoomModel setRoomHolderId(int roomHolderId) {
this.roomHolderId = roomHolderId;
return this;
}
public String getRoomHolderName() {
return roomHolderName;
}
public CreateSudRoomModel setRoomHolderName(String roomHolderName) {
this.roomHolderName = roomHolderName;
return this;
}
public String getAvatar() {
return avatar;
}
public CreateSudRoomModel setAvatar(String avatar) {
this.avatar = avatar;
return this;
}
public int getRoomHolderType() {
return roomHolderType;
}
public CreateSudRoomModel setRoomHolderType(int roomHolderType) {
this.roomHolderType = roomHolderType;
return this;
}
public String getSudGameName() {
return sudGameName;
}
public CreateSudRoomModel setSudGameName(String sudGameName) {
this.sudGameName = sudGameName;
return this;
}
public String getRoomName() {
return roomName;
}
public CreateSudRoomModel setRoomName(String roomName) {
this.roomName = roomName;
return this;
}
public String getRoomStatus() {
return roomStatus;
}
public CreateSudRoomModel setRoomStatus(String roomStatus) {
this.roomStatus = roomStatus;
return this;
}
public String getPlayerTotal() {
return playerTotal;
}
public CreateSudRoomModel setPlayerTotal(String playerTotal) {
this.playerTotal = playerTotal;
return this;
}
public String getObTotal() {
return obTotal;
}
public CreateSudRoomModel setObTotal(String obTotal) {
this.obTotal = obTotal;
return this;
}
public String getMgId() {
return mgId;
}
public CreateSudRoomModel setMgId(String mgId) {
this.mgId = mgId;
return this;
}
public String getSudGameIcon() {
return sudGameIcon;
}
public CreateSudRoomModel setSudGameIcon(String sudGameIcon) {
this.sudGameIcon = sudGameIcon;
return this;
}
}

View File

@ -0,0 +1,156 @@
package com.yunbao.common.dialog;
import android.content.Context;
import android.text.TextUtils;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BottomPopupView;
import com.lxj.xpopup.enums.PopupPosition;
import com.yunbao.common.R;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.CreateSudGameEvent;
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.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.LiveSudGamePopup;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class CreateSudGamePopup extends BottomPopupView {
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
private TextView createGameType;
private EditText roomName, gameSill;
private long interactionID = 0;
private String id;
public CreateSudGamePopup(@NonNull Context context, List<CustomSidebarChildModel> child) {
super(context);
customSidebarChildModels = child;
}
// 返回自定义弹窗的布局
@Override
protected int getImplLayoutId() {
return R.layout.dialog_create_sud_game;
}
// 执行初始化操作比如findView设置点击或者任何你弹窗内的业务逻辑
@Override
protected void onCreate() {
super.onCreate();
Bus.getOn(this);
initView();
initDate();
}
private void initDate() {
}
private void initView() {
createGameType = findViewById(R.id.create_game_type);
roomName = findViewById(R.id.room_name);
gameSill = findViewById(R.id.game_sill);
ViewClicksAntiShake.clicksAntiShake(createGameType, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(createGameType);
builder.hasShadowBg(false)
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Bottom)
.asCustom(new SudGameListSelectPopup(getContext(), 4, customSidebarChildModels, interactionID))
.show();
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.create_room), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
String sill = gameSill.getText().toString();
String name = roomName.getText().toString();
if (TextUtils.isEmpty(name)) {
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("房间名不能为空");
} else {
ToastUtil.show("房间名不能为空");
}
return;
}
if (TextUtils.isEmpty(id)) {
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("还未选择游戏");
} else {
ToastUtil.show("还未选择游戏");
}
return;
}
if (TextUtils.isEmpty(sill)) {
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("数量区间为100--5W");
} else {
ToastUtil.show("数量区间为100--5W");
}
return;
}
int sillNumber = Integer.parseInt(sill);
if (sillNumber < 100 || sillNumber > 50000) {
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("数量区间为100--5W");
} else {
ToastUtil.show("数量区间为100--5W");
}
return;
}
LiveNetManager.get(getContext())
.createSudRoom(name, sill, id, new HttpCallback<CreateSudRoomModel>() {
@Override
public void onSuccess(CreateSudRoomModel data) {
new XPopup.Builder(getContext())
.enableDrag(false)
.dismissOnTouchOutside(false)
.dismissOnBackPressed(false)
.asCustom(new LiveSudGamePopup(getContext(), data))
.show();
dialog.dismiss();
Bus.get().post(new SudGameListDissMissEvent());
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
});
}
@Override
protected void onDismiss() {
Bus.getOff(this);
super.onDismiss();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSudGameListEvent(CreateSudGameEvent event) {
interactionID = event.getInteractionID();
createGameType.setText(event.getTitle());
id = event.getId();
}
}

View File

@ -0,0 +1,124 @@
package com.yunbao.common.dialog;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.text.TextUtils;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BottomPopupView;
import com.lxj.xpopup.enums.PopupPosition;
import com.yunbao.common.R;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.SudGameListDissMissEvent;
import com.yunbao.common.event.SudGameListEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
public class SudGameListPopup extends BottomPopupView {
private long interactionID = 0;
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
private ImageView roomGameArrow;
private TextView gameTitle;
public SudGameListPopup(@NonNull Context context, long interactionID, List<CustomSidebarChildModel> child) {
super(context);
this.interactionID = interactionID;
customSidebarChildModels = child;
}
// 返回自定义弹窗的布局
@Override
protected int getImplLayoutId() {
return R.layout.dialog_sud_game_list;
}
// 执行初始化操作比如findView设置点击或者任何你弹窗内的业务逻辑
@Override
protected void onCreate() {
super.onCreate();
Bus.getOn(this);
initView();
initDate();
}
private void initDate() {
}
private void initView() {
roomGameArrow = findViewById(R.id.room_game_arrow);
gameTitle = findViewById(R.id.game_title);
for (CustomSidebarChildModel model : customSidebarChildModels) {
if (TextUtils.equals(String.valueOf(interactionID), model.getSrc())) {
gameTitle.setText(model.getTitle().substring(0, 2));
}
}
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.interactive_game_room_game), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 0f, 90f);
animator.setDuration(500);
animator.setInterpolator(new LinearInterpolator());
animator.start();
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.interactive_game_room_game));
builder.hasShadowBg(false)
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Bottom)
.asCustom(new SudGameListSelectPopup(getContext(), 0, customSidebarChildModels, interactionID))
.show();
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.interactive_game_add), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
new XPopup.Builder(getContext())
.enableDrag(false)
.asCustom(new CreateSudGamePopup(getContext(), customSidebarChildModels))
.show();
}
});
}
@Override
protected void onDismiss() {
Bus.getOff(this);
super.onDismiss();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSudGameListEvent(SudGameListEvent event) {
interactionID = event.getInteractionID();
gameTitle.setText(event.getTitle().substring(0, 2));
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 90f, 0f);
animator.setDuration(500);
animator.setInterpolator(new LinearInterpolator());
animator.start();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSudGameListDissMissEvent(SudGameListDissMissEvent event) {
dialog.dismiss();
}
}

View File

@ -0,0 +1,94 @@
package com.yunbao.common.dialog;
import android.content.Context;
import android.text.TextUtils;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
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.CreateSudGameEvent;
import com.yunbao.common.event.SudGameListEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import java.util.ArrayList;
import java.util.List;
public class SudGameListSelectPopup extends AttachPopupView {
private int mType;
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
private List<String> selectString = new ArrayList<>();
private TextView topSelect;
private RecyclerView sudTitleSelect;
private SudTitleSelectAdapter sudTitleSelectAdapter;
private long interactionID = 0;
public SudGameListSelectPopup(@NonNull Context context, int type, List<CustomSidebarChildModel> child, long interactionID) {
super(context);
customSidebarChildModels = child;
mType = type;
this.interactionID = interactionID;
}
protected int getImplLayoutId() {
return R.layout.view_sud_game_slelect;
}
@Override
protected void onCreate() {
topSelect = findViewById(R.id.top_select);
sudTitleSelect = findViewById(R.id.sud_title_select);
int index = -1;
if (mType == 0 || mType == 4) {
topSelect.setText(getContext().getString(R.string.interactive_game_room_all));
for (int i = 0; i < customSidebarChildModels.size(); i++) {
selectString.add(customSidebarChildModels.get(i).getTitle());
if (TextUtils.equals(String.valueOf(interactionID), customSidebarChildModels.get(i).getSrc())) {
index = i;
}
}
sudTitleSelectAdapter = new SudTitleSelectAdapter(selectString, index);
sudTitleSelect.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
sudTitleSelect.setAdapter(sudTitleSelectAdapter);
if (interactionID == 0) {
topSelect.setSelected(true);
}
if (mType == 4) {
topSelect.setVisibility(GONE);
}
sudTitleSelectAdapter.setSudTitleSelectCallBack(new SudTitleSelectAdapter.SudTitleSelectCallBack() {
@Override
public void onSudTitleSelectCallBack(int index) {
if (mType == 0) {
Bus.get().post(new SudGameListEvent()
.setInteractionID(Long.parseLong(customSidebarChildModels.get(index).getSrc()))
.setTitle(customSidebarChildModels.get(index).getTitle()));
} else {
Bus.get().post(new CreateSudGameEvent()
.setInteractionID(Long.parseLong(customSidebarChildModels.get(index).getSrc()))
.setId(customSidebarChildModels.get(index).getId())
.setTitle(customSidebarChildModels.get(index).getTitle()));
}
dialog.dismiss();
}
});
}
ViewClicksAntiShake.clicksAntiShake(topSelect, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
Bus.get().post(new SudGameListEvent().setInteractionID(0L).setTitle(getContext().getString(R.string.interactive_game_room_all)));
dialog.dismiss();
}
});
}
}

View File

@ -0,0 +1,38 @@
package com.yunbao.common.event;
import android.widget.TextView;
import com.yunbao.common.bean.BaseModel;
public class CreateSudGameEvent extends BaseModel {
private long interactionID = 0;
private String title;
private String id;
public String getId() {
return id;
}
public CreateSudGameEvent setId(String id) {
this.id = id;
return this;
}
public String getTitle() {
return title;
}
public CreateSudGameEvent setTitle(String title) {
this.title = title;
return this;
}
public long getInteractionID() {
return interactionID;
}
public CreateSudGameEvent setInteractionID(long interactionID) {
this.interactionID = interactionID;
return this;
}
}

View File

@ -1,6 +1,10 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.CustomSidebarChildModel;
import java.util.ArrayList;
import java.util.List;
public class CustomDrawerPopupEvent extends BaseModel {
//是否关闭弹窗
@ -31,6 +35,17 @@ public class CustomDrawerPopupEvent extends BaseModel {
private boolean interaction = false;
private long interactionID;
private List<CustomSidebarChildModel> child = new ArrayList<>();
public List<CustomSidebarChildModel> getChild() {
return child;
}
public CustomDrawerPopupEvent setChild(List<CustomSidebarChildModel> child) {
this.child = child;
return this;
}
public boolean isInteraction() {
return interaction;
}

View File

@ -1,6 +1,10 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.CustomSidebarChildModel;
import java.util.ArrayList;
import java.util.List;
public class NewRoleCustomDrawerPopupEvent extends BaseModel {
//是否关闭弹窗
@ -30,6 +34,16 @@ public class NewRoleCustomDrawerPopupEvent extends BaseModel {
private boolean fontSize = false;
private boolean interaction = false;
private long interactionID;
private List<CustomSidebarChildModel> child = new ArrayList<>();
public List<CustomSidebarChildModel> getChild() {
return child;
}
public NewRoleCustomDrawerPopupEvent setChild(List<CustomSidebarChildModel> child) {
this.child = child;
return this;
}
public boolean isInteraction() {
return interaction;

View File

@ -0,0 +1,6 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
public class SudGameListDissMissEvent extends BaseModel {
}

View File

@ -0,0 +1,26 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
public class SudGameListEvent extends BaseModel {
private long interactionID = 0;
private String title;
public String getTitle() {
return title;
}
public SudGameListEvent setTitle(String title) {
this.title = title;
return this;
}
public long getInteractionID() {
return interactionID;
}
public SudGameListEvent setInteractionID(long interactionID) {
this.interactionID = interactionID;
return this;
}
}

View File

@ -8,6 +8,7 @@ import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.BlindBoxInfoModel;
import com.yunbao.common.bean.CheckLiveModel;
import com.yunbao.common.bean.ContributeModel;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.DiscountsModel;
import com.yunbao.common.bean.EnterRoomNewModel;
@ -972,10 +973,22 @@ public interface PDLiveApi {
/**
* 获取游戏code
*
* @return
*/
@GET("/api/public/?service=Sudgame.getCode")
Observable<ResponseModel<List<SudgameCodeModel>>> getCode();
/**
* 创建游戏房
*
* @return
*/
@GET("/api/public/?service=Sudgameserver.createSudRoom")
Observable<ResponseModel<CreateSudRoomModel>> createSudRoom(
@Query("room_name") String roomName,
@Query("golden_bean_number") String goldenBeanNumber,
@Query("game_id") String gameId);
}

View File

@ -10,6 +10,7 @@ import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.BlindBoxInfoModel;
import com.yunbao.common.bean.CheckLiveModel;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.DiscountsModel;
import com.yunbao.common.bean.EnterRoomNewModel;
@ -2216,6 +2217,29 @@ public class LiveNetManager {
}).isDisposed();
}
public void createSudRoom(String roomName, String goldenBeanNumber, String gameId, HttpCallback<CreateSudRoomModel> callback) {
API.get().pdLiveApi(mContext)
.createSudRoom(roomName, goldenBeanNumber, gameId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {
@Override
public void accept(ResponseModel<CreateSudRoomModel> createSudRoomModelResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
/**
* 直播间取消网络请求
*/

View File

@ -13,6 +13,7 @@ import com.lxj.xpopup.enums.PopupPosition;
import com.yunbao.common.R;
import com.yunbao.common.adapter.CustomDrawerPopupAdapter;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.http.live.LiveNetManager;
@ -222,7 +223,7 @@ public class CustomDrawerPopupView extends DrawerPopupView {
void changeFontSize();
void interaction(long interactionID);
void interaction(long interactionID, List<CustomSidebarChildModel> child);
}
@Subscribe(threadMode = ThreadMode.MAIN)
@ -270,7 +271,7 @@ public class CustomDrawerPopupView extends DrawerPopupView {
callBack.changeFontSize();
}
if (event.isInteraction()) {
callBack.interaction(event.getInteractionID());
callBack.interaction(event.getInteractionID(), event.getChild());
}
}

View File

@ -38,19 +38,22 @@ public class InteractionGamesChildViewHolder extends RecyclerView.ViewHolder {
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (!rigts) {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setRightsInterests(model.getTitle()));
} else {
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
if (activityID != 0) {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setInteractionID(activityID).setInteraction(true));
if (interactionGamesCallBack != null) {
interactionGamesCallBack.onItemViewClicks(model, rigts);
}
}
}
});
}
private InteractionGamesCallBack interactionGamesCallBack;
public void setItemViewClicks(InteractionGamesCallBack callBack) {
interactionGamesCallBack = callBack;
}
public interface InteractionGamesCallBack {
void onItemViewClicks(CustomSidebarChildModel model, boolean rigts);
}
}

View File

@ -4,15 +4,21 @@ import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.lifecycle.Observer;
import com.lxj.xpopup.core.BottomPopupView;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.event.LiveNewWishListEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.sud.QuickStartGameViewModel;
import com.yunbao.common.sud.model.GameConfigModel;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@ -26,12 +32,23 @@ public class LiveSudGamePopup extends BottomPopupView {
private String mLiveUid;
private final QuickStartGameViewModel gameViewModel = new QuickStartGameViewModel(); // 创建ViewModel
private CreateSudRoomModel mCreateSudRoomModel;
private TextView gameTitle, roomName, roomNumber;
private RoundedImageView mAvatar;
public LiveSudGamePopup(@NonNull Context context, long interactionID, String liveUid) {
super(context);
mInteractionID = interactionID;
mLiveUid = liveUid;
}
public LiveSudGamePopup(@NonNull Context context, CreateSudRoomModel createSudRoomModel) {
super(context);
mCreateSudRoomModel = createSudRoomModel;
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
}
// 返回自定义弹窗的布局
@Override
protected int getImplLayoutId() {
@ -50,6 +67,23 @@ public class LiveSudGamePopup extends BottomPopupView {
private void initView() {
gameContainer = findViewById(R.id.game_container);
gameTitle = findViewById(R.id.game_title);
roomName = findViewById(R.id.room_name);
roomNumber = findViewById(R.id.room_number);
mAvatar = findViewById(R.id.avatar);
if (mCreateSudRoomModel != null) {
gameTitle.setText(mCreateSudRoomModel.getSudGameName());
roomName.setText(mCreateSudRoomModel.getRoomName());
roomNumber.setText(mCreateSudRoomModel.getSudGameRoomId());
ImgLoader.display(getContext(), mCreateSudRoomModel.getAvatar(), mAvatar);
}
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.exit), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
gameViewModel.onDestroy();
dialog.dismiss();
}
});
gameViewModel.gameViewLiveData.observe(this, new Observer<View>() {
@Override
public void onChanged(View view) {
@ -61,8 +95,10 @@ public class LiveSudGamePopup extends BottomPopupView {
}
});
// 加载游戏参数定义可查看BaseGameViewModel.switchGame()方法注释
// 游戏配置
GameConfigModel gameConfigModel = gameViewModel.getGameConfigModel();
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
// SudMGP平台64bit游戏ID
gameViewModel.switchGame((Activity) getContext(), mLiveUid, mInteractionID);
}

View File

@ -0,0 +1,35 @@
package com.yunbao.common.views;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class SudTitleSelectViewHolder extends RecyclerView.ViewHolder {
private TextView title;
public SudTitleSelectViewHolder(@NonNull View itemView) {
super(itemView);
title = itemView.findViewById(R.id.select_title);
}
public void setData(String titleStr, boolean select, int position,SudTitleSelectListener listener) {
title.setText(titleStr);
title.setSelected(select);
ViewClicksAntiShake.clicksAntiShake(title, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (listener!=null){
listener.onSudTitleSelectCallBack(position);
}
}
});
}
public interface SudTitleSelectListener {
void onSudTitleSelectCallBack(int index);
}
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="90dp" />
<gradient
android:endColor="#83D2FF"
android:startColor="#009FF8" />
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp" />
<solid android:color="#80000000" />
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp" />
<solid android:color="#201E1A" />
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="6dp" />
<solid android:color="#313131" />
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp" />
<solid android:color="#484848" />
<stroke
android:width="0.5dp"
android:color="#E4E4E4" />
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="6dp" />
<stroke
android:width="0.5dp"
android:color="#5c5c5c" />
<solid android:color="#313131" />
</shape>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_selected="false">
<shape>
<solid android:color="#313131" />
</shape>
</item>
<item android:state_selected="true">
<shape>
<solid android:color="#252525" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="486dp"
android:background="@drawable/bg_live_sud_list"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center"
android:text="@string/interactive_game"
android:textColor="#fff"
android:textSize="18sp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="12dp"
android:text="@string/interactive_game_create_room"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="15dp"
android:src="@mipmap/icon_interactive_game_create_room_back" />
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="50dp"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_room_name"
android:textColor="@color/white"
android:textSize="14sp" />
<EditText
android:id="@+id/room_name"
android:layout_width="175dp"
android:layout_height="32dp"
android:background="@drawable/bg_live_sud_list_input"
android:hint="@string/interactive_game_create_room_name_input"
android:paddingStart="12dp"
android:paddingTop="9dp"
android:paddingBottom="9dp"
android:textColor="@color/white"
android:textColorHint="#FFFFFF"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="26dp"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_game_type"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/create_game_type"
android:layout_width="175dp"
android:layout_height="32dp"
android:background="@drawable/bg_live_sud_list_input"
android:paddingStart="12dp"
android:paddingTop="9dp"
android:paddingBottom="9dp"
android:text="@string/interactive_game_create_game_select"
android:textColor="@color/white"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="26dp"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_game_sill"
android:textColor="@color/white"
android:textSize="14sp" />
<EditText
android:id="@+id/game_sill"
android:layout_width="175dp"
android:layout_height="32dp"
android:background="@drawable/bg_live_sud_list_input"
android:paddingStart="12dp"
android:paddingTop="9dp"
android:paddingBottom="9dp"
android:inputType="numberDecimal"
android:hint="@string/interactive_game_create_gold_bean_quantity"
android:textColor="@color/white"
android:textColorHint="#FFFFFF"
android:textSize="10sp" />
</LinearLayout>
<TextView
android:id="@+id/create_room"
android:layout_width="112dp"
android:layout_height="39dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="40dp"
android:background="@mipmap/icon_create_sud_game"
android:gravity="center"
android:text="@string/interactive_game_create_room"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>

View File

@ -1,11 +1,122 @@
<?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"
android:layout_width="match_parent"
android:layout_height="580dp"
android:background="@drawable/bg_live_sud_list"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="14dp"
android:gravity="center_vertical">
<TextView
android:id="@+id/game_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:text="@string/interactive_game_create_room"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="16dp"
android:src="@mipmap/icon_interactive_game_create_room_seats" />
<TextView
android:id="@+id/exit"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/bg_live_sud_game_back"
android:gravity="center"
android:text="@string/video_exit"
android:textColor="#FFFFFF"
android:textSize="12sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/game_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="175dp"
android:layout_height="50dp"
android:layout_marginStart="15dp"
android:layout_marginTop="16dp"
android:background="@drawable/bg_live_sud_game_top"
android:gravity="center_vertical">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="6dp"
android:scaleType="centerCrop"
app:riv_oval="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="4dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_room_name"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/room_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_room_number"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/room_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View File

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="486dp"
android:background="@drawable/bg_live_sud_list"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center"
android:text="@string/interactive_game"
android:textColor="#fff"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="12dp"
android:text="@string/interactive_game_room_list"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="14dp"
android:src="@mipmap/icon_interactive_game__search" />
<ImageView
android:id="@+id/interactive_game_add"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="14dp"
android:src="@mipmap/icon_interactive_game__add" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="17dp"
android:src="@mipmap/icon_interactive_game__ranking" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:text="@string/interactive_game_room_game"
android:textColor="#fff"
android:textSize="14sp" />
<LinearLayout
android:id="@+id/interactive_game_room_game"
android:layout_width="58dp"
android:layout_height="28dp"
android:layout_marginStart="4dp"
android:background="@drawable/bg_live_sud_list_btn"
android:gravity="center_vertical">
<TextView
android:id="@+id/game_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="@string/interactive_game_room_game_all"
android:textColor="#fff"
android:textSize="14sp" />
<ImageView
android:id="@+id/room_game_arrow"
android:layout_width="8dp"
android:layout_height="14dp"
android:layout_marginStart="8dp"
android:src="@mipmap/icon_interactive_game_arrow" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="@string/interactive_game_room_sill"
android:textColor="#fff"
android:textSize="14sp" />
<LinearLayout
android:layout_width="74dp"
android:layout_height="28dp"
android:layout_marginStart="4dp"
android:background="@drawable/bg_live_sud_list_btn"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="@string/interactive_game_room_game_all"
android:textColor="#fff"
android:textSize="14sp" />
<ImageView
android:layout_width="8dp"
android:layout_height="14dp"
android:layout_marginStart="8dp"
android:src="@mipmap/icon_interactive_game_arrow" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="@string/interactive_game_room_house_owner"
android:textColor="#fff"
android:textSize="14sp" />
<LinearLayout
android:layout_width="58dp"
android:layout_height="28dp"
android:layout_marginStart="4dp"
android:background="@drawable/bg_live_sud_list_btn"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="@string/interactive_game_room_game_all"
android:textColor="#fff"
android:textSize="14sp" />
<ImageView
android:layout_width="8dp"
android:layout_height="14dp"
android:layout_marginStart="8dp"
android:src="@mipmap/icon_interactive_game_arrow" />
</LinearLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent" />
<Button
android:layout_width="174dp"
android:layout_height="61dp"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginBottom="24dp"
android:background="@mipmap/icon_interactive_game_room_random_start"
android:gravity="center"
android:text="@string/interactive_game_room_random_start"
android:textColor="#FF8100"
android:textSize="18sp" />
</FrameLayout>
</LinearLayout>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_live_sud_list_select"
android:orientation="vertical"
android:paddingStart="1dp"
android:paddingTop="5dp"
android:paddingEnd="1dp"
android:paddingBottom="5dp">
<TextView
android:id="@+id/top_select"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_live_sud_list_select_item"
android:clickable="true"
android:gravity="center"
android:padding="3dp"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/sud_title_select"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="26dp">
<TextView
android:id="@+id/select_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_live_sud_list_select_item"
android:gravity="center"
android:padding="3dp"
android:textColor="#FFFFFF"
android:clickable="true"
android:textSize="14sp" />
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1320,4 +1320,20 @@ Limited ride And limited avatar frame</string>
<string name="live_mic_anchor_to_user_dialog">Anchor:</string>
<string name="live_send_red_packge_fans_group">Join a fans club</string>
<string name="interactive_game">互動遊戲</string>
<string name="interactive_game_room_list">房間列表</string>
<string name="interactive_game_room_game">游戲:</string>
<string name="interactive_game_room_game_all">所有</string>
<string name="interactive_game_room_sill">門檻:</string>
<string name="interactive_game_room_house_owner">房主:</string>
<string name="interactive_game_room_random_start">隨機開始</string>
<string name="interactive_game_room_all">所有遊戲</string>
<string name="interactive_game_create_room">創建房間</string>
<string name="interactive_game_create_room_name">房間名稱:</string>
<string name="interactive_game_create_room_number">房間號:</string>
<string name="interactive_game_create_room_name_input">請輸入房間名</string>
<string name="interactive_game_create_game_type">游戲類型:</string>
<string name="interactive_game_create_game_sill">游戲門檻:</string>
<string name="interactive_game_create_game_select">請選擇游戲</string>
<string name="interactive_game_create_gold_bean_quantity">請選擇金豆數量</string>
</resources>

View File

@ -45,6 +45,7 @@ import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.CrashSaveBean;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LinkMicUserBean;
import com.yunbao.common.bean.LiveBean;
@ -58,6 +59,7 @@ import com.yunbao.common.dialog.EffectsSettingsDialog;
import com.yunbao.common.dialog.FloatSettingsDialog;
import com.yunbao.common.dialog.LiveChargeDialogFragment;
import com.yunbao.common.dialog.SlideSettingsDialog;
import com.yunbao.common.dialog.SudGameListPopup;
import com.yunbao.common.dialog.YoursystemisolderDialog;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.event.FollowEvent;
@ -983,13 +985,12 @@ public class LiveAudienceActivity extends LiveActivity {
}
@Override
public void interaction(long interactionID) {
public void interaction(long interactionID, List<CustomSidebarChildModel> child) {
new XPopup.Builder(mContext)
.enableDrag(false)
.hasBlurBg(true)
.dismissOnTouchOutside(false)
.dismissOnBackPressed(false)
.asCustom(new LiveSudGamePopup(mContext, interactionID, mLiveUid))
// .dismissOnTouchOutside(false)
// .dismissOnBackPressed(false)
.asCustom(new SudGameListPopup(mContext, interactionID, child))
.show();
}
@ -1675,6 +1676,17 @@ public class LiveAudienceActivity extends LiveActivity {
.setType(LiveAudienceEvent.LiveAudienceType.FAN_CLUB));
}
}
//互动游戏
if (event.isInteraction()){
// callBack.interaction(event.getInteractionID());
new XPopup.Builder(mContext)
.enableDrag(false)
// .dismissOnTouchOutside(false)
// .dismissOnBackPressed(false)
.asCustom(new SudGameListPopup(mContext, event.getInteractionID(), event.getChild()))
.show();
}
}

View File

@ -467,7 +467,6 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
// fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveRoleDialogFragment");
new XPopup.Builder(mContext)
.enableDrag(false)
.hasBlurBg(true)
.asCustom(new LiveNewRolePopup(mContext))
.show();
}

View File

@ -120,7 +120,6 @@
android:layout_width="63dp"
android:layout_height="63dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:scaleType="centerCrop"
app:riv_oval="true" />