mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Merge pull request #7825 from element-hq/feature/fga/fix-home-scroll-connection
Fix home screen top bar consuming its own scroll events
This commit is contained in:
+9
-1
@@ -184,7 +184,7 @@ private fun HomeScaffold(
|
|||||||
val spacesLazyListState = rememberLazyListState()
|
val spacesLazyListState = rememberLazyListState()
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
modifier = modifier,
|
||||||
topBar = {
|
topBar = {
|
||||||
HomeTopBar(
|
HomeTopBar(
|
||||||
selectedNavigationItem = state.currentHomeNavigationBarItem,
|
selectedNavigationItem = state.currentHomeNavigationBarItem,
|
||||||
@@ -265,6 +265,13 @@ private fun HomeScaffold(
|
|||||||
val contentPadding = PaddingValues(
|
val contentPadding = PaddingValues(
|
||||||
bottom = 96.dp,
|
bottom = 96.dp,
|
||||||
)
|
)
|
||||||
|
// The nested scroll connection is set on the content and not on the Scaffold, else the top bar would
|
||||||
|
// consume the scroll events of its own content.
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.nestedScroll(scrollBehavior.nestedScrollConnection)
|
||||||
|
) {
|
||||||
when (state.currentHomeNavigationBarItem) {
|
when (state.currentHomeNavigationBarItem) {
|
||||||
HomeNavigationBarItem.Chats -> {
|
HomeNavigationBarItem.Chats -> {
|
||||||
RoomListContentView(
|
RoomListContentView(
|
||||||
@@ -303,6 +310,7 @@ private fun HomeScaffold(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
snackbarHost = { SnackbarHost(snackbarHostState) },
|
snackbarHost = { SnackbarHost(snackbarHostState) },
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user