修复直播列表少一个的问题
This commit is contained in:
parent
f75f0c0f0a
commit
dc7b00c257
@ -19,6 +19,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
@ -70,7 +71,12 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
if (position == 4) {
|
||||
return HEAD;
|
||||
} else{
|
||||
LiveBean mode = mList.get(position>4?position-1:position);
|
||||
LiveBean mode;
|
||||
if(mList.size()<4){
|
||||
mode= mList.get(position);
|
||||
}else {
|
||||
mode = mList.get(position > 4 ? position - 1 : position);
|
||||
}
|
||||
if (TextUtils.equals(mode.getIs_week(), "1")) {
|
||||
return WEEKLAYOUT;
|
||||
} else {
|
||||
@ -138,7 +144,10 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return super.getItemCount();
|
||||
if(mList.isEmpty()){
|
||||
return 0;
|
||||
}
|
||||
return super.getItemCount()+1;
|
||||
}
|
||||
|
||||
class HeadVh extends RecyclerView.ViewHolder {
|
||||
|
Loading…
Reference in New Issue
Block a user