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 7ce57a4bd..3a7fcca68 100644 --- a/common/src/main/java/com/yunbao/common/dialog/SudGameListPopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameListPopup.java @@ -34,7 +34,6 @@ 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; @@ -158,14 +157,14 @@ public class SudGameListPopup extends BottomPopupView { @Override public void onViewClicks() { LiveNetManager.get(getContext()) - .randomRoom(id, mSill, roomHolderType,new com.yunbao.common.http.base.HttpCallback() { + .randomRoom(id, mSill, roomHolderType, new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(CreateSudRoomModel data) { if (data != null) { Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data)); dialog.dismiss(); - }else { + } else { if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("当前没有可加入的房间"); } else { @@ -254,6 +253,16 @@ public class SudGameListPopup extends BottomPopupView { .asCustom(new CreateSudGamePopup(getContext(), customSidebarChildModels, false)) .show(); + + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule_bottom), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + + new XPopup.Builder(getContext()) + .enableDrag(false) + .asCustom(new SudGameRuleBottom(getContext())).show(); } }); diff --git a/common/src/main/java/com/yunbao/common/dialog/SudGameRuleBottom.java b/common/src/main/java/com/yunbao/common/dialog/SudGameRuleBottom.java new file mode 100644 index 000000000..6a0e84cc4 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameRuleBottom.java @@ -0,0 +1,32 @@ +package com.yunbao.common.dialog; + +import android.content.Context; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.core.BottomPopupView; +import com.yunbao.common.R; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class SudGameRuleBottom extends BottomPopupView { + public SudGameRuleBottom(@NonNull Context context) { + super(context); + } + + @Override + protected int getImplLayoutId() { + return R.layout.sud_game_rule_bottom_popup; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule_close), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/SudGameRulePopup.java b/common/src/main/java/com/yunbao/common/dialog/SudGameRulePopup.java new file mode 100644 index 000000000..71fefc328 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameRulePopup.java @@ -0,0 +1,32 @@ +package com.yunbao.common.dialog; + +import android.content.Context; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class SudGameRulePopup extends CenterPopupView { + public SudGameRulePopup(@NonNull Context context) { + super(context); + } + + @Override + protected int getImplLayoutId() { + return R.layout.sud_game_rule_popup; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule_close), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + 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 27b1b61cb..50ccf0fea 100644 --- a/common/src/main/res/layout/dialog_sud_game_list.xml +++ b/common/src/main/res/layout/dialog_sud_game_list.xml @@ -49,12 +49,13 @@ android:src="@mipmap/icon_interactive_game__add" /> + android:src="@mipmap/icon_sud_rule_bottom" + android:visibility="visible" /> + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/sud_game_rule_popup.xml b/common/src/main/res/layout/sud_game_rule_popup.xml new file mode 100644 index 000000000..7733ff7a5 --- /dev/null +++ b/common/src/main/res/layout/sud_game_rule_popup.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/icon_sud_rule.png b/common/src/main/res/mipmap-xxhdpi/icon_sud_rule.png new file mode 100644 index 000000000..b793e0d97 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_sud_rule.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_sud_rule_bottom.png b/common/src/main/res/mipmap-xxhdpi/icon_sud_rule_bottom.png new file mode 100644 index 000000000..df75369bd Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_sud_rule_bottom.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_sud_rule_close.png b/common/src/main/res/mipmap-xxhdpi/icon_sud_rule_close.png new file mode 100644 index 000000000..a4077b521 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_sud_rule_close.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_sud_rule_close_bottom.png b/common/src/main/res/mipmap-xxhdpi/icon_sud_rule_close_bottom.png new file mode 100644 index 000000000..2e9812f8e Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_sud_rule_close_bottom.png differ diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index a46f1cc00..901764811 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1286,7 +1286,7 @@ Limited ride And limited avatar frame Equal love: The cumulative number of people who have given gifts to the anchor reaches 50 to light up this achievement; Gift machine: when the accumulated number of gifts reaches 1000, this achievement will be activated; Lighting Master: Unlock [Gift Wall] reaches 100 to light up this achievement. - rule + Rules The current event has not sent any gifts Rule introduction Gift details @@ -1367,5 +1367,10 @@ Limited ride And limited avatar frame You are currently in the game, please return in a timely manner.\n Failure to return for a long time will be considered a surrender. \n During the minimization, it will not be able to switch between live rooms Exiting the live room will synchronize with exiting the game room. \n Do you want to continue minimize + 1. Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; + 2. Currently, we have launched \'GoBang\',\' Bumper car \',\' Flying Chess\', \'Minesweeping\', \'Dart Master\', and \'Monster Eliminating\'. We will provide more game types in the future. Stay tuned; + 3. Users can customize the game threshold, which must be between 100 to 50000 gold beans or 10 to 1000 star coins, and the amount must be a multiple of 10; + 4. At the beginning of the game, chips from participating users will be collected. After the game ends, 10% of the chips will be collected as tickets, and all remaining chips will be given to the winning users.In a draw, the corresponding chips will be deducted from the tickets and returned to the users; + 5. The final interpretation right of the event belongs to PDLIVE. diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 9174341da..34df13862 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1364,4 +1364,9 @@ 您正在遊戲中,請及時返回 長時間未返回將會視爲認輸哦 退出直播間將會同步退出遊戲房間 是否继续 最小化 + 1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與; + 2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待; + 3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數; + 4、遊戲開始時將會收取參與遊戲用戶的門檻金豆,在遊戲結束後,將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶; + 5、活動最終解釋權歸PDLIVE所有。 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index ddc2a7f1d..56873da1c 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1363,4 +1363,9 @@ 若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】 退出直播間將會同步退出遊戲房間 是否继续 最小化 + 1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與; + 2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待; + 3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數; + 4、遊戲開始時將會收取參與遊戲用戶的門檻金豆,在遊戲結束後,將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶; + 5、活動最終解釋權歸PDLIVE所有。 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 7aba3c2f6..ef4582d34 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1363,5 +1363,10 @@ 若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】 退出直播間將會同步退出遊戲房間\n是否继续 最小化 + 1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與; + 2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待; + 3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數; + 4、遊戲開始時將會收取參與遊戲用戶的門檻金豆,在遊戲結束後,將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶; + 5、活動最終解釋權歸PDLIVE所有。 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index a86229259..2020cedff 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1285,7 +1285,7 @@ Limited ride And limited avatar frame Equal love: The cumulative number of people who have given gifts to the anchor reaches 50 to light up this achievement; Gift machine: when the accumulated number of gifts reaches 1000, this achievement will be activated; Lighting Master: Unlock [Gift Wall] reaches 100 to light up this achievement. - rule + Rules Illustrated book Honor achievement Lit up @@ -1371,4 +1371,9 @@ Limited ride And limited avatar frame IN GAME minimize 随机 + 1. Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; + 2. Currently, we have launched \'GoBang\',\' Bumper car \',\' Flying Chess\', \'Minesweeping\', \'Dart Master\', and \'Monster Eliminating\'. We will provide more game types in the future. Stay tuned; + 3. Users can customize the game threshold, which must be between 100 to 50000 gold beans or 10 to 1000 star coins, and the amount must be a multiple of 10; + 4. At the beginning of the game, chips from participating users will be collected. After the game ends, 10% of the chips will be collected as tickets, and all remaining chips will be given to the winning users.In a draw, the corresponding chips will be deducted from the tickets and returned to the users; + 5. The final interpretation right of the event belongs to PDLIVE. diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeGameViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeGameViewHolder.java index 522bde3f0..df25a4345 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeGameViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeGameViewHolder.java @@ -1,6 +1,7 @@ package com.yunbao.main.views; import android.animation.ObjectAnimator; +import android.app.Activity; import android.content.DialogInterface; import android.content.Intent; import android.text.TextUtils; @@ -27,6 +28,7 @@ import com.yunbao.common.bean.SudRoomListModel; import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.dialog.CreateSudGamePopup; import com.yunbao.common.dialog.SudGameListSelectPopup; +import com.yunbao.common.dialog.SudGameRulePopup; import com.yunbao.common.dialog.SudGameSearchDialogPopup; import com.yunbao.common.event.RoomHolderTypeEvent; import com.yunbao.common.event.SudGameListEvent; @@ -38,6 +40,8 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.DeviceUtils; +import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.main.R; @@ -105,7 +109,7 @@ public class MainHomeGameViewHolder extends AbsMainHomeChildViewHolder implement @Override public void loadData(int p, com.yunbao.common.http.HttpCallback callback) { - LiveHttpUtil.getRoomList(id, mSill, roomHolderType, "0", p-1, callback); + LiveHttpUtil.getRoomList(id, mSill, roomHolderType, "0", p - 1, callback); } @Override @@ -149,14 +153,14 @@ public class MainHomeGameViewHolder extends AbsMainHomeChildViewHolder implement @Override public void onViewClicks() { LiveNetManager.get(mContext) - .randomRoom(id, mSill, roomHolderType,new com.yunbao.common.http.base.HttpCallback() { + .randomRoom(id, mSill, roomHolderType, new com.yunbao.common.http.base.HttpCallback() { @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); - }else { + } else { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("当前没有可加入的房间"); } else { @@ -295,6 +299,15 @@ public class MainHomeGameViewHolder extends AbsMainHomeChildViewHolder implement } }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_rule), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + new XPopup.Builder(mContext) + .enableDrag(false) + .maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34)) + .asCustom(new SudGameRulePopup(mContext)).show(); + } + }); } private void initData() { @@ -415,6 +428,7 @@ public class MainHomeGameViewHolder extends AbsMainHomeChildViewHolder implement public void onPause() { super.onPause(); } + @Subscribe(threadMode = ThreadMode.MAIN) public void onSudGameListRefreshEvent(SudGameListRefreshEvent event) { mRefreshView.initData(); diff --git a/main/src/main/res/layout/view_main_home_sud_game_list.xml b/main/src/main/res/layout/view_main_home_sud_game_list.xml index 8f3e3b29d..17946d3e3 100644 --- a/main/src/main/res/layout/view_main_home_sud_game_list.xml +++ b/main/src/main/res/layout/view_main_home_sud_game_list.xml @@ -42,12 +42,13 @@ android:src="@mipmap/icon_home_interactive_game_add" /> + android:src="@mipmap/icon_sud_rule" + android:visibility="visible" />