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; }