From 2a67cf72284a12c28cad21eb2d29e6d02009c598 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 10 Apr 2024 09:51:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/adapter/MainHomeFollowAdapter.java | 20 ++++++ .../adapter/MainHomeRemFollLiveAdapter.java | 15 ++++- .../main/res/layout/item_main_home_follow.xml | 63 ++++++++++++------- 3 files changed, 73 insertions(+), 25 deletions(-) diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeFollowAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeFollowAdapter.java index d7cbd14fd..33d8d091a 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeFollowAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeFollowAdapter.java @@ -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 { 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 { 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 { 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); + } } } diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java index db8c75f09..62fe73882 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java @@ -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 { 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 { 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); } } diff --git a/main/src/main/res/layout/item_main_home_follow.xml b/main/src/main/res/layout/item_main_home_follow.xml index 0810b7d82..68a7392f3 100644 --- a/main/src/main/res/layout/item_main_home_follow.xml +++ b/main/src/main/res/layout/item_main_home_follow.xml @@ -1,19 +1,17 @@ - + android:layout_marginTop="5dp"> + app:riv_corner_radius="5dp" /> + app:riv_corner_radius_bottom_right="5dp" /> + app:riv_oval="true" /> + app:dt_left_width="14dp" /> + android:textSize="14sp" /> + android:textStyle="bold" /> + android:scaleType="fitXY" /> + + + \ No newline at end of file