修改问题

This commit is contained in:
18401019693 2024-04-10 09:51:28 +08:00
parent a100ab1a4a
commit 2a67cf7228
3 changed files with 73 additions and 25 deletions

View File

@ -7,11 +7,13 @@ import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.main.R;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.main.utils.MainIconUtil;
@ -64,6 +66,7 @@ public class MainHomeFollowAdapter extends RefreshAdapter<LiveBean> {
TextView mTitle;
TextView mNum;
ImageView mType;
private View redPacket, dragon_money;
public Vh(View itemView) {
super(itemView);
@ -73,6 +76,8 @@ public class MainHomeFollowAdapter extends RefreshAdapter<LiveBean> {
mTitle = (TextView) itemView.findViewById(R.id.title);
mNum = (TextView) itemView.findViewById(R.id.num);
mType = (ImageView) itemView.findViewById(R.id.type);
redPacket = itemView.findViewById(R.id.red_packet);
dragon_money = itemView.findViewById(R.id.dragon_money);
itemView.setOnClickListener(mOnClickListener);
}
@ -101,6 +106,21 @@ public class MainHomeFollowAdapter extends RefreshAdapter<LiveBean> {
mType.setImageResource(MainIconUtil.getLiveTypeIcon(Constants.LIVE_TYPE_RESTING));
}
// mType.setImageResource(MainIconUtil.getLiveTypeIcon(bean.getType()));
RelativeLayout.LayoutParams dragon_moneyLayoutParams = (RelativeLayout.LayoutParams) dragon_money.getLayoutParams();
if (bean.getRedPacketStatus() == 1) {
dragon_moneyLayoutParams.topMargin = DpUtil.dp2px(55);
redPacket.setVisibility(View.VISIBLE);
} else {
dragon_moneyLayoutParams.topMargin = DpUtil.dp2px(25);
redPacket.setVisibility(View.GONE);
}
if (bean.getSendMoneyLongStatus() == 1) {
dragon_money.setLayoutParams(dragon_moneyLayoutParams);
dragon_money.setVisibility(View.VISIBLE);
} else {
dragon_money.setVisibility(View.GONE);
}
}
}

View File

@ -7,6 +7,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -19,6 +20,7 @@ import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.formatBigNum;
import com.yunbao.main.R;
import com.yunbao.main.utils.MainIconUtil;
@ -79,11 +81,12 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter<LiveBean> {
ImageView dr_pk_ico;
View views;
ImageView bgs;
private View redPacket;
private View redPacket, dragon_money;
public Vh(View itemView) {
super(itemView);
redPacket = itemView.findViewById(R.id.red_packet);
dragon_money = itemView.findViewById(R.id.dragon_money);
live_info_view = (LinearLayout) itemView.findViewById(R.id.live_info_view);
mCover = (ImageView) itemView.findViewById(R.id.cover);
mName = (TextView) itemView.findViewById(R.id.name);
@ -222,10 +225,20 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter<LiveBean> {
if (bean.getIs_week() != null && bean.getIs_week().equals("1")) {
views.setVisibility(View.GONE);
}
RelativeLayout.LayoutParams dragon_moneyLayoutParams = (RelativeLayout.LayoutParams) dragon_money.getLayoutParams();
if (bean.getRedPacketStatus() == 1) {
dragon_moneyLayoutParams.topMargin = DpUtil.dp2px(55);
redPacket.setVisibility(View.VISIBLE);
} else {
dragon_moneyLayoutParams.topMargin = DpUtil.dp2px(25);
redPacket.setVisibility(View.GONE);
}
if (bean.getSendMoneyLongStatus() == 1) {
dragon_money.setLayoutParams(dragon_moneyLayoutParams);
dragon_money.setVisibility(View.VISIBLE);
} else {
dragon_money.setVisibility(View.GONE);
}
}

View File

@ -1,19 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<com.yunbao.common.custom.MyRelativeLayout5
xmlns:android="http://schemas.android.com/apk/res/android"
<com.yunbao.common.custom.MyRelativeLayout5 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="0dp"
android:layout_marginTop="5dp"
>
android:layout_marginTop="5dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:riv_corner_radius="5dp"
/>
app:riv_corner_radius="5dp" />
<com.yunbao.common.custom.RatioRoundImageView
android:layout_width="match_parent"
@ -22,30 +20,28 @@
android:src="@mipmap/bg_main_item_bottom"
app:ri_ratio="0.5"
app:riv_corner_radius_bottom_left="5dp"
app:riv_corner_radius_bottom_right="5dp"
/>
app:riv_corner_radius_bottom_right="5dp" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="6dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="8dp"
android:layout_marginTop="6dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="6dp"
android:scaleType="centerCrop"
app:riv_oval="true"
/>
app:riv_oval="true" />
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@id/avatar"
android:layout_marginRight="10dp"
android:layout_alignParentRight="true"
android:layout_marginTop="7dp"
android:layout_marginRight="10dp"
android:drawablePadding="4dp"
android:gravity="center"
android:singleLine="true"
@ -53,8 +49,7 @@
android:textSize="13sp"
app:dt_left_drawable="@mipmap/icon_main_live_num"
app:dt_left_height="14dp"
app:dt_left_width="14dp"
/>
app:dt_left_width="14dp" />
<TextView
@ -62,15 +57,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@id/avatar"
android:layout_marginRight="10dp"
android:layout_marginTop="6dp"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@id/num"
android:layout_toRightOf="@id/avatar"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#fff"
android:textSize="14sp"
/>
android:textSize="14sp" />
<TextView
android:id="@+id/title"
@ -78,15 +72,14 @@
android:layout_height="wrap_content"
android:layout_above="@id/avatar"
android:layout_marginLeft="10dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="2"
android:textColor="#fff"
android:textSize="14sp"
android:textStyle="bold"
/>
android:textStyle="bold" />
<ImageView
android:id="@+id/type"
@ -94,7 +87,29 @@
android:layout_height="16dp"
android:layout_above="@id/title"
android:layout_marginLeft="10dp"
android:scaleType="fitXY"
/>
android:scaleType="fitXY" />
<ImageView
android:id="@+id/dragon_money"
android:layout_width="25dp"
android:layout_height="30dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="25dp"
android:layout_marginTop="55dp"
android:visibility="gone"
app:srcCompat="@mipmap/icon_live_dragon_money"
tools:visibility="visible" />
<ImageView
android:id="@+id/red_packet"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="20dp"
android:layout_marginTop="25dp"
android:visibility="gone"
app:srcCompat="@mipmap/icon_red_packet"
tools:visibility="visible" />
</com.yunbao.common.custom.MyRelativeLayout5>