android: remove chats bottom gap when tabs bar is hidden
This commit is contained in:
@@ -505,3 +505,7 @@
|
|||||||
- removed extra outer paddings that shifted headers down/right on some pages,
|
- removed extra outer paddings that shifted headers down/right on some pages,
|
||||||
- separated content padding from top app bar container.
|
- separated content padding from top app bar container.
|
||||||
- Result: consistent title baseline and horizontal alignment between main pages.
|
- Result: consistent title baseline and horizontal alignment between main pages.
|
||||||
|
|
||||||
|
### Step 81 - Chats bottom gap fix when tabs bar hidden
|
||||||
|
- Fixed blank gap at the bottom of chats list when global tabs bar auto-hides on scroll.
|
||||||
|
- Chats screen bottom padding is now dynamic and applied only while tabs bar is visible.
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ fun ChatListRoute(
|
|||||||
onOpenChat: (Long) -> Unit,
|
onOpenChat: (Long) -> Unit,
|
||||||
inviteToken: String?,
|
inviteToken: String?,
|
||||||
onInviteTokenConsumed: () -> Unit,
|
onInviteTokenConsumed: () -> Unit,
|
||||||
|
isMainBarVisible: Boolean,
|
||||||
onMainBarVisibilityChanged: (Boolean) -> Unit,
|
onMainBarVisibilityChanged: (Boolean) -> Unit,
|
||||||
viewModel: ChatListViewModel = hiltViewModel(),
|
viewModel: ChatListViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
@@ -90,6 +91,7 @@ fun ChatListRoute(
|
|||||||
onGlobalSearchChanged = viewModel::onGlobalSearchChanged,
|
onGlobalSearchChanged = viewModel::onGlobalSearchChanged,
|
||||||
onRefresh = viewModel::onPullToRefresh,
|
onRefresh = viewModel::onPullToRefresh,
|
||||||
onOpenChat = onOpenChat,
|
onOpenChat = onOpenChat,
|
||||||
|
isMainBarVisible = isMainBarVisible,
|
||||||
onMainBarVisibilityChanged = onMainBarVisibilityChanged,
|
onMainBarVisibilityChanged = onMainBarVisibilityChanged,
|
||||||
onCreateGroup = viewModel::createGroup,
|
onCreateGroup = viewModel::createGroup,
|
||||||
onCreateChannel = viewModel::createChannel,
|
onCreateChannel = viewModel::createChannel,
|
||||||
@@ -116,6 +118,7 @@ fun ChatListScreen(
|
|||||||
onGlobalSearchChanged: (String) -> Unit,
|
onGlobalSearchChanged: (String) -> Unit,
|
||||||
onRefresh: () -> Unit,
|
onRefresh: () -> Unit,
|
||||||
onOpenChat: (Long) -> Unit,
|
onOpenChat: (Long) -> Unit,
|
||||||
|
isMainBarVisible: Boolean,
|
||||||
onMainBarVisibilityChanged: (Boolean) -> Unit,
|
onMainBarVisibilityChanged: (Boolean) -> Unit,
|
||||||
onCreateGroup: (String, List<Long>) -> Unit,
|
onCreateGroup: (String, List<Long>) -> Unit,
|
||||||
onCreateChannel: (String, String, String?) -> Unit,
|
onCreateChannel: (String, String, String?) -> Unit,
|
||||||
@@ -172,7 +175,7 @@ fun ChatListScreen(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.then(if (isTabletLayout) Modifier.widthIn(max = 820.dp) else Modifier)
|
.then(if (isTabletLayout) Modifier.widthIn(max = 820.dp) else Modifier)
|
||||||
.padding(bottom = 92.dp),
|
.padding(bottom = if (isMainBarVisible) 92.dp else 0.dp),
|
||||||
) {
|
) {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
title = { Text("Chats") },
|
title = { Text("Chats") },
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ fun MessengerNavHost(
|
|||||||
onOpenChat = { chatId ->
|
onOpenChat = { chatId ->
|
||||||
navController.navigate("${Routes.Chat}/$chatId")
|
navController.navigate("${Routes.Chat}/$chatId")
|
||||||
},
|
},
|
||||||
|
isMainBarVisible = isMainBarVisible,
|
||||||
onMainBarVisibilityChanged = { isMainBarVisible = it },
|
onMainBarVisibilityChanged = { isMainBarVisible = it },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user