主播语音聊天的UI修改完成

This commit is contained in:
ningwenqiang 2024-09-14 15:25:10 +08:00
parent 0a08b67fb1
commit 91f18b01b9
6 changed files with 803 additions and 457 deletions

View File

@ -0,0 +1,17 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:gravity="center_horizontal">
<shape android:shape="oval">
<solid android:color="#1a000000" /> <!-- 外圈 -->
</shape>
</item>
<item
android:bottom="4dp"
android:gravity="center_horizontal"
android:left="4dp"
android:right="4dp"
android:top="4dp">
<shape android:shape="oval">
<solid android:color="#2a000000" /> <!-- 深蓝色 -->
</shape>
</item>
</layer-list>

View File

@ -330,9 +330,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
static ImageView pk5Ico; static ImageView pk5Ico;
static RelativeLayout pk5; static RelativeLayout pk5;
RelativeLayout mic_view; Group mic_view,mic_view1,mic_view2;
RelativeLayout mic_view1; View video_chat_bg1,video_chat_bg2,video_chat_bg3;
RelativeLayout mic_view2;
static ImageView mic_ico; static ImageView mic_ico;
static RoundedImageView mic_ico1; static RoundedImageView mic_ico1;
@ -830,19 +830,19 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
} }
} }
mic_view.setOnClickListener(new View.OnClickListener() { video_chat_bg1.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
xz(mic_ids.get(0)); xz(mic_ids.get(0));
} }
}); });
mic_view1.setOnClickListener(new View.OnClickListener() { video_chat_bg2.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
xz(mic_ids.get(1)); xz(mic_ids.get(1));
} }
}); });
mic_view2.setOnClickListener(new View.OnClickListener() { video_chat_bg3.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
xz(mic_ids.get(2)); xz(mic_ids.get(2));
@ -1739,9 +1739,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
pk4 = (RelativeLayout) findViewById(R.id.pk4); pk4 = (RelativeLayout) findViewById(R.id.pk4);
pk5 = (RelativeLayout) findViewById(R.id.pk5); pk5 = (RelativeLayout) findViewById(R.id.pk5);
mic_view = (RelativeLayout) findViewById(R.id.mic_view); mic_view = findViewById(R.id.mic_view);
mic_view1 = (RelativeLayout) findViewById(R.id.mic_view1); mic_view1 = findViewById(R.id.mic_view1);
mic_view2 = (RelativeLayout) findViewById(R.id.mic_view2); mic_view2 = findViewById(R.id.mic_view2);
video_chat_bg1 = findViewById(R.id.video_chat_bg1);
video_chat_bg2 = findViewById(R.id.video_chat_bg2);
video_chat_bg3 = findViewById(R.id.video_chat_bg3);
flipper = (ViewFlipper) findViewById(R.id.hour_rank_list); flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
mic_ico = (ImageView) findViewById(R.id.mic_ico); mic_ico = (ImageView) findViewById(R.id.mic_ico);
newMessage = (ImageView) findViewById(R.id.new_message); newMessage = (ImageView) findViewById(R.id.new_message);

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#33ffffff" />
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
</shape>

View File

@ -234,12 +234,13 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_margin="5dp" android:layout_margin="3dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/pd_pao" app:layout_constraintBottom_toBottomOf="@+id/pd_pao"
app:layout_constraintEnd_toEndOf="@+id/pd_pao" app:layout_constraintEnd_toEndOf="@+id/pd_pao"
app:layout_constraintStart_toStartOf="@+id/pd_pao" app:layout_constraintStart_toStartOf="@+id/pd_pao"
app:layout_constraintTop_toTopOf="@+id/pd_pao" app:layout_constraintTop_toTopOf="@+id/pd_pao"
tools:visibility="gone" /> tools:visibility="visible" />
<TextView <TextView
android:id="@+id/time_text" android:id="@+id/time_text"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,304 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:background="@color/black1"
tools:layout_width="68dp">
<View
android:id="@+id/video_chat_bg1"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:background="@drawable/bg_live_video_chat"
app:layout_constraintDimensionRatio="0.91"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/video_chat_circle1"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/live_voice_chat_role_bg"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_bg1"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.57"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/video_chat_bg1"
app:layout_constraintVertical_bias="0.16"
app:layout_constraintWidth_percent="0.72" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/mic_ico"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_circle1"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="@+id/video_chat_circle1"
app:layout_constraintStart_toStartOf="@+id/video_chat_circle1"
app:layout_constraintTop_toTopOf="@+id/video_chat_circle1"
app:layout_constraintWidth_percent="0.48"
app:riv_oval="true"
tools:src="@drawable/m_chu_xia" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/mic_gift_svga"
android:layout_width="0dp"
android:layout_height="0dp"
app:autoPlay="true"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_circle1"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="@+id/video_chat_circle1"
app:layout_constraintStart_toStartOf="@+id/video_chat_circle1"
app:layout_constraintTop_toTopOf="@+id/video_chat_circle1"
app:layout_constraintWidth_percent="0.61" />
<ImageView
android:id="@+id/userVoice"
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@mipmap/voice_open"
app:layout_constraintEnd_toEndOf="@+id/video_chat_circle1"
app:layout_constraintStart_toStartOf="@+id/video_chat_circle1"
app:layout_constraintTop_toBottomOf="@+id/mic_gift_svga" />
<TextView
android:id="@+id/userName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="2dp"
android:ellipsize="end"
android:maxWidth="50dp"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_bg1"
app:layout_constraintEnd_toEndOf="@+id/video_chat_bg1"
app:layout_constraintStart_toStartOf="@+id/video_chat_bg1"
tools:text="昵称111111111" />
<TextView
android:id="@+id/sorNumberTv"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/bg_live_room_mic_num"
android:gravity="center"
android:text="1"
android:textColor="@color/white"
android:textSize="6sp"
app:layout_constraintBottom_toBottomOf="@+id/userName"
app:layout_constraintEnd_toStartOf="@+id/userName"
app:layout_constraintTop_toTopOf="@+id/userName" />
<androidx.constraintlayout.widget.Group
android:id="@+id/mic_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
app:constraint_referenced_ids="video_chat_bg1,video_chat_circle1,mic_ico,mic_gift_svga,userVoice,userName,sorNumberTv" />
<!--第二条目 -->
<View
android:id="@+id/video_chat_bg2"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:background="@drawable/bg_live_video_chat"
app:layout_constraintDimensionRatio="0.91"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/video_chat_bg1" />
<View
android:id="@+id/video_chat_circle2"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/live_voice_chat_role_bg"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_bg2"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.57"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/video_chat_bg2"
app:layout_constraintVertical_bias="0.16"
app:layout_constraintWidth_percent="0.72" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/mic_ico1"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_circle2"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="@+id/video_chat_circle2"
app:layout_constraintStart_toStartOf="@+id/video_chat_circle2"
app:layout_constraintTop_toTopOf="@+id/video_chat_circle2"
app:layout_constraintWidth_percent="0.48"
app:riv_oval="true"
tools:src="@drawable/m_chu_xia" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/mic_gift_svga1"
android:layout_width="0dp"
android:layout_height="0dp"
app:autoPlay="true"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_circle2"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="@+id/video_chat_circle2"
app:layout_constraintStart_toStartOf="@+id/video_chat_circle2"
app:layout_constraintTop_toTopOf="@+id/video_chat_circle2"
app:layout_constraintWidth_percent="0.61" />
<ImageView
android:id="@+id/userVoice1"
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@mipmap/voice_open"
app:layout_constraintEnd_toEndOf="@+id/video_chat_circle2"
app:layout_constraintStart_toStartOf="@+id/video_chat_circle2"
app:layout_constraintTop_toBottomOf="@+id/mic_gift_svga1" />
<TextView
android:id="@+id/userName1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="2dp"
android:ellipsize="end"
android:maxWidth="50dp"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_bg2"
app:layout_constraintEnd_toEndOf="@+id/video_chat_bg2"
app:layout_constraintStart_toStartOf="@+id/video_chat_bg2"
tools:text="昵称111111111" />
<TextView
android:id="@+id/sorNumberTv1"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/bg_live_room_mic_num"
android:gravity="center"
android:text="2"
android:textColor="@color/white"
android:textSize="6sp"
app:layout_constraintBottom_toBottomOf="@+id/userName1"
app:layout_constraintEnd_toStartOf="@+id/userName1"
app:layout_constraintTop_toTopOf="@+id/userName1" />
<androidx.constraintlayout.widget.Group
android:id="@+id/mic_view1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
app:constraint_referenced_ids="video_chat_bg2,video_chat_circle2,mic_ico1,mic_gift_svga1,userVoice1,userName1,sorNumberTv1" />
<!--第三条目 -->
<View
android:id="@+id/video_chat_bg3"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:background="@drawable/bg_live_video_chat"
app:layout_constraintDimensionRatio="0.91"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/video_chat_bg2" />
<View
android:id="@+id/video_chat_circle3"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/live_voice_chat_role_bg"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_bg3"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.57"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/video_chat_bg3"
app:layout_constraintVertical_bias="0.16"
app:layout_constraintWidth_percent="0.72" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/mic_ico2"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_circle3"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="@+id/video_chat_circle3"
app:layout_constraintStart_toStartOf="@+id/video_chat_circle3"
app:layout_constraintTop_toTopOf="@+id/video_chat_circle3"
app:layout_constraintWidth_percent="0.48"
app:riv_oval="true"
tools:src="@drawable/m_chu_xia" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/mic_gift_svga2"
android:layout_width="0dp"
android:layout_height="0dp"
app:autoPlay="true"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_circle3"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="@+id/video_chat_circle3"
app:layout_constraintStart_toStartOf="@+id/video_chat_circle3"
app:layout_constraintTop_toTopOf="@+id/video_chat_circle3"
app:layout_constraintWidth_percent="0.61" />
<ImageView
android:id="@+id/userVoice2"
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@mipmap/voice_open"
app:layout_constraintEnd_toEndOf="@+id/video_chat_circle3"
app:layout_constraintStart_toStartOf="@+id/video_chat_circle3"
app:layout_constraintTop_toBottomOf="@+id/mic_gift_svga2" />
<TextView
android:id="@+id/userName2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="2dp"
android:ellipsize="end"
android:maxWidth="50dp"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/video_chat_bg3"
app:layout_constraintEnd_toEndOf="@+id/video_chat_bg3"
app:layout_constraintStart_toStartOf="@+id/video_chat_bg3"
tools:text="昵称111111111" />
<TextView
android:id="@+id/sorNumberTv2"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/bg_live_room_mic_num"
android:gravity="center"
android:text="3"
android:textColor="@color/white"
android:textSize="6sp"
app:layout_constraintBottom_toBottomOf="@+id/userName2"
app:layout_constraintEnd_toStartOf="@+id/userName2"
app:layout_constraintTop_toTopOf="@+id/userName2" />
<androidx.constraintlayout.widget.Group
android:id="@+id/mic_view2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
app:constraint_referenced_ids="video_chat_bg3,video_chat_circle3,mic_ico2,mic_gift_svga2,userVoice2,userName2,sorNumberTv2" />
</androidx.constraintlayout.widget.ConstraintLayout>