创建随机PK分支

This commit is contained in:
2022-11-21 15:39:12 +08:00
parent 4cd1c22d01
commit 4a637d0a69
15 changed files with 391 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="20dp" />
<solid android:color="#337792D0" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="188dp" android:height="42dp">
<shape android:shape="rectangle">
<solid android:color="#ffffbe41" />
<corners android:radius="21dp" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!--开关按钮关闭时的导轨样式-->
<item android:state_checked="false">
<shape>
<size android:height="25dp" android:width="40dp"/>
<corners android:radius="20dp"/>
<solid android:color="#33000000"/>
</shape>
</item>
<!--开关按钮打开时的导轨样式-->
<item android:state_checked="true">
<shape>
<size android:height="25dp" android:width="40dp"/>
<corners android:radius="20dp"/>
<solid android:color="#F7B500"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!--开关按钮关闭时的导轨样式-->
<item android:state_checked="false">
<shape>
<size android:height="25dp" android:width="25dp"/>
<corners android:radius="20dp"/>
<solid android:color="#FFFFFF"/>
</shape>
</item>
<item android:state_checked="true">
<shape>
<size android:height="25dp" android:width="25dp"/>
<corners android:radius="20dp"/>
<solid android:color="#FFFFFF"/>
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false">
<shape>
<solid android:color="#00000000" />
<corners android:radius="30dp" />
</shape>
</item>
<item android:state_checked="true">
<shape>
<solid android:color="#00000000" />
<corners android:radius="32dp" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content">
<LinearLayout
android:id="@+id/random_menu_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/menu_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="0"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
app:srcCompat="@drawable/rc_picture_icon_back" />
<HorizontalScrollView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_weight="1">
<com.google.android.material.tabs.TabLayout
android:id="@+id/menu_tab"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:tabIndicatorColor="#F6F7FB"
app:tabIndicatorFullWidth="false"
app:tabMaxWidth="100dp"
app:tabMode="scrollable"
app:tabSelectedTextColor="#F6F7FB"
app:tabTextColor="#9A9A9A" />
</HorizontalScrollView>
<LinearLayout
android:id="@+id/menu_reset"
android:layout_width="15dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="0.1"
android:gravity="center"
android:visibility="visible">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="@mipmap/icon_reset" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="1dp"
android:layout_weight="1"
android:gravity="center"
android:text="@string/dialog_reset"
android:textColor="#9A9A9A"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/random_container_view"
android:layout_width="match_parent"
android:layout_height="216dp"
android:layout_marginTop="10dp"
android:layout_weight="1" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content">
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_7792d0"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="15dp"
android:text="@string/random_pk_info_title"
android:textColor="#F6F7FB"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:text="@string/random_pk_info_desc_1"
android:textColor="#F6F7FB"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="10dp"
android:text="@string/random_pk_info_desc_2"
android:textColor="#F6F7FB"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="10dp"
android:text="@string/random_pk_info_desc_3"
android:textColor="#F6F7FB"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="15dp"
android:text="@string/random_pk_info_desc_4"
android:textColor="#F6F7FB"
android:textSize="14sp" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout">
<Button
android:id="@+id/random_pk_info_btn"
android:layout_width="188dp"
android:layout_height="42dp"
android:layout_marginStart="10dp"
android:background="@drawable/bg_live_random_pk_info_btn"
android:text="@string/random_pk_info_btn_start"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/random_pk_info_switch"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/live_random_pk_switch"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/live_random_pk_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_live_random_pk_info_switch"
android:checked="true"
android:thumb="@drawable/bg_live_random_pk_info_switch_thumb"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:track="@drawable/bg_live_random_pk_info_switch_track" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -27,4 +27,14 @@
<string name="more_than" translatable="false">已超过10秒未识别到录音</string>
<string name="live_role_title" translatable="false">身份特權</string>
<string name="noble_seat" translatable="false">貴族坐席</string>
<string name="random_pk_info_title" translatable="false">PK主要规则说明</string>
<string name="random_pk_info_desc_1" translatable="false">1、开始匹配后系统将会自动给您挑选对手进行PK</string>
<string name="random_pk_info_desc_2" translatable="false">2、每场PK总时长10分钟惩罚时间为1分钟</string>
<string name="random_pk_info_desc_3" translatable="false">3、PK过程中若出现黑屏、卡顿延迟等技术问题请检查个人设备及网络后尝试重新登陆开播软件并开播</string>
<string name="random_pk_info_desc_4" translatable="false">4、安全部门将会24小时巡查请文明PK严格遵守主播守则</string>
<string name="random_pk_info_switch" translatable="false">随机PK开关</string>
<string name="random_pk_info_btn_start" translatable="false">开始匹配</string>
<string name="random_pk_info_btn_ing" translatable="false">匹配中 %s \n再次点击可取消匹配</string>
<string name="random_pk_info_btn_end" translatable="false">正在退出匹配 %s \n退出过程中也有可能匹配到对手</string>
</resources>