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