update 随机PK

This commit is contained in:
zlzw 2022-11-24 18:08:45 +08:00
parent e0b69be2d4
commit ed6b531b8d
7 changed files with 32 additions and 26 deletions

View File

@ -103,7 +103,11 @@ public class RandomPkRecyclerAdapter extends RefreshAdapter<RandomPkBean> {
itemView.setBackgroundResource(R.drawable.bg_item_random_pk_type_2);
}
ImgLoader.display(mContext, bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName());
if(bean.getUserNiceName().length()>4){
mName.setText(bean.getUserNiceName().substring(0,4)+"...");
}else {
mName.setText(bean.getUserNiceName());
}
mId.setText(bean.getId());
mStatus.setText(bean.getStatus());
if (bean.isPkIng()) {

View File

@ -167,7 +167,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment {
RandomPkBean bean = new RandomPkBean();
bean.setId(i + "");
bean.setAvatar("https://ceshi.yaoulive.com/default.jpg");
bean.setUserNiceName("测试样本" + i);
bean.setUserNiceName(i + "测试样本123456");
bean.setStatus(i % 3 == 0 ? "PK中" : "空闲");
bean.setPkIng(i % 3 == 0);
bean.setFollow(i % 2 == 0);
@ -202,6 +202,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment {
mSearchLayout.setVisibility(View.INVISIBLE);
switch ((int) tab.getTag()) {
case 1:
mSearchLayout.setVisibility(View.GONE);
mPkInfoLayout.setVisibility(View.VISIBLE);
break;
case 2:

View File

@ -2,7 +2,7 @@
<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"
android:layout_height="330dp"
android:background="@drawable/bg_live_tota">
<LinearLayout
@ -18,7 +18,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_height="50dp"
android:layout_marginBottom="5dp"
android:gravity="center"
android:orientation="horizontal">
@ -91,13 +91,13 @@
<include
layout="@layout/item_random_pk_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="280dp"
android:visibility="visible" />
<include
layout="@layout/item_random_pk_rv_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="32dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:visibility="gone" />
@ -105,9 +105,8 @@
<com.yunbao.common.custom.CommonRefreshView
android:id="@+id/random_container_view"
android:layout_width="match_parent"
android:layout_height="216dp"
android:layout_height="238dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:visibility="gone">
</com.yunbao.common.custom.CommonRefreshView>

View File

@ -43,7 +43,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:text="@string/random_pk_info_desc_2"
android:textColor="#F6F7FB"
@ -53,7 +53,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:text="@string/random_pk_info_desc_3"
android:textColor="#F6F7FB"
@ -63,7 +63,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="15dp"
android:text="@string/random_pk_info_desc_4"

View File

@ -51,7 +51,7 @@
android:id="@+id/item_uid"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_weight="0.8"
android:gravity="center"
android:text="ID"
android:textColor="#FFFFFF"

View File

@ -1,9 +1,9 @@
<?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:id="@+id/random_pk_search_layout"
android:layout_width="match_parent"
android:layout_height="32dp"
android:id="@+id/random_pk_search_layout"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_random_pk_rv_search"
@ -22,16 +22,17 @@
<EditText
android:id="@+id/search_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginStart="5dp"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:hint="@string/random_pk_search_hint"
android:textColorHint="#80FFFFFF"
android:inputType="textPersonName"
android:textColor="#FFFFFF" />
android:textColor="#FFFFFF"
android:textColorHint="#80FFFFFF"
android:textSize="14sp" />
<ImageView
android:id="@+id/search_clear"

View File

@ -27,15 +27,16 @@
<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>
<string name="random_pk_search_hint" translatable="false">请输入您要pk的主播昵称或id</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>
<string name="random_pk_search_hint" translatable="false">請輸入您要pk的主播昵稱或id</string>
</resources>