Do not use hard wrapping.

This commit is contained in:
Onuray Sahin 2020-09-29 20:46:47 +03:00 committed by Benoit Marty
parent 5d190a8137
commit 4dbeaeb465
2 changed files with 5 additions and 7 deletions

View File

@ -118,9 +118,9 @@ class SearchFragment @Inject constructor(
}
override fun onItemClicked(event: Event) {
event.roomId ?: return
navigator.openRoom(requireContext(), event.roomId!!, event.eventId)
event.roomId?.let {
navigator.openRoom(requireContext(), it, event.eventId)
}
}
override fun loadMore() {

View File

@ -48,9 +48,7 @@ class SearchResultController @Inject constructor(
}
override fun buildModels(data: SearchViewState?) {
data?.searchResult?.results ?: return
if (!data.searchResult.nextBatch.isNullOrEmpty()) {
if (!data?.searchResult?.nextBatch.isNullOrEmpty()) {
loadingItem {
// Always use a different id, because we can be notified several times of visibility state changed
id("loadMore${idx++}")
@ -62,7 +60,7 @@ class SearchResultController @Inject constructor(
}
}
buildSearchResultItems(data.searchResult.results!!)
buildSearchResultItems(data?.searchResult?.results.orEmpty())
}
private fun buildSearchResultItems(events: List<Event>) {