Display back button when the conversation pane is expanded.

This commit is contained in:
Alex Hart
2025-10-20 16:17:31 -03:00
committed by Greyson Parrelli
parent f38262c0ab
commit 43bb32e64b
3 changed files with 53 additions and 2 deletions

View File

@@ -415,6 +415,26 @@ class MainActivity : PassphraseRequiredActivity(), VoiceNoteMediaControllerOwner
}
}
val scope = rememberCoroutineScope()
BackHandler(paneExpansionState.currentAnchor == detailOnlyAnchor) {
scope.launch {
paneExpansionState.animateTo(listOnlyAnchor)
}
}
LaunchedEffect(paneExpansionState.currentAnchor, detailOnlyAnchor, listOnlyAnchor, detailAndListAnchor) {
val isFullScreenPane = when (paneExpansionState.currentAnchor) {
listOnlyAnchor, detailOnlyAnchor -> {
true
}
else -> {
false
}
}
mainNavigationViewModel.onPaneAnchorChanged(isFullScreenPane)
}
LaunchedEffect(paneExpansionState, detailOnlyAnchor, listOnlyAnchor, wrappedNavigator) {
mainNavigationViewModel.detailLocation.collect {
if (paneExpansionState.currentAnchor == listOnlyAnchor) {