娱乐界面小图标bug优化

This commit is contained in:
老皮 2024-09-11 18:24:55 +08:00
parent f1670965b9
commit a1b59733b3
7 changed files with 135 additions and 273 deletions

View File

@ -3,6 +3,7 @@ package com.yunbao.common.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
@ -39,7 +40,8 @@ public class SudGameListAdapter extends RefreshAdapter<SudRoomListModel> {
return new SudGameListViewHolder(mInflater.inflate(R.layout.item_sud_game_list, parent, false));
}*/
return new NewSudGameListViewHolder(mInflater.inflate(R.layout.item_new_game_room, parent, false));
return new NewSudGameListViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_new_game_room, parent, false));
// return new NewSudGameListViewHolder(mInflater.inflate(R.layout.item_new_game_room, parent, false));
}

View File

@ -42,7 +42,7 @@ import java.util.Locale;
public class NewSudGameListViewHolder extends RecyclerView.ViewHolder {
private RoundedImageView mAvatar;
private TextView roomName, playerWeAre, playerWeAre2, goldenBeanNumber;
private ImageView sex, gold_coin;
private ImageView sex,tmpImage;
public NewSudGameListViewHolder(@NonNull View itemView) {
super(itemView);
@ -50,10 +50,9 @@ public class NewSudGameListViewHolder extends RecyclerView.ViewHolder {
roomName = itemView.findViewById(R.id.room_name);
playerWeAre = itemView.findViewById(R.id.player_we_are);
playerWeAre2 = itemView.findViewById(R.id.player_we_are_2);
tmpImage = itemView.findViewById(R.id.tmp_image);
goldenBeanNumber = itemView.findViewById(R.id.golden_bean_number);
gold_coin = itemView.findViewById(R.id.gold_coin);
sex = itemView.findViewById(R.id.sex);
}
@ -61,6 +60,7 @@ public class NewSudGameListViewHolder extends RecyclerView.ViewHolder {
public void setData(SudRoomListModel model, boolean isHome) {
ImgLoader.display(itemView.getContext(), model.getAvatar(), mAvatar);
roomName.setText(model.getRoomName());
roomName.setMaxLines(1);
playerWeAre.setText(String.format(itemView.getContext().getString(R.string.interactive_game_player_we_are_4), model.getPlayerTotal()));
playerWeAre2.setText(String.format(itemView.getContext().getString(R.string.interactive_game_player_we_are_3), model.getTotal()));
goldenBeanNumber.setText(model.getGoldenBeanNumber());
@ -69,11 +69,13 @@ public class NewSudGameListViewHolder extends RecyclerView.ViewHolder {
} else if (TextUtils.equals(model.getSex(), "2")) {
ImgLoader.display(itemView.getContext(), R.mipmap.girl, sex);
}
if (TextUtils.equals(model.getCurrencyType(), "2")) {
// ImgLoader.display(itemView.getContext(), R.mipmap.image, tmp_image);
/* if (TextUtils.equals(model.getCurrencyType(), "2")) {
ImgLoader.display(itemView.getContext(), R.mipmap.icon_collectibles, gold_coin);
} else {
ImgLoader.display(itemView.getContext(), R.mipmap.gold_coin, gold_coin);
}
}*/
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {

View File

@ -1,16 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="168dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardCornerRadius="10dp"
app:cardElevation="0dp"
>
<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:id="@+id/layout"
android:layout_height="match_parent">
android:layout_height="168dp">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
@ -120,8 +114,9 @@
android:src="@mipmap/girl"
/>
<TextView
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff777777"
android:textSize="10sp"
@ -131,19 +126,17 @@
app:layout_constraintTop_toTopOf="@id/tmp_view"
app:layout_constraintBottom_toBottomOf="@id/tmp_view"
android:layout_marginEnd="6dp"
app:layout_constraintStart_toEndOf="@id/tmp_image"
/>
<ImageView
android:id="@+id/tmp_image"
android:layout_width="8dp"
android:layout_height="8dp"
android:src="@mipmap/people"
app:layout_constraintTop_toTopOf="@id/tmp_view"
app:layout_constraintBottom_toBottomOf="@id/tmp_view"
app:layout_constraintStart_toEndOf="@id/sex"
android:layout_marginStart="5dp"
android:id="@+id/tmp_image"
/>
app:layout_constraintEnd_toStartOf="@id/player_we_are"
android:layout_marginEnd="2dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 854 B

View File

@ -1,134 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="168dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardCornerRadius="10dp"
app:cardElevation="0dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="15dp"
android:layout_marginStart="15dp"
app:cardElevation="0dp"
app:cardCornerRadius="10dp"
app:cardBackgroundColor="@color/white"
android:id="@+id/top_view_1"
android:layout_height="25dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@mipmap/image"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toBottomOf="parent"
android:id="@+id/gold_coin"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1,000"
android:textColor="#ff333333"
android:textSize="12sp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/gold_coin"
android:layout_marginEnd="8dp"
android:layout_marginStart="4dp"
android:id="@+id/golden_bean_number"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff000000"
android:textSize="15sp"
android:text="@string/interactive_game_create_room_name"
android:id="@+id/room_name"
app:layout_constraintStart_toStartOf="@id/top_view_1"
app:layout_constraintTop_toBottomOf="@id/top_view_1"
android:layout_marginTop="10dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff777777"
android:textSize="10sp"
android:id="@+id/player_we_are_2"
android:text="@string/interactive_game_player_we_are_2"
app:layout_constraintStart_toStartOf="@id/top_view_1"
app:layout_constraintTop_toBottomOf="@id/room_name"
android:layout_marginTop="10dp"
/>
<TextView
android:layout_width="95dp"
android:layout_height="21dp"
android:background="@drawable/white_alpa_shape"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginBottom="15dp"
android:layout_marginStart="37dp"
android:id="@+id/tmp_view"
/>
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="47dp"
android:layout_height="47dp"
android:scaleType="centerCrop"
app:riv_oval="true"
app:layout_constraintBottom_toBottomOf="@id/tmp_view"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp"
/>
<ImageView
android:id="@+id/sex"
android:layout_width="16dp"
android:layout_height="16dp"
app:layout_constraintBottom_toBottomOf="@id/avatar"
app:layout_constraintEnd_toEndOf="@id/avatar"
android:src="@mipmap/girl"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff777777"
android:textSize="10sp"
android:id="@+id/player_we_are"
android:text="@string/interactive_game_player_we_are"
app:layout_constraintEnd_toEndOf="@id/tmp_view"
app:layout_constraintTop_toTopOf="@id/tmp_view"
app:layout_constraintBottom_toBottomOf="@id/tmp_view"
android:layout_marginEnd="6dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

View File

@ -80,7 +80,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center_vertical">