1:修改点歌中的历史点歌中昨日列表
This commit is contained in:
@@ -181,7 +181,7 @@ public class SongHistoryFragment extends BaseMvpFragment<RequestSongPresenter,Fr
|
||||
@Override
|
||||
public void singerSongList(SongPlaylist s) {
|
||||
|
||||
if (s != null &&s.getLists()!=null && s.getLists().size() > 0 ) {
|
||||
if (s != null && !s.getLists().isEmpty()) {
|
||||
// 判断当前是刷新还是加载更多
|
||||
RefreshState state = mBinding.smartRefreshLayout.getState();
|
||||
if (state == RefreshState.Refreshing) {
|
||||
@@ -192,7 +192,7 @@ public class SongHistoryFragment extends BaseMvpFragment<RequestSongPresenter,Fr
|
||||
mBinding.smartRefreshLayout.finishRefresh(true);
|
||||
} else if (state == RefreshState.Loading) {
|
||||
// 加载更多,添加数据到列表
|
||||
if (s.getLists().size() > 0) {
|
||||
if (!s.getLists().isEmpty()) {
|
||||
// 只添加新加载的数据,而不是整个列表
|
||||
songList.addAll(s.getLists());
|
||||
adapter.addData(s.getLists());
|
||||
@@ -210,6 +210,8 @@ public class SongHistoryFragment extends BaseMvpFragment<RequestSongPresenter,Fr
|
||||
}
|
||||
|
||||
} else {
|
||||
songList.clear();
|
||||
adapter.notifyDataSetChanged();
|
||||
// 数据为空
|
||||
if (mBinding.smartRefreshLayout.getState() == RefreshState.Refreshing) {
|
||||
mBinding.smartRefreshLayout.finishRefresh(false);
|
||||
|
||||
Reference in New Issue
Block a user