mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Fix bottomsheet not using right theme (BottomSheet is not part of material3)
This commit is contained in:
+8
-1
@@ -102,6 +102,7 @@ private fun SheetContent(
|
|||||||
// Crashes if sheetContent size is zero
|
// Crashes if sheetContent size is zero
|
||||||
Box(modifier = modifier.size(1.dp))
|
Box(modifier = modifier.size(1.dp))
|
||||||
}
|
}
|
||||||
|
|
||||||
is ActionListState.Target.Success -> {
|
is ActionListState.Target.Success -> {
|
||||||
val actions = target.actions
|
val actions = target.actions
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
@@ -146,5 +147,11 @@ fun SheetContentDarkPreview(@PreviewParameter(ActionListStateProvider::class) st
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ContentToPreview(state: ActionListState) {
|
private fun ContentToPreview(state: ActionListState) {
|
||||||
SheetContent(state)
|
ActionListView(
|
||||||
|
state = state,
|
||||||
|
modalBottomSheetState = ModalBottomSheetState(
|
||||||
|
initialValue = ModalBottomSheetValue.Expanded
|
||||||
|
),
|
||||||
|
onActionSelected = { _, _ -> }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -21,12 +21,12 @@ package io.element.android.libraries.designsystem.theme.components
|
|||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.ColumnScope
|
import androidx.compose.foundation.layout.ColumnScope
|
||||||
import androidx.compose.material.ExperimentalMaterialApi
|
import androidx.compose.material.ExperimentalMaterialApi
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.ModalBottomSheetDefaults
|
import androidx.compose.material.ModalBottomSheetDefaults
|
||||||
import androidx.compose.material.ModalBottomSheetState
|
import androidx.compose.material.ModalBottomSheetState
|
||||||
import androidx.compose.material.ModalBottomSheetValue
|
import androidx.compose.material.ModalBottomSheetValue
|
||||||
import androidx.compose.material.contentColorFor
|
|
||||||
import androidx.compose.material.rememberModalBottomSheetState
|
import androidx.compose.material.rememberModalBottomSheetState
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.contentColorFor
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
@@ -44,7 +44,7 @@ fun ModalBottomSheetLayout(
|
|||||||
sheetState: ModalBottomSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden),
|
sheetState: ModalBottomSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden),
|
||||||
sheetShape: Shape = MaterialTheme.shapes.large,
|
sheetShape: Shape = MaterialTheme.shapes.large,
|
||||||
sheetElevation: Dp = ModalBottomSheetDefaults.Elevation,
|
sheetElevation: Dp = ModalBottomSheetDefaults.Elevation,
|
||||||
sheetBackgroundColor: Color = MaterialTheme.colors.surface,
|
sheetBackgroundColor: Color = MaterialTheme.colorScheme.surface,
|
||||||
sheetContentColor: Color = contentColorFor(sheetBackgroundColor),
|
sheetContentColor: Color = contentColorFor(sheetBackgroundColor),
|
||||||
scrimColor: Color = ModalBottomSheetDefaults.scrimColor,
|
scrimColor: Color = ModalBottomSheetDefaults.scrimColor,
|
||||||
content: @Composable () -> Unit = {}
|
content: @Composable () -> Unit = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user