diff --git a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt index 31b735dbcd..64a2f5eba7 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt @@ -36,6 +36,7 @@ import im.vector.app.R import im.vector.app.RoomGroupingMethod import im.vector.app.core.extensions.restart import im.vector.app.core.extensions.toMvRxBundle +import im.vector.app.core.platform.StateView import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.resources.ColorProvider @@ -521,6 +522,13 @@ class HomeDetailFragment @Inject constructor( private fun setupViewPager(roomGroupingMethod: RoomGroupingMethod, spaces: List?, tab: HomeTab) { val oldAdapter = views.roomListContainerPager.adapter as? FragmentStateAdapter val pagingAllowed = vectorPreferences.enableSpacePager() && tab is HomeTab.RoomList + if (pagingAllowed && spaces == null) { + Timber.i("Home pager: Skip initial setup, root spaces not known yet") + views.roomListContainerStateView.state = StateView.State.Loading + return + } else { + views.roomListContainerStateView.state = StateView.State.Content + } if (DEBUG_VIEW_PAGER) Timber.i("Home pager: setup, old adapter: $oldAdapter") val unsafeSpaces = spaces?.map { it.roomId } ?: listOf() val selectedSpaceId = (roomGroupingMethod as? RoomGroupingMethod.BySpace)?.spaceSummary?.roomId diff --git a/vector/src/main/res/layout/fragment_home_detail.xml b/vector/src/main/res/layout/fragment_home_detail.xml index e7397648ea..2cf3bdb940 100644 --- a/vector/src/main/res/layout/fragment_home_detail.xml +++ b/vector/src/main/res/layout/fragment_home_detail.xml @@ -146,12 +146,17 @@ app:layout_constraintTop_toBottomOf="@id/homeKeysBackupBanner" /> --> - + app:layout_constraintTop_toBottomOf="@+id/homeKeysBackupBanner"> + +