From e2148c3f31d26aae56be22f5eafde7043be77b82 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 26 Sep 2023 09:53:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=88=97=E8=A1=A8=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E6=B8=B8=E6=88=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/dialog/SudGameListPopup.java | 26 +++++++++++++++++-- .../main/res/layout/dialog_sud_game_list.xml | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/dialog/SudGameListPopup.java b/common/src/main/java/com/yunbao/common/dialog/SudGameListPopup.java index b704fa65d..306e74f9d 100644 --- a/common/src/main/java/com/yunbao/common/dialog/SudGameListPopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameListPopup.java @@ -26,10 +26,10 @@ import com.yunbao.common.event.RoomHolderTypeEvent; import com.yunbao.common.event.SudGameListDissMissEvent; import com.yunbao.common.event.SudGameListEvent; import com.yunbao.common.event.SudGameListSillEvent; -import com.yunbao.common.event.SudRoomListModelEvent; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.RandomUtil; import com.yunbao.common.views.LiveSudGamePopup; import com.yunbao.common.views.weight.ViewClicksAntiShake; @@ -149,7 +149,30 @@ public class SudGameListPopup extends BottomPopupView { }); mRefreshView.initData(); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.random_start), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + List 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()); + new XPopup.Builder(getContext()) + .enableDrag(false) + .dismissOnTouchOutside(false) + .dismissOnBackPressed(false) + .asCustom(new LiveSudGamePopup(getContext(), createSudRoomModel)) + .show(); + dialog.dismiss(); + } + + } + }); ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.interactive_game_room_game), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { @@ -273,7 +296,6 @@ public class SudGameListPopup extends BottomPopupView { } - @Subscribe(threadMode = ThreadMode.MAIN) public void onSudGameListDissMissEvent(SudGameListDissMissEvent event) { dialog.dismiss(); diff --git a/common/src/main/res/layout/dialog_sud_game_list.xml b/common/src/main/res/layout/dialog_sud_game_list.xml index d17e6609f..94c8b8918 100644 --- a/common/src/main/res/layout/dialog_sud_game_list.xml +++ b/common/src/main/res/layout/dialog_sud_game_list.xml @@ -174,6 +174,7 @@ android:layout_marginRight="5dp" />