Fix false positive empty roomlist
This commit is contained in:
parent
6f859c9ca6
commit
e53fbaa11d
|
@ -90,9 +90,10 @@ interface CryptoService {
|
||||||
fun isKeyGossipingEnabled(): Boolean
|
fun isKeyGossipingEnabled(): Boolean
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tells if the current crypto implementation supports MSC3061
|
* Tells if the current crypto implementation supports MSC3061
|
||||||
*/
|
*/
|
||||||
fun supportsShareKeysOnInvite(): Boolean
|
fun supportsShareKeysOnInvite(): Boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* As per MSC3061.
|
* As per MSC3061.
|
||||||
* If true will make it possible to share part of e2ee room history
|
* If true will make it possible to share part of e2ee room history
|
||||||
|
|
|
@ -26,6 +26,7 @@ import im.vector.app.features.home.room.list.RoomListListener
|
||||||
import im.vector.app.features.home.room.list.RoomSummaryItemFactory
|
import im.vector.app.features.home.room.list.RoomSummaryItemFactory
|
||||||
import im.vector.app.features.home.room.list.RoomSummaryPlaceHolderItem_
|
import im.vector.app.features.home.room.list.RoomSummaryPlaceHolderItem_
|
||||||
import im.vector.app.features.settings.FontScalePreferences
|
import im.vector.app.features.settings.FontScalePreferences
|
||||||
|
import org.matrix.android.sdk.api.session.room.ResultBoundaries
|
||||||
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
|
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
|
||||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -53,6 +54,8 @@ class HomeFilteredRoomsController @Inject constructor(
|
||||||
|
|
||||||
private val shouldUseSingleLine: Boolean
|
private val shouldUseSingleLine: Boolean
|
||||||
|
|
||||||
|
var initialLoadOccurred = false
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val fontScale = fontScalePreferences.getResolvedFontScaleValue()
|
val fontScale = fontScalePreferences.getResolvedFontScaleValue()
|
||||||
shouldUseSingleLine = fontScale.scale > FontScalePreferences.SCALE_LARGE
|
shouldUseSingleLine = fontScale.scale > FontScalePreferences.SCALE_LARGE
|
||||||
|
@ -78,6 +81,15 @@ class HomeFilteredRoomsController @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun boundaryChange(boundary: ResultBoundaries) {
|
||||||
|
// Sometimes the room stays on empty state, need
|
||||||
|
val boundaryHasLoadedSomething = boundary.frontLoaded || boundary.zeroItemLoaded
|
||||||
|
if (initialLoadOccurred != boundaryHasLoadedSomething) {
|
||||||
|
initialLoadOccurred = boundaryHasLoadedSomething
|
||||||
|
requestForcedModelBuild()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun submitEmptyStateData(state: StateView.State.Empty?) {
|
fun submitEmptyStateData(state: StateView.State.Empty?) {
|
||||||
this.emptyStateData = state
|
this.emptyStateData = state
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,6 +160,11 @@ class HomeRoomListFragment :
|
||||||
roomListViewModel.filteredPagedRoomSummariesLive.livePagedList.observe(viewLifecycleOwner) { roomsList ->
|
roomListViewModel.filteredPagedRoomSummariesLive.livePagedList.observe(viewLifecycleOwner) { roomsList ->
|
||||||
roomsController.submitRoomsList(roomsList)
|
roomsController.submitRoomsList(roomsList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
roomListViewModel.filteredPagedRoomSummariesLive.liveBoundaries.observe(viewLifecycleOwner) {
|
||||||
|
roomsController.boundaryChange(it)
|
||||||
|
}
|
||||||
|
|
||||||
roomListViewModel.onEach(HomeRoomListViewState::emptyState) { emptyState ->
|
roomListViewModel.onEach(HomeRoomListViewState::emptyState) { emptyState ->
|
||||||
roomsController.submitEmptyStateData(emptyState)
|
roomsController.submitEmptyStateData(emptyState)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue