diff --git a/common/src/main/java/com/yunbao/common/views/NineGridLayout.java b/common/src/main/java/com/yunbao/common/views/NineGridLayout.java index 79d50e655..dde78d5ff 100644 --- a/common/src/main/java/com/yunbao/common/views/NineGridLayout.java +++ b/common/src/main/java/com/yunbao/common/views/NineGridLayout.java @@ -19,6 +19,7 @@ import java.util.List; public class NineGridLayout extends FrameLayout { private Context mContext; + private int fullWidth1; private int mWidth1; private int mWidth2; private int mWidth3; @@ -35,6 +36,9 @@ public class NineGridLayout extends FrameLayout { private List mDataList; private Boolean onIsFUll = false; + public void setOnIsFUll(Boolean onIsFUll) { + this.onIsFUll = onIsFUll; + } public NineGridLayout(Context context) { this(context, null); @@ -58,11 +62,10 @@ public class NineGridLayout extends FrameLayout { DisplayMetrics dm = context.getResources().getDisplayMetrics(); float scale = dm.density; int width = dm.widthPixels - space; + fullWidth1= width; mDividerWidth = dividerWidth; - if (onIsFUll){ - } mWidth1 = (int) (scale * 220 + 0.5f); @@ -106,7 +109,12 @@ public class NineGridLayout extends FrameLayout { if (dataSize == 1) { RoundedImageView imageView = mViewList.get(0); if (mLayoutParams00 == null) { - mLayoutParams00 = new LayoutParams(mWidth1, mWidth1); + if (onIsFUll){ + mLayoutParams00 = new LayoutParams(fullWidth1, fullWidth1); + }else { + mLayoutParams00 = new LayoutParams(mWidth1, mWidth1); + } + } if (imageView.getLayoutParams() != mLayoutParams00) { imageView.setLayoutParams(mLayoutParams00); @@ -114,7 +122,12 @@ public class NineGridLayout extends FrameLayout { if (imageView.getVisibility() != VISIBLE) { imageView.setVisibility(VISIBLE); } - setHeight(mWidth1); + if (onIsFUll){ + setHeight(fullWidth1); + }else { + setHeight(mWidth1); + } + if (mActionListener != null) { mActionListener.displayImage(list.get(0), imageView); } diff --git a/live/src/main/res/drawable/man_bg_2.webp b/live/src/main/res/drawable/man_bg_2.webp new file mode 100644 index 000000000..2c59c784e Binary files /dev/null and b/live/src/main/res/drawable/man_bg_2.webp differ diff --git a/live/src/main/res/mipmap-xhdpi/icon_main_rest_work.png b/live/src/main/res/mipmap-xhdpi/icon_main_rest_work.png deleted file mode 100644 index d93818283..000000000 Binary files a/live/src/main/res/mipmap-xhdpi/icon_main_rest_work.png and /dev/null differ diff --git a/live/src/main/res/mipmap-xhdpi/icon_main_rest_work.webp b/live/src/main/res/mipmap-xhdpi/icon_main_rest_work.webp new file mode 100644 index 000000000..afb8c2180 Binary files /dev/null and b/live/src/main/res/mipmap-xhdpi/icon_main_rest_work.webp differ diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeComAdapter2.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeComAdapter2.java index 7b92a8ab4..35ae9c624 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeComAdapter2.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeComAdapter2.java @@ -109,6 +109,7 @@ public class MainHomeComAdapter2 extends RefreshAdapter { attentionImg = itemView.findViewById(R.id.attentionImg); content = itemView.findViewById(R.id.content); mNineGridLayout = itemView.findViewById(R.id.nine_grid_layout); + mNineGridLayout.setOnIsFUll(true); shareImg = itemView.findViewById(R.id.shareImg); shareText = itemView.findViewById(R.id.shareText); msgImg = itemView.findViewById(R.id.msgImg); diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java index 8b2ea4ca6..290189294 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java @@ -10,6 +10,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.jakewharton.rxbinding3.view.RxView; @@ -111,18 +112,19 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { //直播中 mType.setImageResource(MainIconUtil.getLiveTypeIcon(bean.getType())); mType.setVisibility(View.VISIBLE); - mLiveIco.setImageResource(R.mipmap.icon_main_rest_spot); - mLiveIco.setVisibility(View.VISIBLE); + mLiveIco.setImageResource(R.mipmap.icon_main_rest_work); mNum.setVisibility(View.VISIBLE); liveType.setVisibility(View.VISIBLE); mLiveState.setText(mContext.getString(R.string.lives_state)); } else { views.setVisibility(View.VISIBLE); + + //休息中 mType.setImageResource(MainIconUtil.getLiveTypeIcon(Constants.LIVE_TYPE_RESTING)); mType.setVisibility(View.GONE); - // mLiveIco.setImageResource(R.mipmap.icon_main_rest_spot); - mLiveIco.setVisibility(View.INVISIBLE); + mLiveIco.setImageResource(R.mipmap.icon_main_rest_spot); + // mLiveIco.setVisibility(View.INVISIBLE); mLiveState.setText(mContext.getString(R.string.rest_state)); liveType.setVisibility(View.GONE); mNum.setVisibility(View.GONE); diff --git a/main/src/main/res/drawable/oval_white.xml b/main/src/main/res/drawable/oval_white.xml new file mode 100644 index 000000000..ba291163d --- /dev/null +++ b/main/src/main/res/drawable/oval_white.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/main/src/main/res/layout/item_main_home_lives_pola.xml b/main/src/main/res/layout/item_main_home_lives_pola.xml index c2e84db0a..5b1e7c62a 100644 --- a/main/src/main/res/layout/item_main_home_lives_pola.xml +++ b/main/src/main/res/layout/item_main_home_lives_pola.xml @@ -78,7 +78,7 @@ android:paddingEnd="6dp" android:paddingBottom="2dp" android:textColor="@color/color_white" - android:textSize="12sp" + android:textSize="10sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" tools:text="休息中" /> @@ -90,7 +90,7 @@ android:layout_centerVertical="true" android:layout_marginStart="5dp" android:layout_marginEnd="2dp" - android:src="@mipmap/icon_main_rest_work" + android:background="@drawable/oval_white" app:layout_constraintBottom_toBottomOf="@+id/tv_live_state" app:layout_constraintEnd_toStartOf="@+id/tv_live_state" app:layout_constraintTop_toTopOf="@+id/tv_live_state" /> @@ -109,7 +109,7 @@ android:textStyle="bold" app:dt_left_drawable="@mipmap/ic_yola_live_fire" app:dt_left_height="14dp" - app:dt_left_width="14dp" + app:dt_left_width="11.67dp" app:layout_constraintBottom_toBottomOf="@+id/name" app:layout_constraintTop_toTopOf="@+id/name" app:layout_constraintEnd_toEndOf="parent" @@ -252,11 +252,13 @@ android:textColor="#fff" android:textSize="12sp" android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="@+id/num" + app:layout_constraintBottom_toBottomOf="@+id/num2" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/num" + app:layout_constraintTop_toTopOf="@+id/num2" tools:text="mame" /> + + diff --git a/main/src/main/res/layout/view_homemain.xml b/main/src/main/res/layout/view_homemain.xml index e2c5886d2..06be2dfed 100644 --- a/main/src/main/res/layout/view_homemain.xml +++ b/main/src/main/res/layout/view_homemain.xml @@ -8,7 +8,6 @@ diff --git a/main/src/main/res/layout/view_main_message_head.xml b/main/src/main/res/layout/view_main_message_head.xml index fe80a0353..9286fe8de 100644 --- a/main/src/main/res/layout/view_main_message_head.xml +++ b/main/src/main/res/layout/view_main_message_head.xml @@ -4,9 +4,16 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@mipmap/bg_yola_index" android:orientation="vertical"> +