Fix rendering issue when deleting the last message in a conversation.

This commit is contained in:
Greyson Parrelli
2020-12-09 14:39:22 -05:00
parent ffc0a230be
commit ec8793c6fe
2 changed files with 11 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import androidx.lifecycle.MutableLiveData;
import org.signal.core.util.concurrent.SignalExecutors;
import org.signal.core.util.logging.Log;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executor;
@@ -57,6 +58,11 @@ class FixedSizePagingController<E> implements PagingController {
return;
}
if (loadState.size() == 0) {
liveData.postValue(Collections.emptyList());
return;
}
int leftPageBoundary = (aroundIndex / config.pageSize()) * config.pageSize();
int rightPageBoundary = leftPageBoundary + config.pageSize();
int buffer = config.bufferPages() * config.pageSize();