修复首页数据过少时可能的闪退问题
This commit is contained in:
parent
6aefceae32
commit
4fd14c5cbd
@ -73,6 +73,9 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
} 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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user