From 3095438a5cd2681737c0c011ecf9fb6462e7fe9c Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 3 Jun 2023 11:08:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=92=E8=A1=8C=E6=A6=9C?= =?UTF-8?q?=E6=A6=9C=E5=8D=95=E6=A0=B7=E5=BC=8F=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=A6=9C=E7=A5=9E=E7=A7=98=E4=BA=BA=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E5=85=B3=E6=B3=A8=E6=8C=89=E9=92=AE=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=95=B4=E4=BD=93UI=E4=B8=8B=E9=99=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/main/views/AbsMainListChildViewHolder.java | 9 +++++++-- main/src/main/res/layout/activity_main_list.xml | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java b/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java index 81ce41e48..bbcb5b2cd 100644 --- a/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java @@ -66,6 +66,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple private OnAppbarListener appbarListener; private AppBarLayout rootView; private CollapsingToolbarLayout toolbarLayout; + private View rootLayout; public AbsMainListChildViewHolder(Context context, ViewGroup parentView) { super(context, parentView); @@ -82,6 +83,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple mRefreshView = (CommonRefreshView) findViewById(R.id.refreshView); mBackgroundLayout = findViewById(R.id.bg_layout); rootView = (AppBarLayout) findViewById(R.id.rootView); + rootLayout = findViewById(R.id.root_layout); toolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.toolbar_layout); hv = new HeadView(rootView); mRefreshView.setEmptyLayoutId(R.layout.view_no_data_list); @@ -342,19 +344,22 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple if (bean.getIslive() == 1) { setVisibility(View.VISIBLE, position, liveing1, liveing2, liveing3); } - setVisibility(bean.isHide() ? View.GONE : View.VISIBLE, position, mBtnFollow1, mBtnFollow2, mBtnFollow3); + setVisibility(bean.isHide() ? View.INVISIBLE : View.VISIBLE, position, mBtnFollow1, mBtnFollow2, mBtnFollow3); if (bean.getAttention() != 1) { getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).doChecked(true); getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setText("+" + mContext.getString(R.string.follow)); if (isRankOne == 0) { getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ffff79c2); getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF")); + rootLayout.setBackgroundColor(Color.parseColor("#FF90C0")); } else if (isRankOne == 1) { getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_7bbaff); getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF")); + rootLayout.setBackgroundColor(Color.parseColor("#92A9FF")); } else if (isRankOne == 2) { getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ff9072); getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF")); + rootLayout.setBackgroundColor(Color.parseColor("#FFB991")); } getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.VISIBLE); } else { @@ -367,7 +372,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple ImgLoader.display(mContext, R.mipmap.hide, getItem(position, mAvatar1, mAvatar2, mAvatar3)); getItem(position, mSex1, mSex2, mSex3).setVisibility(View.GONE); - setVisibility(View.GONE, position, mBtnFollow1, mBtnFollow2, mBtnFollow3); + setVisibility(View.INVISIBLE, position, mBtnFollow1, mBtnFollow2, mBtnFollow3); } else { ImgLoader.display(mContext, bean.getAvatarThumb(), getItem(position, mAvatar1, mAvatar2, mAvatar3)); getItem(position, mName1, mName2, mName3).setText(bean.getUserNiceName()); diff --git a/main/src/main/res/layout/activity_main_list.xml b/main/src/main/res/layout/activity_main_list.xml index d5ff6d106..84fc90703 100644 --- a/main/src/main/res/layout/activity_main_list.xml +++ b/main/src/main/res/layout/activity_main_list.xml @@ -3,6 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" + android:id="@+id/root_layout" + android:background="#FF90C0" android:layout_height="match_parent">