游戏规则页面

This commit is contained in:
18401019693 2023-11-08 10:23:45 +08:00
parent 816fd21fbc
commit 54aa5fee67
17 changed files with 335 additions and 12 deletions

View File

@ -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<CreateSudRoomModel>() {
.randomRoom(id, mSill, roomHolderType, new com.yunbao.common.http.base.HttpCallback<CreateSudRoomModel>() {
@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();
}
});

View File

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

View File

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

View File

@ -49,12 +49,13 @@
android:src="@mipmap/icon_interactive_game__add" />
<ImageView
android:id="@+id/sud_rule_bottom"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="17dp"
android:src="@mipmap/icon_interactive_game__ranking"
android:visibility="gone" />
android:src="@mipmap/icon_sud_rule_bottom"
android:visibility="visible" />
</LinearLayout>
<LinearLayout

View File

@ -0,0 +1,100 @@
<?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="450dp"
android:background="@drawable/bg_live_sud_list"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/regular_bubble"
android:textColor="#FFFFFF"
android:textSize="24sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="21dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="21dp"
android:ellipsize="end"
android:maxLines="3"
android:text="@string/sud_in_game_rule_hint1"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="21dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="21dp"
android:ellipsize="end"
android:maxLines="4"
android:text="@string/sud_in_game_rule_hint2"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="21dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="21dp"
android:ellipsize="end"
android:maxLines="3"
android:text="@string/sud_in_game_rule_hint3"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="21dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="21dp"
android:ellipsize="end"
android:maxLines="5"
android:text="@string/sud_in_game_rule_hint4"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="21dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="21dp"
android:layout_marginBottom="22dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/sud_in_game_rule_hint5"
android:textColor="@color/white"
android:textSize="14sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<ImageView
android:id="@+id/sud_rule_close"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="15dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="12dp"
android:src="@mipmap/icon_sud_rule_close_bottom" />
</FrameLayout>
</LinearLayout>

View File

@ -0,0 +1,109 @@
<?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="match_parent"
android:background="@color/transparent"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="4dp"
android:layout_marginStart="17dp"
android:layout_marginEnd="17dp"
app:cardElevation="12dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/regular_bubble"
android:textColor="#FFA800"
android:textSize="24sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="10dp"
android:ellipsize="end"
android:maxLines="3"
android:text="@string/sud_in_game_rule_hint1"
android:textColor="#333333"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="10dp"
android:ellipsize="end"
android:maxLines="4"
android:text="@string/sud_in_game_rule_hint2"
android:textColor="#333333"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="10dp"
android:ellipsize="end"
android:maxLines="3"
android:text="@string/sud_in_game_rule_hint3"
android:textColor="#333333"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="10dp"
android:ellipsize="end"
android:maxLines="5"
android:text="@string/sud_in_game_rule_hint4"
android:textColor="#333333"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="42dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/sud_in_game_rule_hint5"
android:textColor="#333333"
android:textSize="14sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<ImageView
android:id="@+id/sud_rule_close"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="end"
android:layout_marginTop="10dp"
android:layout_marginEnd="12dp"
android:src="@mipmap/icon_sud_rule_close" />
</FrameLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1286,7 +1286,7 @@ Limited ride And limited avatar frame</string>
<string name="gift_wall_entrance8_8">Equal love: The cumulative number of people who have given gifts to the anchor reaches 50 to light up this achievement;</string>
<string name="gift_wall_entrance8_9">Gift machine: when the accumulated number of gifts reaches 1000, this achievement will be activated;</string>
<string name="gift_wall_entrance8_10">Lighting Master: Unlock [Gift Wall] reaches 100 to light up this achievement.</string>
<string name="regular_bubble">rule</string>
<string name="regular_bubble">Rules</string>
<string name="unlit_icon_hint2">The current event has not sent any gifts</string>
<string name="rule_introduction">Rule introduction</string>
<string name="gift_details_hint">Gift details</string>
@ -1367,5 +1367,10 @@ Limited ride And limited avatar frame</string>
<string name="currently_in_the_game">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</string>
<string name="the_live_room">Exiting the live room will synchronize with exiting the game room. \n Do you want to continue</string>
<string name="sud_in_game_minimize">minimize</string>
<string name="sud_in_game_rule_hint1">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;</string>
<string name="sud_in_game_rule_hint2">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;</string>
<string name="sud_in_game_rule_hint3">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;</string>
<string name="sud_in_game_rule_hint4">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;</string>
<string name="sud_in_game_rule_hint5">5. The final interpretation right of the event belongs to PDLIVE.</string>
</resources>

View File

@ -1364,4 +1364,9 @@
<string name="currently_in_the_game">您正在遊戲中,請及時返回 長時間未返回將會視爲認輸哦</string>
<string name="the_live_room">退出直播間將會同步退出遊戲房間 是否继续</string>
<string name="sud_in_game_minimize">最小化</string>
<string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊用戶可以在首頁【遊戲專區】或直播間內參與</string>
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】後續將會提供更多遊戲種類敬請期待</string>
<string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻要求在100~50000金豆之間數額必須為10的倍數</string>
<string name="sud_in_game_rule_hint4">4、遊戲開始時將會收取參與遊戲用戶的門檻金豆在遊戲結束後將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶;</string>
<string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string>
</resources>

View File

@ -1363,4 +1363,9 @@
<string name="currently_in_the_game">若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】</string>
<string name="the_live_room">退出直播間將會同步退出遊戲房間 是否继续</string>
<string name="sud_in_game_minimize">最小化</string>
<string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊用戶可以在首頁【遊戲專區】或直播間內參與</string>
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】後續將會提供更多遊戲種類敬請期待</string>
<string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻要求在100~50000金豆之間數額必須為10的倍數</string>
<string name="sud_in_game_rule_hint4">4、遊戲開始時將會收取參與遊戲用戶的門檻金豆在遊戲結束後將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶;</string>
<string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string>
</resources>

View File

@ -1363,5 +1363,10 @@
<string name="currently_in_the_game">若您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦\n【最小化期間將無法切換直播間】</string>
<string name="the_live_room">退出直播間將會同步退出遊戲房間\n是否继续</string>
<string name="sud_in_game_minimize">最小化</string>
<string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊用戶可以在首頁【遊戲專區】或直播間內參與</string>
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】後續將會提供更多遊戲種類敬請期待</string>
<string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻要求在100~50000金豆之間數額必須為10的倍數</string>
<string name="sud_in_game_rule_hint4">4、遊戲開始時將會收取參與遊戲用戶的門檻金豆在遊戲結束後將收取10%的金豆作為門票,剩餘金豆將全部給予勝利用戶,平局時將會扣除相應金豆门票後返還給用戶;</string>
<string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string>
</resources>

View File

@ -1285,7 +1285,7 @@ Limited ride And limited avatar frame</string>
<string name="gift_wall_entrance8_8">Equal love: The cumulative number of people who have given gifts to the anchor reaches 50 to light up this achievement;</string>
<string name="gift_wall_entrance8_9">Gift machine: when the accumulated number of gifts reaches 1000, this achievement will be activated;</string>
<string name="gift_wall_entrance8_10">Lighting Master: Unlock [Gift Wall] reaches 100 to light up this achievement.</string>
<string name="regular_bubble">rule</string>
<string name="regular_bubble">Rules</string>
<string name="codex">Illustrated book</string>
<string name="honorary_achievement">Honor achievement</string>
<string name="lit_icon">Lit up</string>
@ -1371,4 +1371,9 @@ Limited ride And limited avatar frame</string>
<string name="sud_in_game">IN GAME</string>
<string name="sud_in_game_minimize">minimize</string>
<string name="sud_in_game_random_name">随机</string>
<string name="sud_in_game_rule_hint1">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;</string>
<string name="sud_in_game_rule_hint2">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;</string>
<string name="sud_in_game_rule_hint3">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;</string>
<string name="sud_in_game_rule_hint4">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;</string>
<string name="sud_in_game_rule_hint5">5. The final interpretation right of the event belongs to PDLIVE.</string>
</resources>

View File

@ -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<CreateSudRoomModel>() {
.randomRoom(id, mSill, roomHolderType, 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);
}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();

View File

@ -42,12 +42,13 @@
android:src="@mipmap/icon_home_interactive_game_add" />
<ImageView
android:id="@+id/sud_rule"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="17dp"
android:src="@mipmap/icon_home_interactive_game_ranking"
android:visibility="gone" />
android:src="@mipmap/icon_sud_rule"
android:visibility="visible" />
</LinearLayout>
<LinearLayout