Skip to content

Commit

Permalink
chore: Change isBottomSheetEnabled to more generic isSheetEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
wba2hi committed Feb 8, 2024
1 parent 2b780a8 commit a3be81b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fun AdaptiveAppScreen(
AdaptiveSheetView(
windowSizeClass = windowSizeClass,
modifier = Modifier.fillMaxSize(),
isBottomSheetEnabled = selectedPage.isBottomSheetEnabled,
isSheetEnabled = selectedPage.isSheetEnabled,
sheetContent = {
when (selectedPage) {
NavigationPage.DOORS -> DoorControlView(doorControlViewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum class NavigationPage(
@DrawableRes val iconRes: Int,
val title: String,
val description: String,
val isBottomSheetEnabled: Boolean,
val isSheetEnabled: Boolean,
) {
DOORS(
R.drawable.baseline_sensor_door_24,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ import org.eclipse.kuksa.companion.extension.windowSizeClass
fun AdaptiveSheetView(
windowSizeClass: WindowSizeClass,
modifier: Modifier = Modifier,
isBottomSheetEnabled: Boolean = true,
isSheetEnabled: Boolean = true,
sheetContent: @Composable () -> Unit = { },
content: @Composable (PaddingValues) -> Unit = { },
) {
if (windowSizeClass.widthSizeClass == WindowWidthSizeClass.Compact) {
val initialSheetValue = if (isBottomSheetEnabled) SheetValue.PartiallyExpanded else SheetValue.Hidden
val initialSheetValue = if (isSheetEnabled) SheetValue.PartiallyExpanded else SheetValue.Hidden

BottomSheetView(
modifier = modifier,
Expand All @@ -58,7 +58,7 @@ fun AdaptiveSheetView(
} else {
SideSheetView(
modifier = modifier,
isBottomSheetEnabled = isBottomSheetEnabled,
isSideSheetEnabled = isSheetEnabled,
sheetContent = sheetContent,
content = content,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import org.eclipse.kuksa.companion.SHEET_EXPANDED_HEIGHT
@Composable
fun SideSheetView(
modifier: Modifier = Modifier,
isBottomSheetEnabled: Boolean = true,
isSideSheetEnabled: Boolean = true,
sheetContent: @Composable () -> Unit = {},
content: @Composable (PaddingValues) -> Unit,
) {
Expand All @@ -64,7 +64,7 @@ fun SideSheetView(
val paddingValues = PaddingValues(0.dp)
content(paddingValues)
}
if (isBottomSheetEnabled) {
if (isSideSheetEnabled) {
SideSheetInteractionFAB(
sideSheetBehavior = sideSheetBehavior,
modifier = Modifier
Expand Down Expand Up @@ -175,5 +175,5 @@ private fun SideSheetInteractionFAB(
@Preview
@Composable
private fun SideSheetViewPreview() {
SideSheetView(isBottomSheetEnabled = true, sheetContent = {}) {}
SideSheetView(isSideSheetEnabled = true, sheetContent = {}) {}
}

0 comments on commit a3be81b

Please sign in to comment.