diff --git a/app/src/main/java/mega/privacy/android/app/presentation/meeting/view/ParticipantsFullListView.kt b/app/src/main/java/mega/privacy/android/app/presentation/meeting/view/ParticipantsFullListView.kt index e586899a99..0066717579 100644 --- a/app/src/main/java/mega/privacy/android/app/presentation/meeting/view/ParticipantsFullListView.kt +++ b/app/src/main/java/mega/privacy/android/app/presentation/meeting/view/ParticipantsFullListView.kt @@ -192,11 +192,8 @@ private fun ParticipantsFullListView( val scaffoldState = rememberScaffoldState() val snackbarHostState = remember { SnackbarHostState() } val coroutineScope = rememberCoroutineScope() - val modalSheetState = rememberModalBottomSheetState( - initialValue = ModalBottomSheetValue.Hidden, - confirmValueChange = { it != ModalBottomSheetValue.HalfExpanded }, - skipHalfExpanded = true, - ) + val modalSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden) + var isAdmitAllButtonEnabled by rememberSaveable { mutableStateOf(true) } var isCallUserLimitWarningShown by rememberSaveable { mutableStateOf(false) } diff --git a/app/src/main/java/mega/privacy/android/app/presentation/meeting/view/RecurringMeetingInfoView.kt b/app/src/main/java/mega/privacy/android/app/presentation/meeting/view/RecurringMeetingInfoView.kt index 94db8b02e7..dc583bb81a 100644 --- a/app/src/main/java/mega/privacy/android/app/presentation/meeting/view/RecurringMeetingInfoView.kt +++ b/app/src/main/java/mega/privacy/android/app/presentation/meeting/view/RecurringMeetingInfoView.kt @@ -110,11 +110,7 @@ fun RecurringMeetingInfoView( val scaffoldState = rememberScaffoldState() val snackbarHostState = remember { SnackbarHostState() } val coroutineScope = rememberCoroutineScope() - val modalSheetState = rememberModalBottomSheetState( - initialValue = ModalBottomSheetValue.Hidden, - confirmValueChange = { it != ModalBottomSheetValue.HalfExpanded }, - skipHalfExpanded = true, - ) + val modalSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden) BackHandler(enabled = modalSheetState.isVisible) { coroutineScope.launch { modalSheetState.hide() } diff --git a/app/src/main/java/mega/privacy/android/app/presentation/qrcode/QRCodeView.kt b/app/src/main/java/mega/privacy/android/app/presentation/qrcode/QRCodeView.kt index b85de12496..f966368a81 100644 --- a/app/src/main/java/mega/privacy/android/app/presentation/qrcode/QRCodeView.kt +++ b/app/src/main/java/mega/privacy/android/app/presentation/qrcode/QRCodeView.kt @@ -143,12 +143,7 @@ internal fun QRCodeView( var showScannedContactLinkResult by remember { mutableStateOf(null) } var showInviteContactResult by remember { mutableStateOf(null) } var qrCodeComposableBounds by remember { mutableStateOf(null) } - - val modalSheetState = rememberModalBottomSheetState( - initialValue = ModalBottomSheetValue.Hidden, - confirmValueChange = { it != ModalBottomSheetValue.HalfExpanded }, - skipHalfExpanded = true, - ) + val modalSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden) BackHandler(enabled = modalSheetState.isVisible) { coroutineScope.launch { modalSheetState.hide() } diff --git a/app/src/main/java/mega/privacy/android/app/presentation/testpassword/view/TestPasswordComposeView.kt b/app/src/main/java/mega/privacy/android/app/presentation/testpassword/view/TestPasswordComposeView.kt index 717c718aec..79c51aa886 100644 --- a/app/src/main/java/mega/privacy/android/app/presentation/testpassword/view/TestPasswordComposeView.kt +++ b/app/src/main/java/mega/privacy/android/app/presentation/testpassword/view/TestPasswordComposeView.kt @@ -319,11 +319,7 @@ internal fun TestPasswordComposeView( } ) { padding -> val coroutineScope = rememberCoroutineScope() - val modalSheetState = rememberModalBottomSheetState( - initialValue = ModalBottomSheetValue.Hidden, - confirmStateChange = { it != ModalBottomSheetValue.HalfExpanded }, - skipHalfExpanded = true, - ) + val modalSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden) BackHandler(enabled = modalSheetState.isVisible) { coroutineScope.launch { modalSheetState.hide() } diff --git a/app/src/test/java/test/mega/privacy/android/app/presentation/meeting/view/sheet/RecurringMeetingOccurrenceBottomSheetViewTest.kt b/app/src/test/java/test/mega/privacy/android/app/presentation/meeting/view/sheet/RecurringMeetingOccurrenceBottomSheetViewTest.kt index 74518a5094..f86d53f068 100644 --- a/app/src/test/java/test/mega/privacy/android/app/presentation/meeting/view/sheet/RecurringMeetingOccurrenceBottomSheetViewTest.kt +++ b/app/src/test/java/test/mega/privacy/android/app/presentation/meeting/view/sheet/RecurringMeetingOccurrenceBottomSheetViewTest.kt @@ -4,6 +4,7 @@ import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.ModalBottomSheetState import androidx.compose.material.ModalBottomSheetValue import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.test.onNodeWithTag import mega.privacy.android.app.presentation.meeting.view.sheet.CANCEL_OCCURRENCE_TAG import mega.privacy.android.app.presentation.meeting.view.sheet.RecurringMeetingOccurrenceBottomSheetView @@ -28,11 +29,6 @@ class RecurringMeetingOccurrenceBottomSheetViewTest { private val parentSchedId = 123456L private val schedId = 789123L - private val sheetState = ModalBottomSheetState( - initialValue = ModalBottomSheetValue.Hidden, - isSkipHalfExpanded = false, - ) - @Test fun `test that Cancel button is shown`() { initComposeRuleContent( @@ -91,6 +87,12 @@ class RecurringMeetingOccurrenceBottomSheetViewTest { onEditClick: () -> Unit, ) { composeTestRule.setContent { + val sheetState = ModalBottomSheetState( + initialValue = ModalBottomSheetValue.Hidden, + isSkipHalfExpanded = false, + density = LocalDensity.current, + ) + val coroutineScope = rememberCoroutineScope() RecurringMeetingOccurrenceBottomSheetView( diff --git a/shared/original-core-ui/src/test/java/mega/privacy/android/shared/original/core/ui/controls/sheets/BottomSheetTest.kt b/shared/original-core-ui/src/test/java/mega/privacy/android/shared/original/core/ui/controls/sheets/BottomSheetTest.kt index 6d0797873c..47ab76838e 100644 --- a/shared/original-core-ui/src/test/java/mega/privacy/android/shared/original/core/ui/controls/sheets/BottomSheetTest.kt +++ b/shared/original-core-ui/src/test/java/mega/privacy/android/shared/original/core/ui/controls/sheets/BottomSheetTest.kt @@ -10,6 +10,7 @@ import androidx.compose.material.Scaffold import androidx.compose.material.Text import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.testTag import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.assertIsNotDisplayed @@ -34,11 +35,14 @@ class BottomSheetTest { fun `test that when view is set bottom sheet is not displayed to the user`() { val message = "message to test" val button = "show-bottom-sheet" - val sheetState = ModalBottomSheetState( - initialValue = ModalBottomSheetValue.Hidden, - isSkipHalfExpanded = false, - ) + composeTestRule.setContent { + val sheetState = ModalBottomSheetState( + initialValue = ModalBottomSheetValue.Hidden, + isSkipHalfExpanded = false, + density = LocalDensity.current, + ) + val coroutineScope = rememberCoroutineScope() BottomSheet( modalSheetState = sheetState, @@ -74,11 +78,14 @@ class BottomSheetTest { fun `test that when user clicks on button to show bottom sheet bottom sheet is shown to user`() { val message = "message to test" val button = "show-bottom-sheet" - val sheetState = ModalBottomSheetState( - initialValue = ModalBottomSheetValue.Hidden, - isSkipHalfExpanded = false, - ) + composeTestRule.setContent { + val sheetState = ModalBottomSheetState( + initialValue = ModalBottomSheetValue.Hidden, + isSkipHalfExpanded = false, + density = LocalDensity.current + ) + val coroutineScope = rememberCoroutineScope() BottomSheet( modalSheetState = sheetState,