mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Move logic of different BottomSheets in MessagesView to presenters (#600)
* Move bottom sheet logic in `MessagesView` to presenters. * Make the block inside `SheetState.hide` suspend.
This commit is contained in:
committed by
GitHub
parent
65ecfcc681
commit
244306545f
+10
@@ -37,6 +37,8 @@ import androidx.compose.ui.unit.dp
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
import io.element.android.libraries.designsystem.preview.PreviewGroup
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
@@ -66,6 +68,14 @@ fun ModalBottomSheet(
|
||||
)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
fun SheetState.hide(coroutineScope: CoroutineScope, then: suspend () -> Unit) {
|
||||
coroutineScope.launch {
|
||||
hide()
|
||||
then()
|
||||
}
|
||||
}
|
||||
|
||||
// This preview and its screenshots are blank, see: https://issuetracker.google.com/issues/283843380
|
||||
@Preview(group = PreviewGroup.BottomSheets)
|
||||
@Composable
|
||||
|
||||
Reference in New Issue
Block a user