From 82c6167441a90d3c477ac6953bfef1864459b528 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 19 Jun 2026 09:19:04 +0200 Subject: [PATCH] Bottom sheet: initial state must be Hidden else there is no animation when opening the bottom sheet. --- .../createroom/impl/configureroom/SelectParentSpaceOptions.kt | 2 +- .../android/features/home/impl/spacefilters/SpaceFiltersView.kt | 2 +- .../android/features/location/impl/share/ShareLocationView.kt | 2 +- .../android/features/location/impl/show/ShowLocationView.kt | 2 +- .../android/features/messages/impl/actionlist/ActionListView.kt | 2 +- .../sendfailure/resolve/ResolveVerifiedUserSendFailureView.kt | 2 +- .../messages/impl/messagecomposer/AttachmentsBottomSheet.kt | 2 +- .../components/customreaction/CustomReactionBottomSheet.kt | 2 +- .../components/receipt/bottomsheet/ReadReceiptBottomSheet.kt | 2 +- .../rolesandpermissions/impl/root/RolesAndPermissionsView.kt | 2 +- .../roommembermoderation/impl/RoomMemberModerationView.kt | 2 +- .../startchat/impl/joinbyaddress/JoinRoomByAddressView.kt | 2 +- .../libraries/designsystem/components/SimpleModalBottomSheet.kt | 2 +- .../libraries/designsystem/theme/components/ModalBottomSheet.kt | 2 +- .../libraries/matrix/ui/components/AvatarActionBottomSheet.kt | 2 +- .../matrix/ui/components/CreateDmConfirmationBottomSheet.kt | 2 +- .../impl/details/MediaDeleteConfirmationBottomSheet.kt | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/SelectParentSpaceOptions.kt b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/SelectParentSpaceOptions.kt index 537424e5ae..c96fbc4d6b 100644 --- a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/SelectParentSpaceOptions.kt +++ b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/SelectParentSpaceOptions.kt @@ -87,7 +87,7 @@ internal fun SelectParentSpaceOptions( if (displaySelectSpaceBottomSheet) { val sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ) ModalBottomSheet( diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spacefilters/SpaceFiltersView.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spacefilters/SpaceFiltersView.kt index a3ca65e6b3..3528dc58a7 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spacefilters/SpaceFiltersView.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spacefilters/SpaceFiltersView.kt @@ -58,7 +58,7 @@ fun SpaceFiltersView( ) { val isSelecting by rememberUpdatedState(state is SpaceFiltersState.Selecting) val sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), confirmValueChange = { sheetValueTarget -> // This ensures the hide animation is not cancelled diff --git a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/share/ShareLocationView.kt b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/share/ShareLocationView.kt index dc857b37a6..b41581fcf6 100644 --- a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/share/ShareLocationView.kt +++ b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/share/ShareLocationView.kt @@ -106,7 +106,7 @@ fun ShareLocationView( val scaffoldState = rememberBottomSheetScaffoldState( bottomSheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, ) ) val cameraState = rememberCameraState(firstPosition = MapDefaults.defaultCameraPosition) diff --git a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt index 9fdbe3aac8..22a118b01b 100644 --- a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt +++ b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt @@ -93,7 +93,7 @@ fun ShowLocationView( val scaffoldState = rememberBottomSheetScaffoldState( bottomSheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, ) ) LaunchedEffect(state.isSheetDraggable) { diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt index 79537df0c3..f3d673fab7 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt @@ -111,7 +111,7 @@ fun ActionListView( modifier: Modifier = Modifier, ) { val sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, ) val coroutineScope = rememberCoroutineScope() val targetItem = (state.target as? ActionListState.Target.Success)?.event diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/crypto/sendfailure/resolve/ResolveVerifiedUserSendFailureView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/crypto/sendfailure/resolve/ResolveVerifiedUserSendFailureView.kt index 797a43884f..a430d4621f 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/crypto/sendfailure/resolve/ResolveVerifiedUserSendFailureView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/crypto/sendfailure/resolve/ResolveVerifiedUserSendFailureView.kt @@ -45,7 +45,7 @@ fun ResolveVerifiedUserSendFailureView( modifier: Modifier = Modifier, ) { val sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ) var showSheet by remember { mutableStateOf(false) } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/AttachmentsBottomSheet.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/AttachmentsBottomSheet.kt index f13575dc27..d6fb2e7357 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/AttachmentsBottomSheet.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/AttachmentsBottomSheet.kt @@ -74,7 +74,7 @@ internal fun AttachmentsBottomSheet( ModalBottomSheet( modifier = modifier, sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ), onDismissRequest = { isVisible = false }, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/customreaction/CustomReactionBottomSheet.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/customreaction/CustomReactionBottomSheet.kt index 8a5db4e84c..5b66a7a9ba 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/customreaction/CustomReactionBottomSheet.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/customreaction/CustomReactionBottomSheet.kt @@ -32,7 +32,7 @@ fun CustomReactionBottomSheet( modifier: Modifier = Modifier, ) { val sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, ) val coroutineScope = rememberCoroutineScope() val target = state.target as? CustomReactionState.Target.Success diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/bottomsheet/ReadReceiptBottomSheet.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/bottomsheet/ReadReceiptBottomSheet.kt index 922f39aee6..8c0bdfc5ca 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/bottomsheet/ReadReceiptBottomSheet.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/bottomsheet/ReadReceiptBottomSheet.kt @@ -46,7 +46,7 @@ internal fun ReadReceiptBottomSheet( val isVisible = state.selectedEvent != null val sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, ) val coroutineScope = rememberCoroutineScope() if (isVisible) { diff --git a/features/rolesandpermissions/impl/src/main/kotlin/io/element/android/features/rolesandpermissions/impl/root/RolesAndPermissionsView.kt b/features/rolesandpermissions/impl/src/main/kotlin/io/element/android/features/rolesandpermissions/impl/root/RolesAndPermissionsView.kt index 393ff70363..2a2f90c5ae 100644 --- a/features/rolesandpermissions/impl/src/main/kotlin/io/element/android/features/rolesandpermissions/impl/root/RolesAndPermissionsView.kt +++ b/features/rolesandpermissions/impl/src/main/kotlin/io/element/android/features/rolesandpermissions/impl/root/RolesAndPermissionsView.kt @@ -143,7 +143,7 @@ private fun ChangeOwnRoleBottomSheet( ) { val coroutineScope = rememberCoroutineScope() val sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ) fun dismiss() { diff --git a/features/roommembermoderation/impl/src/main/kotlin/io/element/android/features/roommembermoderation/impl/RoomMemberModerationView.kt b/features/roommembermoderation/impl/src/main/kotlin/io/element/android/features/roommembermoderation/impl/RoomMemberModerationView.kt index d06035033c..410c573e4d 100644 --- a/features/roommembermoderation/impl/src/main/kotlin/io/element/android/features/roommembermoderation/impl/RoomMemberModerationView.kt +++ b/features/roommembermoderation/impl/src/main/kotlin/io/element/android/features/roommembermoderation/impl/RoomMemberModerationView.kt @@ -223,7 +223,7 @@ private fun RoomMemberActionsBottomSheet( ) { val coroutineScope = rememberCoroutineScope() val bottomSheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ) ModalBottomSheet( diff --git a/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/joinbyaddress/JoinRoomByAddressView.kt b/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/joinbyaddress/JoinRoomByAddressView.kt index 27483e37aa..ffe6a47f0d 100644 --- a/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/joinbyaddress/JoinRoomByAddressView.kt +++ b/features/startchat/impl/src/main/kotlin/io/element/android/features/startchat/impl/joinbyaddress/JoinRoomByAddressView.kt @@ -49,7 +49,7 @@ fun JoinRoomByAddressView( modifier: Modifier = Modifier, ) { val sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ) ModalBottomSheet( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/SimpleModalBottomSheet.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/SimpleModalBottomSheet.kt index 1d65ed76eb..ce4e90ae70 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/SimpleModalBottomSheet.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/SimpleModalBottomSheet.kt @@ -41,7 +41,7 @@ fun SimpleModalBottomSheet( onDismissRequest = onDismiss, modifier = modifier, sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ), scrollable = false, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ModalBottomSheet.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ModalBottomSheet.kt index 65d2a1b64a..6cb49a6218 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ModalBottomSheet.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ModalBottomSheet.kt @@ -59,7 +59,7 @@ fun ModalBottomSheet( scrollable: Boolean, modifier: Modifier = Modifier, sheetState: SheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, ), shape: Shape = BottomSheetDefaults.ExpandedShape, containerColor: Color = MaterialTheme.colorScheme.surface, diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt index b8080971ab..6898f434e0 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt @@ -49,7 +49,7 @@ fun AvatarActionBottomSheet( ) { val coroutineScope = rememberCoroutineScope() val sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ) diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/CreateDmConfirmationBottomSheet.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/CreateDmConfirmationBottomSheet.kt index a269f82b06..d6a65061e1 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/CreateDmConfirmationBottomSheet.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/CreateDmConfirmationBottomSheet.kt @@ -77,7 +77,7 @@ fun CreateDmConfirmationBottomSheet( modifier = modifier, onDismissRequest = onDismiss, sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ), scrollable = false, diff --git a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDeleteConfirmationBottomSheet.kt b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDeleteConfirmationBottomSheet.kt index d0c69a2d6b..c7638da660 100644 --- a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDeleteConfirmationBottomSheet.kt +++ b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDeleteConfirmationBottomSheet.kt @@ -61,7 +61,7 @@ fun MediaDeleteConfirmationBottomSheet( modifier = modifier, onDismissRequest = onDismiss, sheetState = rememberBottomSheetState( - initialValue = SheetValue.Expanded, + initialValue = SheetValue.Hidden, enabledValues = setOf(SheetValue.Hidden, SheetValue.Expanded), ), scrollable = false,