From 4fd14c5cbdf0041571168f7609536cb54c1b4416 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Fri, 25 Oct 2024 10:02:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=87=E5=B0=91=E6=97=B6=E5=8F=AF=E8=83=BD=E7=9A=84?= =?UTF-8?q?=E9=97=AA=E9=80=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java | 3 +++ .../java/com/yunbao/main/views/MainHomeLiveViewHolder.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java index a80245547..713dee169 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java @@ -73,6 +73,9 @@ public class MainHomeLiveAdapter extends RefreshAdapter { } else{ LiveBean mode; if(mList.size()<4){ + if(position>=mList.size()){ + return HEAD; + } mode= mList.get(position); }else { mode = mList.get(position > 4 ? position - 1 : position); diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index c6d04d58e..0c58c81e7 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -167,6 +167,8 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement public int getSpanSize(int position) { if (position == 4) { return 2; + }else if(mAdapter.getList().size()<4&&position==mAdapter.getList().size()){ + return 2; } return 1; }