From 158ca4e567b47d4d9ab5ca92021cec7249218cdc Mon Sep 17 00:00:00 2001 From: Wojciech Osak Date: Mon, 3 Jun 2024 19:38:09 +0200 Subject: [PATCH] Publish sample to Github Pages --- README.MD | 7 +++---- .../kotlin/io/wojciechosak/calendar/calendar/App.kt | 9 ++++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.MD b/README.MD index 71b510a..494049c 100644 --- a/README.MD +++ b/README.MD @@ -38,6 +38,9 @@ Features: | Vertical calendar | ✅ | | Range selection | ✅ | +You can test Web version here: [Web Demo](https://wojciechosak.github.io/Calendar/) +It is builded sample app and distributed by Github Pages. + --- # Setup @@ -127,10 +130,6 @@ Each view get as parameter day cell composable. Thanks to that your calendar can # Samples: -You can test Web version here: [Web Demo](https://wojciechosak.github.io/Calendar/) -It is builded sample app and distributed by Github Pages. - - In directory sample you can find bunch of examples. You can run Android/iOS application and test it yourself. Below you can find instruction how to run sample project on your computer. diff --git a/sample/composeApp/src/commonMain/kotlin/io/wojciechosak/calendar/calendar/App.kt b/sample/composeApp/src/commonMain/kotlin/io/wojciechosak/calendar/calendar/App.kt index 7cb9006..879c7bb 100644 --- a/sample/composeApp/src/commonMain/kotlin/io/wojciechosak/calendar/calendar/App.kt +++ b/sample/composeApp/src/commonMain/kotlin/io/wojciechosak/calendar/calendar/App.kt @@ -81,7 +81,14 @@ internal fun App() { .width( when (getPlatformType()) { PlatformType.MOBILE -> getScreenSizeInfo().widthDp - PlatformType.WEB -> getScreenSizeInfo().widthDp / 2 + PlatformType.WEB -> { + val isShownOnMobile = getScreenSizeInfo().widthPx < 960 + if(isShownOnMobile) { + getScreenSizeInfo().widthDp + } else { + getScreenSizeInfo().widthDp / 2 + } + } PlatformType.DESKTOP -> getScreenSizeInfo().widthDp / 2 } ) // Set the width to half of the screen width