修改随机开始,修改游戏的上座和结束的逻辑,添加中英文
This commit is contained in:
@@ -36,7 +36,6 @@ import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.RandomUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
@@ -144,19 +143,32 @@ public class MainHomeGameViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(com.yunbao.common.R.id.random_start), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(mContext)
|
||||
.randomRoom(new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (data != null) {
|
||||
Intent intent = new Intent(context, SudGameActivity.class);
|
||||
intent.putExtra("CreateSudRoom", new Gson().toJson(data));
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
// List<SudRoomListModel> sudRoomListModels = sudGameListAdapter.getList();
|
||||
// if (sudRoomListModels.size() > 1) {
|
||||
// int random = RandomUtil.nextInt(sudRoomListModels.size() - 1);
|
||||
// CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
|
||||
// createSudRoomModel.setSudGameId(sudRoomListModels.get(random).getSudGameId());
|
||||
// createSudRoomModel.setSudGameRoomId(sudRoomListModels.get(random).getSudGameRoomId());
|
||||
// createSudRoomModel.setAvatar(sudRoomListModels.get(random).getAvatar());
|
||||
// createSudRoomModel.setRoomName(sudRoomListModels.get(random).getRoomName());
|
||||
// createSudRoomModel.setSudGameName(sudRoomListModels.get(random).getSudGameName());
|
||||
|
||||
List<SudRoomListModel> sudRoomListModels = sudGameListAdapter.getList();
|
||||
if (sudRoomListModels.size() > 1) {
|
||||
int random = RandomUtil.nextInt(sudRoomListModels.size() - 1);
|
||||
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
|
||||
createSudRoomModel.setSudGameId(sudRoomListModels.get(random).getSudGameId());
|
||||
createSudRoomModel.setSudGameRoomId(sudRoomListModels.get(random).getSudGameRoomId());
|
||||
createSudRoomModel.setAvatar(sudRoomListModels.get(random).getAvatar());
|
||||
createSudRoomModel.setRoomName(sudRoomListModels.get(random).getRoomName());
|
||||
createSudRoomModel.setSudGameName(sudRoomListModels.get(random).getSudGameName());
|
||||
Intent intent = new Intent(context, SudGameActivity.class);
|
||||
intent.putExtra("CreateSudRoom", new Gson().toJson(createSudRoomModel));
|
||||
context.startActivity(intent);
|
||||
// new XPopup.Builder(mContext)
|
||||
// .enableDrag(false)
|
||||
// .dismissOnTouchOutside(false)
|
||||
@@ -164,7 +176,6 @@ public class MainHomeGameViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
// .asCustom(new LiveSudGamePopup(mContext, createSudRoomModel))
|
||||
// .show();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@@ -239,7 +250,7 @@ public class MainHomeGameViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.asCustom(new CreateSudGamePopup(mContext, customSidebarChildModels,true).setHomeView(true))
|
||||
.asCustom(new CreateSudGamePopup(mContext, customSidebarChildModels, true).setHomeView(true))
|
||||
|
||||
.show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user