|
@@ -161,15 +161,22 @@ public class ConversationListViewModel extends AndroidViewModel {
|
|
|
RongIMClient.getInstance().getConversationListByPage(new RongIMClient.ResultCallback<List<Conversation>>() {
|
|
|
@Override
|
|
|
public void onSuccess(List<Conversation> conversations) {
|
|
|
- mUiConversationList.clear();
|
|
|
if (loadMore) {
|
|
|
mRefreshEventLiveData.postValue(new Event.RefreshEvent(RefreshState.LoadFinish));
|
|
|
} else {
|
|
|
mRefreshEventLiveData.postValue(new Event.RefreshEvent(RefreshState.RefreshFinish));
|
|
|
}
|
|
|
if (conversations == null || conversations.size() == 0) {
|
|
|
- mConversationListLiveData.postValue(new ArrayList<BaseUiConversation>());
|
|
|
+ if (loadMore) {
|
|
|
+ //没有更多
|
|
|
+ } else {
|
|
|
+ mConversationListLiveData.postValue(new ArrayList<BaseUiConversation>());
|
|
|
+ }
|
|
|
return;
|
|
|
+ } else {
|
|
|
+ if (!loadMore) {
|
|
|
+ mUiConversationList.clear();
|
|
|
+ }
|
|
|
}
|
|
|
RLog.d(TAG, "getConversationListByPage. size:" + conversations.size());
|
|
|
mLastSyncTime = conversations.get(conversations.size() - 1).getSentTime();
|