From a3be81b0730c938ef43b125fa410995f805626e3 Mon Sep 17 00:00:00 2001 From: Andre Weber Date: Thu, 8 Feb 2024 14:57:57 +0100 Subject: [PATCH] chore: Change isBottomSheetEnabled to more generic isSheetEnabled --- .../kuksa/companion/feature/home/view/AdaptiveAppScreen.kt | 2 +- .../feature/home/view/navigation/NavigationPage.kt | 2 +- .../companion/feature/home/view/sheet/AdaptiveSheetView.kt | 6 +++--- .../companion/feature/home/view/sheet/SideSheetView.kt | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/AdaptiveAppScreen.kt b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/AdaptiveAppScreen.kt index 4a9bf3a..b434a5a 100644 --- a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/AdaptiveAppScreen.kt +++ b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/AdaptiveAppScreen.kt @@ -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) diff --git a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/navigation/NavigationPage.kt b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/navigation/NavigationPage.kt index aa9b2ba..da68fa3 100644 --- a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/navigation/NavigationPage.kt +++ b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/navigation/NavigationPage.kt @@ -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, diff --git a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/sheet/AdaptiveSheetView.kt b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/sheet/AdaptiveSheetView.kt index 69f0f84..62d7d6d 100644 --- a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/sheet/AdaptiveSheetView.kt +++ b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/sheet/AdaptiveSheetView.kt @@ -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, @@ -58,7 +58,7 @@ fun AdaptiveSheetView( } else { SideSheetView( modifier = modifier, - isBottomSheetEnabled = isBottomSheetEnabled, + isSideSheetEnabled = isSheetEnabled, sheetContent = sheetContent, content = content, ) diff --git a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/sheet/SideSheetView.kt b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/sheet/SideSheetView.kt index 5b0c49f..4b46f66 100644 --- a/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/sheet/SideSheetView.kt +++ b/app/src/main/kotlin/org/eclipse/kuksa/companion/feature/home/view/sheet/SideSheetView.kt @@ -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, ) { @@ -64,7 +64,7 @@ fun SideSheetView( val paddingValues = PaddingValues(0.dp) content(paddingValues) } - if (isBottomSheetEnabled) { + if (isSideSheetEnabled) { SideSheetInteractionFAB( sideSheetBehavior = sideSheetBehavior, modifier = Modifier @@ -175,5 +175,5 @@ private fun SideSheetInteractionFAB( @Preview @Composable private fun SideSheetViewPreview() { - SideSheetView(isBottomSheetEnabled = true, sheetContent = {}) {} + SideSheetView(isSideSheetEnabled = true, sheetContent = {}) {} }