1、修改消息红标、头像装扮、娱乐顶部列表、等UI问题

This commit is contained in:
老皮 2024-09-14 14:55:20 +08:00
parent 0586360408
commit b9a6d9b966
10 changed files with 100 additions and 56 deletions

View File

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

View File

@ -2,6 +2,7 @@ package com.yunbao.main.adapter;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -9,6 +10,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
@ -116,7 +118,6 @@ public class NewGameRoomTopAdapter extends RecyclerView.Adapter<RecyclerView.Vie
class NewGameRoomTopNormalViewHolder extends RecyclerView.ViewHolder { class NewGameRoomTopNormalViewHolder extends RecyclerView.ViewHolder {
ImageView itemImage; ImageView itemImage;
TextView itemName; TextView itemName;
public NewGameRoomTopNormalViewHolder(@NonNull View itemView) { public NewGameRoomTopNormalViewHolder(@NonNull View itemView) {
super(itemView); super(itemView);
itemImage = itemView.findViewById(R.id.item_image); itemImage = itemView.findViewById(R.id.item_image);

View File

@ -111,7 +111,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
private boolean firstInto = true; private boolean firstInto = true;
private Banner banner_me; private Banner banner_me;
private CardView lt_advertisement; private CardView lt_advertisement;
private SVGAImageView gift_svga;
public MainMeViewHolder(Context context, ViewGroup parentView) { public MainMeViewHolder(Context context, ViewGroup parentView) {
super(context, parentView); super(context, parentView);
} }
@ -171,7 +171,14 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
findViewById(R.id.shouhu_center_tv).setOnClickListener(this); findViewById(R.id.shouhu_center_tv).setOnClickListener(this);
findViewById(R.id.shouhu_center_tv2).setOnClickListener(this); findViewById(R.id.shouhu_center_tv2).setOnClickListener(this);
gift_svga = (SVGAImageView) findViewById(com.yunbao.live.R.id.gift_svga);
ViewClicksAntiShake.clicksAntiShake(gift_svga, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
MobclickAgent.onEvent(mContext, "my_avatar", "个人头像按钮");
RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2);
}
});
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView); mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
mRecyclerView.setHasFixedSize(true); mRecyclerView.setHasFixedSize(true);
@ -315,7 +322,28 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
} }
CommonAppConfig appConfig = CommonAppConfig.getInstance(); CommonAppConfig appConfig = CommonAppConfig.getInstance();
if (u.getDress().getAvatar_frame() != null) {
if (u.getDress().getAvatar_frame().contains("svga")) {
try {
new SVGAParser(mContext).parse(new URL(u.getDress().getAvatar_frame()), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
gift_svga.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(gift_svga, false);
}
@Override
public void onError() {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}
} else {
ImgLoader.display(mContext, u.getDress().getAvatar_frame(), gift_svga);
}
}
if (u.getDress().getMedal() != null) { if (u.getDress().getMedal() != null) {
Log.e("tag", u.getDress().getMedal()); Log.e("tag", u.getDress().getMedal());

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="16dp"/> <corners android:radius="16dp"/>
<solid android:color="#FF3482"/> <solid android:color="#FF4598"/>
</shape> </shape>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffffff" />
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" />
<item android:name="android:shadowColor">#26ff56a5</item>
<item android:name="android:shadowDx">0</item>
<item android:name="android:shadowDy">0</item>
</shape>

View File

@ -3,7 +3,8 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="90dp" android:layout_width="72dp"
android:layout_marginEnd="10dp"
android:layout_height="90dp"> android:layout_height="90dp">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
@ -12,7 +13,7 @@
app:cardBackgroundColor="@color/white" app:cardBackgroundColor="@color/white"
app:cardCornerRadius="15dp" app:cardCornerRadius="15dp"
app:cardElevation="0dp" app:cardElevation="0dp"
android:layout_marginStart="10dp" android:id="@+id/card_view"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

View File

@ -1,47 +1,39 @@
<?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="90dp" android:layout_width="90dp"
android:layout_height="90dp" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardBackgroundColor="@color/white" android:background="@drawable/game_selected_shape"
app:cardCornerRadius="15dp" android:layout_marginEnd="10dp"
app:cardElevation="0dp" android:layout_height="90dp">
android:layout_marginStart="10dp"
>
<androidx.constraintlayout.widget.ConstraintLayout <ImageView
android:layout_width="match_parent" android:layout_width="45dp"
android:layout_height="match_parent"> android:layout_height="45dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="10dp"
android:id="@+id/item_image"
/>
<ImageView <TextView
android:layout_width="45dp" android:layout_width="0dp"
android:layout_height="45dp" android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent" android:text="所有游戏"
app:layout_constraintEnd_toEndOf="parent" android:textColor="#111111"
app:layout_constraintTop_toTopOf="parent" android:textSize="13sp"
android:layout_marginTop="10dp" app:layout_constraintBottom_toBottomOf="parent"
android:id="@+id/item_image" app:layout_constraintStart_toStartOf="parent"
/> app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="14dp"
android:id="@+id/item_name"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:ellipsize="end"
/>
<TextView </androidx.constraintlayout.widget.ConstraintLayout>
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="所有游戏"
android:textColor="#111111"
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="14dp"
android:id="@+id/item_name"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:ellipsize="end"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

View File

@ -13,8 +13,9 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:id="@+id/thumb" android:id="@+id/thumb"
android:layout_width="24dp" android:layout_marginTop="11dp"
android:layout_height="24dp" /> android:layout_width="22dp"
android:layout_height="22dp" />
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
@ -35,11 +36,14 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:background="@drawable/background_ff4598" android:background="@drawable/background_ff4598"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/thumb"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="10dp" android:textSize="10sp"
android:autoSizeMaxTextSize="10sp"
android:autoSizeMinTextSize="7sp"
android:autoSizeTextType="uniform"
android:visibility="gone" /> android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="20dp"> android:paddingTop="40dp">
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -224,6 +224,7 @@
android:layout_width="86dp" android:layout_width="86dp"
android:layout_height="86dp" android:layout_height="86dp"
android:layout_marginStart="18dp" android:layout_marginStart="18dp"
android:layout_marginTop="9dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@ -231,6 +232,16 @@
app:riv_border_width="2dp" app:riv_border_width="2dp"
app:riv_oval="true" /> app:riv_oval="true" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/gift_svga"
android:layout_width="104dp"
android:layout_height="104dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="9dp"
android:scaleType="centerCrop"
app:autoPlay="true" />
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
@ -264,7 +275,7 @@
android:layout_height="17dp" android:layout_height="17dp"
app:layout_constraintBottom_toBottomOf="@id/avatar" app:layout_constraintBottom_toBottomOf="@id/avatar"
app:layout_constraintStart_toStartOf="@id/name" app:layout_constraintStart_toStartOf="@id/name"
android:layout_marginBottom="16dp" android:layout_marginBottom="18dp"
app:cardElevation="0dp" app:cardElevation="0dp"
app:cardBackgroundColor="@color/color_FF8D8D" app:cardBackgroundColor="@color/color_FF8D8D"
app:cardCornerRadius="10dp" app:cardCornerRadius="10dp"