From 4a637d0a6968f40d569a49eb9397208e857d4100 Mon Sep 17 00:00:00 2001
From: zlzw <583819556@qq.com>
Date: Mon, 21 Nov 2022 15:39:12 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=9A=8F=E6=9C=BAPK=E5=88=86?=
=?UTF-8?q?=E6=94=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/yunbao/common/Constants.java | 1 +
.../res/layout/dialog_live_new_function.xml | 21 ++++
.../res/mipmap-xxhdpi/icon_live_random_pk.png | Bin 0 -> 2385 bytes
common/src/main/res/values/strings.xml | 1 +
.../live/activity/LiveRyAnchorActivity.java | 13 ++
.../dialog/LiveNewFunctionDialogFragment.java | 5 +
.../live/dialog/RandomPkDialogFragment.java | 46 +++++++
.../main/res/drawable/background_7792d0.xml | 9 ++
.../drawable/bg_live_random_pk_info_btn.xml | 9 ++
.../bg_live_random_pk_info_switch.xml | 21 ++++
.../bg_live_random_pk_info_switch_thumb.xml | 26 ++++
.../bg_live_random_pk_info_switch_track.xml | 18 +++
.../layout/dialog_live_random_pk_function.xml | 95 ++++++++++++++
.../main/res/layout/item_random_pk_info.xml | 116 ++++++++++++++++++
live/src/main/res/values/strings.xml | 10 ++
15 files changed, 391 insertions(+)
create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_live_random_pk.png
create mode 100644 live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java
create mode 100644 live/src/main/res/drawable/background_7792d0.xml
create mode 100644 live/src/main/res/drawable/bg_live_random_pk_info_btn.xml
create mode 100644 live/src/main/res/drawable/bg_live_random_pk_info_switch.xml
create mode 100644 live/src/main/res/drawable/bg_live_random_pk_info_switch_thumb.xml
create mode 100644 live/src/main/res/drawable/bg_live_random_pk_info_switch_track.xml
create mode 100644 live/src/main/res/layout/dialog_live_random_pk_function.xml
create mode 100644 live/src/main/res/layout/item_random_pk_info.xml
diff --git a/common/src/main/java/com/yunbao/common/Constants.java b/common/src/main/java/com/yunbao/common/Constants.java
index aa5c3c898..cf043fdb8 100644
--- a/common/src/main/java/com/yunbao/common/Constants.java
+++ b/common/src/main/java/com/yunbao/common/Constants.java
@@ -130,6 +130,7 @@ public class Constants {
public static final int LIVE_FUNC_MIC = 2013;//語音
public static final int LIVE_FUNC_WKS = 2014;//語音
public static final int LIVE_FUNC_ZSLK = 2015;//語音
+ public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK
//socket
public static final String SOCKET_CONN = "conn";
diff --git a/common/src/main/res/layout/dialog_live_new_function.xml b/common/src/main/res/layout/dialog_live_new_function.xml
index 234b8cb67..c60106ebf 100644
--- a/common/src/main/res/layout/dialog_live_new_function.xml
+++ b/common/src/main/res/layout/dialog_live_new_function.xml
@@ -256,6 +256,27 @@
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
+
+
+
+
+
+
Px;3rR#lRCwC$Tx(DhR}|hF2WA)_3^;WdJ9IL`i0#xW;-HnO57Yrs0#-l)rNAgH
z_?*^9E25%xDg{PtZFOo}+NvmE)jnuDQfswPj1CqRrHCR1A7CORgoHddy_jxx3CZr=
zu$x`FIp+^UviI(nd+)jDeCOPYARh6EM?B&Yk9fo*{~Hk@-iQw}3JE~QBcaF)WF|5f
zi9{9wjRb$q1pf&Ip9Fw!_<(PUhB8!dWDFukCL!U-JOD3-LKlH=g@bR4!BgHt4eE1<
zKQaZ00Ask25~#f{1W!ePr~N@ILt+At0An)_5E+
zEsNX&*SdAh20e0Sy}giNB-(9YF^vYjdT}wfer{N|&eyY_yT>`eP3zYAdJb@>a}nsq
zb?baR2fD{85dl|!0q1c0bOCr15&LU*A_s=bxdEHV?phXs4q|ww6WJT(zR4WTJHXNG
zP3%CPtlfcYIgpLD8^8n0?A&4pFuj)jINo=u_hmn3oycjthTEspm~%Lv1Kw-Q5YS+z
zru8@;+GfZ0dK@$H?(87}*UEwoI$j9~
zO_n!Wo{9SLfjkJv^S~PqO2W9Eq}gjU3M*g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*mQ|koGFvHa&%WpY@5I`)0}B_G_q#9^kes
z%$7V*6t##Gs=n;Fp}6fpo7(H|UX)fG+%+|cj$L1zQCf8UCz({qcgMURJO#U!nBoHiY9z~QPYVcib#60YX^IHQhJ#7
zc1HuT+OlLXJEey_DK1^VPW}%LxA*Ch0$心願單
娛樂整蠱
多人PK
+ 随机PK
語音連麥
周星榜
暫時離開
diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java
index 18749ed6a..2f3a8e78d 100644
--- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java
+++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java
@@ -67,6 +67,7 @@ import com.yunbao.live.dialog.LiveLinkMicListDialogFragment;
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment;
import com.yunbao.live.dialog.LiveNewWishListDialogFragment;
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
+import com.yunbao.live.dialog.RandomPkDialogFragment;
import com.yunbao.live.event.LinkMicTxMixStreamEvent;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.http.LiveHttpConsts;
@@ -377,6 +378,9 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
t.mirrorType = TRTC_VIDEO_MIRROR_TYPE_DISABLE;
}
break;
+ case Constants.LIVE_FUNC_RANDOM_PK:
+ openRandomPkWindow();
+ break;
default:
break;
}
@@ -556,6 +560,15 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
fragment.show(getSupportFragmentManager(), "LiveLinkMicListDialogFragment");
}
+ /**
+ * 随机PK
+ */
+ public void openRandomPkWindow(){
+ RandomPkDialogFragment fragment=new RandomPkDialogFragment();
+ Bundle bundle=new Bundle();
+ fragment.setArguments(bundle);
+ fragment.show(getSupportFragmentManager(), "RandomPkDialogFragment");
+ }
/**
* 打开选择游戏窗口
diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java
index 63db923f8..364ea23fd 100644
--- a/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java
+++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java
@@ -25,6 +25,7 @@ import com.yunbao.live.interfaces.LiveFunctionClickListener;
public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements View.OnClickListener {
private View mWishView, mPrankView, mWksView, mBeautyView, mCameraView, mLeaveView, mOnePkView, mMultiPkView, mMicView;
+ private View mRandomPk;
private LiveFunctionClickListener mFunctionClickListener;
private int leave = 0;
private boolean isPk;
@@ -79,6 +80,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mOnePkView = findViewById(R.id.live_tool_one_pk);
mMultiPkView = findViewById(R.id.live_tool_multi_pk);
mMicView = findViewById(R.id.live_tool_mic);
+ mRandomPk = findViewById(R.id.live_tool_random_pk);
mWishView.setOnClickListener(this);
mPrankView.setOnClickListener(this);
@@ -89,6 +91,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mOnePkView.setOnClickListener(this);
mMultiPkView.setOnClickListener(this);
mMicView.setOnClickListener(this);
+ mRandomPk.setOnClickListener(this);
if (leave == 0) {
((ImageView) mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave);
@@ -140,6 +143,8 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mFunctionClickListener.onClick(LIVE_FUNC_DR);
} else if (id == R.id.live_tool_mic) {
mFunctionClickListener.onClick(LIVE_FUNC_MIC);
+ } else if (id == R.id.live_tool_random_pk) {
+ mFunctionClickListener.onClick(LIVE_FUNC_RANDOM_PK);
}
}
}
diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java
new file mode 100644
index 000000000..ed9d1f8ad
--- /dev/null
+++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java
@@ -0,0 +1,46 @@
+package com.yunbao.live.dialog;
+
+import android.view.View;
+import android.view.Window;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.google.android.material.tabs.TabLayout;
+import com.yunbao.common.dialog.AbsDialogFragment;
+import com.yunbao.live.R;
+
+/**
+ * 随机PK
+ */
+public class RandomPkDialogFragment extends AbsDialogFragment {
+ private TabLayout tabLayout;
+ private View reset;
+ private RecyclerView mRecyclerView;
+
+ @Override
+ protected int getLayoutId() {
+ return R.layout.dialog_live_random_pk_function;
+ }
+
+ @Override
+ protected int getDialogStyle() {
+ return R.style.dialog2;
+ }
+
+ @Override
+ protected boolean canCancel() {
+ return true;
+ }
+
+ @Override
+ protected void setWindowAttributes(Window window) {
+ initView();
+ }
+
+ private void initView() {
+ tabLayout = (TabLayout) findViewById(R.id.menu_tab);
+ reset = findViewById(R.id.menu_reset);
+ mRecyclerView = (RecyclerView) findViewById(R.id.random_container_view);
+
+ }
+}
diff --git a/live/src/main/res/drawable/background_7792d0.xml b/live/src/main/res/drawable/background_7792d0.xml
new file mode 100644
index 000000000..47c4546ce
--- /dev/null
+++ b/live/src/main/res/drawable/background_7792d0.xml
@@ -0,0 +1,9 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/live/src/main/res/drawable/bg_live_random_pk_info_btn.xml b/live/src/main/res/drawable/bg_live_random_pk_info_btn.xml
new file mode 100644
index 000000000..497f84aeb
--- /dev/null
+++ b/live/src/main/res/drawable/bg_live_random_pk_info_btn.xml
@@ -0,0 +1,9 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/live/src/main/res/drawable/bg_live_random_pk_info_switch.xml b/live/src/main/res/drawable/bg_live_random_pk_info_switch.xml
new file mode 100644
index 000000000..8235463e9
--- /dev/null
+++ b/live/src/main/res/drawable/bg_live_random_pk_info_switch.xml
@@ -0,0 +1,21 @@
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/live/src/main/res/drawable/bg_live_random_pk_info_switch_thumb.xml b/live/src/main/res/drawable/bg_live_random_pk_info_switch_thumb.xml
new file mode 100644
index 000000000..2222919d5
--- /dev/null
+++ b/live/src/main/res/drawable/bg_live_random_pk_info_switch_thumb.xml
@@ -0,0 +1,26 @@
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/live/src/main/res/drawable/bg_live_random_pk_info_switch_track.xml b/live/src/main/res/drawable/bg_live_random_pk_info_switch_track.xml
new file mode 100644
index 000000000..5816955f5
--- /dev/null
+++ b/live/src/main/res/drawable/bg_live_random_pk_info_switch_track.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/live/src/main/res/layout/dialog_live_random_pk_function.xml b/live/src/main/res/layout/dialog_live_random_pk_function.xml
new file mode 100644
index 000000000..6abeb2d5c
--- /dev/null
+++ b/live/src/main/res/layout/dialog_live_random_pk_function.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/live/src/main/res/layout/item_random_pk_info.xml b/live/src/main/res/layout/item_random_pk_info.xml
new file mode 100644
index 000000000..da4afa0af
--- /dev/null
+++ b/live/src/main/res/layout/item_random_pk_info.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/live/src/main/res/values/strings.xml b/live/src/main/res/values/strings.xml
index 4f77f04c7..de6947d08 100644
--- a/live/src/main/res/values/strings.xml
+++ b/live/src/main/res/values/strings.xml
@@ -27,4 +27,14 @@
已超过10秒未识别到录音
身份特權
貴族坐席
+ PK主要规则说明:
+ 1、开始匹配后,系统将会自动给您挑选对手进行PK;
+ 2、每场PK总时长10分钟,惩罚时间为1分钟;
+ 3、PK过程中,若出现黑屏、卡顿延迟等技术问题,请检查个人设备及网络后,尝试重新登陆开播软件并开播;
+ 4、安全部门将会24小时巡查,请文明PK,严格遵守主播守则;
+ 随机PK开关:
+ 开始匹配
+ 匹配中 %s \n再次点击可取消匹配
+ 正在退出匹配 %s \n退出过程中也有可能匹配到对手
+