娱乐界面小图标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.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull; 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 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 { public class NewSudGameListViewHolder extends RecyclerView.ViewHolder {
private RoundedImageView mAvatar; private RoundedImageView mAvatar;
private TextView roomName, playerWeAre, playerWeAre2, goldenBeanNumber; private TextView roomName, playerWeAre, playerWeAre2, goldenBeanNumber;
private ImageView sex, gold_coin; private ImageView sex,tmpImage;
public NewSudGameListViewHolder(@NonNull View itemView) { public NewSudGameListViewHolder(@NonNull View itemView) {
super(itemView); super(itemView);
@ -50,10 +50,9 @@ public class NewSudGameListViewHolder extends RecyclerView.ViewHolder {
roomName = itemView.findViewById(R.id.room_name); roomName = itemView.findViewById(R.id.room_name);
playerWeAre = itemView.findViewById(R.id.player_we_are); playerWeAre = itemView.findViewById(R.id.player_we_are);
playerWeAre2 = itemView.findViewById(R.id.player_we_are_2); playerWeAre2 = itemView.findViewById(R.id.player_we_are_2);
tmpImage = itemView.findViewById(R.id.tmp_image);
goldenBeanNumber = itemView.findViewById(R.id.golden_bean_number); goldenBeanNumber = itemView.findViewById(R.id.golden_bean_number);
gold_coin = itemView.findViewById(R.id.gold_coin);
sex = itemView.findViewById(R.id.sex); sex = itemView.findViewById(R.id.sex);
} }
@ -61,6 +60,7 @@ public class NewSudGameListViewHolder extends RecyclerView.ViewHolder {
public void setData(SudRoomListModel model, boolean isHome) { public void setData(SudRoomListModel model, boolean isHome) {
ImgLoader.display(itemView.getContext(), model.getAvatar(), mAvatar); ImgLoader.display(itemView.getContext(), model.getAvatar(), mAvatar);
roomName.setText(model.getRoomName()); roomName.setText(model.getRoomName());
roomName.setMaxLines(1);
playerWeAre.setText(String.format(itemView.getContext().getString(R.string.interactive_game_player_we_are_4), model.getPlayerTotal())); 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())); playerWeAre2.setText(String.format(itemView.getContext().getString(R.string.interactive_game_player_we_are_3), model.getTotal()));
goldenBeanNumber.setText(model.getGoldenBeanNumber()); goldenBeanNumber.setText(model.getGoldenBeanNumber());
@ -69,11 +69,13 @@ public class NewSudGameListViewHolder extends RecyclerView.ViewHolder {
} else if (TextUtils.equals(model.getSex(), "2")) { } else if (TextUtils.equals(model.getSex(), "2")) {
ImgLoader.display(itemView.getContext(), R.mipmap.girl, sex); 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); ImgLoader.display(itemView.getContext(), R.mipmap.icon_collectibles, gold_coin);
} else { } else {
ImgLoader.display(itemView.getContext(), R.mipmap.gold_coin, gold_coin); ImgLoader.display(itemView.getContext(), R.mipmap.gold_coin, gold_coin);
} }*/
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {

View File

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

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 <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center_vertical"> android:gravity="center_vertical">