From fb6e00eb1fabf61dd2749850e5fcd91ccc3155ba Mon Sep 17 00:00:00 2001 From: Artem Slinkin Date: Fri, 24 Jun 2022 14:42:24 +0500 Subject: [PATCH 1/2] fix bottom modal sheet height --- .../modal_navigation/views/BottomSheetModalView.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/odyssey/odyssey-compose/src/commonMain/kotlin/ru/alexgladkov/odyssey/compose/navigation/modal_navigation/views/BottomSheetModalView.kt b/odyssey/odyssey-compose/src/commonMain/kotlin/ru/alexgladkov/odyssey/compose/navigation/modal_navigation/views/BottomSheetModalView.kt index e51a0e14..6de97d91 100644 --- a/odyssey/odyssey-compose/src/commonMain/kotlin/ru/alexgladkov/odyssey/compose/navigation/modal_navigation/views/BottomSheetModalView.kt +++ b/odyssey/odyssey-compose/src/commonMain/kotlin/ru/alexgladkov/odyssey/compose/navigation/modal_navigation/views/BottomSheetModalView.kt @@ -9,6 +9,7 @@ import androidx.compose.material.* import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp import ru.alexgladkov.odyssey.compose.controllers.ModalController @@ -30,8 +31,13 @@ internal fun BoxScope.BottomModalSheet( var modifier = Modifier.align(Alignment.BottomStart).fillMaxWidth() + val density = LocalDensity.current + + if (bundle.maxHeight != null) - modifier = modifier.fillMaxHeight(bundle.maxHeight) + modifier = modifier + .padding(top = with(density) { (height - viewHeight).toDp() }) + .fillMaxHeight() var offsetValue by remember { mutableStateOf(height) } var backdropAlphaValue by remember { mutableStateOf(0f) } From 19db055f5234351ac9c1a2be8c1bf40dacd13b87 Mon Sep 17 00:00:00 2001 From: Artem Slinkin Date: Fri, 24 Jun 2022 14:44:15 +0500 Subject: [PATCH 2/2] increase version to 1.0.0-beta12 --- buildSrc/buildSrc/src/main/kotlin/Dependencies.kt | 2 +- documentation/GETTING_STARTED.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/buildSrc/src/main/kotlin/Dependencies.kt index 56f1cdf5..3b9fd183 100644 --- a/buildSrc/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,6 +1,6 @@ object Dependencies { - val odyssey = "1.0.0-beta11" + val odyssey = "1.0.0-beta12" val odysseyPackage = "io.github.alexgladkov" object DI { diff --git a/documentation/GETTING_STARTED.md b/documentation/GETTING_STARTED.md index cd338d13..ae3de722 100644 --- a/documentation/GETTING_STARTED.md +++ b/documentation/GETTING_STARTED.md @@ -4,8 +4,8 @@ Add dependencies to gradle ```kotlin named("commonMain") { dependencies { - implementation("io.github.alexgladkov:odyssey-core:1.0.0-beta11") // For core classes - implementation("io.github.alexgladkov:odyssey-compose:1.0.0-beta11") // For compose extensions + implementation("io.github.alexgladkov:odyssey-core:1.0.0-beta12") // For core classes + implementation("io.github.alexgladkov:odyssey-compose:1.0.0-beta12") // For compose extensions } } ``` \ No newline at end of file